Check-in Differences
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From 978a32a5b39a88ef To 294601b232f6563c

2011-11-13
09:10
fixing the WinOZ build system (both MinGW and MSVC) re-licensing the library under the MPL terms check-in: dd270c4d41 user: a.furieri@lqt.it tags: trunk
2011-11-12
19:06
adding reasterlite_tiff_hdrs.h check-in: 978a32a5b3 user: a.furieri@lqt.it tags: trunk
19:05
fixing the previous commit check-in: 8cad98738d user: a.furieri@lqt.it tags: trunk
2010-01-09
11:16
implementing Shaded Relief for Grids check-in: d4879cedec user: a.furieri@lqt.it tags: trunk
2009-12-07
15:41
supporting RGBA, ARGB, BGR and BGRA raw images check-in: 294601b232 user: a.furieri@lqt.it tags: trunk
2009-11-19
11:03
fixing makefile and warnings for MSVC check-in: bf94dc55e3 user: a.furieri@lqt.it tags: trunk

Changes to AUTHORS.

     1      1   Original Author:
     2      2   Alessandro Furieri <a.furieri@lqt.it>
     3      3   
     4         -Contributors:
     5         -Brad Hards <bradh@frogmouth.net>
            4  +Portion Copyrigth [the Epsilon Wavelet library]:
            5  +Alexander Simakov, <xander@entropyware.info>

Changes to Makefile-static-Linux.

    61     61   	/usr/local/lib/libgeos.a -lstdc++ -lm -lpthread -ldl
    62     62   	strip --strip-all ./static_bin/rasterlite_tool
    63     63   
    64     64   ./static_bin/rasterlite_grid: ./src/rasterlite_grid.o
    65     65   	$(CC) ./src/rasterlite_grid.o -o ./static_bin/rasterlite_grid \
    66     66   	/usr/local/lib/libgeotiff.a \
    67     67   	/usr/lib/libtiff.a \
    68         -	/usr/local/lib/libproj.a \
           68  +	/usr/lib/libproj.a \
    69     69   	/usr/lib/libjpeg.a \
    70     70   	/usr/lib/libz.a -lm
    71     71   	strip --strip-all ./static_bin/rasterlite_grid

Changes to Makefile.am.

     1         -ACLOCAL_AMFLAGS = -I m4
     2         -
     3         -SUBDIRS = headers lib src 
            1  +SUBDIRS = headers epsilon lib src 
     4      2   
     5      3   AUTOMAKE_OPTIONS = dist-zip
     6      4   
     7      5   EXTRA_DIST = Makefile-static-MinGW Makefile-static-Linux \
     8         -	Makefile-static-MacOsX makefile.vc nmake.opt 
            6  +	Makefile-static-MacOsX makefile.vc nmake.opt \
            7  +	librasterlite.def
     9      8   
    10      9   pkgconfigdir = $(libdir)/pkgconfig
    11     10   pkgconfig_DATA = rasterlite.pc
    12     11   

Changes to Makefile.in.

     1         -# Makefile.in generated by automake 1.11.1 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
     6         -# Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19     18   pkgdatadir = $(datadir)/@PACKAGE@
    20         -pkgincludedir = $(includedir)/@PACKAGE@
    21     19   pkglibdir = $(libdir)/@PACKAGE@
    22         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    23     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    24     22   install_sh_DATA = $(install_sh) -c -m 644
    25     23   install_sh_PROGRAM = $(install_sh) -c
    26     24   install_sh_SCRIPT = $(install_sh) -c
    27     25   INSTALL_HEADER = $(INSTALL_DATA)
    28     26   transform = $(program_transform_name)
    29     27   NORMAL_INSTALL = :
................................................................................
    43     41   am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    44     42   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    45     43   	$(ACLOCAL_M4)
    46     44   am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
    47     45    configure.lineno config.status.lineno
    48     46   mkinstalldirs = $(install_sh) -d
    49     47   CONFIG_CLEAN_FILES = rasterlite.pc
    50         -CONFIG_CLEAN_VPATH_FILES =
    51     48   SOURCES =
    52     49   DIST_SOURCES =
    53     50   RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
    54     51   	html-recursive info-recursive install-data-recursive \
    55     52   	install-dvi-recursive install-exec-recursive \
    56     53   	install-html-recursive install-info-recursive \
    57     54   	install-pdf-recursive install-ps-recursive install-recursive \
................................................................................
    58     55   	installcheck-recursive installdirs-recursive pdf-recursive \
    59     56   	ps-recursive uninstall-recursive
    60     57   am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    61     58   am__vpath_adj = case $$p in \
    62     59       $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    63     60       *) f=$$p;; \
    64     61     esac;
    65         -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
    66         -am__install_max = 40
    67         -am__nobase_strip_setup = \
    68         -  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
    69         -am__nobase_strip = \
    70         -  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
    71         -am__nobase_list = $(am__nobase_strip_setup); \
    72         -  for p in $$list; do echo "$$p $$p"; done | \
    73         -  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
    74         -  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
    75         -    if (++n[$$2] == $(am__install_max)) \
    76         -      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
    77         -    END { for (dir in files) print dir, files[dir] }'
    78         -am__base_list = \
    79         -  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
    80         -  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
           62  +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
    81     63   am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
           64  +pkgconfigDATA_INSTALL = $(INSTALL_DATA)
    82     65   DATA = $(pkgconfig_DATA)
    83     66   RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
    84     67     distclean-recursive maintainer-clean-recursive
    85         -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
    86         -	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
    87         -	distdir dist dist-all distcheck
    88     68   ETAGS = etags
    89     69   CTAGS = ctags
    90     70   DIST_SUBDIRS = $(SUBDIRS)
    91     71   DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    92     72   distdir = $(PACKAGE)-$(VERSION)
    93     73   top_distdir = $(distdir)
    94     74   am__remove_distdir = \
    95         -  { test ! -d "$(distdir)" \
    96         -    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
    97         -         && rm -fr "$(distdir)"; }; }
    98         -am__relativize = \
    99         -  dir0=`pwd`; \
   100         -  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
   101         -  sed_rest='s,^[^/]*/*,,'; \
   102         -  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
   103         -  sed_butlast='s,/*[^/]*$$,,'; \
   104         -  while test -n "$$dir1"; do \
   105         -    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
   106         -    if test "$$first" != "."; then \
   107         -      if test "$$first" = ".."; then \
   108         -        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
   109         -        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
   110         -      else \
   111         -        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
   112         -        if test "$$first2" = "$$first"; then \
   113         -          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
   114         -        else \
   115         -          dir2="../$$dir2"; \
   116         -        fi; \
   117         -        dir0="$$dir0"/"$$first"; \
   118         -      fi; \
   119         -    fi; \
   120         -    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
   121         -  done; \
   122         -  reldir="$$dir2"
           75  +  { test ! -d $(distdir) \
           76  +    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
           77  +         && rm -fr $(distdir); }; }
   123     78   DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip
   124     79   GZIP_ENV = --best
   125     80   distuninstallcheck_listfiles = find . -type f -print
   126     81   distcleancheck_listfiles = find . -type f -print
   127     82   ACLOCAL = @ACLOCAL@
   128     83   AMTAR = @AMTAR@
   129     84   AR = @AR@
................................................................................
   142     97   CXXDEPMODE = @CXXDEPMODE@
   143     98   CXXFLAGS = @CXXFLAGS@
   144     99   CYGPATH_W = @CYGPATH_W@
   145    100   DEFS = @DEFS@
   146    101   DEPDIR = @DEPDIR@
   147    102   DLLTOOL = @DLLTOOL@
   148    103   DSYMUTIL = @DSYMUTIL@
   149         -DUMPBIN = @DUMPBIN@
          104  +ECHO = @ECHO@
   150    105   ECHO_C = @ECHO_C@
   151    106   ECHO_N = @ECHO_N@
   152    107   ECHO_T = @ECHO_T@
   153    108   EGREP = @EGREP@
   154    109   EXEEXT = @EXEEXT@
   155         -FGREP = @FGREP@
          110  +F77 = @F77@
          111  +FFLAGS = @FFLAGS@
   156    112   GREP = @GREP@
   157    113   INSTALL = @INSTALL@
   158    114   INSTALL_DATA = @INSTALL_DATA@
   159    115   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   160    116   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   161    117   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   162         -LD = @LD@
   163    118   LDFLAGS = @LDFLAGS@
   164    119   LIBOBJS = @LIBOBJS@
   165    120   LIBS = @LIBS@
   166         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   167         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   168    121   LIBTOOL = @LIBTOOL@
   169         -LIPO = @LIPO@
   170    122   LN_S = @LN_S@
   171    123   LTLIBOBJS = @LTLIBOBJS@
   172    124   MAINT = @MAINT@
   173    125   MAKEINFO = @MAKEINFO@
   174    126   MKDIR_P = @MKDIR_P@
   175         -NM = @NM@
   176    127   NMEDIT = @NMEDIT@
   177    128   OBJDUMP = @OBJDUMP@
   178    129   OBJEXT = @OBJEXT@
   179         -OTOOL = @OTOOL@
   180         -OTOOL64 = @OTOOL64@
   181    130   PACKAGE = @PACKAGE@
   182    131   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   183    132   PACKAGE_NAME = @PACKAGE_NAME@
   184    133   PACKAGE_STRING = @PACKAGE_STRING@
   185    134   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   186         -PACKAGE_URL = @PACKAGE_URL@
   187    135   PACKAGE_VERSION = @PACKAGE_VERSION@
   188    136   PATH_SEPARATOR = @PATH_SEPARATOR@
   189         -PKG_CONFIG = @PKG_CONFIG@
   190         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   191         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   192    137   RANLIB = @RANLIB@
   193    138   SED = @SED@
   194    139   SET_MAKE = @SET_MAKE@
   195    140   SHELL = @SHELL@
   196    141   STRIP = @STRIP@
   197    142   VERSION = @VERSION@
   198    143   abs_builddir = @abs_builddir@
   199    144   abs_srcdir = @abs_srcdir@
   200    145   abs_top_builddir = @abs_top_builddir@
   201    146   abs_top_srcdir = @abs_top_srcdir@
   202    147   ac_ct_CC = @ac_ct_CC@
   203    148   ac_ct_CXX = @ac_ct_CXX@
   204         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          149  +ac_ct_F77 = @ac_ct_F77@
   205    150   am__include = @am__include@
   206    151   am__leading_dot = @am__leading_dot@
   207    152   am__quote = @am__quote@
   208    153   am__tar = @am__tar@
   209    154   am__untar = @am__untar@
   210    155   bindir = @bindir@
   211    156   build = @build@
................................................................................
   228    173   includedir = @includedir@
   229    174   infodir = @infodir@
   230    175   install_sh = @install_sh@
   231    176   libdir = @libdir@
   232    177   libexecdir = @libexecdir@
   233    178   localedir = @localedir@
   234    179   localstatedir = @localstatedir@
   235         -lt_ECHO = @lt_ECHO@
   236    180   mandir = @mandir@
   237    181   mkdir_p = @mkdir_p@
   238    182   oldincludedir = @oldincludedir@
   239    183   pdfdir = @pdfdir@
   240    184   prefix = @prefix@
   241    185   program_transform_name = @program_transform_name@
   242    186   psdir = @psdir@
   243    187   sbindir = @sbindir@
   244    188   sharedstatedir = @sharedstatedir@
   245    189   srcdir = @srcdir@
   246    190   sysconfdir = @sysconfdir@
   247    191   target_alias = @target_alias@
   248         -top_build_prefix = @top_build_prefix@
   249    192   top_builddir = @top_builddir@
   250    193   top_srcdir = @top_srcdir@
   251         -ACLOCAL_AMFLAGS = -I m4
   252         -SUBDIRS = headers lib src 
          194  +SUBDIRS = headers epsilon lib src 
   253    195   AUTOMAKE_OPTIONS = dist-zip
   254    196   EXTRA_DIST = Makefile-static-MinGW Makefile-static-Linux \
   255         -	Makefile-static-MacOsX makefile.vc nmake.opt 
          197  +	Makefile-static-MacOsX makefile.vc nmake.opt \
          198  +	librasterlite.def
   256    199   
   257    200   pkgconfigdir = $(libdir)/pkgconfig
   258    201   pkgconfig_DATA = rasterlite.pc
   259    202   all: all-recursive
   260    203   
   261    204   .SUFFIXES:
   262    205   am--refresh:
   263    206   	@:
   264    207   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   265    208   	@for dep in $?; do \
   266    209   	  case '$(am__configure_deps)' in \
   267    210   	    *$$dep*) \
   268         -	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
   269         -	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
          211  +	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
          212  +	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
   270    213   		&& exit 0; \
   271    214   	      exit 1;; \
   272    215   	  esac; \
   273    216   	done; \
   274         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
   275         -	$(am__cd) $(top_srcdir) && \
   276         -	  $(AUTOMAKE) --foreign Makefile
          217  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
          218  +	cd $(top_srcdir) && \
          219  +	  $(AUTOMAKE) --foreign  Makefile
   277    220   .PRECIOUS: Makefile
   278    221   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   279    222   	@case '$?' in \
   280    223   	  *config.status*) \
   281    224   	    echo ' $(SHELL) ./config.status'; \
   282    225   	    $(SHELL) ./config.status;; \
   283    226   	  *) \
................................................................................
   285    228   	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
   286    229   	esac;
   287    230   
   288    231   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   289    232   	$(SHELL) ./config.status --recheck
   290    233   
   291    234   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   292         -	$(am__cd) $(srcdir) && $(AUTOCONF)
          235  +	cd $(srcdir) && $(AUTOCONF)
   293    236   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   294         -	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
   295         -$(am__aclocal_m4_deps):
          237  +	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
   296    238   rasterlite.pc: $(top_builddir)/config.status $(srcdir)/rasterlite.pc.in
   297    239   	cd $(top_builddir) && $(SHELL) ./config.status $@
   298    240   
   299    241   mostlyclean-libtool:
   300    242   	-rm -f *.lo
   301    243   
   302    244   clean-libtool:
   303    245   	-rm -rf .libs _libs
   304    246   
   305    247   distclean-libtool:
   306         -	-rm -f libtool config.lt
          248  +	-rm -f libtool
   307    249   install-pkgconfigDATA: $(pkgconfig_DATA)
   308    250   	@$(NORMAL_INSTALL)
   309    251   	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
   310         -	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
   311         -	for p in $$list; do \
          252  +	@list='$(pkgconfig_DATA)'; for p in $$list; do \
   312    253   	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
   313         -	  echo "$$d$$p"; \
   314         -	done | $(am__base_list) | \
   315         -	while read files; do \
   316         -	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
   317         -	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
          254  +	  f=$(am__strip_dir) \
          255  +	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
          256  +	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
   318    257   	done
   319    258   
   320    259   uninstall-pkgconfigDATA:
   321    260   	@$(NORMAL_UNINSTALL)
   322         -	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
   323         -	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
   324         -	test -n "$$files" || exit 0; \
   325         -	echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
   326         -	cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
          261  +	@list='$(pkgconfig_DATA)'; for p in $$list; do \
          262  +	  f=$(am__strip_dir) \
          263  +	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
          264  +	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
          265  +	done
   327    266   
   328    267   # This directory's subdirectories are mostly independent; you can cd
   329    268   # into them and run `make' without going through this Makefile.
   330    269   # To change the values of `make' variables: instead of editing Makefiles,
   331    270   # (1) if the variable is set in `config.status', edit `config.status'
   332    271   #     (which will cause the Makefiles to be regenerated when you run `make');
   333    272   # (2) otherwise, pass the desired values on the `make' command line.
   334    273   $(RECURSIVE_TARGETS):
   335         -	@fail= failcom='exit 1'; \
          274  +	@failcom='exit 1'; \
   336    275   	for f in x $$MAKEFLAGS; do \
   337    276   	  case $$f in \
   338    277   	    *=* | --[!k]*);; \
   339    278   	    *k*) failcom='fail=yes';; \
   340    279   	  esac; \
   341    280   	done; \
   342    281   	dot_seen=no; \
................................................................................
   345    284   	  echo "Making $$target in $$subdir"; \
   346    285   	  if test "$$subdir" = "."; then \
   347    286   	    dot_seen=yes; \
   348    287   	    local_target="$$target-am"; \
   349    288   	  else \
   350    289   	    local_target="$$target"; \
   351    290   	  fi; \
   352         -	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
          291  +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
   353    292   	  || eval $$failcom; \
   354    293   	done; \
   355    294   	if test "$$dot_seen" = "no"; then \
   356    295   	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
   357    296   	fi; test -z "$$fail"
   358    297   
   359    298   $(RECURSIVE_CLEAN_TARGETS):
   360         -	@fail= failcom='exit 1'; \
          299  +	@failcom='exit 1'; \
   361    300   	for f in x $$MAKEFLAGS; do \
   362    301   	  case $$f in \
   363    302   	    *=* | --[!k]*);; \
   364    303   	    *k*) failcom='fail=yes';; \
   365    304   	  esac; \
   366    305   	done; \
   367    306   	dot_seen=no; \
................................................................................
   379    318   	for subdir in $$rev; do \
   380    319   	  echo "Making $$target in $$subdir"; \
   381    320   	  if test "$$subdir" = "."; then \
   382    321   	    local_target="$$target-am"; \
   383    322   	  else \
   384    323   	    local_target="$$target"; \
   385    324   	  fi; \
   386         -	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
          325  +	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
   387    326   	  || eval $$failcom; \
   388    327   	done && test -z "$$fail"
   389    328   tags-recursive:
   390    329   	list='$(SUBDIRS)'; for subdir in $$list; do \
   391         -	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
          330  +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
   392    331   	done
   393    332   ctags-recursive:
   394    333   	list='$(SUBDIRS)'; for subdir in $$list; do \
   395         -	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
          334  +	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
   396    335   	done
   397    336   
   398    337   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   399    338   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   400    339   	unique=`for i in $$list; do \
   401    340   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   402    341   	  done | \
   403         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          342  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   404    343   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   405    344   	mkid -fID $$unique
   406    345   tags: TAGS
   407    346   
   408    347   TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   409    348   		$(TAGS_FILES) $(LISP)
   410         -	set x; \
          349  +	tags=; \
   411    350   	here=`pwd`; \
   412    351   	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
   413    352   	  include_option=--etags-include; \
   414    353   	  empty_fix=.; \
   415    354   	else \
   416    355   	  include_option=--include; \
   417    356   	  empty_fix=; \
   418    357   	fi; \
   419    358   	list='$(SUBDIRS)'; for subdir in $$list; do \
   420    359   	  if test "$$subdir" = .; then :; else \
   421    360   	    test ! -f $$subdir/TAGS || \
   422         -	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          361  +	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
   423    362   	  fi; \
   424    363   	done; \
   425    364   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   426    365   	unique=`for i in $$list; do \
   427    366   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   428    367   	  done | \
   429    368   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   430    369   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   431         -	shift; \
   432         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          370  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   433    371   	  test -n "$$unique" || unique=$$empty_fix; \
   434         -	  if test $$# -gt 0; then \
   435         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   436         -	      "$$@" $$unique; \
   437         -	  else \
   438         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   439         -	      $$unique; \
   440         -	  fi; \
          372  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          373  +	    $$tags $$unique; \
   441    374   	fi
   442    375   ctags: CTAGS
   443    376   CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   444    377   		$(TAGS_FILES) $(LISP)
          378  +	tags=; \
   445    379   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   446    380   	unique=`for i in $$list; do \
   447    381   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   448    382   	  done | \
   449    383   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   450    384   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   451         -	test -z "$(CTAGS_ARGS)$$unique" \
          385  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   452    386   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   453         -	     $$unique
          387  +	     $$tags $$unique
   454    388   
   455    389   GTAGS:
   456    390   	here=`$(am__cd) $(top_builddir) && pwd` \
   457         -	  && $(am__cd) $(top_srcdir) \
   458         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          391  +	  && cd $(top_srcdir) \
          392  +	  && gtags -i $(GTAGS_ARGS) $$here
   459    393   
   460    394   distclean-tags:
   461    395   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   462    396   
   463    397   distdir: $(DISTFILES)
   464    398   	$(am__remove_distdir)
   465         -	test -d "$(distdir)" || mkdir "$(distdir)"
          399  +	test -d $(distdir) || mkdir $(distdir)
   466    400   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   467    401   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   468    402   	list='$(DISTFILES)'; \
   469    403   	  dist_files=`for file in $$list; do echo $$file; done | \
   470    404   	  sed -e "s|^$$srcdirstrip/||;t" \
   471    405   	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
   472    406   	case $$dist_files in \
................................................................................
   474    408   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   475    409   			   sort -u` ;; \
   476    410   	esac; \
   477    411   	for file in $$dist_files; do \
   478    412   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   479    413   	  if test -d $$d/$$file; then \
   480    414   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   481         -	    if test -d "$(distdir)/$$file"; then \
   482         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          415  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          416  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   483    417   	    fi; \
   484         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   485         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   486         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   487         -	    fi; \
   488         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          418  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   489    419   	  else \
   490         -	    test -f "$(distdir)/$$file" \
   491         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          420  +	    test -f $(distdir)/$$file \
          421  +	    || cp -p $$d/$$file $(distdir)/$$file \
   492    422   	    || exit 1; \
   493    423   	  fi; \
   494    424   	done
   495         -	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          425  +	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
   496    426   	  if test "$$subdir" = .; then :; else \
   497    427   	    test -d "$(distdir)/$$subdir" \
   498    428   	    || $(MKDIR_P) "$(distdir)/$$subdir" \
   499    429   	    || exit 1; \
   500         -	  fi; \
   501         -	done
   502         -	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
   503         -	  if test "$$subdir" = .; then :; else \
   504         -	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
   505         -	    $(am__relativize); \
   506         -	    new_distdir=$$reldir; \
   507         -	    dir1=$$subdir; dir2="$(top_distdir)"; \
   508         -	    $(am__relativize); \
   509         -	    new_top_distdir=$$reldir; \
   510         -	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
   511         -	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
   512         -	    ($(am__cd) $$subdir && \
          430  +	    distdir=`$(am__cd) $(distdir) && pwd`; \
          431  +	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
          432  +	    (cd $$subdir && \
   513    433   	      $(MAKE) $(AM_MAKEFLAGS) \
   514         -	        top_distdir="$$new_top_distdir" \
   515         -	        distdir="$$new_distdir" \
          434  +	        top_distdir="$$top_distdir" \
          435  +	        distdir="$$distdir/$$subdir" \
   516    436   		am__remove_distdir=: \
   517    437   		am__skip_length_check=: \
   518         -		am__skip_mode_fix=: \
   519    438   	        distdir) \
   520    439   	      || exit 1; \
   521    440   	  fi; \
   522    441   	done
   523         -	-test -n "$(am__skip_mode_fix)" \
   524         -	|| find "$(distdir)" -type d ! -perm -755 \
   525         -		-exec chmod u+rwx,go+rx {} \; -o \
          442  +	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
   526    443   	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
   527    444   	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
   528    445   	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
   529         -	|| chmod -R a+r "$(distdir)"
          446  +	|| chmod -R a+r $(distdir)
   530    447   dist-gzip: distdir
   531    448   	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
   532    449   	$(am__remove_distdir)
   533    450   
   534    451   dist-bzip2: distdir
   535    452   	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
   536    453   	$(am__remove_distdir)
   537    454   
   538    455   dist-lzma: distdir
   539    456   	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
   540    457   	$(am__remove_distdir)
   541    458   
   542         -dist-xz: distdir
   543         -	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
   544         -	$(am__remove_distdir)
   545         -
   546    459   dist-tarZ: distdir
   547    460   	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
   548    461   	$(am__remove_distdir)
   549    462   
   550    463   dist-shar: distdir
   551    464   	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
   552    465   	$(am__remove_distdir)
................................................................................
   563    476   
   564    477   # This target untars the dist file and tries a VPATH configuration.  Then
   565    478   # it guarantees that the distribution is self-contained by making another
   566    479   # tarfile.
   567    480   distcheck: dist
   568    481   	case '$(DIST_ARCHIVES)' in \
   569    482   	*.tar.gz*) \
   570         -	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
          483  +	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
   571    484   	*.tar.bz2*) \
   572         -	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
          485  +	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
   573    486   	*.tar.lzma*) \
   574         -	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
   575         -	*.tar.xz*) \
   576         -	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
          487  +	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
   577    488   	*.tar.Z*) \
   578    489   	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
   579    490   	*.shar.gz*) \
   580         -	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
          491  +	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
   581    492   	*.zip*) \
   582    493   	  unzip $(distdir).zip ;;\
   583    494   	esac
   584    495   	chmod -R a-w $(distdir); chmod a+w $(distdir)
   585    496   	mkdir $(distdir)/_build
   586    497   	mkdir $(distdir)/_inst
   587    498   	chmod a-w $(distdir)
   588         -	test -d $(distdir)/_build || exit 0; \
   589    499   	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
   590    500   	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
   591         -	  && am__cwd=`pwd` \
   592         -	  && $(am__cd) $(distdir)/_build \
          501  +	  && cd $(distdir)/_build \
   593    502   	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
   594    503   	    $(DISTCHECK_CONFIGURE_FLAGS) \
   595    504   	  && $(MAKE) $(AM_MAKEFLAGS) \
   596    505   	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
   597    506   	  && $(MAKE) $(AM_MAKEFLAGS) check \
   598    507   	  && $(MAKE) $(AM_MAKEFLAGS) install \
   599    508   	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
................................................................................
   607    516   	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
   608    517   	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
   609    518   	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
   610    519   	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
   611    520   	  && rm -rf "$$dc_destdir" \
   612    521   	  && $(MAKE) $(AM_MAKEFLAGS) dist \
   613    522   	  && rm -rf $(DIST_ARCHIVES) \
   614         -	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
   615         -	  && cd "$$am__cwd" \
   616         -	  || exit 1
          523  +	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
   617    524   	$(am__remove_distdir)
   618    525   	@(echo "$(distdir) archives ready for distribution: "; \
   619    526   	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
   620    527   	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
   621    528   distuninstallcheck:
   622         -	@$(am__cd) '$(distuninstallcheck_dir)' \
          529  +	@cd $(distuninstallcheck_dir) \
   623    530   	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
   624    531   	   || { echo "ERROR: files left after uninstall:" ; \
   625    532   	        if test -n "$(DESTDIR)"; then \
   626    533   	          echo "  (check DESTDIR support)"; \
   627    534   	        fi ; \
   628    535   	        $(distuninstallcheck_listfiles) ; \
   629    536   	        exit 1; } >&2
................................................................................
   660    567   	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   661    568   mostlyclean-generic:
   662    569   
   663    570   clean-generic:
   664    571   
   665    572   distclean-generic:
   666    573   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   667         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   668    574   
   669    575   maintainer-clean-generic:
   670    576   	@echo "This command is intended for maintainers to use"
   671    577   	@echo "it deletes files that may require special tools to rebuild."
   672    578   clean: clean-recursive
   673    579   
   674    580   clean-am: clean-generic clean-libtool mostlyclean-am
................................................................................
   681    587   
   682    588   dvi: dvi-recursive
   683    589   
   684    590   dvi-am:
   685    591   
   686    592   html: html-recursive
   687    593   
   688         -html-am:
   689         -
   690    594   info: info-recursive
   691    595   
   692    596   info-am:
   693    597   
   694    598   install-data-am: install-pkgconfigDATA
   695    599   
   696    600   install-dvi: install-dvi-recursive
   697    601   
   698         -install-dvi-am:
   699         -
   700    602   install-exec-am:
   701    603   
   702    604   install-html: install-html-recursive
   703    605   
   704         -install-html-am:
   705         -
   706    606   install-info: install-info-recursive
   707    607   
   708         -install-info-am:
   709         -
   710    608   install-man:
   711    609   
   712    610   install-pdf: install-pdf-recursive
   713    611   
   714         -install-pdf-am:
   715         -
   716    612   install-ps: install-ps-recursive
   717    613   
   718         -install-ps-am:
   719         -
   720    614   installcheck-am:
   721    615   
   722    616   maintainer-clean: maintainer-clean-recursive
   723    617   	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
   724    618   	-rm -rf $(top_srcdir)/autom4te.cache
   725    619   	-rm -f Makefile
   726    620   maintainer-clean-am: distclean-am maintainer-clean-generic
................................................................................
   735    629   
   736    630   ps: ps-recursive
   737    631   
   738    632   ps-am:
   739    633   
   740    634   uninstall-am: uninstall-pkgconfigDATA
   741    635   
   742         -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
   743         -	install-am install-strip tags-recursive
          636  +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
          637  +	install-strip
   744    638   
   745    639   .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
   746    640   	all all-am am--refresh check check-am clean clean-generic \
   747    641   	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
   748         -	dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
   749         -	distcheck distclean distclean-generic distclean-libtool \
   750         -	distclean-tags distcleancheck distdir distuninstallcheck dvi \
   751         -	dvi-am html html-am info info-am install install-am \
   752         -	install-data install-data-am install-dvi install-dvi-am \
   753         -	install-exec install-exec-am install-html install-html-am \
   754         -	install-info install-info-am install-man install-pdf \
   755         -	install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
   756         -	install-strip installcheck installcheck-am installdirs \
   757         -	installdirs-am maintainer-clean maintainer-clean-generic \
   758         -	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
   759         -	ps ps-am tags tags-recursive uninstall uninstall-am \
          642  +	dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
          643  +	distclean distclean-generic distclean-libtool distclean-tags \
          644  +	distcleancheck distdir distuninstallcheck dvi dvi-am html \
          645  +	html-am info info-am install install-am install-data \
          646  +	install-data-am install-dvi install-dvi-am install-exec \
          647  +	install-exec-am install-html install-html-am install-info \
          648  +	install-info-am install-man install-pdf install-pdf-am \
          649  +	install-pkgconfigDATA install-ps install-ps-am install-strip \
          650  +	installcheck installcheck-am installdirs installdirs-am \
          651  +	maintainer-clean maintainer-clean-generic mostlyclean \
          652  +	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
          653  +	tags tags-recursive uninstall uninstall-am \
   760    654   	uninstall-pkgconfigDATA
   761         -
   762    655   
   763    656   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   764    657   # Otherwise a system limit (for SysV at least) may be exceeded.
   765    658   .NOEXPORT:

Changes to README.

    60     60   --------------
    61     61   a library required in order to access JPEG images
    62     62   download site: http://www.ijg.org
    63     63   
    64     64   zlib
    65     65   --------------
    66     66   a library supporting DEFLATE (zip) compression
    67         -download site: http://www.zlib.net
           67  +dowload site: http://www.zlib.net
    68     68   
    69     69   libpng
    70     70   --------------
    71     71   a library supporting PNG images
    72     72   download site: http://www.libpng.org/pub/png/libpng.html
    73     73   
    74     74   libspatialite / libproj
    75     75   -----------------------
    76     76   please refer to the 'libspatialite' documentation.
    77     77   
           78  +IMPORTANTE NOTICE: librasterlite internally includes a copy 
           79  +of libepsilon, a library supporting Wavelt compressed images: 
           80  +so you ARE NOT required to install and/or build libepsilon
           81  +as a separete step.
           82  +libepsilon is a copyright of:
           83  +Alexander Simakov, <xander@entropyware.info>
           84  +download from: http://sourceforge.net/projects/epsilon-project/
           85  +
    78     86   3 - Build notes
    79     87   ===============
    80     88   
    81     89   3.1: Building on Linux
    82     90   ----------------------
    83     91   
    84     92   Building 'librasterlite' under Linux does not require any special 

Changes to aclocal.m4.

     1         -# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
            1  +# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
     2      2   
     3      3   # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
     4         -# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
            4  +# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     5      5   # This file is free software; the Free Software Foundation
     6      6   # gives unlimited permission to copy and/or distribute it,
     7      7   # with or without modifications, as long as this notice is preserved.
     8      8   
     9      9   # This program is distributed in the hope that it will be useful,
    10     10   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    11     11   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    12     12   # PARTICULAR PURPOSE.
    13     13   
    14     14   m4_ifndef([AC_AUTOCONF_VERSION],
    15     15     [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
    16         -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
    17         -[m4_warning([this file was generated for autoconf 2.67.
           16  +m4_if(AC_AUTOCONF_VERSION, [2.61],,
           17  +[m4_warning([this file was generated for autoconf 2.61.
    18     18   You have another version of autoconf.  It may work, but is not guaranteed to.
    19     19   If you have problems, you may need to regenerate the build system entirely.
    20     20   To do so, use the procedure documented by the package, typically `autoreconf'.])])
    21     21   
    22     22   # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
    23         -#
    24         -#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
    25         -#                 2006, 2007, 2008 Free Software Foundation, Inc.
    26         -#   Written by Gordon Matzigkeit, 1996
    27         -#
    28         -# This file is free software; the Free Software Foundation gives
    29         -# unlimited permission to copy and/or distribute it, with or without
    30         -# modifications, as long as this notice is preserved.
    31         -
    32         -m4_define([_LT_COPYING], [dnl
    33         -#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
    34         -#                 2006, 2007, 2008 Free Software Foundation, Inc.
    35         -#   Written by Gordon Matzigkeit, 1996
    36         -#
    37         -#   This file is part of GNU Libtool.
    38         -#
    39         -# GNU Libtool is free software; you can redistribute it and/or
    40         -# modify it under the terms of the GNU General Public License as
    41         -# published by the Free Software Foundation; either version 2 of
    42         -# the License, or (at your option) any later version.
    43         -#
    44         -# As a special exception to the GNU General Public License,
    45         -# if you distribute this file as part of a program or library that
    46         -# is built using GNU Libtool, you may include this file under the
    47         -# same distribution terms that you use for the rest of that program.
    48         -#
    49         -# GNU Libtool is distributed in the hope that it will be useful,
    50         -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    51         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    52         -# GNU General Public License for more details.
    53         -#
    54         -# You should have received a copy of the GNU General Public License
    55         -# along with GNU Libtool; see the file COPYING.  If not, a copy
    56         -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
    57         -# obtained by writing to the Free Software Foundation, Inc.,
    58         -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    59         -])
    60         -
    61         -# serial 56 LT_INIT
    62         -
    63         -
    64         -# LT_PREREQ(VERSION)
    65         -# ------------------
    66         -# Complain and exit if this libtool version is less that VERSION.
    67         -m4_defun([LT_PREREQ],
    68         -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
    69         -       [m4_default([$3],
    70         -		   [m4_fatal([Libtool version $1 or higher is required],
    71         -		             63)])],
    72         -       [$2])])
    73         -
    74         -
    75         -# _LT_CHECK_BUILDDIR
    76         -# ------------------
    77         -# Complain if the absolute build directory name contains unusual characters
    78         -m4_defun([_LT_CHECK_BUILDDIR],
    79         -[case `pwd` in
    80         -  *\ * | *\	*)
    81         -    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
    82         -esac
    83         -])
    84         -
    85         -
    86         -# LT_INIT([OPTIONS])
    87         -# ------------------
    88         -AC_DEFUN([LT_INIT],
    89         -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
    90         -AC_BEFORE([$0], [LT_LANG])dnl
    91         -AC_BEFORE([$0], [LT_OUTPUT])dnl
    92         -AC_BEFORE([$0], [LTDL_INIT])dnl
    93         -m4_require([_LT_CHECK_BUILDDIR])dnl
    94         -
    95         -dnl Autoconf doesn't catch unexpanded LT_ macros by default:
    96         -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
    97         -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
    98         -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
    99         -dnl unless we require an AC_DEFUNed macro:
   100         -AC_REQUIRE([LTOPTIONS_VERSION])dnl
   101         -AC_REQUIRE([LTSUGAR_VERSION])dnl
   102         -AC_REQUIRE([LTVERSION_VERSION])dnl
   103         -AC_REQUIRE([LTOBSOLETE_VERSION])dnl
   104         -m4_require([_LT_PROG_LTMAIN])dnl
   105         -
   106         -dnl Parse OPTIONS
   107         -_LT_SET_OPTIONS([$0], [$1])
           23  +
           24  +# serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL
           25  +
           26  +
           27  +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
           28  +# -----------------------------------------------------------
           29  +# If this macro is not defined by Autoconf, define it here.
           30  +m4_ifdef([AC_PROVIDE_IFELSE],
           31  +         [],
           32  +         [m4_define([AC_PROVIDE_IFELSE],
           33  +	         [m4_ifdef([AC_PROVIDE_$1],
           34  +		           [$2], [$3])])])
           35  +
           36  +
           37  +# AC_PROG_LIBTOOL
           38  +# ---------------
           39  +AC_DEFUN([AC_PROG_LIBTOOL],
           40  +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
           41  +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
           42  +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
           43  +  AC_PROVIDE_IFELSE([AC_PROG_CXX],
           44  +    [AC_LIBTOOL_CXX],
           45  +    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
           46  +  ])])
           47  +dnl And a similar setup for Fortran 77 support
           48  +  AC_PROVIDE_IFELSE([AC_PROG_F77],
           49  +    [AC_LIBTOOL_F77],
           50  +    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
           51  +])])
           52  +
           53  +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
           54  +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
           55  +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
           56  +  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
           57  +    [AC_LIBTOOL_GCJ],
           58  +    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
           59  +      [AC_LIBTOOL_GCJ],
           60  +      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
           61  +	[AC_LIBTOOL_GCJ],
           62  +      [ifdef([AC_PROG_GCJ],
           63  +	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
           64  +       ifdef([A][M_PROG_GCJ],
           65  +	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
           66  +       ifdef([LT_AC_PROG_GCJ],
           67  +	     [define([LT_AC_PROG_GCJ],
           68  +		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
           69  +])])# AC_PROG_LIBTOOL
           70  +
           71  +
           72  +# _AC_PROG_LIBTOOL
           73  +# ----------------
           74  +AC_DEFUN([_AC_PROG_LIBTOOL],
           75  +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
           76  +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
           77  +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
           78  +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
   108     79   
   109     80   # This can be used to rebuild libtool when needed
   110         -LIBTOOL_DEPS="$ltmain"
           81  +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
   111     82   
   112     83   # Always use our own libtool.
   113     84   LIBTOOL='$(SHELL) $(top_builddir)/libtool'
   114     85   AC_SUBST(LIBTOOL)dnl
   115     86   
   116         -_LT_SETUP
   117         -
   118         -# Only expand once:
   119         -m4_define([LT_INIT])
   120         -])# LT_INIT
   121         -
   122         -# Old names:
   123         -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
   124         -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
   125         -dnl aclocal-1.4 backwards compatibility:
   126         -dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
   127         -dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
   128         -
   129         -
   130         -# _LT_CC_BASENAME(CC)
   131         -# -------------------
   132         -# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
   133         -m4_defun([_LT_CC_BASENAME],
   134         -[for cc_temp in $1""; do
   135         -  case $cc_temp in
   136         -    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
   137         -    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
   138         -    \-*) ;;
   139         -    *) break;;
   140         -  esac
   141         -done
   142         -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
   143         -])
   144         -
   145         -
   146         -# _LT_FILEUTILS_DEFAULTS
   147         -# ----------------------
   148         -# It is okay to use these file commands and assume they have been set
   149         -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
   150         -m4_defun([_LT_FILEUTILS_DEFAULTS],
   151         -[: ${CP="cp -f"}
   152         -: ${MV="mv -f"}
   153         -: ${RM="rm -f"}
   154         -])# _LT_FILEUTILS_DEFAULTS
   155         -
   156         -
   157         -# _LT_SETUP
   158         -# ---------
   159         -m4_defun([_LT_SETUP],
   160         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
           87  +# Prevent multiple expansion
           88  +define([AC_PROG_LIBTOOL], [])
           89  +])# _AC_PROG_LIBTOOL
           90  +
           91  +
           92  +# AC_LIBTOOL_SETUP
           93  +# ----------------
           94  +AC_DEFUN([AC_LIBTOOL_SETUP],
           95  +[AC_PREREQ(2.50)dnl
           96  +AC_REQUIRE([AC_ENABLE_SHARED])dnl
           97  +AC_REQUIRE([AC_ENABLE_STATIC])dnl
           98  +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
           99  +AC_REQUIRE([AC_CANONICAL_HOST])dnl
   161    100   AC_REQUIRE([AC_CANONICAL_BUILD])dnl
   162         -_LT_DECL([], [host_alias], [0], [The host system])dnl
   163         -_LT_DECL([], [host], [0])dnl
   164         -_LT_DECL([], [host_os], [0])dnl
          101  +AC_REQUIRE([AC_PROG_CC])dnl
          102  +AC_REQUIRE([AC_PROG_LD])dnl
          103  +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
          104  +AC_REQUIRE([AC_PROG_NM])dnl
          105  +
          106  +AC_REQUIRE([AC_PROG_LN_S])dnl
          107  +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
          108  +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
          109  +AC_REQUIRE([AC_OBJEXT])dnl
          110  +AC_REQUIRE([AC_EXEEXT])dnl
   165    111   dnl
   166         -_LT_DECL([], [build_alias], [0], [The build system])dnl
   167         -_LT_DECL([], [build], [0])dnl
   168         -_LT_DECL([], [build_os], [0])dnl
   169         -dnl
   170         -AC_REQUIRE([AC_PROG_CC])dnl
   171         -AC_REQUIRE([LT_PATH_LD])dnl
   172         -AC_REQUIRE([LT_PATH_NM])dnl
   173         -dnl
   174         -AC_REQUIRE([AC_PROG_LN_S])dnl
   175         -test -z "$LN_S" && LN_S="ln -s"
   176         -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
   177         -dnl
   178         -AC_REQUIRE([LT_CMD_MAX_LEN])dnl
   179         -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
   180         -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
   181         -dnl
   182         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
   183         -m4_require([_LT_CHECK_SHELL_FEATURES])dnl
   184         -m4_require([_LT_CMD_RELOAD])dnl
   185         -m4_require([_LT_CHECK_MAGIC_METHOD])dnl
   186         -m4_require([_LT_CMD_OLD_ARCHIVE])dnl
   187         -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
          112  +AC_LIBTOOL_SYS_MAX_CMD_LEN
          113  +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
          114  +AC_LIBTOOL_OBJDIR
   188    115   
   189         -_LT_CONFIG_LIBTOOL_INIT([
   190         -# See if we are running on zsh, and set the options which allow our
   191         -# commands through without removal of \ escapes INIT.
   192         -if test -n "\${ZSH_VERSION+set}" ; then
   193         -   setopt NO_GLOB_SUBST
   194         -fi
   195         -])
   196         -if test -n "${ZSH_VERSION+set}" ; then
   197         -   setopt NO_GLOB_SUBST
   198         -fi
   199         -
   200         -_LT_CHECK_OBJDIR
   201         -
   202         -m4_require([_LT_TAG_COMPILER])dnl
   203         -_LT_PROG_ECHO_BACKSLASH
          116  +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
          117  +_LT_AC_PROG_ECHO_BACKSLASH
   204    118   
   205    119   case $host_os in
   206    120   aix3*)
   207    121     # AIX sometimes has problems with the GCC collect2 program.  For some
   208    122     # reason, if we set the COLLECT_NAMES environment variable, the problems
   209    123     # vanish in a puff of smoke.
   210    124     if test "X${COLLECT_NAMES+set}" != Xset; then
................................................................................
   212    126       export COLLECT_NAMES
   213    127     fi
   214    128     ;;
   215    129   esac
   216    130   
   217    131   # Sed substitution that helps us do robust quoting.  It backslashifies
   218    132   # metacharacters that are still active within double-quoted strings.
   219         -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
          133  +Xsed='sed -e 1s/^X//'
          134  +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
   220    135   
   221    136   # Same as above, but do not quote variable references.
   222         -double_quote_subst='s/\([["`\\]]\)/\\\1/g'
          137  +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
   223    138   
   224    139   # Sed substitution to delay expansion of an escaped shell variable in a
   225    140   # double_quote_subst'ed string.
   226    141   delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
   227    142   
   228         -# Sed substitution to delay expansion of an escaped single quote.
   229         -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
   230         -
   231    143   # Sed substitution to avoid accidental globbing in evaled expressions
   232    144   no_glob_subst='s/\*/\\\*/g'
          145  +
          146  +# Constants:
          147  +rm="rm -f"
   233    148   
   234    149   # Global variables:
   235         -ofile=libtool
          150  +default_ofile=libtool
   236    151   can_build_shared=yes
   237    152   
   238    153   # All known linkers require a `.a' archive for static linking (except MSVC,
   239    154   # which needs '.lib').
   240    155   libext=a
   241         -
          156  +ltmain="$ac_aux_dir/ltmain.sh"
          157  +ofile="$default_ofile"
   242    158   with_gnu_ld="$lt_cv_prog_gnu_ld"
   243    159   
          160  +AC_CHECK_TOOL(AR, ar, false)
          161  +AC_CHECK_TOOL(RANLIB, ranlib, :)
          162  +AC_CHECK_TOOL(STRIP, strip, :)
          163  +
   244    164   old_CC="$CC"
   245    165   old_CFLAGS="$CFLAGS"
   246    166   
   247    167   # Set sane defaults for various variables
          168  +test -z "$AR" && AR=ar
          169  +test -z "$AR_FLAGS" && AR_FLAGS=cru
          170  +test -z "$AS" && AS=as
   248    171   test -z "$CC" && CC=cc
   249    172   test -z "$LTCC" && LTCC=$CC
   250    173   test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
          174  +test -z "$DLLTOOL" && DLLTOOL=dlltool
   251    175   test -z "$LD" && LD=ld
   252         -test -z "$ac_objext" && ac_objext=o
   253         -
   254         -_LT_CC_BASENAME([$compiler])
   255         -
   256         -# Only perform the check for file, if the check method requires it
          176  +test -z "$LN_S" && LN_S="ln -s"
   257    177   test -z "$MAGIC_CMD" && MAGIC_CMD=file
   258         -case $deplibs_check_method in
   259         -file_magic*)
   260         -  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
   261         -    _LT_PATH_MAGIC
   262         -  fi
   263         -  ;;
   264         -esac
   265         -
   266         -# Use C for the default configuration in the libtool script
   267         -LT_SUPPORTED_TAG([CC])
   268         -_LT_LANG_C_CONFIG
   269         -_LT_LANG_DEFAULT_CONFIG
   270         -_LT_CONFIG_COMMANDS
   271         -])# _LT_SETUP
   272         -
   273         -
   274         -# _LT_PROG_LTMAIN
   275         -# ---------------
   276         -# Note that this code is called both from `configure', and `config.status'
   277         -# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
   278         -# `config.status' has no value for ac_aux_dir unless we are using Automake,
   279         -# so we pass a copy along to make sure it has a sensible value anyway.
   280         -m4_defun([_LT_PROG_LTMAIN],
   281         -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
   282         -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
   283         -ltmain="$ac_aux_dir/ltmain.sh"
   284         -])# _LT_PROG_LTMAIN
   285         -
   286         -
   287         -
   288         -# So that we can recreate a full libtool script including additional
   289         -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
   290         -# in macros and then make a single call at the end using the `libtool'
   291         -# label.
   292         -
   293         -
   294         -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
   295         -# ----------------------------------------
   296         -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
   297         -m4_define([_LT_CONFIG_LIBTOOL_INIT],
   298         -[m4_ifval([$1],
   299         -          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
   300         -                     [$1
   301         -])])])
   302         -
   303         -# Initialize.
   304         -m4_define([_LT_OUTPUT_LIBTOOL_INIT])
   305         -
   306         -
   307         -# _LT_CONFIG_LIBTOOL([COMMANDS])
   308         -# ------------------------------
   309         -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
   310         -m4_define([_LT_CONFIG_LIBTOOL],
   311         -[m4_ifval([$1],
   312         -          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
   313         -                     [$1
   314         -])])])
   315         -
   316         -# Initialize.
   317         -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
   318         -
   319         -
   320         -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
   321         -# -----------------------------------------------------
   322         -m4_defun([_LT_CONFIG_SAVE_COMMANDS],
   323         -[_LT_CONFIG_LIBTOOL([$1])
   324         -_LT_CONFIG_LIBTOOL_INIT([$2])
   325         -])
   326         -
   327         -
   328         -# _LT_FORMAT_COMMENT([COMMENT])
   329         -# -----------------------------
   330         -# Add leading comment marks to the start of each line, and a trailing
   331         -# full-stop to the whole comment if one is not present already.
   332         -m4_define([_LT_FORMAT_COMMENT],
   333         -[m4_ifval([$1], [
   334         -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
   335         -              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
   336         -)])
   337         -
   338         -
   339         -
   340         -
   341         -
   342         -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
   343         -# -------------------------------------------------------------------
   344         -# CONFIGNAME is the name given to the value in the libtool script.
   345         -# VARNAME is the (base) name used in the configure script.
   346         -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
   347         -# VARNAME.  Any other value will be used directly.
   348         -m4_define([_LT_DECL],
   349         -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
   350         -    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
   351         -	[m4_ifval([$1], [$1], [$2])])
   352         -    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
   353         -    m4_ifval([$4],
   354         -	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
   355         -    lt_dict_add_subkey([lt_decl_dict], [$2],
   356         -	[tagged?], [m4_ifval([$5], [yes], [no])])])
   357         -])
   358         -
   359         -
   360         -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
   361         -# --------------------------------------------------------
   362         -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
   363         -
   364         -
   365         -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
   366         -# ------------------------------------------------
   367         -m4_define([lt_decl_tag_varnames],
   368         -[_lt_decl_filter([tagged?], [yes], $@)])
   369         -
   370         -
   371         -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
   372         -# ---------------------------------------------------------
   373         -m4_define([_lt_decl_filter],
   374         -[m4_case([$#],
   375         -  [0], [m4_fatal([$0: too few arguments: $#])],
   376         -  [1], [m4_fatal([$0: too few arguments: $#: $1])],
   377         -  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
   378         -  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
   379         -  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
   380         -])
   381         -
   382         -
   383         -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
   384         -# --------------------------------------------------
   385         -m4_define([lt_decl_quote_varnames],
   386         -[_lt_decl_filter([value], [1], $@)])
   387         -
   388         -
   389         -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
   390         -# ---------------------------------------------------
   391         -m4_define([lt_decl_dquote_varnames],
   392         -[_lt_decl_filter([value], [2], $@)])
   393         -
   394         -
   395         -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
   396         -# ---------------------------------------------------
   397         -m4_define([lt_decl_varnames_tagged],
   398         -[m4_assert([$# <= 2])dnl
   399         -_$0(m4_quote(m4_default([$1], [[, ]])),
   400         -    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
   401         -    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
   402         -m4_define([_lt_decl_varnames_tagged],
   403         -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
   404         -
   405         -
   406         -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
   407         -# ------------------------------------------------
   408         -m4_define([lt_decl_all_varnames],
   409         -[_$0(m4_quote(m4_default([$1], [[, ]])),
   410         -     m4_if([$2], [],
   411         -	   m4_quote(lt_decl_varnames),
   412         -	m4_quote(m4_shift($@))))[]dnl
   413         -])
   414         -m4_define([_lt_decl_all_varnames],
   415         -[lt_join($@, lt_decl_varnames_tagged([$1],
   416         -			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
   417         -])
   418         -
   419         -
   420         -# _LT_CONFIG_STATUS_DECLARE([VARNAME])
   421         -# ------------------------------------
   422         -# Quote a variable value, and forward it to `config.status' so that its
   423         -# declaration there will have the same value as in `configure'.  VARNAME
   424         -# must have a single quote delimited value for this to work.
   425         -m4_define([_LT_CONFIG_STATUS_DECLARE],
   426         -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
   427         -
   428         -
   429         -# _LT_CONFIG_STATUS_DECLARATIONS
   430         -# ------------------------------
   431         -# We delimit libtool config variables with single quotes, so when
   432         -# we write them to config.status, we have to be sure to quote all
   433         -# embedded single quotes properly.  In configure, this macro expands
   434         -# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
   435         -#
   436         -#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
   437         -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
   438         -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
   439         -    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
   440         -
   441         -
   442         -# _LT_LIBTOOL_TAGS
   443         -# ----------------
   444         -# Output comment and list of tags supported by the script
   445         -m4_defun([_LT_LIBTOOL_TAGS],
   446         -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
   447         -available_tags="_LT_TAGS"dnl
   448         -])
   449         -
   450         -
   451         -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
   452         -# -----------------------------------
   453         -# Extract the dictionary values for VARNAME (optionally with TAG) and
   454         -# expand to a commented shell variable setting:
   455         -#
   456         -#    # Some comment about what VAR is for.
   457         -#    visible_name=$lt_internal_name
   458         -m4_define([_LT_LIBTOOL_DECLARE],
   459         -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
   460         -					   [description])))[]dnl
   461         -m4_pushdef([_libtool_name],
   462         -    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
   463         -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
   464         -    [0], [_libtool_name=[$]$1],
   465         -    [1], [_libtool_name=$lt_[]$1],
   466         -    [2], [_libtool_name=$lt_[]$1],
   467         -    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
   468         -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
   469         -])
   470         -
   471         -
   472         -# _LT_LIBTOOL_CONFIG_VARS
   473         -# -----------------------
   474         -# Produce commented declarations of non-tagged libtool config variables
   475         -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
   476         -# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
   477         -# section) are produced by _LT_LIBTOOL_TAG_VARS.
   478         -m4_defun([_LT_LIBTOOL_CONFIG_VARS],
   479         -[m4_foreach([_lt_var],
   480         -    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
   481         -    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
   482         -
   483         -
   484         -# _LT_LIBTOOL_TAG_VARS(TAG)
   485         -# -------------------------
   486         -m4_define([_LT_LIBTOOL_TAG_VARS],
   487         -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
   488         -    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
   489         -
   490         -
   491         -# _LT_TAGVAR(VARNAME, [TAGNAME])
   492         -# ------------------------------
   493         -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
   494         -
   495         -
   496         -# _LT_CONFIG_COMMANDS
   497         -# -------------------
   498         -# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
   499         -# variables for single and double quote escaping we saved from calls
   500         -# to _LT_DECL, we can put quote escaped variables declarations
   501         -# into `config.status', and then the shell code to quote escape them in
   502         -# for loops in `config.status'.  Finally, any additional code accumulated
   503         -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
   504         -m4_defun([_LT_CONFIG_COMMANDS],
   505         -[AC_PROVIDE_IFELSE([LT_OUTPUT],
   506         -	dnl If the libtool generation code has been placed in $CONFIG_LT,
   507         -	dnl instead of duplicating it all over again into config.status,
   508         -	dnl then we will have config.status run $CONFIG_LT later, so it
   509         -	dnl needs to know what name is stored there:
   510         -        [AC_CONFIG_COMMANDS([libtool],
   511         -            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
   512         -    dnl If the libtool generation code is destined for config.status,
   513         -    dnl expand the accumulated commands and init code now:
   514         -    [AC_CONFIG_COMMANDS([libtool],
   515         -        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
   516         -])#_LT_CONFIG_COMMANDS
   517         -
   518         -
   519         -# Initialize.
   520         -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
   521         -[
   522         -
   523         -# The HP-UX ksh and POSIX shell print the target directory to stdout
   524         -# if CDPATH is set.
   525         -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
   526         -
   527         -sed_quote_subst='$sed_quote_subst'
   528         -double_quote_subst='$double_quote_subst'
   529         -delay_variable_subst='$delay_variable_subst'
   530         -_LT_CONFIG_STATUS_DECLARATIONS
   531         -LTCC='$LTCC'
   532         -LTCFLAGS='$LTCFLAGS'
   533         -compiler='$compiler_DEFAULT'
   534         -
   535         -# Quote evaled strings.
   536         -for var in lt_decl_all_varnames([[ \
   537         -]], lt_decl_quote_varnames); do
   538         -    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
   539         -    *[[\\\\\\\`\\"\\\$]]*)
   540         -      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
   541         -      ;;
   542         -    *)
   543         -      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
   544         -      ;;
   545         -    esac
   546         -done
   547         -
   548         -# Double-quote double-evaled strings.
   549         -for var in lt_decl_all_varnames([[ \
   550         -]], lt_decl_dquote_varnames); do
   551         -    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
   552         -    *[[\\\\\\\`\\"\\\$]]*)
   553         -      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
   554         -      ;;
   555         -    *)
   556         -      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
   557         -      ;;
   558         -    esac
   559         -done
   560         -
   561         -# Fix-up fallback echo if it was mangled by the above quoting rules.
   562         -case \$lt_ECHO in
   563         -*'\\\[$]0 --fallback-echo"')dnl "
   564         -  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
   565         -  ;;
   566         -esac
   567         -
   568         -_LT_OUTPUT_LIBTOOL_INIT
   569         -])
   570         -
   571         -
   572         -# LT_OUTPUT
   573         -# ---------
   574         -# This macro allows early generation of the libtool script (before
   575         -# AC_OUTPUT is called), incase it is used in configure for compilation
   576         -# tests.
   577         -AC_DEFUN([LT_OUTPUT],
   578         -[: ${CONFIG_LT=./config.lt}
   579         -AC_MSG_NOTICE([creating $CONFIG_LT])
   580         -cat >"$CONFIG_LT" <<_LTEOF
   581         -#! $SHELL
   582         -# Generated by $as_me.
   583         -# Run this file to recreate a libtool stub with the current configuration.
   584         -
   585         -lt_cl_silent=false
   586         -SHELL=\${CONFIG_SHELL-$SHELL}
   587         -_LTEOF
   588         -
   589         -cat >>"$CONFIG_LT" <<\_LTEOF
   590         -AS_SHELL_SANITIZE
   591         -_AS_PREPARE
   592         -
   593         -exec AS_MESSAGE_FD>&1
   594         -exec AS_MESSAGE_LOG_FD>>config.log
   595         -{
   596         -  echo
   597         -  AS_BOX([Running $as_me.])
   598         -} >&AS_MESSAGE_LOG_FD
   599         -
   600         -lt_cl_help="\
   601         -\`$as_me' creates a local libtool stub from the current configuration,
   602         -for use in further configure time tests before the real libtool is
   603         -generated.
   604         -
   605         -Usage: $[0] [[OPTIONS]]
   606         -
   607         -  -h, --help      print this help, then exit
   608         -  -V, --version   print version number, then exit
   609         -  -q, --quiet     do not print progress messages
   610         -  -d, --debug     don't remove temporary files
   611         -
   612         -Report bugs to <bug-libtool@gnu.org>."
   613         -
   614         -lt_cl_version="\
   615         -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
   616         -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
   617         -configured by $[0], generated by m4_PACKAGE_STRING.
   618         -
   619         -Copyright (C) 2008 Free Software Foundation, Inc.
   620         -This config.lt script is free software; the Free Software Foundation
   621         -gives unlimited permision to copy, distribute and modify it."
   622         -
   623         -while test $[#] != 0
   624         -do
   625         -  case $[1] in
   626         -    --version | --v* | -V )
   627         -      echo "$lt_cl_version"; exit 0 ;;
   628         -    --help | --h* | -h )
   629         -      echo "$lt_cl_help"; exit 0 ;;
   630         -    --debug | --d* | -d )
   631         -      debug=: ;;
   632         -    --quiet | --q* | --silent | --s* | -q )
   633         -      lt_cl_silent=: ;;
   634         -
   635         -    -*) AC_MSG_ERROR([unrecognized option: $[1]
   636         -Try \`$[0] --help' for more information.]) ;;
   637         -
   638         -    *) AC_MSG_ERROR([unrecognized argument: $[1]
   639         -Try \`$[0] --help' for more information.]) ;;
   640         -  esac
   641         -  shift
   642         -done
   643         -
   644         -if $lt_cl_silent; then
   645         -  exec AS_MESSAGE_FD>/dev/null
   646         -fi
   647         -_LTEOF
   648         -
   649         -cat >>"$CONFIG_LT" <<_LTEOF
   650         -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
   651         -_LTEOF
   652         -
   653         -cat >>"$CONFIG_LT" <<\_LTEOF
   654         -AC_MSG_NOTICE([creating $ofile])
   655         -_LT_OUTPUT_LIBTOOL_COMMANDS
   656         -AS_EXIT(0)
   657         -_LTEOF
   658         -chmod +x "$CONFIG_LT"
   659         -
   660         -# configure is writing to config.log, but config.lt does its own redirection,
   661         -# appending to config.log, which fails on DOS, as config.log is still kept
   662         -# open by configure.  Here we exec the FD to /dev/null, effectively closing
   663         -# config.log, so it can be properly (re)opened and appended to by config.lt.
   664         -if test "$no_create" != yes; then
   665         -  lt_cl_success=:
   666         -  test "$silent" = yes &&
   667         -    lt_config_lt_args="$lt_config_lt_args --quiet"
   668         -  exec AS_MESSAGE_LOG_FD>/dev/null
   669         -  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
   670         -  exec AS_MESSAGE_LOG_FD>>config.log
   671         -  $lt_cl_success || AS_EXIT(1)
   672         -fi
   673         -])# LT_OUTPUT
   674         -
   675         -
   676         -# _LT_CONFIG(TAG)
   677         -# ---------------
   678         -# If TAG is the built-in tag, create an initial libtool script with a
   679         -# default configuration from the untagged config vars.  Otherwise add code
   680         -# to config.status for appending the configuration named by TAG from the
   681         -# matching tagged config vars.
   682         -m4_defun([_LT_CONFIG],
   683         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
   684         -_LT_CONFIG_SAVE_COMMANDS([
   685         -  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   686         -  m4_if(_LT_TAG, [C], [
   687         -    # See if we are running on zsh, and set the options which allow our
   688         -    # commands through without removal of \ escapes.
   689         -    if test -n "${ZSH_VERSION+set}" ; then
   690         -      setopt NO_GLOB_SUBST
   691         -    fi
   692         -
   693         -    cfgfile="${ofile}T"
   694         -    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
   695         -    $RM "$cfgfile"
   696         -
   697         -    cat <<_LT_EOF >> "$cfgfile"
   698         -#! $SHELL
   699         -
   700         -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
   701         -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
   702         -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
   703         -# NOTE: Changes made to this file will be lost: look at ltmain.sh.
   704         -#
   705         -_LT_COPYING
   706         -_LT_LIBTOOL_TAGS
   707         -
   708         -# ### BEGIN LIBTOOL CONFIG
   709         -_LT_LIBTOOL_CONFIG_VARS
   710         -_LT_LIBTOOL_TAG_VARS
   711         -# ### END LIBTOOL CONFIG
   712         -
   713         -_LT_EOF
   714         -
   715         -  case $host_os in
   716         -  aix3*)
   717         -    cat <<\_LT_EOF >> "$cfgfile"
   718         -# AIX sometimes has problems with the GCC collect2 program.  For some
   719         -# reason, if we set the COLLECT_NAMES environment variable, the problems
   720         -# vanish in a puff of smoke.
   721         -if test "X${COLLECT_NAMES+set}" != Xset; then
   722         -  COLLECT_NAMES=
   723         -  export COLLECT_NAMES
   724         -fi
   725         -_LT_EOF
   726         -    ;;
   727         -  esac
   728         -
   729         -  _LT_PROG_LTMAIN
   730         -
   731         -  # We use sed instead of cat because bash on DJGPP gets confused if
   732         -  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
   733         -  # text mode, it properly converts lines to CR/LF.  This bash problem
   734         -  # is reportedly fixed, but why not run on old versions too?
   735         -  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
   736         -    || (rm -f "$cfgfile"; exit 1)
   737         -
   738         -  _LT_PROG_XSI_SHELLFNS
   739         -
   740         -  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
   741         -    || (rm -f "$cfgfile"; exit 1)
   742         -
   743         -  mv -f "$cfgfile" "$ofile" ||
   744         -    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   745         -  chmod +x "$ofile"
   746         -],
   747         -[cat <<_LT_EOF >> "$ofile"
   748         -
   749         -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
   750         -dnl in a comment (ie after a #).
   751         -# ### BEGIN LIBTOOL TAG CONFIG: $1
   752         -_LT_LIBTOOL_TAG_VARS(_LT_TAG)
   753         -# ### END LIBTOOL TAG CONFIG: $1
   754         -_LT_EOF
   755         -])dnl /m4_if
   756         -],
   757         -[m4_if([$1], [], [
   758         -    PACKAGE='$PACKAGE'
   759         -    VERSION='$VERSION'
   760         -    TIMESTAMP='$TIMESTAMP'
   761         -    RM='$RM'
   762         -    ofile='$ofile'], [])
   763         -])dnl /_LT_CONFIG_SAVE_COMMANDS
   764         -])# _LT_CONFIG
   765         -
   766         -
   767         -# LT_SUPPORTED_TAG(TAG)
   768         -# ---------------------
   769         -# Trace this macro to discover what tags are supported by the libtool
   770         -# --tag option, using:
   771         -#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
   772         -AC_DEFUN([LT_SUPPORTED_TAG], [])
   773         -
   774         -
   775         -# C support is built-in for now
   776         -m4_define([_LT_LANG_C_enabled], [])
   777         -m4_define([_LT_TAGS], [])
   778         -
   779         -
   780         -# LT_LANG(LANG)
   781         -# -------------
   782         -# Enable libtool support for the given language if not already enabled.
   783         -AC_DEFUN([LT_LANG],
   784         -[AC_BEFORE([$0], [LT_OUTPUT])dnl
   785         -m4_case([$1],
   786         -  [C],			[_LT_LANG(C)],
   787         -  [C++],		[_LT_LANG(CXX)],
   788         -  [Java],		[_LT_LANG(GCJ)],
   789         -  [Fortran 77],		[_LT_LANG(F77)],
   790         -  [Fortran],		[_LT_LANG(FC)],
   791         -  [Windows Resource],	[_LT_LANG(RC)],
   792         -  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
   793         -    [_LT_LANG($1)],
   794         -    [m4_fatal([$0: unsupported language: "$1"])])])dnl
   795         -])# LT_LANG
   796         -
   797         -
   798         -# _LT_LANG(LANGNAME)
   799         -# ------------------
   800         -m4_defun([_LT_LANG],
   801         -[m4_ifdef([_LT_LANG_]$1[_enabled], [],
   802         -  [LT_SUPPORTED_TAG([$1])dnl
   803         -  m4_append([_LT_TAGS], [$1 ])dnl
   804         -  m4_define([_LT_LANG_]$1[_enabled], [])dnl
   805         -  _LT_LANG_$1_CONFIG($1)])dnl
   806         -])# _LT_LANG
   807         -
   808         -
   809         -# _LT_LANG_DEFAULT_CONFIG
   810         -# -----------------------
   811         -m4_defun([_LT_LANG_DEFAULT_CONFIG],
   812         -[AC_PROVIDE_IFELSE([AC_PROG_CXX],
   813         -  [LT_LANG(CXX)],
   814         -  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
   815         -
   816         -AC_PROVIDE_IFELSE([AC_PROG_F77],
   817         -  [LT_LANG(F77)],
   818         -  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
   819         -
   820         -AC_PROVIDE_IFELSE([AC_PROG_FC],
   821         -  [LT_LANG(FC)],
   822         -  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
   823         -
   824         -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
   825         -dnl pulling things in needlessly.
   826         -AC_PROVIDE_IFELSE([AC_PROG_GCJ],
   827         -  [LT_LANG(GCJ)],
   828         -  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
   829         -    [LT_LANG(GCJ)],
   830         -    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
   831         -      [LT_LANG(GCJ)],
   832         -      [m4_ifdef([AC_PROG_GCJ],
   833         -	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
   834         -       m4_ifdef([A][M_PROG_GCJ],
   835         -	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
   836         -       m4_ifdef([LT_PROG_GCJ],
   837         -	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
   838         -
   839         -AC_PROVIDE_IFELSE([LT_PROG_RC],
   840         -  [LT_LANG(RC)],
   841         -  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
   842         -])# _LT_LANG_DEFAULT_CONFIG
   843         -
   844         -# Obsolete macros:
   845         -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
   846         -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
   847         -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
   848         -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
   849         -dnl aclocal-1.4 backwards compatibility:
   850         -dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
   851         -dnl AC_DEFUN([AC_LIBTOOL_F77], [])
   852         -dnl AC_DEFUN([AC_LIBTOOL_FC], [])
   853         -dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
   854         -
   855         -
   856         -# _LT_TAG_COMPILER
   857         -# ----------------
   858         -m4_defun([_LT_TAG_COMPILER],
   859         -[AC_REQUIRE([AC_PROG_CC])dnl
   860         -
   861         -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
   862         -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
   863         -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
   864         -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
   865         -
   866         -# If no C compiler was specified, use CC.
   867         -LTCC=${LTCC-"$CC"}
   868         -
   869         -# If no C compiler flags were specified, use CFLAGS.
   870         -LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
   871         -
   872         -# Allow CC to be a program name with arguments.
   873         -compiler=$CC
   874         -])# _LT_TAG_COMPILER
   875         -
   876         -
   877         -# _LT_COMPILER_BOILERPLATE
   878         -# ------------------------
   879         -# Check for compiler boilerplate output or warnings with
   880         -# the simple compiler test code.
   881         -m4_defun([_LT_COMPILER_BOILERPLATE],
   882         -[m4_require([_LT_DECL_SED])dnl
   883         -ac_outfile=conftest.$ac_objext
   884         -echo "$lt_simple_compile_test_code" >conftest.$ac_ext
   885         -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
   886         -_lt_compiler_boilerplate=`cat conftest.err`
   887         -$RM conftest*
   888         -])# _LT_COMPILER_BOILERPLATE
   889         -
   890         -
   891         -# _LT_LINKER_BOILERPLATE
   892         -# ----------------------
   893         -# Check for linker boilerplate output or warnings with
   894         -# the simple link test code.
   895         -m4_defun([_LT_LINKER_BOILERPLATE],
   896         -[m4_require([_LT_DECL_SED])dnl
   897         -ac_outfile=conftest.$ac_objext
   898         -echo "$lt_simple_link_test_code" >conftest.$ac_ext
   899         -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
   900         -_lt_linker_boilerplate=`cat conftest.err`
   901         -$RM -r conftest*
   902         -])# _LT_LINKER_BOILERPLATE
   903         -
   904         -# _LT_REQUIRED_DARWIN_CHECKS
   905         -# -------------------------
   906         -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
   907         -  case $host_os in
   908         -    rhapsody* | darwin*)
   909         -    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
   910         -    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
   911         -    AC_CHECK_TOOL([LIPO], [lipo], [:])
   912         -    AC_CHECK_TOOL([OTOOL], [otool], [:])
   913         -    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
   914         -    _LT_DECL([], [DSYMUTIL], [1],
   915         -      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
   916         -    _LT_DECL([], [NMEDIT], [1],
   917         -      [Tool to change global to local symbols on Mac OS X])
   918         -    _LT_DECL([], [LIPO], [1],
   919         -      [Tool to manipulate fat objects and archives on Mac OS X])
   920         -    _LT_DECL([], [OTOOL], [1],
   921         -      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
   922         -    _LT_DECL([], [OTOOL64], [1],
   923         -      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
   924         -
   925         -    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
   926         -      [lt_cv_apple_cc_single_mod=no
   927         -      if test -z "${LT_MULTI_MODULE}"; then
   928         -	# By default we will add the -single_module flag. You can override
   929         -	# by either setting the environment variable LT_MULTI_MODULE
   930         -	# non-empty at configure time, or by adding -multi_module to the
   931         -	# link flags.
   932         -	rm -rf libconftest.dylib*
   933         -	echo "int foo(void){return 1;}" > conftest.c
   934         -	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
   935         --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
   936         -	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
   937         -	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
   938         -        _lt_result=$?
   939         -	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
   940         -	  lt_cv_apple_cc_single_mod=yes
   941         -	else
   942         -	  cat conftest.err >&AS_MESSAGE_LOG_FD
   943         -	fi
   944         -	rm -rf libconftest.dylib*
   945         -	rm -f conftest.*
   946         -      fi])
   947         -    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
   948         -      [lt_cv_ld_exported_symbols_list],
   949         -      [lt_cv_ld_exported_symbols_list=no
   950         -      save_LDFLAGS=$LDFLAGS
   951         -      echo "_main" > conftest.sym
   952         -      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
   953         -      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
   954         -	[lt_cv_ld_exported_symbols_list=yes],
   955         -	[lt_cv_ld_exported_symbols_list=no])
   956         -	LDFLAGS="$save_LDFLAGS"
   957         -    ])
   958         -    case $host_os in
   959         -    rhapsody* | darwin1.[[012]])
   960         -      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
   961         -    darwin1.*)
   962         -      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
   963         -    darwin*) # darwin 5.x on
   964         -      # if running on 10.5 or later, the deployment target defaults
   965         -      # to the OS version, if on x86, and 10.4, the deployment
   966         -      # target defaults to 10.4. Don't you love it?
   967         -      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
   968         -	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
   969         -	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
   970         -	10.[[012]]*)
   971         -	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
   972         -	10.*)
   973         -	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
   974         -      esac
   975         -    ;;
   976         -  esac
   977         -    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
   978         -      _lt_dar_single_mod='$single_module'
   979         -    fi
   980         -    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
   981         -      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
   982         -    else
   983         -      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
   984         -    fi
   985         -    if test "$DSYMUTIL" != ":"; then
   986         -      _lt_dsymutil='~$DSYMUTIL $lib || :'
   987         -    else
   988         -      _lt_dsymutil=
   989         -    fi
   990         -    ;;
   991         -  esac
   992         -])
   993         -
   994         -
   995         -# _LT_DARWIN_LINKER_FEATURES
   996         -# --------------------------
   997         -# Checks for linker and compiler features on darwin
   998         -m4_defun([_LT_DARWIN_LINKER_FEATURES],
   999         -[
  1000         -  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
  1001         -  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  1002         -  _LT_TAGVAR(hardcode_direct, $1)=no
  1003         -  _LT_TAGVAR(hardcode_automatic, $1)=yes
  1004         -  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  1005         -  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
  1006         -  _LT_TAGVAR(link_all_deplibs, $1)=yes
  1007         -  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
  1008         -  case $cc_basename in
  1009         -     ifort*) _lt_dar_can_shared=yes ;;
  1010         -     *) _lt_dar_can_shared=$GCC ;;
  1011         -  esac
  1012         -  if test "$_lt_dar_can_shared" = "yes"; then
  1013         -    output_verbose_link_cmd=echo
  1014         -    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
  1015         -    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
  1016         -    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
  1017         -    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
  1018         -    m4_if([$1], [CXX],
  1019         -[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
  1020         -      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
  1021         -      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
  1022         -    fi
  1023         -],[])
  1024         -  else
  1025         -  _LT_TAGVAR(ld_shlibs, $1)=no
  1026         -  fi
  1027         -])
  1028         -
  1029         -# _LT_SYS_MODULE_PATH_AIX
  1030         -# -----------------------
  1031         -# Links a minimal program and checks the executable
  1032         -# for the system default hardcoded library path. In most cases,
  1033         -# this is /usr/lib:/lib, but when the MPI compilers are used
  1034         -# the location of the communication and MPI libs are included too.
  1035         -# If we don't find anything, use the default library path according
  1036         -# to the aix ld manual.
  1037         -m4_defun([_LT_SYS_MODULE_PATH_AIX],
  1038         -[m4_require([_LT_DECL_SED])dnl
  1039         -AC_LINK_IFELSE(AC_LANG_PROGRAM,[
  1040         -lt_aix_libpath_sed='
  1041         -    /Import File Strings/,/^$/ {
  1042         -	/^0/ {
  1043         -	    s/^0  *\(.*\)$/\1/
  1044         -	    p
  1045         -	}
  1046         -    }'
  1047         -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  1048         -# Check for a 64-bit object if we didn't find anything.
  1049         -if test -z "$aix_libpath"; then
  1050         -  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
  1051         -fi],[])
  1052         -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  1053         -])# _LT_SYS_MODULE_PATH_AIX
  1054         -
  1055         -
  1056         -# _LT_SHELL_INIT(ARG)
  1057         -# -------------------
  1058         -m4_define([_LT_SHELL_INIT],
  1059         -[ifdef([AC_DIVERSION_NOTICE],
  1060         -	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  1061         -	 [AC_DIVERT_PUSH(NOTICE)])
  1062         -$1
  1063         -AC_DIVERT_POP
  1064         -])# _LT_SHELL_INIT
  1065         -
  1066         -
  1067         -# _LT_PROG_ECHO_BACKSLASH
  1068         -# -----------------------
  1069         -# Add some code to the start of the generated configure script which
  1070         -# will find an echo command which doesn't interpret backslashes.
  1071         -m4_defun([_LT_PROG_ECHO_BACKSLASH],
  1072         -[_LT_SHELL_INIT([
  1073         -# Check that we are running under the correct shell.
  1074         -SHELL=${CONFIG_SHELL-/bin/sh}
  1075         -
  1076         -case X$lt_ECHO in
  1077         -X*--fallback-echo)
  1078         -  # Remove one level of quotation (which was required for Make).
  1079         -  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  1080         -  ;;
  1081         -esac
  1082         -
  1083         -ECHO=${lt_ECHO-echo}
  1084         -if test "X[$]1" = X--no-reexec; then
  1085         -  # Discard the --no-reexec flag, and continue.
  1086         -  shift
  1087         -elif test "X[$]1" = X--fallback-echo; then
  1088         -  # Avoid inline document here, it may be left over
  1089         -  :
  1090         -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
  1091         -  # Yippee, $ECHO works!
  1092         -  :
  1093         -else
  1094         -  # Restart under the correct shell.
  1095         -  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  1096         -fi
  1097         -
  1098         -if test "X[$]1" = X--fallback-echo; then
  1099         -  # used as fallback echo
  1100         -  shift
  1101         -  cat <<_LT_EOF
  1102         -[$]*
  1103         -_LT_EOF
  1104         -  exit 0
  1105         -fi
  1106         -
  1107         -# The HP-UX ksh and POSIX shell print the target directory to stdout
  1108         -# if CDPATH is set.
  1109         -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  1110         -
  1111         -if test -z "$lt_ECHO"; then
  1112         -  if test "X${echo_test_string+set}" != Xset; then
  1113         -    # find a string as large as possible, as long as the shell can cope with it
  1114         -    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  1115         -      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  1116         -      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
  1117         -	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
  1118         -      then
  1119         -        break
  1120         -      fi
  1121         -    done
  1122         -  fi
  1123         -
  1124         -  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
  1125         -     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
  1126         -     test "X$echo_testing_string" = "X$echo_test_string"; then
  1127         -    :
  1128         -  else
  1129         -    # The Solaris, AIX, and Digital Unix default echo programs unquote
  1130         -    # backslashes.  This makes it impossible to quote backslashes using
  1131         -    #   echo "$something" | sed 's/\\/\\\\/g'
  1132         -    #
  1133         -    # So, first we look for a working echo in the user's PATH.
  1134         -
  1135         -    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  1136         -    for dir in $PATH /usr/ucb; do
  1137         -      IFS="$lt_save_ifs"
  1138         -      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  1139         -         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  1140         -         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  1141         -         test "X$echo_testing_string" = "X$echo_test_string"; then
  1142         -        ECHO="$dir/echo"
  1143         -        break
  1144         -      fi
  1145         -    done
  1146         -    IFS="$lt_save_ifs"
  1147         -
  1148         -    if test "X$ECHO" = Xecho; then
  1149         -      # We didn't find a better echo, so look for alternatives.
  1150         -      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
  1151         -         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
  1152         -         test "X$echo_testing_string" = "X$echo_test_string"; then
  1153         -        # This shell has a builtin print -r that does the trick.
  1154         -        ECHO='print -r'
  1155         -      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
  1156         -	   test "X$CONFIG_SHELL" != X/bin/ksh; then
  1157         -        # If we have ksh, try running configure again with it.
  1158         -        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  1159         -        export ORIGINAL_CONFIG_SHELL
  1160         -        CONFIG_SHELL=/bin/ksh
  1161         -        export CONFIG_SHELL
  1162         -        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  1163         -      else
  1164         -        # Try using printf.
  1165         -        ECHO='printf %s\n'
  1166         -        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
  1167         -	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
  1168         -	   test "X$echo_testing_string" = "X$echo_test_string"; then
  1169         -	  # Cool, printf works
  1170         -	  :
  1171         -        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  1172         -	     test "X$echo_testing_string" = 'X\t' &&
  1173         -	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  1174         -	     test "X$echo_testing_string" = "X$echo_test_string"; then
  1175         -	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  1176         -	  export CONFIG_SHELL
  1177         -	  SHELL="$CONFIG_SHELL"
  1178         -	  export SHELL
  1179         -	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
  1180         -        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  1181         -	     test "X$echo_testing_string" = 'X\t' &&
  1182         -	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  1183         -	     test "X$echo_testing_string" = "X$echo_test_string"; then
  1184         -	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
  1185         -        else
  1186         -	  # maybe with a smaller string...
  1187         -	  prev=:
  1188         -
  1189         -	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  1190         -	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
  1191         -	    then
  1192         -	      break
  1193         -	    fi
  1194         -	    prev="$cmd"
  1195         -	  done
  1196         -
  1197         -	  if test "$prev" != 'sed 50q "[$]0"'; then
  1198         -	    echo_test_string=`eval $prev`
  1199         -	    export echo_test_string
  1200         -	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  1201         -	  else
  1202         -	    # Oops.  We lost completely, so just stick with echo.
  1203         -	    ECHO=echo
  1204         -	  fi
  1205         -        fi
  1206         -      fi
  1207         -    fi
  1208         -  fi
  1209         -fi
  1210         -
  1211         -# Copy echo and quote the copy suitably for passing to libtool from
  1212         -# the Makefile, instead of quoting the original, which is used later.
  1213         -lt_ECHO=$ECHO
  1214         -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  1215         -   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  1216         -fi
  1217         -
  1218         -AC_SUBST(lt_ECHO)
  1219         -])
  1220         -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
  1221         -_LT_DECL([], [ECHO], [1],
  1222         -    [An echo program that does not interpret backslashes])
  1223         -])# _LT_PROG_ECHO_BACKSLASH
  1224         -
  1225         -
  1226         -# _LT_ENABLE_LOCK
  1227         -# ---------------
  1228         -m4_defun([_LT_ENABLE_LOCK],
  1229         -[AC_ARG_ENABLE([libtool-lock],
  1230         -  [AS_HELP_STRING([--disable-libtool-lock],
  1231         -    [avoid locking (might break parallel builds)])])
  1232         -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  1233         -
  1234         -# Some flags need to be propagated to the compiler or linker for good
  1235         -# libtool support.
  1236         -case $host in
  1237         -ia64-*-hpux*)
  1238         -  # Find out which ABI we are using.
  1239         -  echo 'int i;' > conftest.$ac_ext
  1240         -  if AC_TRY_EVAL(ac_compile); then
  1241         -    case `/usr/bin/file conftest.$ac_objext` in
  1242         -      *ELF-32*)
  1243         -	HPUX_IA64_MODE="32"
  1244         -	;;
  1245         -      *ELF-64*)
  1246         -	HPUX_IA64_MODE="64"
  1247         -	;;
  1248         -    esac
  1249         -  fi
  1250         -  rm -rf conftest*
  1251         -  ;;
  1252         -*-*-irix6*)
  1253         -  # Find out which ABI we are using.
  1254         -  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  1255         -  if AC_TRY_EVAL(ac_compile); then
  1256         -    if test "$lt_cv_prog_gnu_ld" = yes; then
  1257         -      case `/usr/bin/file conftest.$ac_objext` in
  1258         -	*32-bit*)
  1259         -	  LD="${LD-ld} -melf32bsmip"
  1260         -	  ;;
  1261         -	*N32*)
  1262         -	  LD="${LD-ld} -melf32bmipn32"
  1263         -	  ;;
  1264         -	*64-bit*)
  1265         -	  LD="${LD-ld} -melf64bmip"
  1266         -	;;
  1267         -      esac
  1268         -    else
  1269         -      case `/usr/bin/file conftest.$ac_objext` in
  1270         -	*32-bit*)
  1271         -	  LD="${LD-ld} -32"
  1272         -	  ;;
  1273         -	*N32*)
  1274         -	  LD="${LD-ld} -n32"
  1275         -	  ;;
  1276         -	*64-bit*)
  1277         -	  LD="${LD-ld} -64"
  1278         -	  ;;
  1279         -      esac
  1280         -    fi
  1281         -  fi
  1282         -  rm -rf conftest*
  1283         -  ;;
  1284         -
  1285         -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
  1286         -s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
  1287         -  # Find out which ABI we are using.
  1288         -  echo 'int i;' > conftest.$ac_ext
  1289         -  if AC_TRY_EVAL(ac_compile); then
  1290         -    case `/usr/bin/file conftest.o` in
  1291         -      *32-bit*)
  1292         -	case $host in
  1293         -	  x86_64-*kfreebsd*-gnu)
  1294         -	    LD="${LD-ld} -m elf_i386_fbsd"
  1295         -	    ;;
  1296         -	  x86_64-*linux*)
  1297         -	    LD="${LD-ld} -m elf_i386"
  1298         -	    ;;
  1299         -	  ppc64-*linux*|powerpc64-*linux*)
  1300         -	    LD="${LD-ld} -m elf32ppclinux"
  1301         -	    ;;
  1302         -	  s390x-*linux*)
  1303         -	    LD="${LD-ld} -m elf_s390"
  1304         -	    ;;
  1305         -	  sparc64-*linux*)
  1306         -	    LD="${LD-ld} -m elf32_sparc"
  1307         -	    ;;
  1308         -	esac
  1309         -	;;
  1310         -      *64-bit*)
  1311         -	case $host in
  1312         -	  x86_64-*kfreebsd*-gnu)
  1313         -	    LD="${LD-ld} -m elf_x86_64_fbsd"
  1314         -	    ;;
  1315         -	  x86_64-*linux*)
  1316         -	    LD="${LD-ld} -m elf_x86_64"
  1317         -	    ;;
  1318         -	  ppc*-*linux*|powerpc*-*linux*)
  1319         -	    LD="${LD-ld} -m elf64ppc"
  1320         -	    ;;
  1321         -	  s390*-*linux*|s390*-*tpf*)
  1322         -	    LD="${LD-ld} -m elf64_s390"
  1323         -	    ;;
  1324         -	  sparc*-*linux*)
  1325         -	    LD="${LD-ld} -m elf64_sparc"
  1326         -	    ;;
  1327         -	esac
  1328         -	;;
  1329         -    esac
  1330         -  fi
  1331         -  rm -rf conftest*
  1332         -  ;;
  1333         -
  1334         -*-*-sco3.2v5*)
  1335         -  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  1336         -  SAVE_CFLAGS="$CFLAGS"
  1337         -  CFLAGS="$CFLAGS -belf"
  1338         -  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  1339         -    [AC_LANG_PUSH(C)
  1340         -     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  1341         -     AC_LANG_POP])
  1342         -  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  1343         -    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  1344         -    CFLAGS="$SAVE_CFLAGS"
  1345         -  fi
  1346         -  ;;
  1347         -sparc*-*solaris*)
  1348         -  # Find out which ABI we are using.
  1349         -  echo 'int i;' > conftest.$ac_ext
  1350         -  if AC_TRY_EVAL(ac_compile); then
  1351         -    case `/usr/bin/file conftest.o` in
  1352         -    *64-bit*)
  1353         -      case $lt_cv_prog_gnu_ld in
  1354         -      yes*) LD="${LD-ld} -m elf64_sparc" ;;
  1355         -      *)
  1356         -	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
  1357         -	  LD="${LD-ld} -64"
  1358         -	fi
  1359         -	;;
  1360         -      esac
  1361         -      ;;
  1362         -    esac
  1363         -  fi
  1364         -  rm -rf conftest*
  1365         -  ;;
  1366         -esac
  1367         -
  1368         -need_locks="$enable_libtool_lock"
  1369         -])# _LT_ENABLE_LOCK
  1370         -
  1371         -
  1372         -# _LT_CMD_OLD_ARCHIVE
  1373         -# -------------------
  1374         -m4_defun([_LT_CMD_OLD_ARCHIVE],
  1375         -[AC_CHECK_TOOL(AR, ar, false)
  1376         -test -z "$AR" && AR=ar
  1377         -test -z "$AR_FLAGS" && AR_FLAGS=cru
  1378         -_LT_DECL([], [AR], [1], [The archiver])
  1379         -_LT_DECL([], [AR_FLAGS], [1])
  1380         -
  1381         -AC_CHECK_TOOL(STRIP, strip, :)
          178  +test -z "$NM" && NM=nm
          179  +test -z "$SED" && SED=sed
          180  +test -z "$OBJDUMP" && OBJDUMP=objdump
          181  +test -z "$RANLIB" && RANLIB=:
  1382    182   test -z "$STRIP" && STRIP=:
  1383         -_LT_DECL([], [STRIP], [1], [A symbol stripping program])
  1384         -
  1385         -AC_CHECK_TOOL(RANLIB, ranlib, :)
  1386         -test -z "$RANLIB" && RANLIB=:
  1387         -_LT_DECL([], [RANLIB], [1],
  1388         -    [Commands used to install an old-style archive])
          183  +test -z "$ac_objext" && ac_objext=o
  1389    184   
  1390    185   # Determine commands to create old-style static archives.
  1391    186   old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
  1392    187   old_postinstall_cmds='chmod 644 $oldlib'
  1393    188   old_postuninstall_cmds=
  1394    189   
  1395    190   if test -n "$RANLIB"; then
................................................................................
  1399    194       ;;
  1400    195     *)
  1401    196       old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
  1402    197       ;;
  1403    198     esac
  1404    199     old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  1405    200   fi
  1406         -_LT_DECL([], [old_postinstall_cmds], [2])
  1407         -_LT_DECL([], [old_postuninstall_cmds], [2])
  1408         -_LT_TAGDECL([], [old_archive_cmds], [2],
  1409         -    [Commands used to build an old-style archive])
  1410         -])# _LT_CMD_OLD_ARCHIVE
  1411         -
  1412         -
  1413         -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
          201  +
          202  +_LT_CC_BASENAME([$compiler])
          203  +
          204  +# Only perform the check for file, if the check method requires it
          205  +case $deplibs_check_method in
          206  +file_magic*)
          207  +  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
          208  +    AC_PATH_MAGIC
          209  +  fi
          210  +  ;;
          211  +esac
          212  +
          213  +_LT_REQUIRED_DARWIN_CHECKS
          214  +
          215  +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
          216  +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
          217  +enable_win32_dll=yes, enable_win32_dll=no)
          218  +
          219  +AC_ARG_ENABLE([libtool-lock],
          220  +    [AC_HELP_STRING([--disable-libtool-lock],
          221  +	[avoid locking (might break parallel builds)])])
          222  +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
          223  +
          224  +AC_ARG_WITH([pic],
          225  +    [AC_HELP_STRING([--with-pic],
          226  +	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
          227  +    [pic_mode="$withval"],
          228  +    [pic_mode=default])
          229  +test -z "$pic_mode" && pic_mode=default
          230  +
          231  +# Use C for the default configuration in the libtool script
          232  +tagname=
          233  +AC_LIBTOOL_LANG_C_CONFIG
          234  +_LT_AC_TAGCONFIG
          235  +])# AC_LIBTOOL_SETUP
          236  +
          237  +
          238  +# _LT_AC_SYS_COMPILER
          239  +# -------------------
          240  +AC_DEFUN([_LT_AC_SYS_COMPILER],
          241  +[AC_REQUIRE([AC_PROG_CC])dnl
          242  +
          243  +# If no C compiler was specified, use CC.
          244  +LTCC=${LTCC-"$CC"}
          245  +
          246  +# If no C compiler flags were specified, use CFLAGS.
          247  +LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
          248  +
          249  +# Allow CC to be a program name with arguments.
          250  +compiler=$CC
          251  +])# _LT_AC_SYS_COMPILER
          252  +
          253  +
          254  +# _LT_CC_BASENAME(CC)
          255  +# -------------------
          256  +# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
          257  +AC_DEFUN([_LT_CC_BASENAME],
          258  +[for cc_temp in $1""; do
          259  +  case $cc_temp in
          260  +    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
          261  +    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
          262  +    \-*) ;;
          263  +    *) break;;
          264  +  esac
          265  +done
          266  +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
          267  +])
          268  +
          269  +
          270  +# _LT_COMPILER_BOILERPLATE
          271  +# ------------------------
          272  +# Check for compiler boilerplate output or warnings with
          273  +# the simple compiler test code.
          274  +AC_DEFUN([_LT_COMPILER_BOILERPLATE],
          275  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          276  +ac_outfile=conftest.$ac_objext
          277  +echo "$lt_simple_compile_test_code" >conftest.$ac_ext
          278  +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
          279  +_lt_compiler_boilerplate=`cat conftest.err`
          280  +$rm conftest*
          281  +])# _LT_COMPILER_BOILERPLATE
          282  +
          283  +
          284  +# _LT_LINKER_BOILERPLATE
          285  +# ----------------------
          286  +# Check for linker boilerplate output or warnings with
          287  +# the simple link test code.
          288  +AC_DEFUN([_LT_LINKER_BOILERPLATE],
          289  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          290  +ac_outfile=conftest.$ac_objext
          291  +echo "$lt_simple_link_test_code" >conftest.$ac_ext
          292  +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
          293  +_lt_linker_boilerplate=`cat conftest.err`
          294  +$rm -r conftest*
          295  +])# _LT_LINKER_BOILERPLATE
          296  +
          297  +# _LT_REQUIRED_DARWIN_CHECKS
          298  +# --------------------------
          299  +# Check for some things on darwin
          300  +AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
          301  +  case $host_os in
          302  +    rhapsody* | darwin*)
          303  +    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
          304  +    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
          305  +
          306  +    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
          307  +      [lt_cv_apple_cc_single_mod=no
          308  +      if test -z "${LT_MULTI_MODULE}"; then
          309  +   # By default we will add the -single_module flag. You can override
          310  +   # by either setting the environment variable LT_MULTI_MODULE
          311  +   # non-empty at configure time, or by adding -multi_module to the
          312  +   # link flags.
          313  +   echo "int foo(void){return 1;}" > conftest.c
          314  +   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
          315  +     -dynamiclib ${wl}-single_module conftest.c
          316  +   if test -f libconftest.dylib; then
          317  +     lt_cv_apple_cc_single_mod=yes
          318  +     rm -rf libconftest.dylib*
          319  +   fi
          320  +   rm conftest.c
          321  +      fi])
          322  +    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
          323  +      [lt_cv_ld_exported_symbols_list],
          324  +      [lt_cv_ld_exported_symbols_list=no
          325  +      save_LDFLAGS=$LDFLAGS
          326  +      echo "_main" > conftest.sym
          327  +      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
          328  +      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
          329  +   [lt_cv_ld_exported_symbols_list=yes],
          330  +   [lt_cv_ld_exported_symbols_list=no])
          331  +   LDFLAGS="$save_LDFLAGS"
          332  +    ])
          333  +    case $host_os in
          334  +    rhapsody* | darwin1.[[0123]])
          335  +      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
          336  +    darwin1.*)
          337  +     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
          338  +    darwin*)
          339  +      # if running on 10.5 or later, the deployment target defaults
          340  +      # to the OS version, if on x86, and 10.4, the deployment
          341  +      # target defaults to 10.4. Don't you love it?
          342  +      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
          343  +   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
          344  +     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
          345  +   10.[[012]]*)
          346  +     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
          347  +   10.*)
          348  +     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
          349  +      esac
          350  +    ;;
          351  +  esac
          352  +    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
          353  +      _lt_dar_single_mod='$single_module'
          354  +    fi
          355  +    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
          356  +      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
          357  +    else
          358  +      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
          359  +    fi
          360  +    if test "$DSYMUTIL" != ":"; then
          361  +      _lt_dsymutil="~$DSYMUTIL \$lib || :"
          362  +    else
          363  +      _lt_dsymutil=
          364  +    fi
          365  +    ;;
          366  +  esac
          367  +])
          368  +
          369  +# _LT_AC_SYS_LIBPATH_AIX
          370  +# ----------------------
          371  +# Links a minimal program and checks the executable
          372  +# for the system default hardcoded library path. In most cases,
          373  +# this is /usr/lib:/lib, but when the MPI compilers are used
          374  +# the location of the communication and MPI libs are included too.
          375  +# If we don't find anything, use the default library path according
          376  +# to the aix ld manual.
          377  +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
          378  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
          379  +AC_LINK_IFELSE(AC_LANG_PROGRAM,[
          380  +lt_aix_libpath_sed='
          381  +    /Import File Strings/,/^$/ {
          382  +	/^0/ {
          383  +	    s/^0  *\(.*\)$/\1/
          384  +	    p
          385  +	}
          386  +    }'
          387  +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
          388  +# Check for a 64-bit object if we didn't find anything.
          389  +if test -z "$aix_libpath"; then
          390  +  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
          391  +fi],[])
          392  +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
          393  +])# _LT_AC_SYS_LIBPATH_AIX
          394  +
          395  +
          396  +# _LT_AC_SHELL_INIT(ARG)
          397  +# ----------------------
          398  +AC_DEFUN([_LT_AC_SHELL_INIT],
          399  +[ifdef([AC_DIVERSION_NOTICE],
          400  +	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
          401  +	 [AC_DIVERT_PUSH(NOTICE)])
          402  +$1
          403  +AC_DIVERT_POP
          404  +])# _LT_AC_SHELL_INIT
          405  +
          406  +
          407  +# _LT_AC_PROG_ECHO_BACKSLASH
          408  +# --------------------------
          409  +# Add some code to the start of the generated configure script which
          410  +# will find an echo command which doesn't interpret backslashes.
          411  +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
          412  +[_LT_AC_SHELL_INIT([
          413  +# Check that we are running under the correct shell.
          414  +SHELL=${CONFIG_SHELL-/bin/sh}
          415  +
          416  +case X$ECHO in
          417  +X*--fallback-echo)
          418  +  # Remove one level of quotation (which was required for Make).
          419  +  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
          420  +  ;;
          421  +esac
          422  +
          423  +echo=${ECHO-echo}
          424  +if test "X[$]1" = X--no-reexec; then
          425  +  # Discard the --no-reexec flag, and continue.
          426  +  shift
          427  +elif test "X[$]1" = X--fallback-echo; then
          428  +  # Avoid inline document here, it may be left over
          429  +  :
          430  +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
          431  +  # Yippee, $echo works!
          432  +  :
          433  +else
          434  +  # Restart under the correct shell.
          435  +  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
          436  +fi
          437  +
          438  +if test "X[$]1" = X--fallback-echo; then
          439  +  # used as fallback echo
          440  +  shift
          441  +  cat <<EOF
          442  +[$]*
          443  +EOF
          444  +  exit 0
          445  +fi
          446  +
          447  +# The HP-UX ksh and POSIX shell print the target directory to stdout
          448  +# if CDPATH is set.
          449  +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
          450  +
          451  +if test -z "$ECHO"; then
          452  +if test "X${echo_test_string+set}" != Xset; then
          453  +# find a string as large as possible, as long as the shell can cope with it
          454  +  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
          455  +    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
          456  +    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
          457  +       echo_test_string=`eval $cmd` &&
          458  +       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
          459  +    then
          460  +      break
          461  +    fi
          462  +  done
          463  +fi
          464  +
          465  +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
          466  +   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
          467  +   test "X$echo_testing_string" = "X$echo_test_string"; then
          468  +  :
          469  +else
          470  +  # The Solaris, AIX, and Digital Unix default echo programs unquote
          471  +  # backslashes.  This makes it impossible to quote backslashes using
          472  +  #   echo "$something" | sed 's/\\/\\\\/g'
          473  +  #
          474  +  # So, first we look for a working echo in the user's PATH.
          475  +
          476  +  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
          477  +  for dir in $PATH /usr/ucb; do
          478  +    IFS="$lt_save_ifs"
          479  +    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
          480  +       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
          481  +       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
          482  +       test "X$echo_testing_string" = "X$echo_test_string"; then
          483  +      echo="$dir/echo"
          484  +      break
          485  +    fi
          486  +  done
          487  +  IFS="$lt_save_ifs"
          488  +
          489  +  if test "X$echo" = Xecho; then
          490  +    # We didn't find a better echo, so look for alternatives.
          491  +    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
          492  +       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
          493  +       test "X$echo_testing_string" = "X$echo_test_string"; then
          494  +      # This shell has a builtin print -r that does the trick.
          495  +      echo='print -r'
          496  +    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
          497  +	 test "X$CONFIG_SHELL" != X/bin/ksh; then
          498  +      # If we have ksh, try running configure again with it.
          499  +      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
          500  +      export ORIGINAL_CONFIG_SHELL
          501  +      CONFIG_SHELL=/bin/ksh
          502  +      export CONFIG_SHELL
          503  +      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
          504  +    else
          505  +      # Try using printf.
          506  +      echo='printf %s\n'
          507  +      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
          508  +	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
          509  +	 test "X$echo_testing_string" = "X$echo_test_string"; then
          510  +	# Cool, printf works
          511  +	:
          512  +      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
          513  +	   test "X$echo_testing_string" = 'X\t' &&
          514  +	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
          515  +	   test "X$echo_testing_string" = "X$echo_test_string"; then
          516  +	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
          517  +	export CONFIG_SHELL
          518  +	SHELL="$CONFIG_SHELL"
          519  +	export SHELL
          520  +	echo="$CONFIG_SHELL [$]0 --fallback-echo"
          521  +      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
          522  +	   test "X$echo_testing_string" = 'X\t' &&
          523  +	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
          524  +	   test "X$echo_testing_string" = "X$echo_test_string"; then
          525  +	echo="$CONFIG_SHELL [$]0 --fallback-echo"
          526  +      else
          527  +	# maybe with a smaller string...
          528  +	prev=:
          529  +
          530  +	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
          531  +	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
          532  +	  then
          533  +	    break
          534  +	  fi
          535  +	  prev="$cmd"
          536  +	done
          537  +
          538  +	if test "$prev" != 'sed 50q "[$]0"'; then
          539  +	  echo_test_string=`eval $prev`
          540  +	  export echo_test_string
          541  +	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
          542  +	else
          543  +	  # Oops.  We lost completely, so just stick with echo.
          544  +	  echo=echo
          545  +	fi
          546  +      fi
          547  +    fi
          548  +  fi
          549  +fi
          550  +fi
          551  +
          552  +# Copy echo and quote the copy suitably for passing to libtool from
          553  +# the Makefile, instead of quoting the original, which is used later.
          554  +ECHO=$echo
          555  +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
          556  +   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
          557  +fi
          558  +
          559  +AC_SUBST(ECHO)
          560  +])])# _LT_AC_PROG_ECHO_BACKSLASH
          561  +
          562  +
          563  +# _LT_AC_LOCK
          564  +# -----------
          565  +AC_DEFUN([_LT_AC_LOCK],
          566  +[AC_ARG_ENABLE([libtool-lock],
          567  +    [AC_HELP_STRING([--disable-libtool-lock],
          568  +	[avoid locking (might break parallel builds)])])
          569  +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
          570  +
          571  +# Some flags need to be propagated to the compiler or linker for good
          572  +# libtool support.
          573  +case $host in
          574  +ia64-*-hpux*)
          575  +  # Find out which ABI we are using.
          576  +  echo 'int i;' > conftest.$ac_ext
          577  +  if AC_TRY_EVAL(ac_compile); then
          578  +    case `/usr/bin/file conftest.$ac_objext` in
          579  +    *ELF-32*)
          580  +      HPUX_IA64_MODE="32"
          581  +      ;;
          582  +    *ELF-64*)
          583  +      HPUX_IA64_MODE="64"
          584  +      ;;
          585  +    esac
          586  +  fi
          587  +  rm -rf conftest*
          588  +  ;;
          589  +*-*-irix6*)
          590  +  # Find out which ABI we are using.
          591  +  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
          592  +  if AC_TRY_EVAL(ac_compile); then
          593  +   if test "$lt_cv_prog_gnu_ld" = yes; then
          594  +    case `/usr/bin/file conftest.$ac_objext` in
          595  +    *32-bit*)
          596  +      LD="${LD-ld} -melf32bsmip"
          597  +      ;;
          598  +    *N32*)
          599  +      LD="${LD-ld} -melf32bmipn32"
          600  +      ;;
          601  +    *64-bit*)
          602  +      LD="${LD-ld} -melf64bmip"
          603  +      ;;
          604  +    esac
          605  +   else
          606  +    case `/usr/bin/file conftest.$ac_objext` in
          607  +    *32-bit*)
          608  +      LD="${LD-ld} -32"
          609  +      ;;
          610  +    *N32*)
          611  +      LD="${LD-ld} -n32"
          612  +      ;;
          613  +    *64-bit*)
          614  +      LD="${LD-ld} -64"
          615  +      ;;
          616  +    esac
          617  +   fi
          618  +  fi
          619  +  rm -rf conftest*
          620  +  ;;
          621  +
          622  +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
          623  +s390*-*linux*|sparc*-*linux*)
          624  +  # Find out which ABI we are using.
          625  +  echo 'int i;' > conftest.$ac_ext
          626  +  if AC_TRY_EVAL(ac_compile); then
          627  +    case `/usr/bin/file conftest.o` in
          628  +    *32-bit*)
          629  +      case $host in
          630  +        x86_64-*kfreebsd*-gnu)
          631  +          LD="${LD-ld} -m elf_i386_fbsd"
          632  +          ;;
          633  +        x86_64-*linux*)
          634  +          LD="${LD-ld} -m elf_i386"
          635  +          ;;
          636  +        ppc64-*linux*|powerpc64-*linux*)
          637  +          LD="${LD-ld} -m elf32ppclinux"
          638  +          ;;
          639  +        s390x-*linux*)
          640  +          LD="${LD-ld} -m elf_s390"
          641  +          ;;
          642  +        sparc64-*linux*)
          643  +          LD="${LD-ld} -m elf32_sparc"
          644  +          ;;
          645  +      esac
          646  +      ;;
          647  +    *64-bit*)
          648  +      case $host in
          649  +        x86_64-*kfreebsd*-gnu)
          650  +          LD="${LD-ld} -m elf_x86_64_fbsd"
          651  +          ;;
          652  +        x86_64-*linux*)
          653  +          LD="${LD-ld} -m elf_x86_64"
          654  +          ;;
          655  +        ppc*-*linux*|powerpc*-*linux*)
          656  +          LD="${LD-ld} -m elf64ppc"
          657  +          ;;
          658  +        s390*-*linux*)
          659  +          LD="${LD-ld} -m elf64_s390"
          660  +          ;;
          661  +        sparc*-*linux*)
          662  +          LD="${LD-ld} -m elf64_sparc"
          663  +          ;;
          664  +      esac
          665  +      ;;
          666  +    esac
          667  +  fi
          668  +  rm -rf conftest*
          669  +  ;;
          670  +
          671  +*-*-sco3.2v5*)
          672  +  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
          673  +  SAVE_CFLAGS="$CFLAGS"
          674  +  CFLAGS="$CFLAGS -belf"
          675  +  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
          676  +    [AC_LANG_PUSH(C)
          677  +     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
          678  +     AC_LANG_POP])
          679  +  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
          680  +    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
          681  +    CFLAGS="$SAVE_CFLAGS"
          682  +  fi
          683  +  ;;
          684  +sparc*-*solaris*)
          685  +  # Find out which ABI we are using.
          686  +  echo 'int i;' > conftest.$ac_ext
          687  +  if AC_TRY_EVAL(ac_compile); then
          688  +    case `/usr/bin/file conftest.o` in
          689  +    *64-bit*)
          690  +      case $lt_cv_prog_gnu_ld in
          691  +      yes*) LD="${LD-ld} -m elf64_sparc" ;;
          692  +      *)
          693  +        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
          694  +	  LD="${LD-ld} -64"
          695  +	fi
          696  +	;;
          697  +      esac
          698  +      ;;
          699  +    esac
          700  +  fi
          701  +  rm -rf conftest*
          702  +  ;;
          703  +
          704  +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
          705  +[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
          706  +  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
          707  +  AC_CHECK_TOOL(AS, as, false)
          708  +  AC_CHECK_TOOL(OBJDUMP, objdump, false)
          709  +  ;;
          710  +  ])
          711  +esac
          712  +
          713  +need_locks="$enable_libtool_lock"
          714  +
          715  +])# _LT_AC_LOCK
          716  +
          717  +
          718  +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  1414    719   #		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  1415    720   # ----------------------------------------------------------------
  1416    721   # Check whether the given compiler option works
  1417         -AC_DEFUN([_LT_COMPILER_OPTION],
  1418         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1419         -m4_require([_LT_DECL_SED])dnl
          722  +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
          723  +[AC_REQUIRE([LT_AC_PROG_SED])
  1420    724   AC_CACHE_CHECK([$1], [$2],
  1421    725     [$2=no
  1422         -   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
          726  +  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  1423    727      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  1424    728      lt_compiler_flag="$3"
  1425    729      # Insert the option either (1) after the last *FLAGS variable, or
  1426    730      # (2) before a word containing "conftest.", or (3) at the end.
  1427    731      # Note that $ac_compile itself does not contain backslashes and begins
  1428    732      # with a dollar sign (not a hyphen), so the echo should work correctly.
  1429    733      # The option is referenced via a variable to avoid confusing sed.
................................................................................
  1435    739      (eval "$lt_compile" 2>conftest.err)
  1436    740      ac_status=$?
  1437    741      cat conftest.err >&AS_MESSAGE_LOG_FD
  1438    742      echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  1439    743      if (exit $ac_status) && test -s "$ac_outfile"; then
  1440    744        # The compiler can only warn and ignore the option if not recognized
  1441    745        # So say no if there are warnings other than the usual output.
  1442         -     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
          746  +     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  1443    747        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  1444    748        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  1445    749          $2=yes
  1446    750        fi
  1447    751      fi
  1448         -   $RM conftest*
          752  +   $rm conftest*
  1449    753   ])
  1450    754   
  1451    755   if test x"[$]$2" = xyes; then
  1452         -    m4_if([$5], , :, [$5])
          756  +    ifelse([$5], , :, [$5])
  1453    757   else
  1454         -    m4_if([$6], , :, [$6])
          758  +    ifelse([$6], , :, [$6])
  1455    759   fi
  1456         -])# _LT_COMPILER_OPTION
  1457         -
  1458         -# Old name:
  1459         -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
  1460         -dnl aclocal-1.4 backwards compatibility:
  1461         -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
          760  +])# AC_LIBTOOL_COMPILER_OPTION
  1462    761   
  1463    762   
  1464         -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  1465         -#                  [ACTION-SUCCESS], [ACTION-FAILURE])
  1466         -# ----------------------------------------------------
  1467         -# Check whether the given linker option works
  1468         -AC_DEFUN([_LT_LINKER_OPTION],
  1469         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1470         -m4_require([_LT_DECL_SED])dnl
          763  +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
          764  +#                          [ACTION-SUCCESS], [ACTION-FAILURE])
          765  +# ------------------------------------------------------------
          766  +# Check whether the given compiler option works
          767  +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
          768  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
  1471    769   AC_CACHE_CHECK([$1], [$2],
  1472    770     [$2=no
  1473    771      save_LDFLAGS="$LDFLAGS"
  1474    772      LDFLAGS="$LDFLAGS $3"
  1475    773      echo "$lt_simple_link_test_code" > conftest.$ac_ext
  1476    774      if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  1477    775        # The linker can only warn and ignore the option if not recognized
  1478    776        # So say no if there are warnings
  1479    777        if test -s conftest.err; then
  1480    778          # Append any errors to the config.log.
  1481    779          cat conftest.err 1>&AS_MESSAGE_LOG_FD
  1482         -       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
          780  +       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
  1483    781          $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  1484    782          if diff conftest.exp conftest.er2 >/dev/null; then
  1485    783            $2=yes
  1486    784          fi
  1487    785        else
  1488    786          $2=yes
  1489    787        fi
  1490    788      fi
  1491         -   $RM -r conftest*
          789  +   $rm -r conftest*
  1492    790      LDFLAGS="$save_LDFLAGS"
  1493    791   ])
  1494    792   
  1495    793   if test x"[$]$2" = xyes; then
  1496         -    m4_if([$4], , :, [$4])
          794  +    ifelse([$4], , :, [$4])
  1497    795   else
  1498         -    m4_if([$5], , :, [$5])
          796  +    ifelse([$5], , :, [$5])
  1499    797   fi
  1500         -])# _LT_LINKER_OPTION
  1501         -
  1502         -# Old name:
  1503         -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
  1504         -dnl aclocal-1.4 backwards compatibility:
  1505         -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
          798  +])# AC_LIBTOOL_LINKER_OPTION
  1506    799   
  1507    800   
  1508         -# LT_CMD_MAX_LEN
  1509         -#---------------
  1510         -AC_DEFUN([LT_CMD_MAX_LEN],
  1511         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  1512         -# find the maximum length of command line arguments
          801  +# AC_LIBTOOL_SYS_MAX_CMD_LEN
          802  +# --------------------------
          803  +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
          804  +[# find the maximum length of command line arguments
  1513    805   AC_MSG_CHECKING([the maximum length of command line arguments])
  1514    806   AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  1515    807     i=0
  1516    808     teststring="ABCD"
  1517    809   
  1518    810     case $build_os in
  1519    811     msdosdjgpp*)
................................................................................
  1527    819     gnu*)
  1528    820       # Under GNU Hurd, this test is not required because there is
  1529    821       # no limit to the length of command line arguments.
  1530    822       # Libtool will interpret -1 as no limit whatsoever
  1531    823       lt_cv_sys_max_cmd_len=-1;
  1532    824       ;;
  1533    825   
  1534         -  cygwin* | mingw* | cegcc*)
          826  +  cygwin* | mingw*)
  1535    827       # On Win9x/ME, this test blows up -- it succeeds, but takes
  1536    828       # about 5 minutes as the teststring grows exponentially.
  1537    829       # Worse, since 9x/ME are not pre-emptively multitasking,
  1538    830       # you end up with a "frozen" computer, even though with patience
  1539    831       # the test eventually succeeds (with a max line length of 256k).
  1540    832       # Instead, let's just punt: use the minimum linelength reported by
  1541    833       # all of the supported platforms: 8192 (on NT/2K/XP).
................................................................................
  1582    874       ;;
  1583    875     sco3.2v5*)
  1584    876       lt_cv_sys_max_cmd_len=102400
  1585    877       ;;
  1586    878     sysv5* | sco5v6* | sysv4.2uw2*)
  1587    879       kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
  1588    880       if test -n "$kargmax"; then
  1589         -      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
          881  +      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
  1590    882       else
  1591    883         lt_cv_sys_max_cmd_len=32768
  1592    884       fi
  1593    885       ;;
  1594    886     *)
  1595    887       lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
  1596    888       if test -n "$lt_cv_sys_max_cmd_len"; then
  1597    889         lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
  1598    890         lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
  1599    891       else
  1600         -      # Make teststring a little bigger before we do anything with it.
  1601         -      # a 1K string should be a reasonable start.
  1602         -      for i in 1 2 3 4 5 6 7 8 ; do
  1603         -        teststring=$teststring$teststring
  1604         -      done
  1605    892         SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
  1606         -      # If test is not a shell built-in, we'll probably end up computing a
  1607         -      # maximum length that is only half of the actual maximum length, but
  1608         -      # we can't tell.
  1609         -      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
  1610         -	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
          893  +      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
          894  +	       = "XX$teststring") >/dev/null 2>&1 &&
          895  +	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
          896  +	      lt_cv_sys_max_cmd_len=$new_result &&
  1611    897   	      test $i != 17 # 1/2 MB should be enough
  1612    898         do
  1613    899           i=`expr $i + 1`
  1614    900           teststring=$teststring$teststring
  1615    901         done
  1616         -      # Only check the string length outside the loop.
  1617         -      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
  1618    902         teststring=
  1619         -      # Add a significant safety factor because C++ compilers can tack on
  1620         -      # massive amounts of additional arguments before passing them to the
  1621         -      # linker.  It appears as though 1/2 is a usable value.
          903  +      # Add a significant safety factor because C++ compilers can tack on massive
          904  +      # amounts of additional arguments before passing them to the linker.
          905  +      # It appears as though 1/2 is a usable value.
  1622    906         lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  1623    907       fi
  1624    908       ;;
  1625    909     esac
  1626    910   ])
  1627    911   if test -n $lt_cv_sys_max_cmd_len ; then
  1628    912     AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  1629    913   else
  1630    914     AC_MSG_RESULT(none)
  1631    915   fi
  1632         -max_cmd_len=$lt_cv_sys_max_cmd_len
  1633         -_LT_DECL([], [max_cmd_len], [0],
  1634         -    [What is the maximum length of a command?])
  1635         -])# LT_CMD_MAX_LEN
  1636         -
  1637         -# Old name:
  1638         -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
  1639         -dnl aclocal-1.4 backwards compatibility:
  1640         -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
          916  +])# AC_LIBTOOL_SYS_MAX_CMD_LEN
  1641    917   
  1642    918   
  1643         -# _LT_HEADER_DLFCN
  1644         -# ----------------
  1645         -m4_defun([_LT_HEADER_DLFCN],
  1646         -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
  1647         -])# _LT_HEADER_DLFCN
          919  +# _LT_AC_CHECK_DLFCN
          920  +# ------------------
          921  +AC_DEFUN([_LT_AC_CHECK_DLFCN],
          922  +[AC_CHECK_HEADERS(dlfcn.h)dnl
          923  +])# _LT_AC_CHECK_DLFCN
  1648    924   
  1649    925   
  1650         -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  1651         -#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  1652         -# ----------------------------------------------------------------
  1653         -m4_defun([_LT_TRY_DLOPEN_SELF],
  1654         -[m4_require([_LT_HEADER_DLFCN])dnl
          926  +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
          927  +#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
          928  +# ---------------------------------------------------------------------
          929  +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
          930  +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  1655    931   if test "$cross_compiling" = yes; then :
  1656    932     [$4]
  1657    933   else
  1658    934     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  1659    935     lt_status=$lt_dlunknown
  1660         -  cat > conftest.$ac_ext <<_LT_EOF
          936  +  cat > conftest.$ac_ext <<EOF
  1661    937   [#line __oline__ "configure"
  1662    938   #include "confdefs.h"
  1663    939   
  1664    940   #if HAVE_DLFCN_H
  1665    941   #include <dlfcn.h>
  1666    942   #endif
  1667    943   
................................................................................
  1694    970   #        else
  1695    971   #          define LT_DLLAZY_OR_NOW	0
  1696    972   #        endif
  1697    973   #      endif
  1698    974   #    endif
  1699    975   #  endif
  1700    976   #endif
          977  +
          978  +#ifdef __cplusplus
          979  +extern "C" void exit (int);
          980  +#endif
  1701    981   
  1702    982   void fnord() { int i=42;}
  1703    983   int main ()
  1704    984   {
  1705    985     void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  1706    986     int status = $lt_dlunknown;
  1707    987   
................................................................................
  1710    990         if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
  1711    991         else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  1712    992         /* dlclose (self); */
  1713    993       }
  1714    994     else
  1715    995       puts (dlerror ());
  1716    996   
  1717         -  return status;
          997  +    exit (status);
  1718    998   }]
  1719         -_LT_EOF
          999  +EOF
  1720   1000     if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  1721   1001       (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
  1722   1002       lt_status=$?
  1723   1003       case x$lt_status in
  1724   1004         x$lt_dlno_uscore) $1 ;;
  1725   1005         x$lt_dlneed_uscore) $2 ;;
  1726   1006         x$lt_dlunknown|x*) $3 ;;
................................................................................
  1727   1007       esac
  1728   1008     else :
  1729   1009       # compilation failed
  1730   1010       $3
  1731   1011     fi
  1732   1012   fi
  1733   1013   rm -fr conftest*
  1734         -])# _LT_TRY_DLOPEN_SELF
         1014  +])# _LT_AC_TRY_DLOPEN_SELF
  1735   1015   
  1736   1016   
  1737         -# LT_SYS_DLOPEN_SELF
  1738         -# ------------------
  1739         -AC_DEFUN([LT_SYS_DLOPEN_SELF],
  1740         -[m4_require([_LT_HEADER_DLFCN])dnl
         1017  +# AC_LIBTOOL_DLOPEN_SELF
         1018  +# ----------------------
         1019  +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
         1020  +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  1741   1021   if test "x$enable_dlopen" != xyes; then
  1742   1022     enable_dlopen=unknown
  1743   1023     enable_dlopen_self=unknown
  1744   1024     enable_dlopen_self_static=unknown
  1745   1025   else
  1746   1026     lt_cv_dlopen=no
  1747   1027     lt_cv_dlopen_libs=
................................................................................
  1749   1029     case $host_os in
  1750   1030     beos*)
  1751   1031       lt_cv_dlopen="load_add_on"
  1752   1032       lt_cv_dlopen_libs=
  1753   1033       lt_cv_dlopen_self=yes
  1754   1034       ;;
  1755   1035   
  1756         -  mingw* | pw32* | cegcc*)
         1036  +  mingw* | pw32*)
  1757   1037       lt_cv_dlopen="LoadLibrary"
  1758   1038       lt_cv_dlopen_libs=
  1759         -    ;;
         1039  +   ;;
  1760   1040   
  1761   1041     cygwin*)
  1762   1042       lt_cv_dlopen="dlopen"
  1763   1043       lt_cv_dlopen_libs=
  1764         -    ;;
         1044  +   ;;
  1765   1045   
  1766   1046     darwin*)
  1767   1047     # if libdl is installed we need to link against it
  1768   1048       AC_CHECK_LIB([dl], [dlopen],
  1769   1049   		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
  1770   1050       lt_cv_dlopen="dyld"
  1771   1051       lt_cv_dlopen_libs=
  1772   1052       lt_cv_dlopen_self=yes
  1773   1053       ])
  1774         -    ;;
         1054  +   ;;
  1775   1055   
  1776   1056     *)
  1777   1057       AC_CHECK_FUNC([shl_load],
  1778   1058   	  [lt_cv_dlopen="shl_load"],
  1779   1059         [AC_CHECK_LIB([dld], [shl_load],
  1780   1060   	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
  1781   1061   	[AC_CHECK_FUNC([dlopen],
................................................................................
  1809   1089       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  1810   1090   
  1811   1091       save_LIBS="$LIBS"
  1812   1092       LIBS="$lt_cv_dlopen_libs $LIBS"
  1813   1093   
  1814   1094       AC_CACHE_CHECK([whether a program can dlopen itself],
  1815   1095   	  lt_cv_dlopen_self, [dnl
  1816         -	  _LT_TRY_DLOPEN_SELF(
         1096  +	  _LT_AC_TRY_DLOPEN_SELF(
  1817   1097   	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  1818   1098   	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  1819   1099       ])
  1820   1100   
  1821   1101       if test "x$lt_cv_dlopen_self" = xyes; then
  1822   1102         wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
  1823   1103         AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  1824         -	  lt_cv_dlopen_self_static, [dnl
  1825         -	  _LT_TRY_DLOPEN_SELF(
         1104  +    	  lt_cv_dlopen_self_static, [dnl
         1105  +	  _LT_AC_TRY_DLOPEN_SELF(
  1826   1106   	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  1827   1107   	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
  1828   1108         ])
  1829   1109       fi
  1830   1110   
  1831   1111       CPPFLAGS="$save_CPPFLAGS"
  1832   1112       LDFLAGS="$save_LDFLAGS"
................................................................................
  1840   1120     esac
  1841   1121   
  1842   1122     case $lt_cv_dlopen_self_static in
  1843   1123     yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  1844   1124     *) enable_dlopen_self_static=unknown ;;
  1845   1125     esac
  1846   1126   fi
  1847         -_LT_DECL([dlopen_support], [enable_dlopen], [0],
  1848         -	 [Whether dlopen is supported])
  1849         -_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
  1850         -	 [Whether dlopen of programs is supported])
  1851         -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
  1852         -	 [Whether dlopen of statically linked programs is supported])
  1853         -])# LT_SYS_DLOPEN_SELF
  1854         -
  1855         -# Old name:
  1856         -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
  1857         -dnl aclocal-1.4 backwards compatibility:
  1858         -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
         1127  +])# AC_LIBTOOL_DLOPEN_SELF
  1859   1128   
  1860   1129   
  1861         -# _LT_COMPILER_C_O([TAGNAME])
  1862         -# ---------------------------
  1863         -# Check to see if options -c and -o are simultaneously supported by compiler.
  1864         -# This macro does not hard code the compiler like AC_PROG_CC_C_O.
  1865         -m4_defun([_LT_COMPILER_C_O],
  1866         -[m4_require([_LT_DECL_SED])dnl
  1867         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1868         -m4_require([_LT_TAG_COMPILER])dnl
         1130  +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
         1131  +# ---------------------------------
         1132  +# Check to see if options -c and -o are simultaneously supported by compiler
         1133  +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
         1134  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         1135  +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  1869   1136   AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  1870         -  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  1871         -  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  1872         -   $RM -r conftest 2>/dev/null
         1137  +  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
         1138  +  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
         1139  +   $rm -r conftest 2>/dev/null
  1873   1140      mkdir conftest
  1874   1141      cd conftest
  1875   1142      mkdir out
  1876   1143      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  1877   1144   
  1878   1145      lt_compiler_flag="-o out/conftest2.$ac_objext"
  1879   1146      # Insert the option either (1) after the last *FLAGS variable, or
................................................................................
  1889   1156      ac_status=$?
  1890   1157      cat out/conftest.err >&AS_MESSAGE_LOG_FD
  1891   1158      echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  1892   1159      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  1893   1160      then
  1894   1161        # The compiler can only warn and ignore the option if not recognized
  1895   1162        # So say no if there are warnings
  1896         -     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
         1163  +     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  1897   1164        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  1898   1165        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
  1899         -       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
         1166  +       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  1900   1167        fi
  1901   1168      fi
  1902   1169      chmod u+w . 2>&AS_MESSAGE_LOG_FD
  1903         -   $RM conftest*
         1170  +   $rm conftest*
  1904   1171      # SGI C++ compiler will create directory out/ii_files/ for
  1905   1172      # template instantiation
  1906         -   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
  1907         -   $RM out/* && rmdir out
         1173  +   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
         1174  +   $rm out/* && rmdir out
  1908   1175      cd ..
  1909         -   $RM -r conftest
  1910         -   $RM conftest*
         1176  +   rmdir conftest
         1177  +   $rm conftest*
  1911   1178   ])
  1912         -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
  1913         -	[Does compiler simultaneously support -c and -o options?])
  1914         -])# _LT_COMPILER_C_O
         1179  +])# AC_LIBTOOL_PROG_CC_C_O
  1915   1180   
  1916   1181   
  1917         -# _LT_COMPILER_FILE_LOCKS([TAGNAME])
  1918         -# ----------------------------------
         1182  +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
         1183  +# -----------------------------------------
  1919   1184   # Check to see if we can do hard links to lock some files if needed
  1920         -m4_defun([_LT_COMPILER_FILE_LOCKS],
  1921         -[m4_require([_LT_ENABLE_LOCK])dnl
  1922         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  1923         -_LT_COMPILER_C_O([$1])
         1185  +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
         1186  +[AC_REQUIRE([_LT_AC_LOCK])dnl
  1924   1187   
  1925   1188   hard_links="nottested"
  1926         -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
         1189  +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  1927   1190     # do not overwrite the value of need_locks provided by the user
  1928   1191     AC_MSG_CHECKING([if we can lock with hard links])
  1929   1192     hard_links=yes
  1930         -  $RM conftest*
         1193  +  $rm conftest*
  1931   1194     ln conftest.a conftest.b 2>/dev/null && hard_links=no
  1932   1195     touch conftest.a
  1933   1196     ln conftest.a conftest.b 2>&5 || hard_links=no
  1934   1197     ln conftest.a conftest.b 2>/dev/null && hard_links=no
  1935   1198     AC_MSG_RESULT([$hard_links])
  1936   1199     if test "$hard_links" = no; then
  1937   1200       AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  1938   1201       need_locks=warn
  1939   1202     fi
  1940   1203   else
  1941   1204     need_locks=no
  1942   1205   fi
  1943         -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
  1944         -])# _LT_COMPILER_FILE_LOCKS
         1206  +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
  1945   1207   
  1946   1208   
  1947         -# _LT_CHECK_OBJDIR
  1948         -# ----------------
  1949         -m4_defun([_LT_CHECK_OBJDIR],
         1209  +# AC_LIBTOOL_OBJDIR
         1210  +# -----------------
         1211  +AC_DEFUN([AC_LIBTOOL_OBJDIR],
  1950   1212   [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  1951   1213   [rm -f .libs 2>/dev/null
  1952   1214   mkdir .libs 2>/dev/null
  1953   1215   if test -d .libs; then
  1954   1216     lt_cv_objdir=.libs
  1955   1217   else
  1956   1218     # MS-DOS does not allow filenames that begin with a dot.
  1957   1219     lt_cv_objdir=_libs
  1958   1220   fi
  1959   1221   rmdir .libs 2>/dev/null])
  1960   1222   objdir=$lt_cv_objdir
  1961         -_LT_DECL([], [objdir], [0],
  1962         -         [The name of the directory that contains temporary libtool files])dnl
  1963         -m4_pattern_allow([LT_OBJDIR])dnl
  1964         -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
  1965         -  [Define to the sub-directory in which libtool stores uninstalled libraries.])
  1966         -])# _LT_CHECK_OBJDIR
         1223  +])# AC_LIBTOOL_OBJDIR
  1967   1224   
  1968   1225   
  1969         -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
  1970         -# --------------------------------------
         1226  +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
         1227  +# ----------------------------------------------
  1971   1228   # Check hardcoding attributes.
  1972         -m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
         1229  +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
  1973   1230   [AC_MSG_CHECKING([how to hardcode library paths into programs])
  1974         -_LT_TAGVAR(hardcode_action, $1)=
  1975         -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
  1976         -   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
  1977         -   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
         1231  +_LT_AC_TAGVAR(hardcode_action, $1)=
         1232  +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
         1233  +   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
         1234  +   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
  1978   1235   
  1979         -  # We can hardcode non-existent directories.
  1980         -  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
         1236  +  # We can hardcode non-existant directories.
         1237  +  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
  1981   1238        # If the only mechanism to avoid hardcoding is shlibpath_var, we
  1982   1239        # have to relink, otherwise we might link with an installed library
  1983   1240        # when we should be linking with a yet-to-be-installed one
  1984         -     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  1985         -     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
         1241  +     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
         1242  +     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
  1986   1243       # Linking always hardcodes the temporary library directory.
  1987         -    _LT_TAGVAR(hardcode_action, $1)=relink
         1244  +    _LT_AC_TAGVAR(hardcode_action, $1)=relink
  1988   1245     else
  1989   1246       # We can link without hardcoding, and we can hardcode nonexisting dirs.
  1990         -    _LT_TAGVAR(hardcode_action, $1)=immediate
         1247  +    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
  1991   1248     fi
  1992   1249   else
  1993   1250     # We cannot hardcode anything, or else we can only hardcode existing
  1994   1251     # directories.
  1995         -  _LT_TAGVAR(hardcode_action, $1)=unsupported
         1252  +  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
  1996   1253   fi
  1997         -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
         1254  +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
  1998   1255   
  1999         -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
  2000         -   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
         1256  +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
  2001   1257     # Fast installation is not supported
  2002   1258     enable_fast_install=no
  2003   1259   elif test "$shlibpath_overrides_runpath" = yes ||
  2004   1260        test "$enable_shared" = no; then
  2005   1261     # Fast installation is not necessary
  2006   1262     enable_fast_install=needless
  2007   1263   fi
  2008         -_LT_TAGDECL([], [hardcode_action], [0],
  2009         -    [How to hardcode a shared library path into an executable])
  2010         -])# _LT_LINKER_HARDCODE_LIBPATH
         1264  +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
  2011   1265   
  2012   1266   
  2013         -# _LT_CMD_STRIPLIB
  2014         -# ----------------
  2015         -m4_defun([_LT_CMD_STRIPLIB],
  2016         -[m4_require([_LT_DECL_EGREP])
  2017         -striplib=
         1267  +# AC_LIBTOOL_SYS_LIB_STRIP
         1268  +# ------------------------
         1269  +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
         1270  +[striplib=
  2018   1271   old_striplib=
  2019   1272   AC_MSG_CHECKING([whether stripping libraries is possible])
  2020         -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
         1273  +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  2021   1274     test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  2022   1275     test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  2023   1276     AC_MSG_RESULT([yes])
  2024   1277   else
  2025   1278   # FIXME - insert some real tests, host_os isn't really good enough
  2026   1279     case $host_os in
  2027         -  darwin*)
  2028         -    if test -n "$STRIP" ; then
  2029         -      striplib="$STRIP -x"
  2030         -      old_striplib="$STRIP -S"
  2031         -      AC_MSG_RESULT([yes])
  2032         -    else
  2033         -      AC_MSG_RESULT([no])
  2034         -    fi
  2035         -    ;;
  2036         -  *)
  2037         -    AC_MSG_RESULT([no])
         1280  +   darwin*)
         1281  +       if test -n "$STRIP" ; then
         1282  +         striplib="$STRIP -x"
         1283  +         old_striplib="$STRIP -S"
         1284  +         AC_MSG_RESULT([yes])
         1285  +       else
         1286  +  AC_MSG_RESULT([no])
         1287  +fi
         1288  +       ;;
         1289  +   *)
         1290  +  AC_MSG_RESULT([no])
  2038   1291       ;;
  2039   1292     esac
  2040   1293   fi
  2041         -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
  2042         -_LT_DECL([], [striplib], [1])
  2043         -])# _LT_CMD_STRIPLIB
         1294  +])# AC_LIBTOOL_SYS_LIB_STRIP
  2044   1295   
  2045   1296   
  2046         -# _LT_SYS_DYNAMIC_LINKER([TAG])
         1297  +# AC_LIBTOOL_SYS_DYNAMIC_LINKER
  2047   1298   # -----------------------------
  2048   1299   # PORTME Fill in your ld.so characteristics
  2049         -m4_defun([_LT_SYS_DYNAMIC_LINKER],
  2050         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  2051         -m4_require([_LT_DECL_EGREP])dnl
  2052         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  2053         -m4_require([_LT_DECL_OBJDUMP])dnl
  2054         -m4_require([_LT_DECL_SED])dnl
         1300  +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
         1301  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
  2055   1302   AC_MSG_CHECKING([dynamic linker characteristics])
  2056         -m4_if([$1],
  2057         -	[], [
         1303  +library_names_spec=
         1304  +libname_spec='lib$name'
         1305  +soname_spec=
         1306  +shrext_cmds=".so"
         1307  +postinstall_cmds=
         1308  +postuninstall_cmds=
         1309  +finish_cmds=
         1310  +finish_eval=
         1311  +shlibpath_var=
         1312  +shlibpath_overrides_runpath=unknown
         1313  +version_type=none
         1314  +dynamic_linker="$host_os ld.so"
         1315  +sys_lib_dlsearch_path_spec="/lib /usr/lib"
         1316  +m4_if($1,[],[
  2058   1317   if test "$GCC" = yes; then
  2059   1318     case $host_os in
  2060   1319       darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
  2061   1320       *) lt_awk_arg="/^libraries:/" ;;
  2062   1321     esac
  2063   1322     lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  2064         -  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
         1323  +  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
  2065   1324       # if the path contains ";" then we assume it to be the separator
  2066   1325       # otherwise default to the standard path separator (i.e. ":") - it is
  2067   1326       # assumed that no part of a normal pathname contains ";" but that should
  2068   1327       # okay in the real world where ";" in dirpaths is itself problematic.
  2069         -    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
         1328  +    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
  2070   1329     else
  2071         -    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
         1330  +    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
  2072   1331     fi
  2073   1332     # Ok, now we have the path, separated by spaces, we can step through it
  2074   1333     # and add multilib dir if necessary.
  2075   1334     lt_tmp_lt_search_path_spec=
  2076   1335     lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
  2077   1336     for lt_sys_path in $lt_search_path_spec; do
  2078   1337       if test -d "$lt_sys_path/$lt_multi_os_dir"; then
  2079   1338         lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
  2080   1339       else
  2081   1340         test -d "$lt_sys_path" && \
  2082   1341   	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
  2083   1342       fi
  2084   1343     done
  2085         -  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
         1344  +  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
  2086   1345   BEGIN {RS=" "; FS="/|\n";} {
  2087   1346     lt_foo="";
  2088   1347     lt_count=0;
  2089   1348     for (lt_i = NF; lt_i > 0; lt_i--) {
  2090   1349       if ($lt_i != "" && $lt_i != ".") {
  2091   1350         if ($lt_i == "..") {
  2092   1351           lt_count++;
................................................................................
  2098   1357           }
  2099   1358         }
  2100   1359       }
  2101   1360     }
  2102   1361     if (lt_foo != "") { lt_freq[[lt_foo]]++; }
  2103   1362     if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
  2104   1363   }'`
  2105         -  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
         1364  +  sys_lib_search_path_spec=`echo $lt_search_path_spec`
  2106   1365   else
  2107   1366     sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  2108   1367   fi])
  2109         -library_names_spec=
  2110         -libname_spec='lib$name'
  2111         -soname_spec=
  2112         -shrext_cmds=".so"
  2113         -postinstall_cmds=
  2114         -postuninstall_cmds=
  2115         -finish_cmds=
  2116         -finish_eval=
  2117         -shlibpath_var=
  2118         -shlibpath_overrides_runpath=unknown
  2119         -version_type=none
  2120         -dynamic_linker="$host_os ld.so"
  2121         -sys_lib_dlsearch_path_spec="/lib /usr/lib"
  2122   1368   need_lib_prefix=unknown
  2123   1369   hardcode_into_libs=no
  2124   1370   
  2125   1371   # when you set need_version to no, make sure it does not cause -set_version
  2126   1372   # flags to be left without arguments
  2127   1373   need_version=unknown
  2128   1374   
................................................................................
  2151   1397       # the line `#! .'.  This would cause the generated library to
  2152   1398       # depend on `.', always an invalid library.  This was fixed in
  2153   1399       # development snapshots of GCC prior to 3.0.
  2154   1400       case $host_os in
  2155   1401         aix4 | aix4.[[01]] | aix4.[[01]].*)
  2156   1402         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  2157   1403   	   echo ' yes '
  2158         -	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
         1404  +	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
  2159   1405   	:
  2160   1406         else
  2161   1407   	can_build_shared=no
  2162   1408         fi
  2163   1409         ;;
  2164   1410       esac
  2165   1411       # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
................................................................................
  2177   1423         soname_spec='${libname}${release}${shared_ext}$major'
  2178   1424       fi
  2179   1425       shlibpath_var=LIBPATH
  2180   1426     fi
  2181   1427     ;;
  2182   1428   
  2183   1429   amigaos*)
  2184         -  case $host_cpu in
  2185         -  powerpc)
  2186         -    # Since July 2007 AmigaOS4 officially supports .so libraries.
  2187         -    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
  2188         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2189         -    ;;
  2190         -  m68k)
  2191         -    library_names_spec='$libname.ixlibrary $libname.a'
  2192         -    # Create ${libname}_ixlibrary.a entries in /sys/libs.
  2193         -    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
  2194         -    ;;
  2195         -  esac
         1430  +  library_names_spec='$libname.ixlibrary $libname.a'
         1431  +  # Create ${libname}_ixlibrary.a entries in /sys/libs.
         1432  +  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
  2196   1433     ;;
  2197   1434   
  2198   1435   beos*)
  2199   1436     library_names_spec='${libname}${shared_ext}'
  2200   1437     dynamic_linker="$host_os ld.so"
  2201   1438     shlibpath_var=LIBRARY_PATH
  2202   1439     ;;
................................................................................
  2211   1448     sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  2212   1449     sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  2213   1450     # the default ld.so.conf also contains /usr/contrib/lib and
  2214   1451     # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  2215   1452     # libtool to hard-code these into programs
  2216   1453     ;;
  2217   1454   
  2218         -cygwin* | mingw* | pw32* | cegcc*)
         1455  +cygwin* | mingw* | pw32*)
  2219   1456     version_type=windows
  2220   1457     shrext_cmds=".dll"
  2221   1458     need_version=no
  2222   1459     need_lib_prefix=no
  2223   1460   
  2224   1461     case $GCC,$host_os in
  2225         -  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
         1462  +  yes,cygwin* | yes,mingw* | yes,pw32*)
  2226   1463       library_names_spec='$libname.dll.a'
  2227   1464       # DLL is installed to $(libdir)/../bin by postinstall_cmds
  2228   1465       postinstall_cmds='base_file=`basename \${file}`~
  2229         -      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
         1466  +      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
  2230   1467         dldir=$destdir/`dirname \$dlpath`~
  2231   1468         test -d \$dldir || mkdir -p \$dldir~
  2232   1469         $install_prog $dir/$dlname \$dldir/$dlname~
  2233         -      chmod a+x \$dldir/$dlname~
  2234         -      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
  2235         -        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
  2236         -      fi'
         1470  +      chmod a+x \$dldir/$dlname'
  2237   1471       postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
  2238   1472         dlpath=$dir/\$dldll~
  2239         -       $RM \$dlpath'
         1473  +       $rm \$dlpath'
  2240   1474       shlibpath_overrides_runpath=yes
  2241   1475   
  2242   1476       case $host_os in
  2243   1477       cygwin*)
  2244   1478         # Cygwin DLLs use 'cyg' prefix rather than 'lib'
  2245   1479         soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2246   1480         sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
  2247   1481         ;;
  2248         -    mingw* | cegcc*)
         1482  +    mingw*)
  2249   1483         # MinGW DLLs use traditional 'lib' prefix
  2250   1484         soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2251         -      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  2252         -      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         1485  +      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
         1486  +      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
  2253   1487           # It is most probably a Windows format PATH printed by
  2254   1488           # mingw gcc, but we are running on Cygwin. Gcc prints its search
  2255   1489           # path with ; separators, and with drive letters. We can handle the
  2256   1490           # drive letters (cygwin fileutils understands them), so leave them,
  2257   1491           # especially as we might pass files found there to a mingw objdump,
  2258   1492           # which wouldn't understand a cygwinified path. Ahh.
  2259         -        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
         1493  +        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  2260   1494         else
  2261         -        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
         1495  +        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
  2262   1496         fi
  2263   1497         ;;
  2264   1498       pw32*)
  2265   1499         # pw32 DLLs use 'pw' prefix rather than 'lib'
  2266   1500         library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  2267   1501         ;;
  2268   1502       esac
................................................................................
  2278   1512     ;;
  2279   1513   
  2280   1514   darwin* | rhapsody*)
  2281   1515     dynamic_linker="$host_os dyld"
  2282   1516     version_type=darwin
  2283   1517     need_lib_prefix=no
  2284   1518     need_version=no
  2285         -  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
         1519  +  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
  2286   1520     soname_spec='${libname}${release}${major}$shared_ext'
  2287   1521     shlibpath_overrides_runpath=yes
  2288   1522     shlibpath_var=DYLD_LIBRARY_PATH
  2289   1523     shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
  2290         -m4_if([$1], [],[
  2291         -  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
         1524  +  m4_if([$1], [],[
         1525  +  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
  2292   1526     sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
  2293   1527     ;;
  2294   1528   
  2295   1529   dgux*)
  2296   1530     version_type=linux
  2297   1531     need_lib_prefix=no
  2298   1532     need_version=no
................................................................................
  2377   1611       if test "X$HPUX_IA64_MODE" = X32; then
  2378   1612         sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
  2379   1613       else
  2380   1614         sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
  2381   1615       fi
  2382   1616       sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  2383   1617       ;;
  2384         -  hppa*64*)
  2385         -    shrext_cmds='.sl'
  2386         -    hardcode_into_libs=yes
  2387         -    dynamic_linker="$host_os dld.sl"
  2388         -    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
  2389         -    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  2390         -    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2391         -    soname_spec='${libname}${release}${shared_ext}$major'
  2392         -    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
  2393         -    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  2394         -    ;;
  2395         -  *)
         1618  +   hppa*64*)
         1619  +     shrext_cmds='.sl'
         1620  +     hardcode_into_libs=yes
         1621  +     dynamic_linker="$host_os dld.sl"
         1622  +     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
         1623  +     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
         1624  +     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
         1625  +     soname_spec='${libname}${release}${shared_ext}$major'
         1626  +     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
         1627  +     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
         1628  +     ;;
         1629  +   *)
  2396   1630       shrext_cmds='.sl'
  2397   1631       dynamic_linker="$host_os dld.sl"
  2398   1632       shlibpath_var=SHLIB_PATH
  2399   1633       shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  2400   1634       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2401   1635       soname_spec='${libname}${release}${shared_ext}$major'
  2402   1636       ;;
................................................................................
  2456   1690   
  2457   1691   # No shared lib support for Linux oldld, aout, or coff.
  2458   1692   linux*oldld* | linux*aout* | linux*coff*)
  2459   1693     dynamic_linker=no
  2460   1694     ;;
  2461   1695   
  2462   1696   # This must be Linux ELF.
  2463         -linux* | k*bsd*-gnu | kopensolaris*-gnu)
         1697  +linux* | k*bsd*-gnu)
  2464   1698     version_type=linux
  2465   1699     need_lib_prefix=no
  2466   1700     need_version=no
  2467   1701     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2468   1702     soname_spec='${libname}${release}${shared_ext}$major'
  2469   1703     finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  2470   1704     shlibpath_var=LD_LIBRARY_PATH
  2471   1705     shlibpath_overrides_runpath=no
  2472         -  # Some binutils ld are patched to set DT_RUNPATH
  2473         -  save_LDFLAGS=$LDFLAGS
  2474         -  save_libdir=$libdir
  2475         -  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
  2476         -       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
  2477         -  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
  2478         -    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
  2479         -       [shlibpath_overrides_runpath=yes])])
  2480         -  LDFLAGS=$save_LDFLAGS
  2481         -  libdir=$save_libdir
  2482         -
  2483   1706     # This implies no fast_install, which is unacceptable.
  2484   1707     # Some rework will be needed to allow for fast_install
  2485   1708     # before this can be enabled.
  2486   1709     hardcode_into_libs=yes
  2487   1710   
  2488   1711     # Append ld.so.conf contents to the search path
  2489   1712     if test -f /etc/ld.so.conf; then
  2490         -    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
         1713  +    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
  2491   1714       sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
  2492   1715     fi
  2493   1716   
  2494   1717     # We used to test for /lib/ld.so.1 and disable shared libraries on
  2495   1718     # powerpc, because MkLinux only supported shared libraries with the
  2496   1719     # GNU dynamic linker.  Since this was broken with cross compilers,
  2497   1720     # most powerpc-linux boxes support dynamic linking these days and
................................................................................
  2512   1735     dynamic_linker='NetBSD ld.elf_so'
  2513   1736     ;;
  2514   1737   
  2515   1738   netbsd*)
  2516   1739     version_type=sunos
  2517   1740     need_lib_prefix=no
  2518   1741     need_version=no
  2519         -  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
         1742  +  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  2520   1743       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2521   1744       finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2522   1745       dynamic_linker='NetBSD (a.out) ld.so'
  2523   1746     else
  2524   1747       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  2525   1748       soname_spec='${libname}${release}${shared_ext}$major'
  2526   1749       dynamic_linker='NetBSD ld.elf_so'
................................................................................
  2533   1756   newsos6)
  2534   1757     version_type=linux
  2535   1758     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2536   1759     shlibpath_var=LD_LIBRARY_PATH
  2537   1760     shlibpath_overrides_runpath=yes
  2538   1761     ;;
  2539   1762   
  2540         -*nto* | *qnx*)
  2541         -  version_type=qnx
         1763  +nto-qnx*)
         1764  +  version_type=linux
  2542   1765     need_lib_prefix=no
  2543   1766     need_version=no
  2544   1767     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2545   1768     soname_spec='${libname}${release}${shared_ext}$major'
  2546   1769     shlibpath_var=LD_LIBRARY_PATH
  2547         -  shlibpath_overrides_runpath=no
  2548         -  hardcode_into_libs=yes
  2549         -  dynamic_linker='ldqnx.so'
         1770  +  shlibpath_overrides_runpath=yes
  2550   1771     ;;
  2551   1772   
  2552   1773   openbsd*)
  2553   1774     version_type=sunos
  2554   1775     sys_lib_dlsearch_path_spec="/usr/lib"
  2555   1776     need_lib_prefix=no
  2556   1777     # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
  2557   1778     case $host_os in
  2558         -    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
  2559         -    *)				need_version=no  ;;
         1779  +    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
         1780  +    *)                         need_version=no  ;;
  2560   1781     esac
  2561   1782     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  2562   1783     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  2563   1784     shlibpath_var=LD_LIBRARY_PATH
  2564         -  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         1785  +  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  2565   1786       case $host_os in
  2566   1787         openbsd2.[[89]] | openbsd2.[[89]].*)
  2567   1788   	shlibpath_overrides_runpath=no
  2568   1789   	;;
  2569   1790         *)
  2570   1791   	shlibpath_overrides_runpath=yes
  2571   1792   	;;
................................................................................
  2629   1850     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2630   1851     soname_spec='${libname}${release}${shared_ext}$major'
  2631   1852     shlibpath_var=LD_LIBRARY_PATH
  2632   1853     case $host_vendor in
  2633   1854       sni)
  2634   1855         shlibpath_overrides_runpath=no
  2635   1856         need_lib_prefix=no
         1857  +      export_dynamic_flag_spec='${wl}-Blargedynsym'
  2636   1858         runpath_var=LD_RUN_PATH
  2637   1859         ;;
  2638   1860       siemens)
  2639   1861         need_lib_prefix=no
  2640   1862         ;;
  2641   1863       motorola)
  2642   1864         need_lib_prefix=no
................................................................................
  2659   1881   sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  2660   1882     version_type=freebsd-elf
  2661   1883     need_lib_prefix=no
  2662   1884     need_version=no
  2663   1885     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  2664   1886     soname_spec='${libname}${release}${shared_ext}$major'
  2665   1887     shlibpath_var=LD_LIBRARY_PATH
  2666         -  shlibpath_overrides_runpath=yes
  2667   1888     hardcode_into_libs=yes
  2668   1889     if test "$with_gnu_ld" = yes; then
  2669   1890       sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
         1891  +    shlibpath_overrides_runpath=no
  2670   1892     else
  2671   1893       sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
         1894  +    shlibpath_overrides_runpath=yes
  2672   1895       case $host_os in
  2673   1896         sco3.2v5*)
  2674   1897           sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
  2675   1898   	;;
  2676   1899       esac
  2677   1900     fi
  2678   1901     sys_lib_dlsearch_path_spec='/usr/lib'
  2679   1902     ;;
  2680   1903   
  2681         -tpf*)
  2682         -  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
  2683         -  version_type=linux
  2684         -  need_lib_prefix=no
  2685         -  need_version=no
  2686         -  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2687         -  shlibpath_var=LD_LIBRARY_PATH
  2688         -  shlibpath_overrides_runpath=no
  2689         -  hardcode_into_libs=yes
  2690         -  ;;
  2691         -
  2692   1904   uts4*)
  2693   1905     version_type=linux
  2694   1906     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  2695   1907     soname_spec='${libname}${release}${shared_ext}$major'
  2696   1908     shlibpath_var=LD_LIBRARY_PATH
  2697   1909     ;;
  2698   1910   
................................................................................
  2699   1911   *)
  2700   1912     dynamic_linker=no
  2701   1913     ;;
  2702   1914   esac
  2703   1915   AC_MSG_RESULT([$dynamic_linker])
  2704   1916   test "$dynamic_linker" = no && can_build_shared=no
  2705   1917   
         1918  +AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
         1919  +[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
         1920  +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
         1921  +AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
         1922  +[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
         1923  +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
         1924  +
  2706   1925   variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
  2707   1926   if test "$GCC" = yes; then
  2708   1927     variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  2709   1928   fi
  2710         -
  2711         -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
  2712         -  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
  2713         -fi
  2714         -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
  2715         -  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
  2716         -fi
  2717         -
  2718         -_LT_DECL([], [variables_saved_for_relink], [1],
  2719         -    [Variables whose values should be saved in libtool wrapper scripts and
  2720         -    restored at link time])
  2721         -_LT_DECL([], [need_lib_prefix], [0],
  2722         -    [Do we need the "lib" prefix for modules?])
  2723         -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
  2724         -_LT_DECL([], [version_type], [0], [Library versioning type])
  2725         -_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
  2726         -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
  2727         -_LT_DECL([], [shlibpath_overrides_runpath], [0],
  2728         -    [Is shlibpath searched before the hard-coded library search path?])
  2729         -_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
  2730         -_LT_DECL([], [library_names_spec], [1],
  2731         -    [[List of archive names.  First name is the real one, the rest are links.
  2732         -    The last name is the one that the linker finds with -lNAME]])
  2733         -_LT_DECL([], [soname_spec], [1],
  2734         -    [[The coded name of the library, if different from the real name]])
  2735         -_LT_DECL([], [postinstall_cmds], [2],
  2736         -    [Command to use after installation of a shared archive])
  2737         -_LT_DECL([], [postuninstall_cmds], [2],
  2738         -    [Command to use after uninstallation of a shared archive])
  2739         -_LT_DECL([], [finish_cmds], [2],
  2740         -    [Commands used to finish a libtool library installation in a directory])
  2741         -_LT_DECL([], [finish_eval], [1],
  2742         -    [[As "finish_cmds", except a single script fragment to be evaled but
  2743         -    not shown]])
  2744         -_LT_DECL([], [hardcode_into_libs], [0],
  2745         -    [Whether we should hardcode library paths into libraries])
  2746         -_LT_DECL([], [sys_lib_search_path_spec], [2],
  2747         -    [Compile-time system search path for libraries])
  2748         -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
  2749         -    [Run-time system search path for libraries])
  2750         -])# _LT_SYS_DYNAMIC_LINKER
  2751         -
  2752         -
  2753         -# _LT_PATH_TOOL_PREFIX(TOOL)
         1929  +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
         1930  +
         1931  +
         1932  +# _LT_AC_TAGCONFIG
         1933  +# ----------------
         1934  +AC_DEFUN([_LT_AC_TAGCONFIG],
         1935  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         1936  +AC_ARG_WITH([tags],
         1937  +    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
         1938  +        [include additional configurations @<:@automatic@:>@])],
         1939  +    [tagnames="$withval"])
         1940  +
         1941  +if test -f "$ltmain" && test -n "$tagnames"; then
         1942  +  if test ! -f "${ofile}"; then
         1943  +    AC_MSG_WARN([output file `$ofile' does not exist])
         1944  +  fi
         1945  +
         1946  +  if test -z "$LTCC"; then
         1947  +    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
         1948  +    if test -z "$LTCC"; then
         1949  +      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
         1950  +    else
         1951  +      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
         1952  +    fi
         1953  +  fi
         1954  +  if test -z "$LTCFLAGS"; then
         1955  +    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
         1956  +  fi
         1957  +
         1958  +  # Extract list of available tagged configurations in $ofile.
         1959  +  # Note that this assumes the entire list is on one line.
         1960  +  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
         1961  +
         1962  +  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         1963  +  for tagname in $tagnames; do
         1964  +    IFS="$lt_save_ifs"
         1965  +    # Check whether tagname contains only valid characters
         1966  +    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
         1967  +    "") ;;
         1968  +    *)  AC_MSG_ERROR([invalid tag name: $tagname])
         1969  +	;;
         1970  +    esac
         1971  +
         1972  +    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
         1973  +    then
         1974  +      AC_MSG_ERROR([tag name \"$tagname\" already exists])
         1975  +    fi
         1976  +
         1977  +    # Update the list of available tags.
         1978  +    if test -n "$tagname"; then
         1979  +      echo appending configuration tag \"$tagname\" to $ofile
         1980  +
         1981  +      case $tagname in
         1982  +      CXX)
         1983  +	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
         1984  +	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
         1985  +	    (test "X$CXX" != "Xg++"))) ; then
         1986  +	  AC_LIBTOOL_LANG_CXX_CONFIG
         1987  +	else
         1988  +	  tagname=""
         1989  +	fi
         1990  +	;;
         1991  +
         1992  +      F77)
         1993  +	if test -n "$F77" && test "X$F77" != "Xno"; then
         1994  +	  AC_LIBTOOL_LANG_F77_CONFIG
         1995  +	else
         1996  +	  tagname=""
         1997  +	fi
         1998  +	;;
         1999  +
         2000  +      GCJ)
         2001  +	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
         2002  +	  AC_LIBTOOL_LANG_GCJ_CONFIG
         2003  +	else
         2004  +	  tagname=""
         2005  +	fi
         2006  +	;;
         2007  +
         2008  +      RC)
         2009  +	AC_LIBTOOL_LANG_RC_CONFIG
         2010  +	;;
         2011  +
         2012  +      *)
         2013  +	AC_MSG_ERROR([Unsupported tag name: $tagname])
         2014  +	;;
         2015  +      esac
         2016  +
         2017  +      # Append the new tag name to the list of available tags.
         2018  +      if test -n "$tagname" ; then
         2019  +      available_tags="$available_tags $tagname"
         2020  +    fi
         2021  +    fi
         2022  +  done
         2023  +  IFS="$lt_save_ifs"
         2024  +
         2025  +  # Now substitute the updated list of available tags.
         2026  +  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
         2027  +    mv "${ofile}T" "$ofile"
         2028  +    chmod +x "$ofile"
         2029  +  else
         2030  +    rm -f "${ofile}T"
         2031  +    AC_MSG_ERROR([unable to update list of available tagged configurations.])
         2032  +  fi
         2033  +fi
         2034  +])# _LT_AC_TAGCONFIG
         2035  +
         2036  +
         2037  +# AC_LIBTOOL_DLOPEN
         2038  +# -----------------
         2039  +# enable checks for dlopen support
         2040  +AC_DEFUN([AC_LIBTOOL_DLOPEN],
         2041  + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
         2042  +])# AC_LIBTOOL_DLOPEN
         2043  +
         2044  +
         2045  +# AC_LIBTOOL_WIN32_DLL
         2046  +# --------------------
         2047  +# declare package support for building win32 DLLs
         2048  +AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
         2049  +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
         2050  +])# AC_LIBTOOL_WIN32_DLL
         2051  +
         2052  +
         2053  +# AC_ENABLE_SHARED([DEFAULT])
         2054  +# ---------------------------
         2055  +# implement the --enable-shared flag
         2056  +# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
         2057  +AC_DEFUN([AC_ENABLE_SHARED],
         2058  +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
         2059  +AC_ARG_ENABLE([shared],
         2060  +    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
         2061  +	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
         2062  +    [p=${PACKAGE-default}
         2063  +    case $enableval in
         2064  +    yes) enable_shared=yes ;;
         2065  +    no) enable_shared=no ;;
         2066  +    *)
         2067  +      enable_shared=no
         2068  +      # Look at the argument we got.  We use all the common list separators.
         2069  +      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         2070  +      for pkg in $enableval; do
         2071  +	IFS="$lt_save_ifs"
         2072  +	if test "X$pkg" = "X$p"; then
         2073  +	  enable_shared=yes
         2074  +	fi
         2075  +      done
         2076  +      IFS="$lt_save_ifs"
         2077  +      ;;
         2078  +    esac],
         2079  +    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
         2080  +])# AC_ENABLE_SHARED
         2081  +
         2082  +
         2083  +# AC_DISABLE_SHARED
         2084  +# -----------------
         2085  +# set the default shared flag to --disable-shared
         2086  +AC_DEFUN([AC_DISABLE_SHARED],
         2087  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2088  +AC_ENABLE_SHARED(no)
         2089  +])# AC_DISABLE_SHARED
         2090  +
         2091  +
         2092  +# AC_ENABLE_STATIC([DEFAULT])
         2093  +# ---------------------------
         2094  +# implement the --enable-static flag
         2095  +# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
         2096  +AC_DEFUN([AC_ENABLE_STATIC],
         2097  +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
         2098  +AC_ARG_ENABLE([static],
         2099  +    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
         2100  +	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
         2101  +    [p=${PACKAGE-default}
         2102  +    case $enableval in
         2103  +    yes) enable_static=yes ;;
         2104  +    no) enable_static=no ;;
         2105  +    *)
         2106  +     enable_static=no
         2107  +      # Look at the argument we got.  We use all the common list separators.
         2108  +      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         2109  +      for pkg in $enableval; do
         2110  +	IFS="$lt_save_ifs"
         2111  +	if test "X$pkg" = "X$p"; then
         2112  +	  enable_static=yes
         2113  +	fi
         2114  +      done
         2115  +      IFS="$lt_save_ifs"
         2116  +      ;;
         2117  +    esac],
         2118  +    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
         2119  +])# AC_ENABLE_STATIC
         2120  +
         2121  +
         2122  +# AC_DISABLE_STATIC
         2123  +# -----------------
         2124  +# set the default static flag to --disable-static
         2125  +AC_DEFUN([AC_DISABLE_STATIC],
         2126  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2127  +AC_ENABLE_STATIC(no)
         2128  +])# AC_DISABLE_STATIC
         2129  +
         2130  +
         2131  +# AC_ENABLE_FAST_INSTALL([DEFAULT])
         2132  +# ---------------------------------
         2133  +# implement the --enable-fast-install flag
         2134  +# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
         2135  +AC_DEFUN([AC_ENABLE_FAST_INSTALL],
         2136  +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
         2137  +AC_ARG_ENABLE([fast-install],
         2138  +    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
         2139  +    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
         2140  +    [p=${PACKAGE-default}
         2141  +    case $enableval in
         2142  +    yes) enable_fast_install=yes ;;
         2143  +    no) enable_fast_install=no ;;
         2144  +    *)
         2145  +      enable_fast_install=no
         2146  +      # Look at the argument we got.  We use all the common list separators.
         2147  +      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
         2148  +      for pkg in $enableval; do
         2149  +	IFS="$lt_save_ifs"
         2150  +	if test "X$pkg" = "X$p"; then
         2151  +	  enable_fast_install=yes
         2152  +	fi
         2153  +      done
         2154  +      IFS="$lt_save_ifs"
         2155  +      ;;
         2156  +    esac],
         2157  +    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
         2158  +])# AC_ENABLE_FAST_INSTALL
         2159  +
         2160  +
         2161  +# AC_DISABLE_FAST_INSTALL
         2162  +# -----------------------
         2163  +# set the default to --disable-fast-install
         2164  +AC_DEFUN([AC_DISABLE_FAST_INSTALL],
         2165  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2166  +AC_ENABLE_FAST_INSTALL(no)
         2167  +])# AC_DISABLE_FAST_INSTALL
         2168  +
         2169  +
         2170  +# AC_LIBTOOL_PICMODE([MODE])
  2754   2171   # --------------------------
         2172  +# implement the --with-pic flag
         2173  +# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
         2174  +AC_DEFUN([AC_LIBTOOL_PICMODE],
         2175  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2176  +pic_mode=ifelse($#,1,$1,default)
         2177  +])# AC_LIBTOOL_PICMODE
         2178  +
         2179  +
         2180  +# AC_PROG_EGREP
         2181  +# -------------
         2182  +# This is predefined starting with Autoconf 2.54, so this conditional
         2183  +# definition can be removed once we require Autoconf 2.54 or later.
         2184  +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
         2185  +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
         2186  +   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
         2187  +    then ac_cv_prog_egrep='grep -E'
         2188  +    else ac_cv_prog_egrep='egrep'
         2189  +    fi])
         2190  + EGREP=$ac_cv_prog_egrep
         2191  + AC_SUBST([EGREP])
         2192  +])])
         2193  +
         2194  +
         2195  +# AC_PATH_TOOL_PREFIX
         2196  +# -------------------
  2755   2197   # find a file program which can recognize shared library
  2756         -AC_DEFUN([_LT_PATH_TOOL_PREFIX],
  2757         -[m4_require([_LT_DECL_EGREP])dnl
         2198  +AC_DEFUN([AC_PATH_TOOL_PREFIX],
         2199  +[AC_REQUIRE([AC_PROG_EGREP])dnl
  2758   2200   AC_MSG_CHECKING([for $1])
  2759   2201   AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  2760   2202   [case $MAGIC_CMD in
  2761   2203   [[\\/*] |  ?:[\\/]*])
  2762   2204     lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  2763   2205     ;;
  2764   2206   *)
  2765   2207     lt_save_MAGIC_CMD="$MAGIC_CMD"
  2766   2208     lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  2767   2209   dnl $ac_dummy forces splitting on constant user-supplied paths.
  2768   2210   dnl POSIX.2 word splitting is done only on the output of word expansions,
  2769   2211   dnl not every word.  This closes a longstanding sh security hole.
  2770         -  ac_dummy="m4_if([$2], , $PATH, [$2])"
         2212  +  ac_dummy="ifelse([$2], , $PATH, [$2])"
  2771   2213     for ac_dir in $ac_dummy; do
  2772   2214       IFS="$lt_save_ifs"
  2773   2215       test -z "$ac_dir" && ac_dir=.
  2774   2216       if test -f $ac_dir/$1; then
  2775   2217         lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  2776   2218         if test -n "$file_magic_test_file"; then
  2777   2219   	case $deplibs_check_method in
................................................................................
  2778   2220   	"file_magic "*)
  2779   2221   	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
  2780   2222   	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  2781   2223   	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  2782   2224   	    $EGREP "$file_magic_regex" > /dev/null; then
  2783   2225   	    :
  2784   2226   	  else
  2785         -	    cat <<_LT_EOF 1>&2
         2227  +	    cat <<EOF 1>&2
  2786   2228   
  2787   2229   *** Warning: the command libtool uses to detect shared libraries,
  2788   2230   *** $file_magic_cmd, produces output that libtool cannot recognize.
  2789   2231   *** The result is that libtool may fail to recognize shared libraries
  2790   2232   *** as such.  This will affect the creation of libtool libraries that
  2791   2233   *** depend on shared libraries, but programs linked with such libtool
  2792   2234   *** libraries will work regardless of this problem.  Nevertheless, you
  2793   2235   *** may want to report the problem to your system manager and/or to
  2794   2236   *** bug-libtool@gnu.org
  2795   2237   
  2796         -_LT_EOF
         2238  +EOF
  2797   2239   	  fi ;;
  2798   2240   	esac
  2799   2241         fi
  2800   2242         break
  2801   2243       fi
  2802   2244     done
  2803   2245     IFS="$lt_save_ifs"
................................................................................
  2806   2248   esac])
  2807   2249   MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  2808   2250   if test -n "$MAGIC_CMD"; then
  2809   2251     AC_MSG_RESULT($MAGIC_CMD)
  2810   2252   else
  2811   2253     AC_MSG_RESULT(no)
  2812   2254   fi
  2813         -_LT_DECL([], [MAGIC_CMD], [0],
  2814         -	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
  2815         -])# _LT_PATH_TOOL_PREFIX
  2816         -
  2817         -# Old name:
  2818         -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
  2819         -dnl aclocal-1.4 backwards compatibility:
  2820         -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
         2255  +])# AC_PATH_TOOL_PREFIX
  2821   2256   
  2822   2257   
  2823         -# _LT_PATH_MAGIC
  2824         -# --------------
         2258  +# AC_PATH_MAGIC
         2259  +# -------------
  2825   2260   # find a file program which can recognize a shared library
  2826         -m4_defun([_LT_PATH_MAGIC],
  2827         -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
         2261  +AC_DEFUN([AC_PATH_MAGIC],
         2262  +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
  2828   2263   if test -z "$lt_cv_path_MAGIC_CMD"; then
  2829   2264     if test -n "$ac_tool_prefix"; then
  2830         -    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
         2265  +    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
  2831   2266     else
  2832   2267       MAGIC_CMD=:
  2833   2268     fi
  2834   2269   fi
  2835         -])# _LT_PATH_MAGIC
         2270  +])# AC_PATH_MAGIC
  2836   2271   
  2837   2272   
  2838         -# LT_PATH_LD
         2273  +# AC_PROG_LD
  2839   2274   # ----------
  2840   2275   # find the pathname to the GNU or non-GNU linker
  2841         -AC_DEFUN([LT_PATH_LD],
  2842         -[AC_REQUIRE([AC_PROG_CC])dnl
         2276  +AC_DEFUN([AC_PROG_LD],
         2277  +[AC_ARG_WITH([gnu-ld],
         2278  +    [AC_HELP_STRING([--with-gnu-ld],
         2279  +	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
         2280  +    [test "$withval" = no || with_gnu_ld=yes],
         2281  +    [with_gnu_ld=no])
         2282  +AC_REQUIRE([LT_AC_PROG_SED])dnl
         2283  +AC_REQUIRE([AC_PROG_CC])dnl
  2843   2284   AC_REQUIRE([AC_CANONICAL_HOST])dnl
  2844   2285   AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  2845         -m4_require([_LT_DECL_SED])dnl
  2846         -m4_require([_LT_DECL_EGREP])dnl
  2847         -
  2848         -AC_ARG_WITH([gnu-ld],
  2849         -    [AS_HELP_STRING([--with-gnu-ld],
  2850         -	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
  2851         -    [test "$withval" = no || with_gnu_ld=yes],
  2852         -    [with_gnu_ld=no])dnl
  2853         -
  2854   2286   ac_prog=ld
  2855   2287   if test "$GCC" = yes; then
  2856   2288     # Check if gcc -print-prog-name=ld gives a path.
  2857   2289     AC_MSG_CHECKING([for ld used by $CC])
  2858   2290     case $host in
  2859   2291     *-*-mingw*)
  2860   2292       # gcc leaves a trailing carriage return which upsets mingw
................................................................................
  2863   2295       ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  2864   2296     esac
  2865   2297     case $ac_prog in
  2866   2298       # Accept absolute paths.
  2867   2299       [[\\/]]* | ?:[[\\/]]*)
  2868   2300         re_direlt='/[[^/]][[^/]]*/\.\./'
  2869   2301         # Canonicalize the pathname of ld
  2870         -      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
  2871         -      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
  2872         -	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
         2302  +      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
         2303  +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
         2304  +	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
  2873   2305         done
  2874   2306         test -z "$LD" && LD="$ac_prog"
  2875   2307         ;;
  2876   2308     "")
  2877   2309       # If it fails, then pretend we aren't using GCC.
  2878   2310       ac_prog=ld
  2879   2311       ;;
................................................................................
  2915   2347   LD="$lt_cv_path_LD"
  2916   2348   if test -n "$LD"; then
  2917   2349     AC_MSG_RESULT($LD)
  2918   2350   else
  2919   2351     AC_MSG_RESULT(no)
  2920   2352   fi
  2921   2353   test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  2922         -_LT_PATH_LD_GNU
  2923         -AC_SUBST([LD])
  2924         -
  2925         -_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
  2926         -])# LT_PATH_LD
  2927         -
  2928         -# Old names:
  2929         -AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
  2930         -AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
  2931         -dnl aclocal-1.4 backwards compatibility:
  2932         -dnl AC_DEFUN([AM_PROG_LD], [])
  2933         -dnl AC_DEFUN([AC_PROG_LD], [])
         2354  +AC_PROG_LD_GNU
         2355  +])# AC_PROG_LD
  2934   2356   
  2935   2357   
  2936         -# _LT_PATH_LD_GNU
  2937         -#- --------------
  2938         -m4_defun([_LT_PATH_LD_GNU],
  2939         -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
         2358  +# AC_PROG_LD_GNU
         2359  +# --------------
         2360  +AC_DEFUN([AC_PROG_LD_GNU],
         2361  +[AC_REQUIRE([AC_PROG_EGREP])dnl
         2362  +AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  2940   2363   [# I'd rather use --version here, but apparently some GNU lds only accept -v.
  2941   2364   case `$LD -v 2>&1 </dev/null` in
  2942   2365   *GNU* | *'with BFD'*)
  2943   2366     lt_cv_prog_gnu_ld=yes
  2944   2367     ;;
  2945   2368   *)
  2946   2369     lt_cv_prog_gnu_ld=no
  2947   2370     ;;
  2948   2371   esac])
  2949   2372   with_gnu_ld=$lt_cv_prog_gnu_ld
  2950         -])# _LT_PATH_LD_GNU
         2373  +])# AC_PROG_LD_GNU
  2951   2374   
  2952   2375   
  2953         -# _LT_CMD_RELOAD
  2954         -# --------------
         2376  +# AC_PROG_LD_RELOAD_FLAG
         2377  +# ----------------------
  2955   2378   # find reload flag for linker
  2956   2379   #   -- PORTME Some linkers may need a different reload flag.
  2957         -m4_defun([_LT_CMD_RELOAD],
         2380  +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  2958   2381   [AC_CACHE_CHECK([for $LD option to reload object files],
  2959   2382     lt_cv_ld_reload_flag,
  2960   2383     [lt_cv_ld_reload_flag='-r'])
  2961   2384   reload_flag=$lt_cv_ld_reload_flag
  2962   2385   case $reload_flag in
  2963   2386   "" | " "*) ;;
  2964   2387   *) reload_flag=" $reload_flag" ;;
................................................................................
  2969   2392       if test "$GCC" = yes; then
  2970   2393         reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
  2971   2394       else
  2972   2395         reload_cmds='$LD$reload_flag -o $output$reload_objs'
  2973   2396       fi
  2974   2397       ;;
  2975   2398   esac
  2976         -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
  2977         -_LT_DECL([], [reload_cmds], [2])dnl
  2978         -])# _LT_CMD_RELOAD
         2399  +])# AC_PROG_LD_RELOAD_FLAG
  2979   2400   
  2980   2401   
  2981         -# _LT_CHECK_MAGIC_METHOD
  2982         -# ----------------------
         2402  +# AC_DEPLIBS_CHECK_METHOD
         2403  +# -----------------------
  2983   2404   # how to check for library dependencies
  2984   2405   #  -- PORTME fill in with the dynamic library characteristics
  2985         -m4_defun([_LT_CHECK_MAGIC_METHOD],
  2986         -[m4_require([_LT_DECL_EGREP])
  2987         -m4_require([_LT_DECL_OBJDUMP])
  2988         -AC_CACHE_CHECK([how to recognize dependent libraries],
         2406  +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
         2407  +[AC_CACHE_CHECK([how to recognize dependent libraries],
  2989   2408   lt_cv_deplibs_check_method,
  2990   2409   [lt_cv_file_magic_cmd='$MAGIC_CMD'
  2991   2410   lt_cv_file_magic_test_file=
  2992   2411   lt_cv_deplibs_check_method='unknown'
  2993   2412   # Need to set the preceding variable on all platforms that support
  2994   2413   # interlibrary dependencies.
  2995   2414   # 'none' -- dependencies not supported.
................................................................................
  3031   2450       lt_cv_file_magic_cmd='func_win32_libid'
  3032   2451     else
  3033   2452       lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  3034   2453       lt_cv_file_magic_cmd='$OBJDUMP -f'
  3035   2454     fi
  3036   2455     ;;
  3037   2456   
  3038         -cegcc)
  3039         -  # use the weaker test based on 'objdump'. See mingw*.
  3040         -  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
  3041         -  lt_cv_file_magic_cmd='$OBJDUMP -f'
  3042         -  ;;
  3043         -
  3044   2457   darwin* | rhapsody*)
  3045   2458     lt_cv_deplibs_check_method=pass_all
  3046   2459     ;;
  3047   2460   
  3048   2461   freebsd* | dragonfly*)
  3049         -  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
         2462  +  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  3050   2463       case $host_cpu in
  3051   2464       i*86 )
  3052   2465         # Not sure whether the presence of OpenBSD here was a mistake.
  3053   2466         # Let's accept both of them until this is cleared up.
  3054   2467         lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
  3055   2468         lt_cv_file_magic_cmd=/usr/bin/file
  3056   2469         lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
................................................................................
  3095   2508     *-64|*"-64 ") libmagic=64-bit;;
  3096   2509     *) libmagic=never-match;;
  3097   2510     esac
  3098   2511     lt_cv_deplibs_check_method=pass_all
  3099   2512     ;;
  3100   2513   
  3101   2514   # This must be Linux ELF.
  3102         -linux* | k*bsd*-gnu | kopensolaris*-gnu)
         2515  +linux* | k*bsd*-gnu)
  3103   2516     lt_cv_deplibs_check_method=pass_all
  3104   2517     ;;
  3105   2518   
  3106   2519   netbsd* | netbsdelf*-gnu)
  3107         -  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
         2520  +  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  3108   2521       lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  3109   2522     else
  3110   2523       lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
  3111   2524     fi
  3112   2525     ;;
  3113   2526   
  3114   2527   newos6*)
  3115   2528     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
  3116   2529     lt_cv_file_magic_cmd=/usr/bin/file
  3117   2530     lt_cv_file_magic_test_file=/usr/lib/libnls.so
  3118   2531     ;;
  3119   2532   
  3120         -*nto* | *qnx*)
  3121         -  lt_cv_deplibs_check_method=pass_all
         2533  +nto-qnx*)
         2534  +  lt_cv_deplibs_check_method=unknown
  3122   2535     ;;
  3123   2536   
  3124   2537   openbsd*)
  3125         -  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         2538  +  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  3126   2539       lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
  3127   2540     else
  3128   2541       lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  3129   2542     fi
  3130   2543     ;;
  3131   2544   
  3132   2545   osf3* | osf4* | osf5*)
................................................................................
  3137   2550     lt_cv_deplibs_check_method=pass_all
  3138   2551     ;;
  3139   2552   
  3140   2553   solaris*)
  3141   2554     lt_cv_deplibs_check_method=pass_all
  3142   2555     ;;
  3143   2556   
  3144         -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  3145         -  lt_cv_deplibs_check_method=pass_all
  3146         -  ;;
  3147         -
  3148   2557   sysv4 | sysv4.3*)
  3149   2558     case $host_vendor in
  3150   2559     motorola)
  3151   2560       lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
  3152   2561       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  3153   2562       ;;
  3154   2563     ncr)
................................................................................
  3168   2577       ;;
  3169   2578     pc)
  3170   2579       lt_cv_deplibs_check_method=pass_all
  3171   2580       ;;
  3172   2581     esac
  3173   2582     ;;
  3174   2583   
  3175         -tpf*)
         2584  +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  3176   2585     lt_cv_deplibs_check_method=pass_all
  3177   2586     ;;
  3178   2587   esac
  3179   2588   ])
  3180   2589   file_magic_cmd=$lt_cv_file_magic_cmd
  3181   2590   deplibs_check_method=$lt_cv_deplibs_check_method
  3182   2591   test -z "$deplibs_check_method" && deplibs_check_method=unknown
  3183         -
  3184         -_LT_DECL([], [deplibs_check_method], [1],
  3185         -    [Method to check whether dependent libraries are shared objects])
  3186         -_LT_DECL([], [file_magic_cmd], [1],
  3187         -    [Command to use when deplibs_check_method == "file_magic"])
  3188         -])# _LT_CHECK_MAGIC_METHOD
         2592  +])# AC_DEPLIBS_CHECK_METHOD
  3189   2593   
  3190   2594   
  3191         -# LT_PATH_NM
         2595  +# AC_PROG_NM
  3192   2596   # ----------
  3193         -# find the pathname to a BSD- or MS-compatible name lister
  3194         -AC_DEFUN([LT_PATH_NM],
  3195         -[AC_REQUIRE([AC_PROG_CC])dnl
  3196         -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
         2597  +# find the pathname to a BSD-compatible name lister
         2598  +AC_DEFUN([AC_PROG_NM],
         2599  +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
  3197   2600   [if test -n "$NM"; then
  3198   2601     # Let the user override the test.
  3199   2602     lt_cv_path_NM="$NM"
  3200   2603   else
  3201   2604     lt_nm_to_check="${ac_tool_prefix}nm"
  3202   2605     if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
  3203   2606       lt_nm_to_check="$lt_nm_to_check nm"
................................................................................
  3231   2634   	  esac
  3232   2635   	  ;;
  3233   2636   	esac
  3234   2637         fi
  3235   2638       done
  3236   2639       IFS="$lt_save_ifs"
  3237   2640     done
  3238         -  : ${lt_cv_path_NM=no}
         2641  +  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  3239   2642   fi])
  3240         -if test "$lt_cv_path_NM" != "no"; then
  3241         -  NM="$lt_cv_path_NM"
  3242         -else
  3243         -  # Didn't find any BSD compatible name lister, look for dumpbin.
  3244         -  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
  3245         -  AC_SUBST([DUMPBIN])
  3246         -  if test "$DUMPBIN" != ":"; then
  3247         -    NM="$DUMPBIN"
  3248         -  fi
  3249         -fi
  3250         -test -z "$NM" && NM=nm
  3251         -AC_SUBST([NM])
  3252         -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
  3253         -
  3254         -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
  3255         -  [lt_cv_nm_interface="BSD nm"
  3256         -  echo "int some_variable = 0;" > conftest.$ac_ext
  3257         -  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
  3258         -  (eval "$ac_compile" 2>conftest.err)
  3259         -  cat conftest.err >&AS_MESSAGE_LOG_FD
  3260         -  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
  3261         -  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
  3262         -  cat conftest.err >&AS_MESSAGE_LOG_FD
  3263         -  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
  3264         -  cat conftest.out >&AS_MESSAGE_LOG_FD
  3265         -  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
  3266         -    lt_cv_nm_interface="MS dumpbin"
  3267         -  fi
  3268         -  rm -f conftest*])
  3269         -])# LT_PATH_NM
  3270         -
  3271         -# Old names:
  3272         -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
  3273         -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
  3274         -dnl aclocal-1.4 backwards compatibility:
  3275         -dnl AC_DEFUN([AM_PROG_NM], [])
  3276         -dnl AC_DEFUN([AC_PROG_NM], [])
         2643  +NM="$lt_cv_path_NM"
         2644  +])# AC_PROG_NM
  3277   2645   
  3278   2646   
  3279         -# LT_LIB_M
  3280         -# --------
         2647  +# AC_CHECK_LIBM
         2648  +# -------------
  3281   2649   # check for math library
  3282         -AC_DEFUN([LT_LIB_M],
         2650  +AC_DEFUN([AC_CHECK_LIBM],
  3283   2651   [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3284   2652   LIBM=
  3285   2653   case $host in
  3286   2654   *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
  3287   2655     # These system don't have libm, or don't need it
  3288   2656     ;;
  3289   2657   *-ncr-sysv4.3*)
................................................................................
  3290   2658     AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  3291   2659     AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
  3292   2660     ;;
  3293   2661   *)
  3294   2662     AC_CHECK_LIB(m, cos, LIBM="-lm")
  3295   2663     ;;
  3296   2664   esac
  3297         -AC_SUBST([LIBM])
  3298         -])# LT_LIB_M
  3299         -
  3300         -# Old name:
  3301         -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
  3302         -dnl aclocal-1.4 backwards compatibility:
  3303         -dnl AC_DEFUN([AC_CHECK_LIBM], [])
  3304         -
  3305         -
  3306         -# _LT_COMPILER_NO_RTTI([TAGNAME])
  3307         -# -------------------------------
  3308         -m4_defun([_LT_COMPILER_NO_RTTI],
  3309         -[m4_require([_LT_TAG_COMPILER])dnl
  3310         -
  3311         -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
         2665  +])# AC_CHECK_LIBM
         2666  +
         2667  +
         2668  +# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
         2669  +# -----------------------------------
         2670  +# sets LIBLTDL to the link flags for the libltdl convenience library and
         2671  +# LTDLINCL to the include flags for the libltdl header and adds
         2672  +# --enable-ltdl-convenience to the configure arguments.  Note that
         2673  +# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
         2674  +# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
         2675  +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
         2676  +# (note the single quotes!).  If your package is not flat and you're not
         2677  +# using automake, define top_builddir and top_srcdir appropriately in
         2678  +# the Makefiles.
         2679  +AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
         2680  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2681  +  case $enable_ltdl_convenience in
         2682  +  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
         2683  +  "") enable_ltdl_convenience=yes
         2684  +      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
         2685  +  esac
         2686  +  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
         2687  +  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
         2688  +  # For backwards non-gettext consistent compatibility...
         2689  +  INCLTDL="$LTDLINCL"
         2690  +])# AC_LIBLTDL_CONVENIENCE
         2691  +
         2692  +
         2693  +# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
         2694  +# -----------------------------------
         2695  +# sets LIBLTDL to the link flags for the libltdl installable library and
         2696  +# LTDLINCL to the include flags for the libltdl header and adds
         2697  +# --enable-ltdl-install to the configure arguments.  Note that
         2698  +# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
         2699  +# and an installed libltdl is not found, it is assumed to be `libltdl'.
         2700  +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
         2701  +# '${top_srcdir}/' (note the single quotes!).  If your package is not
         2702  +# flat and you're not using automake, define top_builddir and top_srcdir
         2703  +# appropriately in the Makefiles.
         2704  +# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
         2705  +AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
         2706  +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
         2707  +  AC_CHECK_LIB(ltdl, lt_dlinit,
         2708  +  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
         2709  +  [if test x"$enable_ltdl_install" = xno; then
         2710  +     AC_MSG_WARN([libltdl not installed, but installation disabled])
         2711  +   else
         2712  +     enable_ltdl_install=yes
         2713  +   fi
         2714  +  ])
         2715  +  if test x"$enable_ltdl_install" = x"yes"; then
         2716  +    ac_configure_args="$ac_configure_args --enable-ltdl-install"
         2717  +    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
         2718  +    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
         2719  +  else
         2720  +    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
         2721  +    LIBLTDL="-lltdl"
         2722  +    LTDLINCL=
         2723  +  fi
         2724  +  # For backwards non-gettext consistent compatibility...
         2725  +  INCLTDL="$LTDLINCL"
         2726  +])# AC_LIBLTDL_INSTALLABLE
         2727  +
         2728  +
         2729  +# AC_LIBTOOL_CXX
         2730  +# --------------
         2731  +# enable support for C++ libraries
         2732  +AC_DEFUN([AC_LIBTOOL_CXX],
         2733  +[AC_REQUIRE([_LT_AC_LANG_CXX])
         2734  +])# AC_LIBTOOL_CXX
         2735  +
         2736  +
         2737  +# _LT_AC_LANG_CXX
         2738  +# ---------------
         2739  +AC_DEFUN([_LT_AC_LANG_CXX],
         2740  +[AC_REQUIRE([AC_PROG_CXX])
         2741  +AC_REQUIRE([_LT_AC_PROG_CXXCPP])
         2742  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
         2743  +])# _LT_AC_LANG_CXX
         2744  +
         2745  +# _LT_AC_PROG_CXXCPP
         2746  +# ------------------
         2747  +AC_DEFUN([_LT_AC_PROG_CXXCPP],
         2748  +[
         2749  +AC_REQUIRE([AC_PROG_CXX])
         2750  +if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
         2751  +    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
         2752  +    (test "X$CXX" != "Xg++"))) ; then
         2753  +  AC_PROG_CXXCPP
         2754  +fi
         2755  +])# _LT_AC_PROG_CXXCPP
         2756  +
         2757  +# AC_LIBTOOL_F77
         2758  +# --------------
         2759  +# enable support for Fortran 77 libraries
         2760  +AC_DEFUN([AC_LIBTOOL_F77],
         2761  +[AC_REQUIRE([_LT_AC_LANG_F77])
         2762  +])# AC_LIBTOOL_F77
         2763  +
         2764  +
         2765  +# _LT_AC_LANG_F77
         2766  +# ---------------
         2767  +AC_DEFUN([_LT_AC_LANG_F77],
         2768  +[AC_REQUIRE([AC_PROG_F77])
         2769  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
         2770  +])# _LT_AC_LANG_F77
         2771  +
         2772  +
         2773  +# AC_LIBTOOL_GCJ
         2774  +# --------------
         2775  +# enable support for GCJ libraries
         2776  +AC_DEFUN([AC_LIBTOOL_GCJ],
         2777  +[AC_REQUIRE([_LT_AC_LANG_GCJ])
         2778  +])# AC_LIBTOOL_GCJ
         2779  +
         2780  +
         2781  +# _LT_AC_LANG_GCJ
         2782  +# ---------------
         2783  +AC_DEFUN([_LT_AC_LANG_GCJ],
         2784  +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
         2785  +  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
         2786  +    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
         2787  +      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
         2788  +	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
         2789  +	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
         2790  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
         2791  +])# _LT_AC_LANG_GCJ
         2792  +
         2793  +
         2794  +# AC_LIBTOOL_RC
         2795  +# -------------
         2796  +# enable support for Windows resource files
         2797  +AC_DEFUN([AC_LIBTOOL_RC],
         2798  +[AC_REQUIRE([LT_AC_PROG_RC])
         2799  +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
         2800  +])# AC_LIBTOOL_RC
         2801  +
         2802  +
         2803  +# AC_LIBTOOL_LANG_C_CONFIG
         2804  +# ------------------------
         2805  +# Ensure that the configuration vars for the C compiler are
         2806  +# suitably defined.  Those variables are subsequently used by
         2807  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         2808  +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
         2809  +AC_DEFUN([_LT_AC_LANG_C_CONFIG],
         2810  +[lt_save_CC="$CC"
         2811  +AC_LANG_PUSH(C)
         2812  +
         2813  +# Source file extension for C test sources.
         2814  +ac_ext=c
         2815  +
         2816  +# Object file extension for compiled C test sources.
         2817  +objext=o
         2818  +_LT_AC_TAGVAR(objext, $1)=$objext
         2819  +
         2820  +# Code to be used in simple compile tests
         2821  +lt_simple_compile_test_code="int some_variable = 0;"
         2822  +
         2823  +# Code to be used in simple link tests
         2824  +lt_simple_link_test_code='int main(){return(0);}'
         2825  +
         2826  +_LT_AC_SYS_COMPILER
         2827  +
         2828  +# save warnings/boilerplate of simple test code
         2829  +_LT_COMPILER_BOILERPLATE
         2830  +_LT_LINKER_BOILERPLATE
         2831  +
         2832  +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
         2833  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         2834  +AC_LIBTOOL_PROG_CC_C_O($1)
         2835  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         2836  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         2837  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         2838  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         2839  +AC_LIBTOOL_SYS_LIB_STRIP
         2840  +AC_LIBTOOL_DLOPEN_SELF
         2841  +
         2842  +# Report which library types will actually be built
         2843  +AC_MSG_CHECKING([if libtool supports shared libraries])
         2844  +AC_MSG_RESULT([$can_build_shared])
         2845  +
         2846  +AC_MSG_CHECKING([whether to build shared libraries])
         2847  +test "$can_build_shared" = "no" && enable_shared=no
         2848  +
         2849  +# On AIX, shared libraries and static libraries use the same namespace, and
         2850  +# are all built from PIC.
         2851  +case $host_os in
         2852  +aix3*)
         2853  +  test "$enable_shared" = yes && enable_static=no
         2854  +  if test -n "$RANLIB"; then
         2855  +    archive_cmds="$archive_cmds~\$RANLIB \$lib"
         2856  +    postinstall_cmds='$RANLIB $lib'
         2857  +  fi
         2858  +  ;;
         2859  +
         2860  +aix[[4-9]]*)
         2861  +  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
         2862  +    test "$enable_shared" = yes && enable_static=no
         2863  +  fi
         2864  +    ;;
         2865  +esac
         2866  +AC_MSG_RESULT([$enable_shared])
         2867  +
         2868  +AC_MSG_CHECKING([whether to build static libraries])
         2869  +# Make sure either enable_shared or enable_static is yes.
         2870  +test "$enable_shared" = yes || enable_static=yes
         2871  +AC_MSG_RESULT([$enable_static])
         2872  +
         2873  +AC_LIBTOOL_CONFIG($1)
         2874  +
         2875  +AC_LANG_POP
         2876  +CC="$lt_save_CC"
         2877  +])# AC_LIBTOOL_LANG_C_CONFIG
         2878  +
         2879  +
         2880  +# AC_LIBTOOL_LANG_CXX_CONFIG
         2881  +# --------------------------
         2882  +# Ensure that the configuration vars for the C compiler are
         2883  +# suitably defined.  Those variables are subsequently used by
         2884  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         2885  +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
         2886  +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
         2887  +[AC_LANG_PUSH(C++)
         2888  +AC_REQUIRE([AC_PROG_CXX])
         2889  +AC_REQUIRE([_LT_AC_PROG_CXXCPP])
         2890  +
         2891  +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         2892  +_LT_AC_TAGVAR(allow_undefined_flag, $1)=
         2893  +_LT_AC_TAGVAR(always_export_symbols, $1)=no
         2894  +_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
         2895  +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         2896  +_LT_AC_TAGVAR(hardcode_direct, $1)=no
         2897  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         2898  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
         2899  +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         2900  +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
         2901  +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         2902  +_LT_AC_TAGVAR(hardcode_automatic, $1)=no
         2903  +_LT_AC_TAGVAR(module_cmds, $1)=
         2904  +_LT_AC_TAGVAR(module_expsym_cmds, $1)=
         2905  +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
         2906  +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
         2907  +_LT_AC_TAGVAR(no_undefined_flag, $1)=
         2908  +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         2909  +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
         2910  +
         2911  +# Dependencies to place before and after the object being linked:
         2912  +_LT_AC_TAGVAR(predep_objects, $1)=
         2913  +_LT_AC_TAGVAR(postdep_objects, $1)=
         2914  +_LT_AC_TAGVAR(predeps, $1)=
         2915  +_LT_AC_TAGVAR(postdeps, $1)=
         2916  +_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
         2917  +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
         2918  +
         2919  +# Source file extension for C++ test sources.
         2920  +ac_ext=cpp
         2921  +
         2922  +# Object file extension for compiled C++ test sources.
         2923  +objext=o
         2924  +_LT_AC_TAGVAR(objext, $1)=$objext
         2925  +
         2926  +# Code to be used in simple compile tests
         2927  +lt_simple_compile_test_code="int some_variable = 0;"
         2928  +
         2929  +# Code to be used in simple link tests
         2930  +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
         2931  +
         2932  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         2933  +_LT_AC_SYS_COMPILER
         2934  +
         2935  +# save warnings/boilerplate of simple test code
         2936  +_LT_COMPILER_BOILERPLATE
         2937  +_LT_LINKER_BOILERPLATE
         2938  +
         2939  +# Allow CC to be a program name with arguments.
         2940  +lt_save_CC=$CC
         2941  +lt_save_LD=$LD
         2942  +lt_save_GCC=$GCC
         2943  +GCC=$GXX
         2944  +lt_save_with_gnu_ld=$with_gnu_ld
         2945  +lt_save_path_LD=$lt_cv_path_LD
         2946  +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
         2947  +  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
         2948  +else
         2949  +  $as_unset lt_cv_prog_gnu_ld
         2950  +fi
         2951  +if test -n "${lt_cv_path_LDCXX+set}"; then
         2952  +  lt_cv_path_LD=$lt_cv_path_LDCXX
         2953  +else
         2954  +  $as_unset lt_cv_path_LD
         2955  +fi
         2956  +test -z "${LDCXX+set}" || LD=$LDCXX
         2957  +CC=${CXX-"c++"}
         2958  +compiler=$CC
         2959  +_LT_AC_TAGVAR(compiler, $1)=$CC
         2960  +_LT_CC_BASENAME([$compiler])
         2961  +
         2962  +# We don't want -fno-exception wen compiling C++ code, so set the
         2963  +# no_builtin_flag separately
         2964  +if test "$GXX" = yes; then
         2965  +  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
         2966  +else
         2967  +  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
         2968  +fi
         2969  +
         2970  +if test "$GXX" = yes; then
         2971  +  # Set up default GNU C++ configuration
         2972  +
         2973  +  AC_PROG_LD
         2974  +
         2975  +  # Check if GNU C++ uses GNU ld as the underlying linker, since the
         2976  +  # archiving commands below assume that GNU ld is being used.
         2977  +  if test "$with_gnu_ld" = yes; then
         2978  +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
         2979  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         2980  +
         2981  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
         2982  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         2983  +
         2984  +    # If archive_cmds runs LD, not CC, wlarc should be empty
         2985  +    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         2986  +    #     investigate it a little bit more. (MM)
         2987  +    wlarc='${wl}'
         2988  +
         2989  +    # ancient GNU ld didn't support --whole-archive et. al.
         2990  +    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
         2991  +	grep 'no-whole-archive' > /dev/null; then
         2992  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         2993  +    else
         2994  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         2995  +    fi
         2996  +  else
         2997  +    with_gnu_ld=no
         2998  +    wlarc=
         2999  +
         3000  +    # A generic and very simple default shared library creation
         3001  +    # command for GNU C++ for the case where it uses the native
         3002  +    # linker, instead of GNU ld.  If possible, this setting should
         3003  +    # overridden to take advantage of the native linker features on
         3004  +    # the platform it is being used on.
         3005  +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
         3006  +  fi
         3007  +
         3008  +  # Commands to make compiler produce verbose output that lists
         3009  +  # what "hidden" libraries, object files and flags are used when
         3010  +  # linking a shared library.
         3011  +  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
         3012  +
         3013  +else
         3014  +  GXX=no
         3015  +  with_gnu_ld=no
         3016  +  wlarc=
         3017  +fi
         3018  +
         3019  +# PORTME: fill in a description of your system's C++ link characteristics
         3020  +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
         3021  +_LT_AC_TAGVAR(ld_shlibs, $1)=yes
         3022  +case $host_os in
         3023  +  aix3*)
         3024  +    # FIXME: insert proper C++ library support
         3025  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3026  +    ;;
         3027  +  aix[[4-9]]*)
         3028  +    if test "$host_cpu" = ia64; then
         3029  +      # On IA64, the linker does run time linking by default, so we don't
         3030  +      # have to do anything special.
         3031  +      aix_use_runtimelinking=no
         3032  +      exp_sym_flag='-Bexport'
         3033  +      no_entry_flag=""
         3034  +    else
         3035  +      aix_use_runtimelinking=no
         3036  +
         3037  +      # Test if we are trying to use run time linking or normal
         3038  +      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
         3039  +      # need to do runtime linking.
         3040  +      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
         3041  +	for ld_flag in $LDFLAGS; do
         3042  +	  case $ld_flag in
         3043  +	  *-brtl*)
         3044  +	    aix_use_runtimelinking=yes
         3045  +	    break
         3046  +	    ;;
         3047  +	  esac
         3048  +	done
         3049  +	;;
         3050  +      esac
         3051  +
         3052  +      exp_sym_flag='-bexport'
         3053  +      no_entry_flag='-bnoentry'
         3054  +    fi
         3055  +
         3056  +    # When large executables or shared objects are built, AIX ld can
         3057  +    # have problems creating the table of contents.  If linking a library
         3058  +    # or program results in "error TOC overflow" add -mminimal-toc to
         3059  +    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
         3060  +    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
         3061  +
         3062  +    _LT_AC_TAGVAR(archive_cmds, $1)=''
         3063  +    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3064  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         3065  +    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3066  +
         3067  +    if test "$GXX" = yes; then
         3068  +      case $host_os in aix4.[[012]]|aix4.[[012]].*)
         3069  +      # We only want to do this on AIX 4.2 and lower, the check
         3070  +      # below for broken collect2 doesn't work under 4.3+
         3071  +	collect2name=`${CC} -print-prog-name=collect2`
         3072  +	if test -f "$collect2name" && \
         3073  +	   strings "$collect2name" | grep resolve_lib_name >/dev/null
         3074  +	then
         3075  +	  # We have reworked collect2
         3076  +	  :
         3077  +	else
         3078  +	  # We have old collect2
         3079  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
         3080  +	  # It fails to find uninstalled libraries when the uninstalled
         3081  +	  # path is not listed in the libpath.  Setting hardcode_minus_L
         3082  +	  # to unsupported forces relinking
         3083  +	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         3084  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         3085  +	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         3086  +	fi
         3087  +	;;
         3088  +      esac
         3089  +      shared_flag='-shared'
         3090  +      if test "$aix_use_runtimelinking" = yes; then
         3091  +	shared_flag="$shared_flag "'${wl}-G'
         3092  +      fi
         3093  +    else
         3094  +      # not using gcc
         3095  +      if test "$host_cpu" = ia64; then
         3096  +	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
         3097  +	# chokes on -Wl,-G. The following line is correct:
         3098  +	shared_flag='-G'
         3099  +      else
         3100  +	if test "$aix_use_runtimelinking" = yes; then
         3101  +	  shared_flag='${wl}-G'
         3102  +	else
         3103  +	  shared_flag='${wl}-bM:SRE'
         3104  +	fi
         3105  +      fi
         3106  +    fi
         3107  +
         3108  +    # It seems that -bexpall does not export symbols beginning with
         3109  +    # underscore (_), so it is better to generate a list of symbols to export.
         3110  +    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
         3111  +    if test "$aix_use_runtimelinking" = yes; then
         3112  +      # Warning - without using the other runtime loading flags (-brtl),
         3113  +      # -berok will link without error, but may produce a broken library.
         3114  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
         3115  +      # Determine the default libpath from the value encoded in an empty executable.
         3116  +      _LT_AC_SYS_LIBPATH_AIX
         3117  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         3118  +
         3119  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         3120  +     else
         3121  +      if test "$host_cpu" = ia64; then
         3122  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
         3123  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
         3124  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
         3125  +      else
         3126  +	# Determine the default libpath from the value encoded in an empty executable.
         3127  +	_LT_AC_SYS_LIBPATH_AIX
         3128  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         3129  +	# Warning - without using the other run time loading flags,
         3130  +	# -berok will link without error, but may produce a broken library.
         3131  +	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
         3132  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
         3133  +	# Exported symbols can be pulled into shared objects from archives
         3134  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
         3135  +	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
         3136  +	# This is similar to how AIX traditionally builds its shared libraries.
         3137  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
         3138  +      fi
         3139  +    fi
         3140  +    ;;
         3141  +
         3142  +  beos*)
         3143  +    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         3144  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         3145  +      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
         3146  +      # support --undefined.  This deserves some investigation.  FIXME
         3147  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3148  +    else
         3149  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3150  +    fi
         3151  +    ;;
         3152  +
         3153  +  chorus*)
         3154  +    case $cc_basename in
         3155  +      *)
         3156  +	# FIXME: insert proper C++ library support
         3157  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3158  +	;;
         3159  +    esac
         3160  +    ;;
         3161  +
         3162  +  cygwin* | mingw* | pw32*)
         3163  +    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
         3164  +    # as there is no search path for DLLs.
         3165  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         3166  +    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         3167  +    _LT_AC_TAGVAR(always_export_symbols, $1)=no
         3168  +    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
         3169  +
         3170  +    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         3171  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         3172  +      # If the export-symbols file already is a .def file (1st line
         3173  +      # is EXPORTS), use it as is; otherwise, prepend...
         3174  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
         3175  +	cp $export_symbols $output_objdir/$soname.def;
         3176  +      else
         3177  +	echo EXPORTS > $output_objdir/$soname.def;
         3178  +	cat $export_symbols >> $output_objdir/$soname.def;
         3179  +      fi~
         3180  +      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         3181  +    else
         3182  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3183  +    fi
         3184  +  ;;
         3185  +      darwin* | rhapsody*)
         3186  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3187  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         3188  +      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
         3189  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         3190  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
         3191  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3192  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
         3193  +      if test "$GXX" = yes ; then
         3194  +      output_verbose_link_cmd='echo'
         3195  +      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
         3196  +      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
         3197  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
         3198  +      _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
         3199  +      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
         3200  +        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
         3201  +        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
         3202  +      fi
         3203  +      else
         3204  +      case $cc_basename in
         3205  +        xlc*)
         3206  +         output_verbose_link_cmd='echo'
         3207  +          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
         3208  +          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
         3209  +          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
         3210  +          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         3211  +          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         3212  +          ;;
         3213  +       *)
         3214  +         _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3215  +          ;;
         3216  +      esac
         3217  +      fi
         3218  +        ;;
         3219  +
         3220  +  dgux*)
         3221  +    case $cc_basename in
         3222  +      ec++*)
         3223  +	# FIXME: insert proper C++ library support
         3224  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3225  +	;;
         3226  +      ghcx*)
         3227  +	# Green Hills C++ Compiler
         3228  +	# FIXME: insert proper C++ library support
         3229  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3230  +	;;
         3231  +      *)
         3232  +	# FIXME: insert proper C++ library support
         3233  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3234  +	;;
         3235  +    esac
         3236  +    ;;
         3237  +  freebsd[[12]]*)
         3238  +    # C++ shared libraries reported to be fairly broken before switch to ELF
         3239  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3240  +    ;;
         3241  +  freebsd-elf*)
         3242  +    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3243  +    ;;
         3244  +  freebsd* | dragonfly*)
         3245  +    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
         3246  +    # conventions
         3247  +    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
         3248  +    ;;
         3249  +  gnu*)
         3250  +    ;;
         3251  +  hpux9*)
         3252  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         3253  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3254  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3255  +    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3256  +    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
         3257  +				# but as the default
         3258  +				# location of the library.
         3259  +
         3260  +    case $cc_basename in
         3261  +    CC*)
         3262  +      # FIXME: insert proper C++ library support
         3263  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3264  +      ;;
         3265  +    aCC*)
         3266  +      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         3267  +      # Commands to make compiler produce verbose output that lists
         3268  +      # what "hidden" libraries, object files and flags are used when
         3269  +      # linking a shared library.
         3270  +      #
         3271  +      # There doesn't appear to be a way to prevent this compiler from
         3272  +      # explicitly linking system object files so we need to strip them
         3273  +      # from the output so that they don't get included in the library
         3274  +      # dependencies.
         3275  +      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3276  +      ;;
         3277  +    *)
         3278  +      if test "$GXX" = yes; then
         3279  +        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         3280  +      else
         3281  +        # FIXME: insert proper C++ library support
         3282  +        _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3283  +      fi
         3284  +      ;;
         3285  +    esac
         3286  +    ;;
         3287  +  hpux10*|hpux11*)
         3288  +    if test $with_gnu_ld = no; then
         3289  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         3290  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3291  +
         3292  +      case $host_cpu in
         3293  +      hppa*64*|ia64*) ;;
         3294  +      *)
         3295  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3296  +        ;;
         3297  +      esac
         3298  +    fi
         3299  +    case $host_cpu in
         3300  +    hppa*64*|ia64*)
         3301  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         3302  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3303  +      ;;
         3304  +    *)
         3305  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3306  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
         3307  +					      # but as the default
         3308  +					      # location of the library.
         3309  +      ;;
         3310  +    esac
         3311  +
         3312  +    case $cc_basename in
         3313  +      CC*)
         3314  +	# FIXME: insert proper C++ library support
         3315  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3316  +	;;
         3317  +      aCC*)
         3318  +	case $host_cpu in
         3319  +	hppa*64*)
         3320  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3321  +	  ;;
         3322  +	ia64*)
         3323  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3324  +	  ;;
         3325  +	*)
         3326  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3327  +	  ;;
         3328  +	esac
         3329  +	# Commands to make compiler produce verbose output that lists
         3330  +	# what "hidden" libraries, object files and flags are used when
         3331  +	# linking a shared library.
         3332  +	#
         3333  +	# There doesn't appear to be a way to prevent this compiler from
         3334  +	# explicitly linking system object files so we need to strip them
         3335  +	# from the output so that they don't get included in the library
         3336  +	# dependencies.
         3337  +	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3338  +	;;
         3339  +      *)
         3340  +	if test "$GXX" = yes; then
         3341  +	  if test $with_gnu_ld = no; then
         3342  +	    case $host_cpu in
         3343  +	    hppa*64*)
         3344  +	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3345  +	      ;;
         3346  +	    ia64*)
         3347  +	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3348  +	      ;;
         3349  +	    *)
         3350  +	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3351  +	      ;;
         3352  +	    esac
         3353  +	  fi
         3354  +	else
         3355  +	  # FIXME: insert proper C++ library support
         3356  +	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3357  +	fi
         3358  +	;;
         3359  +    esac
         3360  +    ;;
         3361  +  interix[[3-9]]*)
         3362  +    _LT_AC_TAGVAR(hardcode_direct, $1)=no
         3363  +    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3364  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3365  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3366  +    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
         3367  +    # Instead, shared libraries are loaded at an image base (0x10000000 by
         3368  +    # default) and relocated if they conflict, which is a slow very memory
         3369  +    # consuming and fragmenting process.  To avoid this, we pick a random,
         3370  +    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
         3371  +    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
         3372  +    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         3373  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         3374  +    ;;
         3375  +  irix5* | irix6*)
         3376  +    case $cc_basename in
         3377  +      CC*)
         3378  +	# SGI C++
         3379  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         3380  +
         3381  +	# Archives containing C++ object files must be created using
         3382  +	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
         3383  +	# necessary to make sure instantiated templates are included
         3384  +	# in the archive.
         3385  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
         3386  +	;;
         3387  +      *)
         3388  +	if test "$GXX" = yes; then
         3389  +	  if test "$with_gnu_ld" = no; then
         3390  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         3391  +	  else
         3392  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
         3393  +	  fi
         3394  +	fi
         3395  +	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3396  +	;;
         3397  +    esac
         3398  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3399  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3400  +    ;;
         3401  +  linux* | k*bsd*-gnu)
         3402  +    case $cc_basename in
         3403  +      KCC*)
         3404  +	# Kuck and Associates, Inc. (KAI) C++ Compiler
         3405  +
         3406  +	# KCC will only create a shared library if the output file
         3407  +	# ends with ".so" (or ".sl" for HP-UX), so rename the library
         3408  +	# to its proper name (with version) after linking.
         3409  +	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
         3410  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
         3411  +	# Commands to make compiler produce verbose output that lists
         3412  +	# what "hidden" libraries, object files and flags are used when
         3413  +	# linking a shared library.
         3414  +	#
         3415  +	# There doesn't appear to be a way to prevent this compiler from
         3416  +	# explicitly linking system object files so we need to strip them
         3417  +	# from the output so that they don't get included in the library
         3418  +	# dependencies.
         3419  +	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3420  +
         3421  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
         3422  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         3423  +
         3424  +	# Archives containing C++ object files must be created using
         3425  +	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
         3426  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
         3427  +	;;
         3428  +      icpc*)
         3429  +	# Intel C++
         3430  +	with_gnu_ld=yes
         3431  +	# version 8.0 and above of icpc choke on multiply defined symbols
         3432  +	# if we add $predep_objects and $postdep_objects, however 7.1 and
         3433  +	# earlier do not add the objects themselves.
         3434  +	case `$CC -V 2>&1` in
         3435  +	*"Version 7."*)
         3436  +  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3437  +  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         3438  +	  ;;
         3439  +	*)  # Version 8.0 or newer
         3440  +	  tmp_idyn=
         3441  +	  case $host_cpu in
         3442  +	    ia64*) tmp_idyn=' -i_dynamic';;
         3443  +	  esac
         3444  +  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3445  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         3446  +	  ;;
         3447  +	esac
         3448  +	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3449  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3450  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         3451  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
         3452  +	;;
         3453  +      pgCC* | pgcpp*)
         3454  +        # Portland Group C++ compiler
         3455  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
         3456  +  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
         3457  +
         3458  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
         3459  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         3460  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         3461  +        ;;
         3462  +      cxx*)
         3463  +	# Compaq C++
         3464  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
         3465  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
         3466  +
         3467  +	runpath_var=LD_RUN_PATH
         3468  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
         3469  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3470  +
         3471  +	# Commands to make compiler produce verbose output that lists
         3472  +	# what "hidden" libraries, object files and flags are used when
         3473  +	# linking a shared library.
         3474  +	#
         3475  +	# There doesn't appear to be a way to prevent this compiler from
         3476  +	# explicitly linking system object files so we need to strip them
         3477  +	# from the output so that they don't get included in the library
         3478  +	# dependencies.
         3479  +	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3480  +	;;
         3481  +      *)
         3482  +	case `$CC -V 2>&1 | sed 5q` in
         3483  +	*Sun\ C*)
         3484  +	  # Sun C++ 5.9
         3485  +	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
         3486  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3487  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
         3488  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         3489  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
         3490  +
         3491  +	  # Not sure whether something based on
         3492  +	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
         3493  +	  # would be better.
         3494  +	  output_verbose_link_cmd='echo'
         3495  +
         3496  +	  # Archives containing C++ object files must be created using
         3497  +	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
         3498  +	  # necessary to make sure instantiated templates are included
         3499  +	  # in the archive.
         3500  +	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
         3501  +	  ;;
         3502  +	esac
         3503  +	;;
         3504  +    esac
         3505  +    ;;
         3506  +  lynxos*)
         3507  +    # FIXME: insert proper C++ library support
         3508  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3509  +    ;;
         3510  +  m88k*)
         3511  +    # FIXME: insert proper C++ library support
         3512  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3513  +    ;;
         3514  +  mvs*)
         3515  +    case $cc_basename in
         3516  +      cxx*)
         3517  +	# FIXME: insert proper C++ library support
         3518  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3519  +	;;
         3520  +      *)
         3521  +	# FIXME: insert proper C++ library support
         3522  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3523  +	;;
         3524  +    esac
         3525  +    ;;
         3526  +  netbsd* | netbsdelf*-gnu)
         3527  +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         3528  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
         3529  +      wlarc=
         3530  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         3531  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3532  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3533  +    fi
         3534  +    # Workaround some broken pre-1.5 toolchains
         3535  +    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
         3536  +    ;;
         3537  +  openbsd2*)
         3538  +    # C++ shared libraries are fairly broken
         3539  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3540  +    ;;
         3541  +  openbsd*)
         3542  +    if test -f /usr/libexec/ld.so; then
         3543  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         3544  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3545  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
         3546  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3547  +      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         3548  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
         3549  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         3550  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         3551  +      fi
         3552  +      output_verbose_link_cmd='echo'
         3553  +    else
         3554  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3555  +    fi
         3556  +    ;;
         3557  +  osf3*)
         3558  +    case $cc_basename in
         3559  +      KCC*)
         3560  +	# Kuck and Associates, Inc. (KAI) C++ Compiler
         3561  +
         3562  +	# KCC will only create a shared library if the output file
         3563  +	# ends with ".so" (or ".sl" for HP-UX), so rename the library
         3564  +	# to its proper name (with version) after linking.
         3565  +	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
         3566  +
         3567  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3568  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3569  +
         3570  +	# Archives containing C++ object files must be created using
         3571  +	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
         3572  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
         3573  +
         3574  +	;;
         3575  +      RCC*)
         3576  +	# Rational C++ 2.4.1
         3577  +	# FIXME: insert proper C++ library support
         3578  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3579  +	;;
         3580  +      cxx*)
         3581  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         3582  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         3583  +
         3584  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3585  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3586  +
         3587  +	# Commands to make compiler produce verbose output that lists
         3588  +	# what "hidden" libraries, object files and flags are used when
         3589  +	# linking a shared library.
         3590  +	#
         3591  +	# There doesn't appear to be a way to prevent this compiler from
         3592  +	# explicitly linking system object files so we need to strip them
         3593  +	# from the output so that they don't get included in the library
         3594  +	# dependencies.
         3595  +	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3596  +	;;
         3597  +      *)
         3598  +	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
         3599  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         3600  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         3601  +
         3602  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3603  +	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3604  +
         3605  +	  # Commands to make compiler produce verbose output that lists
         3606  +	  # what "hidden" libraries, object files and flags are used when
         3607  +	  # linking a shared library.
         3608  +	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
         3609  +
         3610  +	else
         3611  +	  # FIXME: insert proper C++ library support
         3612  +	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3613  +	fi
         3614  +	;;
         3615  +    esac
         3616  +    ;;
         3617  +  osf4* | osf5*)
         3618  +    case $cc_basename in
         3619  +      KCC*)
         3620  +	# Kuck and Associates, Inc. (KAI) C++ Compiler
         3621  +
         3622  +	# KCC will only create a shared library if the output file
         3623  +	# ends with ".so" (or ".sl" for HP-UX), so rename the library
         3624  +	# to its proper name (with version) after linking.
         3625  +	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
         3626  +
         3627  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         3628  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3629  +
         3630  +	# Archives containing C++ object files must be created using
         3631  +	# the KAI C++ compiler.
         3632  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
         3633  +	;;
         3634  +      RCC*)
         3635  +	# Rational C++ 2.4.1
         3636  +	# FIXME: insert proper C++ library support
         3637  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3638  +	;;
         3639  +      cxx*)
         3640  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
         3641  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         3642  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
         3643  +	  echo "-hidden">> $lib.exp~
         3644  +	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
         3645  +	  $rm $lib.exp'
         3646  +
         3647  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
         3648  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3649  +
         3650  +	# Commands to make compiler produce verbose output that lists
         3651  +	# what "hidden" libraries, object files and flags are used when
         3652  +	# linking a shared library.
         3653  +	#
         3654  +	# There doesn't appear to be a way to prevent this compiler from
         3655  +	# explicitly linking system object files so we need to strip them
         3656  +	# from the output so that they don't get included in the library
         3657  +	# dependencies.
         3658  +	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
         3659  +	;;
         3660  +      *)
         3661  +	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
         3662  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         3663  +	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         3664  +
         3665  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         3666  +	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         3667  +
         3668  +	  # Commands to make compiler produce verbose output that lists
         3669  +	  # what "hidden" libraries, object files and flags are used when
         3670  +	  # linking a shared library.
         3671  +	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
         3672  +
         3673  +	else
         3674  +	  # FIXME: insert proper C++ library support
         3675  +	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3676  +	fi
         3677  +	;;
         3678  +    esac
         3679  +    ;;
         3680  +  psos*)
         3681  +    # FIXME: insert proper C++ library support
         3682  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3683  +    ;;
         3684  +  sunos4*)
         3685  +    case $cc_basename in
         3686  +      CC*)
         3687  +	# Sun C++ 4.x
         3688  +	# FIXME: insert proper C++ library support
         3689  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3690  +	;;
         3691  +      lcc*)
         3692  +	# Lucid
         3693  +	# FIXME: insert proper C++ library support
         3694  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3695  +	;;
         3696  +      *)
         3697  +	# FIXME: insert proper C++ library support
         3698  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3699  +	;;
         3700  +    esac
         3701  +    ;;
         3702  +  solaris*)
         3703  +    case $cc_basename in
         3704  +      CC*)
         3705  +	# Sun C++ 4.2, 5.x and Centerline C++
         3706  +        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
         3707  +	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
         3708  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
         3709  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         3710  +	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
         3711  +
         3712  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         3713  +	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3714  +	case $host_os in
         3715  +	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
         3716  +	  *)
         3717  +	    # The compiler driver will combine and reorder linker options,
         3718  +	    # but understands `-z linker_flag'.
         3719  +	    # Supported since Solaris 2.6 (maybe 2.5.1?)
         3720  +	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
         3721  +	    ;;
         3722  +	esac
         3723  +	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3724  +
         3725  +	output_verbose_link_cmd='echo'
         3726  +
         3727  +	# Archives containing C++ object files must be created using
         3728  +	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
         3729  +	# necessary to make sure instantiated templates are included
         3730  +	# in the archive.
         3731  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
         3732  +	;;
         3733  +      gcx*)
         3734  +	# Green Hills C++ Compiler
         3735  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
         3736  +
         3737  +	# The C++ compiler must be used to create the archive.
         3738  +	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
         3739  +	;;
         3740  +      *)
         3741  +	# GNU C++ compiler with Solaris linker
         3742  +	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
         3743  +	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
         3744  +	  if $CC --version | grep -v '^2\.7' > /dev/null; then
         3745  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
         3746  +	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         3747  +		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
         3748  +
         3749  +	    # Commands to make compiler produce verbose output that lists
         3750  +	    # what "hidden" libraries, object files and flags are used when
         3751  +	    # linking a shared library.
         3752  +	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
         3753  +	  else
         3754  +	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
         3755  +	    # platform.
         3756  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
         3757  +	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         3758  +		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
         3759  +
         3760  +	    # Commands to make compiler produce verbose output that lists
         3761  +	    # what "hidden" libraries, object files and flags are used when
         3762  +	    # linking a shared library.
         3763  +	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
         3764  +	  fi
         3765  +
         3766  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
         3767  +	  case $host_os in
         3768  +	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
         3769  +	  *)
         3770  +	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
         3771  +	    ;;
         3772  +	  esac
         3773  +	fi
         3774  +	;;
         3775  +    esac
         3776  +    ;;
         3777  +  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
         3778  +    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         3779  +    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3780  +    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3781  +    runpath_var='LD_RUN_PATH'
         3782  +
         3783  +    case $cc_basename in
         3784  +      CC*)
         3785  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3786  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3787  +	;;
         3788  +      *)
         3789  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3790  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         3791  +	;;
         3792  +    esac
         3793  +    ;;
         3794  +  sysv5* | sco3.2v5* | sco5v6*)
         3795  +    # Note: We can NOT use -z defs as we might desire, because we do not
         3796  +    # link with -lc, and that would cause any symbols used from libc to
         3797  +    # always be unresolved, which means just about no library would
         3798  +    # ever link correctly.  If we're not using GNU ld we use -z text
         3799  +    # though, which does catch some bad symbols but isn't as heavy-handed
         3800  +    # as -z defs.
         3801  +    # For security reasons, it is highly recommended that you always
         3802  +    # use absolute paths for naming shared libraries, and exclude the
         3803  +    # DT_RUNPATH tag from executables and libraries.  But doing so
         3804  +    # requires that you compile everything twice, which is a pain.
         3805  +    # So that behaviour is only enabled if SCOABSPATH is set to a
         3806  +    # non-empty value in the environment.  Most likely only useful for
         3807  +    # creating official distributions of packages.
         3808  +    # This is a hack until libtool officially supports absolute path
         3809  +    # names for shared libraries.
         3810  +    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         3811  +    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
         3812  +    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         3813  +    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         3814  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
         3815  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         3816  +    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         3817  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
         3818  +    runpath_var='LD_RUN_PATH'
         3819  +
         3820  +    case $cc_basename in
         3821  +      CC*)
         3822  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3823  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3824  +	;;
         3825  +      *)
         3826  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3827  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         3828  +	;;
         3829  +    esac
         3830  +    ;;
         3831  +  tandem*)
         3832  +    case $cc_basename in
         3833  +      NCC*)
         3834  +	# NonStop-UX NCC 3.20
         3835  +	# FIXME: insert proper C++ library support
         3836  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3837  +	;;
         3838  +      *)
         3839  +	# FIXME: insert proper C++ library support
         3840  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         3841  +	;;
         3842  +    esac
         3843  +    ;;
         3844  +  vxworks*)
         3845  +    # FIXME: insert proper C++ library support
         3846  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3847  +    ;;
         3848  +  *)
         3849  +    # FIXME: insert proper C++ library support
         3850  +    _LT_AC_TAGVAR(ld_shlibs, $1)=no
         3851  +    ;;
         3852  +esac
         3853  +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
         3854  +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
         3855  +
         3856  +_LT_AC_TAGVAR(GCC, $1)="$GXX"
         3857  +_LT_AC_TAGVAR(LD, $1)="$LD"
         3858  +
         3859  +AC_LIBTOOL_POSTDEP_PREDEP($1)
         3860  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         3861  +AC_LIBTOOL_PROG_CC_C_O($1)
         3862  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         3863  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         3864  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         3865  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         3866  +
         3867  +AC_LIBTOOL_CONFIG($1)
         3868  +
         3869  +AC_LANG_POP
         3870  +CC=$lt_save_CC
         3871  +LDCXX=$LD
         3872  +LD=$lt_save_LD
         3873  +GCC=$lt_save_GCC
         3874  +with_gnu_ldcxx=$with_gnu_ld
         3875  +with_gnu_ld=$lt_save_with_gnu_ld
         3876  +lt_cv_path_LDCXX=$lt_cv_path_LD
         3877  +lt_cv_path_LD=$lt_save_path_LD
         3878  +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
         3879  +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
         3880  +])# AC_LIBTOOL_LANG_CXX_CONFIG
         3881  +
         3882  +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
         3883  +# ------------------------------------
         3884  +# Figure out "hidden" library dependencies from verbose
         3885  +# compiler output when linking a shared library.
         3886  +# Parse the compiler output and extract the necessary
         3887  +# objects, libraries and library flags.
         3888  +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
         3889  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
         3890  +dnl we can't use the lt_simple_compile_test_code here,
         3891  +dnl because it contains code intended for an executable,
         3892  +dnl not a library.  It's possible we should let each
         3893  +dnl tag define a new lt_????_link_test_code variable,
         3894  +dnl but it's only used here...
         3895  +ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
         3896  +int a;
         3897  +void foo (void) { a = 0; }
         3898  +EOF
         3899  +],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
         3900  +class Foo
         3901  +{
         3902  +public:
         3903  +  Foo (void) { a = 0; }
         3904  +private:
         3905  +  int a;
         3906  +};
         3907  +EOF
         3908  +],[$1],[F77],[cat > conftest.$ac_ext <<EOF
         3909  +      subroutine foo
         3910  +      implicit none
         3911  +      integer*4 a
         3912  +      a=0
         3913  +      return
         3914  +      end
         3915  +EOF
         3916  +],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
         3917  +public class foo {
         3918  +  private int a;
         3919  +  public void bar (void) {
         3920  +    a = 0;
         3921  +  }
         3922  +};
         3923  +EOF
         3924  +])
         3925  +dnl Parse the compiler output and extract the necessary
         3926  +dnl objects, libraries and library flags.
         3927  +if AC_TRY_EVAL(ac_compile); then
         3928  +  # Parse the compiler output and extract the necessary
         3929  +  # objects, libraries and library flags.
         3930  +
         3931  +  # Sentinel used to keep track of whether or not we are before
         3932  +  # the conftest object file.
         3933  +  pre_test_object_deps_done=no
         3934  +
         3935  +  # The `*' in the case matches for architectures that use `case' in
         3936  +  # $output_verbose_cmd can trigger glob expansion during the loop
         3937  +  # eval without this substitution.
         3938  +  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
         3939  +
         3940  +  for p in `eval $output_verbose_link_cmd`; do
         3941  +    case $p in
         3942  +
         3943  +    -L* | -R* | -l*)
         3944  +       # Some compilers place space between "-{L,R}" and the path.
         3945  +       # Remove the space.
         3946  +       if test $p = "-L" \
         3947  +	  || test $p = "-R"; then
         3948  +	 prev=$p
         3949  +	 continue
         3950  +       else
         3951  +	 prev=
         3952  +       fi
         3953  +
         3954  +       if test "$pre_test_object_deps_done" = no; then
         3955  +	 case $p in
         3956  +	 -L* | -R*)
         3957  +	   # Internal compiler library paths should come after those
         3958  +	   # provided the user.  The postdeps already come after the
         3959  +	   # user supplied libs so there is no need to process them.
         3960  +	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
         3961  +	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
         3962  +	   else
         3963  +	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
         3964  +	   fi
         3965  +	   ;;
         3966  +	 # The "-l" case would never come before the object being
         3967  +	 # linked, so don't bother handling this case.
         3968  +	 esac
         3969  +       else
         3970  +	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
         3971  +	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
         3972  +	 else
         3973  +	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
         3974  +	 fi
         3975  +       fi
         3976  +       ;;
         3977  +
         3978  +    *.$objext)
         3979  +       # This assumes that the test object file only shows up
         3980  +       # once in the compiler output.
         3981  +       if test "$p" = "conftest.$objext"; then
         3982  +	 pre_test_object_deps_done=yes
         3983  +	 continue
         3984  +       fi
         3985  +
         3986  +       if test "$pre_test_object_deps_done" = no; then
         3987  +	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
         3988  +	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
         3989  +	 else
         3990  +	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
         3991  +	 fi
         3992  +       else
         3993  +	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
         3994  +	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
         3995  +	 else
         3996  +	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
         3997  +	 fi
         3998  +       fi
         3999  +       ;;
         4000  +
         4001  +    *) ;; # Ignore the rest.
         4002  +
         4003  +    esac
         4004  +  done
         4005  +
         4006  +  # Clean up.
         4007  +  rm -f a.out a.exe
         4008  +else
         4009  +  echo "libtool.m4: error: problem compiling $1 test program"
         4010  +fi
         4011  +
         4012  +$rm -f confest.$objext
         4013  +
         4014  +_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
         4015  +if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
         4016  +  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
         4017  +fi
         4018  +
         4019  +# PORTME: override above test on systems where it is broken
         4020  +ifelse([$1],[CXX],
         4021  +[case $host_os in
         4022  +interix[[3-9]]*)
         4023  +  # Interix 3.5 installs completely hosed .la files for C++, so rather than
         4024  +  # hack all around it, let's just trust "g++" to DTRT.
         4025  +  _LT_AC_TAGVAR(predep_objects,$1)=
         4026  +  _LT_AC_TAGVAR(postdep_objects,$1)=
         4027  +  _LT_AC_TAGVAR(postdeps,$1)=
         4028  +  ;;
         4029  +
         4030  +linux*)
         4031  +  case `$CC -V 2>&1 | sed 5q` in
         4032  +  *Sun\ C*)
         4033  +    # Sun C++ 5.9
         4034  +    #
         4035  +    # The more standards-conforming stlport4 library is
         4036  +    # incompatible with the Cstd library. Avoid specifying
         4037  +    # it if it's in CXXFLAGS. Ignore libCrun as
         4038  +    # -library=stlport4 depends on it.
         4039  +    case " $CXX $CXXFLAGS " in
         4040  +    *" -library=stlport4 "*)
         4041  +      solaris_use_stlport4=yes
         4042  +      ;;
         4043  +    esac
         4044  +    if test "$solaris_use_stlport4" != yes; then
         4045  +      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
         4046  +    fi
         4047  +    ;;
         4048  +  esac
         4049  +  ;;
         4050  +
         4051  +solaris*)
         4052  +  case $cc_basename in
         4053  +  CC*)
         4054  +    # The more standards-conforming stlport4 library is
         4055  +    # incompatible with the Cstd library. Avoid specifying
         4056  +    # it if it's in CXXFLAGS. Ignore libCrun as
         4057  +    # -library=stlport4 depends on it.
         4058  +    case " $CXX $CXXFLAGS " in
         4059  +    *" -library=stlport4 "*)
         4060  +      solaris_use_stlport4=yes
         4061  +      ;;
         4062  +    esac
         4063  +
         4064  +    # Adding this requires a known-good setup of shared libraries for
         4065  +    # Sun compiler versions before 5.6, else PIC objects from an old
         4066  +    # archive will be linked into the output, leading to subtle bugs.
         4067  +    if test "$solaris_use_stlport4" != yes; then
         4068  +      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
         4069  +    fi
         4070  +    ;;
         4071  +  esac
         4072  +  ;;
         4073  +esac
         4074  +])
         4075  +case " $_LT_AC_TAGVAR(postdeps, $1) " in
         4076  +*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
         4077  +esac
         4078  +])# AC_LIBTOOL_POSTDEP_PREDEP
         4079  +
         4080  +# AC_LIBTOOL_LANG_F77_CONFIG
         4081  +# --------------------------
         4082  +# Ensure that the configuration vars for the C compiler are
         4083  +# suitably defined.  Those variables are subsequently used by
         4084  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         4085  +AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
         4086  +AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
         4087  +[AC_REQUIRE([AC_PROG_F77])
         4088  +AC_LANG_PUSH(Fortran 77)
         4089  +
         4090  +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         4091  +_LT_AC_TAGVAR(allow_undefined_flag, $1)=
         4092  +_LT_AC_TAGVAR(always_export_symbols, $1)=no
         4093  +_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
         4094  +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         4095  +_LT_AC_TAGVAR(hardcode_direct, $1)=no
         4096  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         4097  +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
         4098  +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         4099  +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
         4100  +_LT_AC_TAGVAR(hardcode_automatic, $1)=no
         4101  +_LT_AC_TAGVAR(module_cmds, $1)=
         4102  +_LT_AC_TAGVAR(module_expsym_cmds, $1)=
         4103  +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
         4104  +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
         4105  +_LT_AC_TAGVAR(no_undefined_flag, $1)=
         4106  +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         4107  +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
         4108  +
         4109  +# Source file extension for f77 test sources.
         4110  +ac_ext=f
         4111  +
         4112  +# Object file extension for compiled f77 test sources.
         4113  +objext=o
         4114  +_LT_AC_TAGVAR(objext, $1)=$objext
         4115  +
         4116  +# Code to be used in simple compile tests
         4117  +lt_simple_compile_test_code="\
         4118  +      subroutine t
         4119  +      return
         4120  +      end
         4121  +"
         4122  +
         4123  +# Code to be used in simple link tests
         4124  +lt_simple_link_test_code="\
         4125  +      program t
         4126  +      end
         4127  +"
         4128  +
         4129  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         4130  +_LT_AC_SYS_COMPILER
         4131  +
         4132  +# save warnings/boilerplate of simple test code
         4133  +_LT_COMPILER_BOILERPLATE
         4134  +_LT_LINKER_BOILERPLATE
         4135  +
         4136  +# Allow CC to be a program name with arguments.
         4137  +lt_save_CC="$CC"
         4138  +CC=${F77-"f77"}
         4139  +compiler=$CC
         4140  +_LT_AC_TAGVAR(compiler, $1)=$CC
         4141  +_LT_CC_BASENAME([$compiler])
         4142  +
         4143  +AC_MSG_CHECKING([if libtool supports shared libraries])
         4144  +AC_MSG_RESULT([$can_build_shared])
         4145  +
         4146  +AC_MSG_CHECKING([whether to build shared libraries])
         4147  +test "$can_build_shared" = "no" && enable_shared=no
         4148  +
         4149  +# On AIX, shared libraries and static libraries use the same namespace, and
         4150  +# are all built from PIC.
         4151  +case $host_os in
         4152  +aix3*)
         4153  +  test "$enable_shared" = yes && enable_static=no
         4154  +  if test -n "$RANLIB"; then
         4155  +    archive_cmds="$archive_cmds~\$RANLIB \$lib"
         4156  +    postinstall_cmds='$RANLIB $lib'
         4157  +  fi
         4158  +  ;;
         4159  +aix[[4-9]]*)
         4160  +  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
         4161  +    test "$enable_shared" = yes && enable_static=no
         4162  +  fi
         4163  +  ;;
         4164  +esac
         4165  +AC_MSG_RESULT([$enable_shared])
         4166  +
         4167  +AC_MSG_CHECKING([whether to build static libraries])
         4168  +# Make sure either enable_shared or enable_static is yes.
         4169  +test "$enable_shared" = yes || enable_static=yes
         4170  +AC_MSG_RESULT([$enable_static])
         4171  +
         4172  +_LT_AC_TAGVAR(GCC, $1)="$G77"
         4173  +_LT_AC_TAGVAR(LD, $1)="$LD"
         4174  +
         4175  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         4176  +AC_LIBTOOL_PROG_CC_C_O($1)
         4177  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         4178  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         4179  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         4180  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         4181  +
         4182  +AC_LIBTOOL_CONFIG($1)
         4183  +
         4184  +AC_LANG_POP
         4185  +CC="$lt_save_CC"
         4186  +])# AC_LIBTOOL_LANG_F77_CONFIG
         4187  +
         4188  +
         4189  +# AC_LIBTOOL_LANG_GCJ_CONFIG
         4190  +# --------------------------
         4191  +# Ensure that the configuration vars for the C compiler are
         4192  +# suitably defined.  Those variables are subsequently used by
         4193  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         4194  +AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
         4195  +AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
         4196  +[AC_LANG_SAVE
         4197  +
         4198  +# Source file extension for Java test sources.
         4199  +ac_ext=java
         4200  +
         4201  +# Object file extension for compiled Java test sources.
         4202  +objext=o
         4203  +_LT_AC_TAGVAR(objext, $1)=$objext
         4204  +
         4205  +# Code to be used in simple compile tests
         4206  +lt_simple_compile_test_code="class foo {}"
         4207  +
         4208  +# Code to be used in simple link tests
         4209  +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
         4210  +
         4211  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         4212  +_LT_AC_SYS_COMPILER
         4213  +
         4214  +# save warnings/boilerplate of simple test code
         4215  +_LT_COMPILER_BOILERPLATE
         4216  +_LT_LINKER_BOILERPLATE
         4217  +
         4218  +# Allow CC to be a program name with arguments.
         4219  +lt_save_CC="$CC"
         4220  +CC=${GCJ-"gcj"}
         4221  +compiler=$CC
         4222  +_LT_AC_TAGVAR(compiler, $1)=$CC
         4223  +_LT_CC_BASENAME([$compiler])
         4224  +
         4225  +# GCJ did not exist at the time GCC didn't implicitly link libc in.
         4226  +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         4227  +
         4228  +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
         4229  +
         4230  +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
         4231  +AC_LIBTOOL_PROG_COMPILER_PIC($1)
         4232  +AC_LIBTOOL_PROG_CC_C_O($1)
         4233  +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
         4234  +AC_LIBTOOL_PROG_LD_SHLIBS($1)
         4235  +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
         4236  +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
         4237  +
         4238  +AC_LIBTOOL_CONFIG($1)
         4239  +
         4240  +AC_LANG_RESTORE
         4241  +CC="$lt_save_CC"
         4242  +])# AC_LIBTOOL_LANG_GCJ_CONFIG
         4243  +
         4244  +
         4245  +# AC_LIBTOOL_LANG_RC_CONFIG
         4246  +# -------------------------
         4247  +# Ensure that the configuration vars for the Windows resource compiler are
         4248  +# suitably defined.  Those variables are subsequently used by
         4249  +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
         4250  +AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
         4251  +AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
         4252  +[AC_LANG_SAVE
         4253  +
         4254  +# Source file extension for RC test sources.
         4255  +ac_ext=rc
         4256  +
         4257  +# Object file extension for compiled RC test sources.
         4258  +objext=o
         4259  +_LT_AC_TAGVAR(objext, $1)=$objext
         4260  +
         4261  +# Code to be used in simple compile tests
         4262  +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
         4263  +
         4264  +# Code to be used in simple link tests
         4265  +lt_simple_link_test_code="$lt_simple_compile_test_code"
         4266  +
         4267  +# ltmain only uses $CC for tagged configurations so make sure $CC is set.
         4268  +_LT_AC_SYS_COMPILER
         4269  +
         4270  +# save warnings/boilerplate of simple test code
         4271  +_LT_COMPILER_BOILERPLATE
         4272  +_LT_LINKER_BOILERPLATE
         4273  +
         4274  +# Allow CC to be a program name with arguments.
         4275  +lt_save_CC="$CC"
         4276  +CC=${RC-"windres"}
         4277  +compiler=$CC
         4278  +_LT_AC_TAGVAR(compiler, $1)=$CC
         4279  +_LT_CC_BASENAME([$compiler])
         4280  +_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
         4281  +
         4282  +AC_LIBTOOL_CONFIG($1)
         4283  +
         4284  +AC_LANG_RESTORE
         4285  +CC="$lt_save_CC"
         4286  +])# AC_LIBTOOL_LANG_RC_CONFIG
         4287  +
         4288  +
         4289  +# AC_LIBTOOL_CONFIG([TAGNAME])
         4290  +# ----------------------------
         4291  +# If TAGNAME is not passed, then create an initial libtool script
         4292  +# with a default configuration from the untagged config vars.  Otherwise
         4293  +# add code to config.status for appending the configuration named by
         4294  +# TAGNAME from the matching tagged config vars.
         4295  +AC_DEFUN([AC_LIBTOOL_CONFIG],
         4296  +[# The else clause should only fire when bootstrapping the
         4297  +# libtool distribution, otherwise you forgot to ship ltmain.sh
         4298  +# with your package, and you will get complaints that there are
         4299  +# no rules to generate ltmain.sh.
         4300  +if test -f "$ltmain"; then
         4301  +  # See if we are running on zsh, and set the options which allow our commands through
         4302  +  # without removal of \ escapes.
         4303  +  if test -n "${ZSH_VERSION+set}" ; then
         4304  +    setopt NO_GLOB_SUBST
         4305  +  fi
         4306  +  # Now quote all the things that may contain metacharacters while being
         4307  +  # careful not to overquote the AC_SUBSTed values.  We take copies of the
         4308  +  # variables and quote the copies for generation of the libtool script.
         4309  +  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
         4310  +    SED SHELL STRIP \
         4311  +    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
         4312  +    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
         4313  +    deplibs_check_method reload_flag reload_cmds need_locks \
         4314  +    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
         4315  +    lt_cv_sys_global_symbol_to_c_name_address \
         4316  +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
         4317  +    old_postinstall_cmds old_postuninstall_cmds \
         4318  +    _LT_AC_TAGVAR(compiler, $1) \
         4319  +    _LT_AC_TAGVAR(CC, $1) \
         4320  +    _LT_AC_TAGVAR(LD, $1) \
         4321  +    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
         4322  +    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
         4323  +    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
         4324  +    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
         4325  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
         4326  +    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
         4327  +    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
         4328  +    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
         4329  +    _LT_AC_TAGVAR(old_archive_cmds, $1) \
         4330  +    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
         4331  +    _LT_AC_TAGVAR(predep_objects, $1) \
         4332  +    _LT_AC_TAGVAR(postdep_objects, $1) \
         4333  +    _LT_AC_TAGVAR(predeps, $1) \
         4334  +    _LT_AC_TAGVAR(postdeps, $1) \
         4335  +    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
         4336  +    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
         4337  +    _LT_AC_TAGVAR(archive_cmds, $1) \
         4338  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
         4339  +    _LT_AC_TAGVAR(postinstall_cmds, $1) \
         4340  +    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
         4341  +    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
         4342  +    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
         4343  +    _LT_AC_TAGVAR(no_undefined_flag, $1) \
         4344  +    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
         4345  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
         4346  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
         4347  +    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
         4348  +    _LT_AC_TAGVAR(hardcode_automatic, $1) \
         4349  +    _LT_AC_TAGVAR(module_cmds, $1) \
         4350  +    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
         4351  +    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
         4352  +    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
         4353  +    _LT_AC_TAGVAR(exclude_expsyms, $1) \
         4354  +    _LT_AC_TAGVAR(include_expsyms, $1); do
         4355  +
         4356  +    case $var in
         4357  +    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
         4358  +    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
         4359  +    _LT_AC_TAGVAR(archive_cmds, $1) | \
         4360  +    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
         4361  +    _LT_AC_TAGVAR(module_cmds, $1) | \
         4362  +    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
         4363  +    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
         4364  +    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
         4365  +    extract_expsyms_cmds | reload_cmds | finish_cmds | \
         4366  +    postinstall_cmds | postuninstall_cmds | \
         4367  +    old_postinstall_cmds | old_postuninstall_cmds | \
         4368  +    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
         4369  +      # Double-quote double-evaled strings.
         4370  +      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
         4371  +      ;;
         4372  +    *)
         4373  +      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
         4374  +      ;;
         4375  +    esac
         4376  +  done
         4377  +
         4378  +  case $lt_echo in
         4379  +  *'\[$]0 --fallback-echo"')
         4380  +    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
         4381  +    ;;
         4382  +  esac
         4383  +
         4384  +ifelse([$1], [],
         4385  +  [cfgfile="${ofile}T"
         4386  +  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
         4387  +  $rm -f "$cfgfile"
         4388  +  AC_MSG_NOTICE([creating $ofile])],
         4389  +  [cfgfile="$ofile"])
         4390  +
         4391  +  cat <<__EOF__ >> "$cfgfile"
         4392  +ifelse([$1], [],
         4393  +[#! $SHELL
         4394  +
         4395  +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
         4396  +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
         4397  +# NOTE: Changes made to this file will be lost: look at ltmain.sh.
         4398  +#
         4399  +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
         4400  +# Free Software Foundation, Inc.
         4401  +#
         4402  +# This file is part of GNU Libtool:
         4403  +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
         4404  +#
         4405  +# This program is free software; you can redistribute it and/or modify
         4406  +# it under the terms of the GNU General Public License as published by
         4407  +# the Free Software Foundation; either version 2 of the License, or
         4408  +# (at your option) any later version.
         4409  +#
         4410  +# This program is distributed in the hope that it will be useful, but
         4411  +# WITHOUT ANY WARRANTY; without even the implied warranty of
         4412  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
         4413  +# General Public License for more details.
         4414  +#
         4415  +# You should have received a copy of the GNU General Public License
         4416  +# along with this program; if not, write to the Free Software
         4417  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
         4418  +#
         4419  +# As a special exception to the GNU General Public License, if you
         4420  +# distribute this file as part of a program that contains a
         4421  +# configuration script generated by Autoconf, you may include it under
         4422  +# the same distribution terms that you use for the rest of that program.
         4423  +
         4424  +# A sed program that does not truncate output.
         4425  +SED=$lt_SED
         4426  +
         4427  +# Sed that helps us avoid accidentally triggering echo(1) options like -n.
         4428  +Xsed="$SED -e 1s/^X//"
         4429  +
         4430  +# The HP-UX ksh and POSIX shell print the target directory to stdout
         4431  +# if CDPATH is set.
         4432  +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
         4433  +
         4434  +# The names of the tagged configurations supported by this script.
         4435  +available_tags=
         4436  +
         4437  +# ### BEGIN LIBTOOL CONFIG],
         4438  +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
         4439  +
         4440  +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
         4441  +
         4442  +# Shell to use when invoking shell scripts.
         4443  +SHELL=$lt_SHELL
         4444  +
         4445  +# Whether or not to build shared libraries.
         4446  +build_libtool_libs=$enable_shared
         4447  +
         4448  +# Whether or not to build static libraries.
         4449  +build_old_libs=$enable_static
         4450  +
         4451  +# Whether or not to add -lc for building shared libraries.
         4452  +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
         4453  +
         4454  +# Whether or not to disallow shared libs when runtime libs are static
         4455  +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
         4456  +
         4457  +# Whether or not to optimize for fast installation.
         4458  +fast_install=$enable_fast_install
         4459  +
         4460  +# The host system.
         4461  +host_alias=$host_alias
         4462  +host=$host
         4463  +host_os=$host_os
         4464  +
         4465  +# The build system.
         4466  +build_alias=$build_alias
         4467  +build=$build
         4468  +build_os=$build_os
         4469  +
         4470  +# An echo program that does not interpret backslashes.
         4471  +echo=$lt_echo
         4472  +
         4473  +# The archiver.
         4474  +AR=$lt_AR
         4475  +AR_FLAGS=$lt_AR_FLAGS
         4476  +
         4477  +# A C compiler.
         4478  +LTCC=$lt_LTCC
         4479  +
         4480  +# LTCC compiler flags.
         4481  +LTCFLAGS=$lt_LTCFLAGS
         4482  +
         4483  +# A language-specific compiler.
         4484  +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
         4485  +
         4486  +# Is the compiler the GNU C compiler?
         4487  +with_gcc=$_LT_AC_TAGVAR(GCC, $1)
         4488  +
         4489  +# An ERE matcher.
         4490  +EGREP=$lt_EGREP
         4491  +
         4492  +# The linker used to build libraries.
         4493  +LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
         4494  +
         4495  +# Whether we need hard or soft links.
         4496  +LN_S=$lt_LN_S
         4497  +
         4498  +# A BSD-compatible nm program.
         4499  +NM=$lt_NM
         4500  +
         4501  +# A symbol stripping program
         4502  +STRIP=$lt_STRIP
         4503  +
         4504  +# Used to examine libraries when file_magic_cmd begins "file"
         4505  +MAGIC_CMD=$MAGIC_CMD
         4506  +
         4507  +# Used on cygwin: DLL creation program.
         4508  +DLLTOOL="$DLLTOOL"
         4509  +
         4510  +# Used on cygwin: object dumper.
         4511  +OBJDUMP="$OBJDUMP"
         4512  +
         4513  +# Used on cygwin: assembler.
         4514  +AS="$AS"
         4515  +
         4516  +# The name of the directory that contains temporary libtool files.
         4517  +objdir=$objdir
         4518  +
         4519  +# How to create reloadable object files.
         4520  +reload_flag=$lt_reload_flag
         4521  +reload_cmds=$lt_reload_cmds
         4522  +
         4523  +# How to pass a linker flag through the compiler.
         4524  +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
         4525  +
         4526  +# Object file suffix (normally "o").
         4527  +objext="$ac_objext"
         4528  +
         4529  +# Old archive suffix (normally "a").
         4530  +libext="$libext"
         4531  +
         4532  +# Shared library suffix (normally ".so").
         4533  +shrext_cmds='$shrext_cmds'
         4534  +
         4535  +# Executable file suffix (normally "").
         4536  +exeext="$exeext"
         4537  +
         4538  +# Additional compiler flags for building library objects.
         4539  +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
         4540  +pic_mode=$pic_mode
         4541  +
         4542  +# What is the maximum length of a command?
         4543  +max_cmd_len=$lt_cv_sys_max_cmd_len
         4544  +
         4545  +# Does compiler simultaneously support -c and -o options?
         4546  +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
         4547  +
         4548  +# Must we lock files when doing compilation?
         4549  +need_locks=$lt_need_locks
         4550  +
         4551  +# Do we need the lib prefix for modules?
         4552  +need_lib_prefix=$need_lib_prefix
         4553  +
         4554  +# Do we need a version for libraries?
         4555  +need_version=$need_version
         4556  +
         4557  +# Whether dlopen is supported.
         4558  +dlopen_support=$enable_dlopen
         4559  +
         4560  +# Whether dlopen of programs is supported.
         4561  +dlopen_self=$enable_dlopen_self
         4562  +
         4563  +# Whether dlopen of statically linked programs is supported.
         4564  +dlopen_self_static=$enable_dlopen_self_static
         4565  +
         4566  +# Compiler flag to prevent dynamic linking.
         4567  +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
         4568  +
         4569  +# Compiler flag to turn off builtin functions.
         4570  +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
         4571  +
         4572  +# Compiler flag to allow reflexive dlopens.
         4573  +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
         4574  +
         4575  +# Compiler flag to generate shared objects directly from archives.
         4576  +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
         4577  +
         4578  +# Compiler flag to generate thread-safe objects.
         4579  +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
         4580  +
         4581  +# Library versioning type.
         4582  +version_type=$version_type
         4583  +
         4584  +# Format of library name prefix.
         4585  +libname_spec=$lt_libname_spec
         4586  +
         4587  +# List of archive names.  First name is the real one, the rest are links.
         4588  +# The last name is the one that the linker finds with -lNAME.
         4589  +library_names_spec=$lt_library_names_spec
         4590  +
         4591  +# The coded name of the library, if different from the real name.
         4592  +soname_spec=$lt_soname_spec
         4593  +
         4594  +# Commands used to build and install an old-style archive.
         4595  +RANLIB=$lt_RANLIB
         4596  +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
         4597  +old_postinstall_cmds=$lt_old_postinstall_cmds
         4598  +old_postuninstall_cmds=$lt_old_postuninstall_cmds
         4599  +
         4600  +# Create an old-style archive from a shared archive.
         4601  +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
         4602  +
         4603  +# Create a temporary old-style archive to link instead of a shared archive.
         4604  +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
         4605  +
         4606  +# Commands used to build and install a shared archive.
         4607  +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
         4608  +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
         4609  +postinstall_cmds=$lt_postinstall_cmds
         4610  +postuninstall_cmds=$lt_postuninstall_cmds
         4611  +
         4612  +# Commands used to build a loadable module (assumed same as above if empty)
         4613  +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
         4614  +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
         4615  +
         4616  +# Commands to strip libraries.
         4617  +old_striplib=$lt_old_striplib
         4618  +striplib=$lt_striplib
         4619  +
         4620  +# Dependencies to place before the objects being linked to create a
         4621  +# shared library.
         4622  +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
         4623  +
         4624  +# Dependencies to place after the objects being linked to create a
         4625  +# shared library.
         4626  +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
         4627  +
         4628  +# Dependencies to place before the objects being linked to create a
         4629  +# shared library.
         4630  +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
         4631  +
         4632  +# Dependencies to place after the objects being linked to create a
         4633  +# shared library.
         4634  +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
         4635  +
         4636  +# The directories searched by this compiler when creating a shared
         4637  +# library
         4638  +compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
         4639  +
         4640  +# The library search path used internally by the compiler when linking
         4641  +# a shared library.
         4642  +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
         4643  +
         4644  +# Method to check whether dependent libraries are shared objects.
         4645  +deplibs_check_method=$lt_deplibs_check_method
         4646  +
         4647  +# Command to use when deplibs_check_method == file_magic.
         4648  +file_magic_cmd=$lt_file_magic_cmd
         4649  +
         4650  +# Flag that allows shared libraries with undefined symbols to be built.
         4651  +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
         4652  +
         4653  +# Flag that forces no undefined symbols.
         4654  +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
         4655  +
         4656  +# Commands used to finish a libtool library installation in a directory.
         4657  +finish_cmds=$lt_finish_cmds
         4658  +
         4659  +# Same as above, but a single script fragment to be evaled but not shown.
         4660  +finish_eval=$lt_finish_eval
         4661  +
         4662  +# Take the output of nm and produce a listing of raw symbols and C names.
         4663  +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
         4664  +
         4665  +# Transform the output of nm in a proper C declaration
         4666  +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
         4667  +
         4668  +# Transform the output of nm in a C name address pair
         4669  +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
         4670  +
         4671  +# This is the shared library runtime path variable.
         4672  +runpath_var=$runpath_var
         4673  +
         4674  +# This is the shared library path variable.
         4675  +shlibpath_var=$shlibpath_var
         4676  +
         4677  +# Is shlibpath searched before the hard-coded library search path?
         4678  +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
         4679  +
         4680  +# How to hardcode a shared library path into an executable.
         4681  +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
         4682  +
         4683  +# Whether we should hardcode library paths into libraries.
         4684  +hardcode_into_libs=$hardcode_into_libs
         4685  +
         4686  +# Flag to hardcode \$libdir into a binary during linking.
         4687  +# This must work even if \$libdir does not exist.
         4688  +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
         4689  +
         4690  +# If ld is used when linking, flag to hardcode \$libdir into
         4691  +# a binary during linking. This must work even if \$libdir does
         4692  +# not exist.
         4693  +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
         4694  +
         4695  +# Whether we need a single -rpath flag with a separated argument.
         4696  +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
         4697  +
         4698  +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
         4699  +# resulting binary.
         4700  +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
         4701  +
         4702  +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
         4703  +# resulting binary.
         4704  +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
         4705  +
         4706  +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
         4707  +# the resulting binary.
         4708  +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
         4709  +
         4710  +# Set to yes if building a shared library automatically hardcodes DIR into the library
         4711  +# and all subsequent libraries and executables linked against it.
         4712  +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
         4713  +
         4714  +# Variables whose values should be saved in libtool wrapper scripts and
         4715  +# restored at relink time.
         4716  +variables_saved_for_relink="$variables_saved_for_relink"
         4717  +
         4718  +# Whether libtool must link a program against all its dependency libraries.
         4719  +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
         4720  +
         4721  +# Compile-time system search path for libraries
         4722  +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
         4723  +
         4724  +# Run-time system search path for libraries
         4725  +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
         4726  +
         4727  +# Fix the shell variable \$srcfile for the compiler.
         4728  +fix_srcfile_path=$lt_fix_srcfile_path
         4729  +
         4730  +# Set to yes if exported symbols are required.
         4731  +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
         4732  +
         4733  +# The commands to list exported symbols.
         4734  +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
         4735  +
         4736  +# The commands to extract the exported symbol list from a shared archive.
         4737  +extract_expsyms_cmds=$lt_extract_expsyms_cmds
         4738  +
         4739  +# Symbols that should not be listed in the preloaded symbols.
         4740  +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
         4741  +
         4742  +# Symbols that must always be exported.
         4743  +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
         4744  +
         4745  +ifelse([$1],[],
         4746  +[# ### END LIBTOOL CONFIG],
         4747  +[# ### END LIBTOOL TAG CONFIG: $tagname])
         4748  +
         4749  +__EOF__
         4750  +
         4751  +ifelse([$1],[], [
         4752  +  case $host_os in
         4753  +  aix3*)
         4754  +    cat <<\EOF >> "$cfgfile"
         4755  +
         4756  +# AIX sometimes has problems with the GCC collect2 program.  For some
         4757  +# reason, if we set the COLLECT_NAMES environment variable, the problems
         4758  +# vanish in a puff of smoke.
         4759  +if test "X${COLLECT_NAMES+set}" != Xset; then
         4760  +  COLLECT_NAMES=
         4761  +  export COLLECT_NAMES
         4762  +fi
         4763  +EOF
         4764  +    ;;
         4765  +  esac
         4766  +
         4767  +  # We use sed instead of cat because bash on DJGPP gets confused if
         4768  +  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
         4769  +  # text mode, it properly converts lines to CR/LF.  This bash problem
         4770  +  # is reportedly fixed, but why not run on old versions too?
         4771  +  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
         4772  +
         4773  +  mv -f "$cfgfile" "$ofile" || \
         4774  +    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
         4775  +  chmod +x "$ofile"
         4776  +])
         4777  +else
         4778  +  # If there is no Makefile yet, we rely on a make rule to execute
         4779  +  # `config.status --recheck' to rerun these tests and create the
         4780  +  # libtool script then.
         4781  +  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
         4782  +  if test -f "$ltmain_in"; then
         4783  +    test -f Makefile && make "$ltmain"
         4784  +  fi
         4785  +fi
         4786  +])# AC_LIBTOOL_CONFIG
         4787  +
         4788  +
         4789  +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
         4790  +# -------------------------------------------
         4791  +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
         4792  +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
         4793  +
         4794  +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  3312   4795   
  3313   4796   if test "$GCC" = yes; then
  3314         -  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
         4797  +  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  3315   4798   
  3316         -  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
         4799  +  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
  3317   4800       lt_cv_prog_compiler_rtti_exceptions,
  3318   4801       [-fno-rtti -fno-exceptions], [],
  3319         -    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
         4802  +    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
  3320   4803   fi
  3321         -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
  3322         -	[Compiler flag to turn off builtin functions])
  3323         -])# _LT_COMPILER_NO_RTTI
         4804  +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
  3324   4805   
  3325   4806   
  3326         -# _LT_CMD_GLOBAL_SYMBOLS
  3327         -# ----------------------
  3328         -m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
  3329         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3330         -AC_REQUIRE([AC_PROG_CC])dnl
  3331         -AC_REQUIRE([LT_PATH_NM])dnl
  3332         -AC_REQUIRE([LT_PATH_LD])dnl
  3333         -m4_require([_LT_DECL_SED])dnl
  3334         -m4_require([_LT_DECL_EGREP])dnl
  3335         -m4_require([_LT_TAG_COMPILER])dnl
  3336         -
         4807  +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
         4808  +# ---------------------------------
         4809  +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
         4810  +[AC_REQUIRE([AC_CANONICAL_HOST])
         4811  +AC_REQUIRE([LT_AC_PROG_SED])
         4812  +AC_REQUIRE([AC_PROG_NM])
         4813  +AC_REQUIRE([AC_OBJEXT])
  3337   4814   # Check for command to grab the raw symbol name followed by C symbol from nm.
  3338   4815   AC_MSG_CHECKING([command to parse $NM output from $compiler object])
  3339   4816   AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
  3340   4817   [
  3341   4818   # These are sane defaults that work on at least a few old systems.
  3342   4819   # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
  3343   4820   
  3344   4821   # Character class describing NM global symbol codes.
  3345   4822   symcode='[[BCDEGRST]]'
  3346   4823   
  3347   4824   # Regexp to match symbols that can be accessed directly from C.
  3348   4825   sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
  3349   4826   
         4827  +# Transform an extracted symbol line into a proper C declaration
         4828  +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
         4829  +
         4830  +# Transform an extracted symbol line into symbol name and symbol address
         4831  +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
         4832  +
  3350   4833   # Define system-specific variables.
  3351   4834   case $host_os in
  3352   4835   aix*)
  3353   4836     symcode='[[BCDT]]'
  3354   4837     ;;
  3355         -cygwin* | mingw* | pw32* | cegcc*)
         4838  +cygwin* | mingw* | pw32*)
  3356   4839     symcode='[[ABCDGISTW]]'
  3357   4840     ;;
  3358         -hpux*)
         4841  +hpux*) # Its linker distinguishes data from code symbols
  3359   4842     if test "$host_cpu" = ia64; then
  3360   4843       symcode='[[ABCDEGRST]]'
  3361   4844     fi
         4845  +  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
         4846  +  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
         4847  +  ;;
         4848  +linux* | k*bsd*-gnu)
         4849  +  if test "$host_cpu" = ia64; then
         4850  +    symcode='[[ABCDGIRSTW]]'
         4851  +    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
         4852  +    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
         4853  +  fi
  3362   4854     ;;
  3363   4855   irix* | nonstopux*)
  3364   4856     symcode='[[BCDEGRST]]'
  3365   4857     ;;
  3366   4858   osf*)
  3367   4859     symcode='[[BCDEGQRST]]'
  3368   4860     ;;
................................................................................
  3378   4870   sysv5* | sco5v6* | unixware* | OpenUNIX*)
  3379   4871     symcode='[[ABDT]]'
  3380   4872     ;;
  3381   4873   sysv4)
  3382   4874     symcode='[[DFNSTU]]'
  3383   4875     ;;
  3384   4876   esac
         4877  +
         4878  +# Handle CRLF in mingw tool chain
         4879  +opt_cr=
         4880  +case $build_os in
         4881  +mingw*)
         4882  +  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
         4883  +  ;;
         4884  +esac
  3385   4885   
  3386   4886   # If we're using GNU nm, then use its standard symbol codes.
  3387   4887   case `$NM -V 2>&1` in
  3388   4888   *GNU* | *'with BFD'*)
  3389   4889     symcode='[[ABCDGIRSTW]]' ;;
  3390   4890   esac
  3391   4891   
  3392         -# Transform an extracted symbol line into a proper C declaration.
  3393         -# Some systems (esp. on ia64) link data and code symbols differently,
  3394         -# so use this general approach.
  3395         -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
  3396         -
  3397         -# Transform an extracted symbol line into symbol name and symbol address
  3398         -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
  3399         -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
  3400         -
  3401         -# Handle CRLF in mingw tool chain
  3402         -opt_cr=
  3403         -case $build_os in
  3404         -mingw*)
  3405         -  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
  3406         -  ;;
  3407         -esac
  3408         -
  3409         -# Try without a prefix underscore, then with it.
         4892  +# Try without a prefix undercore, then with it.
  3410   4893   for ac_symprfx in "" "_"; do
  3411   4894   
  3412   4895     # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
  3413   4896     symxfrm="\\1 $ac_symprfx\\2 \\2"
  3414   4897   
  3415   4898     # Write the raw and C identifiers.
  3416         -  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
  3417         -    # Fake it for dumpbin and say T for any non-static function
  3418         -    # and D for any global variable.
  3419         -    # Also find C++ and __fastcall symbols from MSVC++,
  3420         -    # which start with @ or ?.
  3421         -    lt_cv_sys_global_symbol_pipe="$AWK ['"\
  3422         -"     {last_section=section; section=\$ 3};"\
  3423         -"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
  3424         -"     \$ 0!~/External *\|/{next};"\
  3425         -"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
  3426         -"     {if(hide[section]) next};"\
  3427         -"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
  3428         -"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
  3429         -"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
  3430         -"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
  3431         -"     ' prfx=^$ac_symprfx]"
  3432         -  else
  3433         -    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
  3434         -  fi
         4899  +  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
  3435   4900   
  3436   4901     # Check to see that the pipe works correctly.
  3437   4902     pipe_works=no
  3438   4903   
  3439   4904     rm -f conftest*
  3440         -  cat > conftest.$ac_ext <<_LT_EOF
         4905  +  cat > conftest.$ac_ext <<EOF
  3441   4906   #ifdef __cplusplus
  3442   4907   extern "C" {
  3443   4908   #endif
  3444   4909   char nm_test_var;
  3445         -void nm_test_func(void);
  3446         -void nm_test_func(void){}
         4910  +void nm_test_func(){}
  3447   4911   #ifdef __cplusplus
  3448   4912   }
  3449   4913   #endif
  3450   4914   int main(){nm_test_var='a';nm_test_func();return(0);}
  3451         -_LT_EOF
         4915  +EOF
  3452   4916   
  3453   4917     if AC_TRY_EVAL(ac_compile); then
  3454   4918       # Now try to grab the symbols.
  3455   4919       nlist=conftest.nm
  3456   4920       if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
  3457   4921         # Try sorting and uniquifying the output.
  3458   4922         if sort "$nlist" | uniq > "$nlist"T; then
  3459   4923   	mv -f "$nlist"T "$nlist"
  3460   4924         else
  3461   4925   	rm -f "$nlist"T
  3462   4926         fi
  3463   4927   
  3464   4928         # Make sure that we snagged all the symbols we need.
  3465         -      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
  3466         -	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
  3467         -	  cat <<_LT_EOF > conftest.$ac_ext
         4929  +      if grep ' nm_test_var$' "$nlist" >/dev/null; then
         4930  +	if grep ' nm_test_func$' "$nlist" >/dev/null; then
         4931  +	  cat <<EOF > conftest.$ac_ext
  3468   4932   #ifdef __cplusplus
  3469   4933   extern "C" {
  3470   4934   #endif
  3471   4935   
  3472         -_LT_EOF
         4936  +EOF
  3473   4937   	  # Now generate the symbol file.
  3474         -	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
         4938  +	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
  3475   4939   
  3476         -	  cat <<_LT_EOF >> conftest.$ac_ext
         4940  +	  cat <<EOF >> conftest.$ac_ext
         4941  +#if defined (__STDC__) && __STDC__
         4942  +# define lt_ptr_t void *
         4943  +#else
         4944  +# define lt_ptr_t char *
         4945  +# define const
         4946  +#endif
  3477   4947   
  3478         -/* The mapping between symbol names and symbols.  */
         4948  +/* The mapping between symbol names and symbols. */
  3479   4949   const struct {
  3480   4950     const char *name;
  3481         -  void       *address;
         4951  +  lt_ptr_t address;
  3482   4952   }
  3483         -lt__PROGRAM__LTX_preloaded_symbols[[]] =
         4953  +lt_preloaded_symbols[[]] =
  3484   4954   {
  3485         -  { "@PROGRAM@", (void *) 0 },
  3486         -_LT_EOF
  3487         -	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
  3488         -	  cat <<\_LT_EOF >> conftest.$ac_ext
  3489         -  {0, (void *) 0}
         4955  +EOF
         4956  +	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
         4957  +	  cat <<\EOF >> conftest.$ac_ext
         4958  +  {0, (lt_ptr_t) 0}
  3490   4959   };
  3491   4960   
  3492         -/* This works around a problem in FreeBSD linker */
  3493         -#ifdef FREEBSD_WORKAROUND
  3494         -static const void *lt_preloaded_setup() {
  3495         -  return lt__PROGRAM__LTX_preloaded_symbols;
  3496         -}
  3497         -#endif
  3498         -
  3499   4961   #ifdef __cplusplus
  3500   4962   }
  3501   4963   #endif
  3502         -_LT_EOF
         4964  +EOF
  3503   4965   	  # Now try linking the two files.
  3504   4966   	  mv conftest.$ac_objext conftstm.$ac_objext
  3505   4967   	  lt_save_LIBS="$LIBS"
  3506   4968   	  lt_save_CFLAGS="$CFLAGS"
  3507   4969   	  LIBS="conftstm.$ac_objext"
  3508         -	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
         4970  +	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
  3509   4971   	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
  3510   4972   	    pipe_works=yes
  3511   4973   	  fi
  3512   4974   	  LIBS="$lt_save_LIBS"
  3513   4975   	  CFLAGS="$lt_save_CFLAGS"
  3514   4976   	else
  3515   4977   	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
................................................................................
  3538   5000     lt_cv_sys_global_symbol_to_cdecl=
  3539   5001   fi
  3540   5002   if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
  3541   5003     AC_MSG_RESULT(failed)
  3542   5004   else
  3543   5005     AC_MSG_RESULT(ok)
  3544   5006   fi
  3545         -
  3546         -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
  3547         -    [Take the output of nm and produce a listing of raw symbols and C names])
  3548         -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
  3549         -    [Transform the output of nm in a proper C declaration])
  3550         -_LT_DECL([global_symbol_to_c_name_address],
  3551         -    [lt_cv_sys_global_symbol_to_c_name_address], [1],
  3552         -    [Transform the output of nm in a C name address pair])
  3553         -_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
  3554         -    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
  3555         -    [Transform the output of nm in a C name address pair when lib prefix is needed])
  3556         -]) # _LT_CMD_GLOBAL_SYMBOLS
         5007  +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  3557   5008   
  3558   5009   
  3559         -# _LT_COMPILER_PIC([TAGNAME])
  3560         -# ---------------------------
  3561         -m4_defun([_LT_COMPILER_PIC],
  3562         -[m4_require([_LT_TAG_COMPILER])dnl
  3563         -_LT_TAGVAR(lt_prog_compiler_wl, $1)=
  3564         -_LT_TAGVAR(lt_prog_compiler_pic, $1)=
  3565         -_LT_TAGVAR(lt_prog_compiler_static, $1)=
         5010  +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
         5011  +# ---------------------------------------
         5012  +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
         5013  +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
         5014  +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5015  +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
  3566   5016   
  3567   5017   AC_MSG_CHECKING([for $compiler option to produce PIC])
  3568         -m4_if([$1], [CXX], [
         5018  + ifelse([$1],[CXX],[
  3569   5019     # C++ specific cases for pic, static, wl, etc.
  3570   5020     if test "$GXX" = yes; then
  3571         -    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3572         -    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5021  +    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5022  +    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  3573   5023   
  3574   5024       case $host_os in
  3575   5025       aix*)
  3576   5026         # All AIX code is PIC.
  3577   5027         if test "$host_cpu" = ia64; then
  3578   5028   	# AIX 5 now supports IA64 processor
  3579         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5029  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3580   5030         fi
  3581   5031         ;;
  3582         -
  3583   5032       amigaos*)
  3584         -      case $host_cpu in
  3585         -      powerpc)
  3586         -            # see comment about AmigaOS4 .so support
  3587         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3588         -        ;;
  3589         -      m68k)
  3590         -            # FIXME: we need at least 68020 code to build shared libraries, but
  3591         -            # adding the `-m68020' flag to GCC prevents building anything better,
  3592         -            # like `-m68040'.
  3593         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  3594         -        ;;
  3595         -      esac
         5033  +      # FIXME: we need at least 68020 code to build shared libraries, but
         5034  +      # adding the `-m68020' flag to GCC prevents building anything better,
         5035  +      # like `-m68040'.
         5036  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  3596   5037         ;;
  3597         -
  3598   5038       beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
  3599   5039         # PIC is the default for these OSes.
  3600   5040         ;;
  3601         -    mingw* | cygwin* | os2* | pw32* | cegcc*)
         5041  +    mingw* | cygwin* | os2* | pw32*)
  3602   5042         # This hack is so that the source file can tell whether it is being
  3603   5043         # built for inclusion in a dll (and should export symbols for example).
  3604   5044         # Although the cygwin gcc ignores -fPIC, still need this for old-style
  3605   5045         # (--disable-auto-import) libraries
  3606   5046         m4_if([$1], [GCJ], [],
  3607         -	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
         5047  +	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  3608   5048         ;;
  3609   5049       darwin* | rhapsody*)
  3610   5050         # PIC is the default on this platform
  3611   5051         # Common symbols not allowed in MH_DYLIB files
  3612         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
         5052  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  3613   5053         ;;
  3614   5054       *djgpp*)
  3615   5055         # DJGPP does not support shared libraries at all
  3616         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
         5056  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  3617   5057         ;;
  3618   5058       interix[[3-9]]*)
  3619   5059         # Interix 3.x gcc -fpic/-fPIC options generate broken code.
  3620   5060         # Instead, we relocate shared libraries at runtime.
  3621   5061         ;;
  3622   5062       sysv4*MP*)
  3623   5063         if test -d /usr/nec; then
  3624         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
         5064  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
  3625   5065         fi
  3626   5066         ;;
  3627   5067       hpux*)
  3628         -      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
  3629         -      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
  3630         -      # sets the default TLS model and affects inlining.
         5068  +      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
         5069  +      # not for PA HP-UX.
  3631   5070         case $host_cpu in
  3632         -      hppa*64*)
         5071  +      hppa*64*|ia64*)
  3633   5072   	;;
  3634   5073         *)
  3635         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5074  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3636   5075   	;;
  3637   5076         esac
  3638   5077         ;;
  3639         -    *qnx* | *nto*)
  3640         -      # QNX uses GNU C++, but need to define -shared option too, otherwise
  3641         -      # it will coredump.
  3642         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  3643         -      ;;
  3644   5078       *)
  3645         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5079  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3646   5080         ;;
  3647   5081       esac
  3648   5082     else
  3649   5083       case $host_os in
  3650   5084         aix[[4-9]]*)
  3651   5085   	# All AIX code is PIC.
  3652   5086   	if test "$host_cpu" = ia64; then
  3653   5087   	  # AIX 5 now supports IA64 processor
  3654         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5088  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3655   5089   	else
  3656         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
         5090  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  3657   5091   	fi
  3658   5092   	;;
  3659   5093         chorus*)
  3660   5094   	case $cc_basename in
  3661   5095   	cxch68*)
  3662   5096   	  # Green Hills C++ Compiler
  3663         -	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
         5097  +	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
  3664   5098   	  ;;
  3665   5099   	esac
  3666   5100   	;;
         5101  +       darwin*)
         5102  +         # PIC is the default on this platform
         5103  +         # Common symbols not allowed in MH_DYLIB files
         5104  +         case $cc_basename in
         5105  +           xlc*)
         5106  +           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
         5107  +           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5108  +           ;;
         5109  +         esac
         5110  +       ;;
  3667   5111         dgux*)
  3668   5112   	case $cc_basename in
  3669   5113   	  ec++*)
  3670         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5114  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3671   5115   	    ;;
  3672   5116   	  ghcx*)
  3673   5117   	    # Green Hills C++ Compiler
  3674         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5118  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  3675   5119   	    ;;
  3676   5120   	  *)
  3677   5121   	    ;;
  3678   5122   	esac
  3679   5123   	;;
  3680   5124         freebsd* | dragonfly*)
  3681   5125   	# FreeBSD uses GNU C++
  3682   5126   	;;
  3683   5127         hpux9* | hpux10* | hpux11*)
  3684   5128   	case $cc_basename in
  3685   5129   	  CC*)
  3686         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3687         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
         5130  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5131  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  3688   5132   	    if test "$host_cpu" != ia64; then
  3689         -	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
         5133  +	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  3690   5134   	    fi
  3691   5135   	    ;;
  3692   5136   	  aCC*)
  3693         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3694         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
         5137  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5138  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  3695   5139   	    case $host_cpu in
  3696   5140   	    hppa*64*|ia64*)
  3697   5141   	      # +Z the default
  3698   5142   	      ;;
  3699   5143   	    *)
  3700         -	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
         5144  +	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  3701   5145   	      ;;
  3702   5146   	    esac
  3703   5147   	    ;;
  3704   5148   	  *)
  3705   5149   	    ;;
  3706   5150   	esac
  3707   5151   	;;
................................................................................
  3708   5152         interix*)
  3709   5153   	# This is c89, which is MS Visual C++ (no shared libs)
  3710   5154   	# Anyone wants to do a port?
  3711   5155   	;;
  3712   5156         irix5* | irix6* | nonstopux*)
  3713   5157   	case $cc_basename in
  3714   5158   	  CC*)
  3715         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3716         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5159  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5160  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  3717   5161   	    # CC pic flag -KPIC is the default.
  3718   5162   	    ;;
  3719   5163   	  *)
  3720   5164   	    ;;
  3721   5165   	esac
  3722   5166   	;;
  3723         -      linux* | k*bsd*-gnu | kopensolaris*-gnu)
         5167  +      linux* | k*bsd*-gnu)
  3724   5168   	case $cc_basename in
  3725   5169   	  KCC*)
  3726   5170   	    # KAI C++ Compiler
  3727         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
  3728         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5171  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
         5172  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3729   5173   	    ;;
  3730         -	  ecpc* )
  3731         -	    # old Intel C++ for x86_64 which still supported -KPIC.
  3732         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3733         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3734         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  3735         -	    ;;
  3736         -	  icpc* )
  3737         -	    # Intel C++, used to be incompatible with GCC.
  3738         -	    # ICC 10 doesn't accept -KPIC any more.
  3739         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3740         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3741         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5174  +	  icpc* | ecpc*)
         5175  +	    # Intel C++
         5176  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5177  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5178  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  3742   5179   	    ;;
  3743   5180   	  pgCC* | pgcpp*)
  3744         -	    # Portland Group C++ compiler
  3745         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3746         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
  3747         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5181  +	    # Portland Group C++ compiler.
         5182  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5183  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
         5184  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3748   5185   	    ;;
  3749   5186   	  cxx*)
  3750   5187   	    # Compaq C++
  3751   5188   	    # Make sure the PIC flag is empty.  It appears that all Alpha
  3752   5189   	    # Linux and Compaq Tru64 Unix objects are PIC.
  3753         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  3754         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  3755         -	    ;;
  3756         -	  xlc* | xlC*)
  3757         -	    # IBM XL 8.0 on PPC
  3758         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3759         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
  3760         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
         5190  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5191  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  3761   5192   	    ;;
  3762   5193   	  *)
  3763   5194   	    case `$CC -V 2>&1 | sed 5q` in
  3764   5195   	    *Sun\ C*)
  3765   5196   	      # Sun C++ 5.9
  3766         -	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3767         -	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3768         -	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
         5197  +	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5198  +	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5199  +	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  3769   5200   	      ;;
  3770   5201   	    esac
  3771   5202   	    ;;
  3772   5203   	esac
  3773   5204   	;;
  3774   5205         lynxos*)
  3775   5206   	;;
  3776   5207         m88k*)
  3777   5208   	;;
  3778   5209         mvs*)
  3779   5210   	case $cc_basename in
  3780   5211   	  cxx*)
  3781         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
         5212  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
  3782   5213   	    ;;
  3783   5214   	  *)
  3784   5215   	    ;;
  3785   5216   	esac
  3786   5217   	;;
  3787   5218         netbsd* | netbsdelf*-gnu)
  3788   5219   	;;
  3789         -      *qnx* | *nto*)
  3790         -        # QNX uses GNU C++, but need to define -shared option too, otherwise
  3791         -        # it will coredump.
  3792         -        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  3793         -        ;;
  3794   5220         osf3* | osf4* | osf5*)
  3795   5221   	case $cc_basename in
  3796   5222   	  KCC*)
  3797         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
         5223  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
  3798   5224   	    ;;
  3799   5225   	  RCC*)
  3800   5226   	    # Rational C++ 2.4.1
  3801         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5227  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  3802   5228   	    ;;
  3803   5229   	  cxx*)
  3804   5230   	    # Digital/Compaq C++
  3805         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5231  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3806   5232   	    # Make sure the PIC flag is empty.  It appears that all Alpha
  3807   5233   	    # Linux and Compaq Tru64 Unix objects are PIC.
  3808         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  3809         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5234  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5235  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  3810   5236   	    ;;
  3811   5237   	  *)
  3812   5238   	    ;;
  3813   5239   	esac
  3814   5240   	;;
  3815   5241         psos*)
  3816   5242   	;;
  3817   5243         solaris*)
  3818   5244   	case $cc_basename in
  3819   5245   	  CC*)
  3820   5246   	    # Sun C++ 4.2, 5.x and Centerline C++
  3821         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3822         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3823         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
         5247  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5248  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5249  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  3824   5250   	    ;;
  3825   5251   	  gcx*)
  3826   5252   	    # Green Hills C++ Compiler
  3827         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
         5253  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  3828   5254   	    ;;
  3829   5255   	  *)
  3830   5256   	    ;;
  3831   5257   	esac
  3832   5258   	;;
  3833   5259         sunos4*)
  3834   5260   	case $cc_basename in
  3835   5261   	  CC*)
  3836   5262   	    # Sun C++ 4.x
  3837         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  3838         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5263  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5264  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3839   5265   	    ;;
  3840   5266   	  lcc*)
  3841   5267   	    # Lucid
  3842         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5268  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5269  +	    ;;
         5270  +	  *)
         5271  +	    ;;
         5272  +	esac
         5273  +	;;
         5274  +      tandem*)
         5275  +	case $cc_basename in
         5276  +	  NCC*)
         5277  +	    # NonStop-UX NCC 3.20
         5278  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3843   5279   	    ;;
  3844   5280   	  *)
  3845   5281   	    ;;
  3846   5282   	esac
  3847   5283   	;;
  3848   5284         sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
  3849   5285   	case $cc_basename in
  3850   5286   	  CC*)
  3851         -	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3852         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3853         -	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3854         -	    ;;
  3855         -	esac
  3856         -	;;
  3857         -      tandem*)
  3858         -	case $cc_basename in
  3859         -	  NCC*)
  3860         -	    # NonStop-UX NCC 3.20
  3861         -	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  3862         -	    ;;
  3863         -	  *)
         5287  +	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5288  +	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5289  +	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3864   5290   	    ;;
  3865   5291   	esac
  3866   5292   	;;
  3867   5293         vxworks*)
  3868   5294   	;;
  3869   5295         *)
  3870         -	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5296  +	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  3871   5297   	;;
  3872   5298       esac
  3873   5299     fi
  3874   5300   ],
  3875   5301   [
  3876   5302     if test "$GCC" = yes; then
  3877         -    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3878         -    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5303  +    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5304  +    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  3879   5305   
  3880   5306       case $host_os in
  3881   5307         aix*)
  3882   5308         # All AIX code is PIC.
  3883   5309         if test "$host_cpu" = ia64; then
  3884   5310   	# AIX 5 now supports IA64 processor
  3885         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5311  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3886   5312         fi
  3887   5313         ;;
  3888   5314   
  3889   5315       amigaos*)
  3890         -      case $host_cpu in
  3891         -      powerpc)
  3892         -            # see comment about AmigaOS4 .so support
  3893         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3894         -        ;;
  3895         -      m68k)
  3896         -            # FIXME: we need at least 68020 code to build shared libraries, but
  3897         -            # adding the `-m68020' flag to GCC prevents building anything better,
  3898         -            # like `-m68040'.
  3899         -            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  3900         -        ;;
  3901         -      esac
         5316  +      # FIXME: we need at least 68020 code to build shared libraries, but
         5317  +      # adding the `-m68020' flag to GCC prevents building anything better,
         5318  +      # like `-m68040'.
         5319  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  3902   5320         ;;
  3903   5321   
  3904   5322       beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
  3905   5323         # PIC is the default for these OSes.
  3906   5324         ;;
  3907   5325   
  3908         -    mingw* | cygwin* | pw32* | os2* | cegcc*)
         5326  +    mingw* | cygwin* | pw32* | os2*)
  3909   5327         # This hack is so that the source file can tell whether it is being
  3910   5328         # built for inclusion in a dll (and should export symbols for example).
  3911   5329         # Although the cygwin gcc ignores -fPIC, still need this for old-style
  3912   5330         # (--disable-auto-import) libraries
  3913   5331         m4_if([$1], [GCJ], [],
  3914         -	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
         5332  +	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  3915   5333         ;;
  3916   5334   
  3917   5335       darwin* | rhapsody*)
  3918   5336         # PIC is the default on this platform
  3919   5337         # Common symbols not allowed in MH_DYLIB files
  3920         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  3921         -      ;;
  3922         -
  3923         -    hpux*)
  3924         -      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
  3925         -      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
  3926         -      # sets the default TLS model and affects inlining.
  3927         -      case $host_cpu in
  3928         -      hppa*64*)
  3929         -	# +Z the default
  3930         -	;;
  3931         -      *)
  3932         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3933         -	;;
  3934         -      esac
         5338  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  3935   5339         ;;
  3936   5340   
  3937   5341       interix[[3-9]]*)
  3938   5342         # Interix 3.x gcc -fpic/-fPIC options generate broken code.
  3939   5343         # Instead, we relocate shared libraries at runtime.
  3940   5344         ;;
  3941   5345   
  3942   5346       msdosdjgpp*)
  3943   5347         # Just because we use GCC doesn't mean we suddenly get shared libraries
  3944   5348         # on systems that don't support them.
  3945         -      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5349  +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  3946   5350         enable_shared=no
  3947   5351         ;;
  3948   5352   
  3949         -    *nto* | *qnx*)
  3950         -      # QNX uses GNU C++, but need to define -shared option too, otherwise
  3951         -      # it will coredump.
  3952         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  3953         -      ;;
  3954         -
  3955   5353       sysv4*MP*)
  3956   5354         if test -d /usr/nec; then
  3957         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
         5355  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
  3958   5356         fi
  3959   5357         ;;
         5358  +
         5359  +    hpux*)
         5360  +      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
         5361  +      # not for PA HP-UX.
         5362  +      case $host_cpu in
         5363  +      hppa*64*|ia64*)
         5364  +	# +Z the default
         5365  +	;;
         5366  +      *)
         5367  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5368  +	;;
         5369  +      esac
         5370  +      ;;
  3960   5371   
  3961   5372       *)
  3962         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
         5373  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  3963   5374         ;;
  3964   5375       esac
  3965   5376     else
  3966   5377       # PORTME Check for flag to pass linker flags through the system compiler.
  3967   5378       case $host_os in
  3968   5379       aix*)
  3969         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5380  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3970   5381         if test "$host_cpu" = ia64; then
  3971   5382   	# AIX 5 now supports IA64 processor
  3972         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5383  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  3973   5384         else
  3974         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
         5385  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  3975   5386         fi
  3976   5387         ;;
         5388  +      darwin*)
         5389  +        # PIC is the default on this platform
         5390  +        # Common symbols not allowed in MH_DYLIB files
         5391  +       case $cc_basename in
         5392  +         xlc*)
         5393  +         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
         5394  +         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5395  +         ;;
         5396  +       esac
         5397  +       ;;
  3977   5398   
  3978         -    mingw* | cygwin* | pw32* | os2* | cegcc*)
         5399  +    mingw* | cygwin* | pw32* | os2*)
  3979   5400         # This hack is so that the source file can tell whether it is being
  3980   5401         # built for inclusion in a dll (and should export symbols for example).
  3981   5402         m4_if([$1], [GCJ], [],
  3982         -	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
         5403  +	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
  3983   5404         ;;
  3984   5405   
  3985   5406       hpux9* | hpux10* | hpux11*)
  3986         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5407  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  3987   5408         # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
  3988   5409         # not for PA HP-UX.
  3989   5410         case $host_cpu in
  3990   5411         hppa*64*|ia64*)
  3991   5412   	# +Z the default
  3992   5413   	;;
  3993   5414         *)
  3994         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
         5415  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  3995   5416   	;;
  3996   5417         esac
  3997   5418         # Is there a better lt_prog_compiler_static that works with the bundled CC?
  3998         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
         5419  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  3999   5420         ;;
  4000   5421   
  4001   5422       irix5* | irix6* | nonstopux*)
  4002         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5423  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4003   5424         # PIC (with -KPIC) is the default.
  4004         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5425  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4005   5426         ;;
  4006   5427   
  4007         -    linux* | k*bsd*-gnu | kopensolaris*-gnu)
         5428  +    newsos6)
         5429  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5430  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5431  +      ;;
         5432  +
         5433  +    linux* | k*bsd*-gnu)
  4008   5434         case $cc_basename in
  4009         -      # old Intel for x86_64 which still supported -KPIC.
  4010         -      ecc*)
  4011         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4012         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4013         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
         5435  +      icc* | ecc*)
         5436  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5437  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5438  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  4014   5439           ;;
  4015         -      # icc used to be incompatible with GCC.
  4016         -      # ICC 10 doesn't accept -KPIC any more.
  4017         -      icc* | ifort*)
  4018         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4019         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  4020         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
  4021         -        ;;
  4022         -      # Lahey Fortran 8.1.
  4023         -      lf95*)
  4024         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4025         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
  4026         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
  4027         -	;;
  4028   5440         pgcc* | pgf77* | pgf90* | pgf95*)
  4029   5441           # Portland Group compilers (*not* the Pentium gcc compiler,
  4030   5442   	# which looks to be a dead project)
  4031         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4032         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
  4033         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5443  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5444  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
         5445  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4034   5446           ;;
  4035   5447         ccc*)
  4036         -        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5448  +        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4037   5449           # All Alpha code is PIC.
  4038         -        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5450  +        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4039   5451           ;;
  4040         -      xl*)
  4041         -	# IBM XL C 8.0/Fortran 10.1 on PPC
  4042         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4043         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
  4044         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
  4045         -	;;
  4046   5452         *)
  4047         -	case `$CC -V 2>&1 | sed 5q` in
         5453  +        case `$CC -V 2>&1 | sed 5q` in
  4048   5454   	*Sun\ C*)
  4049   5455   	  # Sun C 5.9
  4050         -	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4051         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4052         -	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5456  +	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5457  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5458  +	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4053   5459   	  ;;
  4054   5460   	*Sun\ F*)
  4055   5461   	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
  4056         -	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4057         -	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4058         -	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
         5462  +	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5463  +	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5464  +	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
  4059   5465   	  ;;
  4060   5466   	esac
  4061   5467   	;;
  4062   5468         esac
  4063   5469         ;;
  4064   5470   
  4065         -    newsos6)
  4066         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4067         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4068         -      ;;
  4069         -
  4070         -    *nto* | *qnx*)
  4071         -      # QNX uses GNU C++, but need to define -shared option too, otherwise
  4072         -      # it will coredump.
  4073         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
  4074         -      ;;
  4075         -
  4076   5471       osf3* | osf4* | osf5*)
  4077         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5472  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4078   5473         # All OSF/1 code is PIC.
  4079         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5474  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4080   5475         ;;
  4081   5476   
  4082   5477       rdos*)
  4083         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         5478  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  4084   5479         ;;
  4085   5480   
  4086   5481       solaris*)
  4087         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4088         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5482  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5483  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4089   5484         case $cc_basename in
  4090   5485         f77* | f90* | f95*)
  4091         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
         5486  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
  4092   5487         *)
  4093         -	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
         5488  +	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
  4094   5489         esac
  4095   5490         ;;
  4096   5491   
  4097   5492       sunos4*)
  4098         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  4099         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  4100         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5493  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
         5494  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
         5495  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4101   5496         ;;
  4102   5497   
  4103   5498       sysv4 | sysv4.2uw2* | sysv4.3*)
  4104         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4105         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4106         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5499  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5500  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5501  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4107   5502         ;;
  4108   5503   
  4109   5504       sysv4*MP*)
  4110   5505         if test -d /usr/nec ;then
  4111         -	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
  4112         -	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5506  +	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
         5507  +	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4113   5508         fi
  4114   5509         ;;
  4115   5510   
  4116   5511       sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
  4117         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4118         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  4119         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5512  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5513  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
         5514  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4120   5515         ;;
  4121   5516   
  4122   5517       unicos*)
  4123         -      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  4124         -      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5518  +      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         5519  +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  4125   5520         ;;
  4126   5521   
  4127   5522       uts4*)
  4128         -      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  4129         -      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         5523  +      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
         5524  +      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  4130   5525         ;;
  4131   5526   
  4132   5527       *)
  4133         -      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
         5528  +      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  4134   5529         ;;
  4135   5530       esac
  4136   5531     fi
  4137   5532   ])
  4138         -case $host_os in
  4139         -  # For platforms which do not support PIC, -DPIC is meaningless:
  4140         -  *djgpp*)
  4141         -    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
  4142         -    ;;
  4143         -  *)
  4144         -    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
  4145         -    ;;
  4146         -esac
  4147         -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
  4148         -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
  4149         -	[How to pass a linker flag through the compiler])
         5533  +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
  4150   5534   
  4151   5535   #
  4152   5536   # Check to make sure the PIC flag actually works.
  4153   5537   #
  4154         -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
  4155         -  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
  4156         -    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
  4157         -    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
  4158         -    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
         5538  +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
         5539  +  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
         5540  +    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
         5541  +    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
         5542  +    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
  4159   5543        "" | " "*) ;;
  4160         -     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
         5544  +     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
  4161   5545        esac],
  4162         -    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
  4163         -     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
         5546  +    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5547  +     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
  4164   5548   fi
  4165         -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
  4166         -	[Additional compiler flags for building library objects])
         5549  +case $host_os in
         5550  +  # For platforms which do not support PIC, -DPIC is meaningless:
         5551  +  *djgpp*)
         5552  +    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
         5553  +    ;;
         5554  +  *)
         5555  +    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
         5556  +    ;;
         5557  +esac
  4167   5558   
  4168   5559   #
  4169   5560   # Check to make sure the static flag actually works.
  4170   5561   #
  4171         -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
  4172         -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
  4173         -  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
         5562  +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
         5563  +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
         5564  +  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
  4174   5565     $lt_tmp_static_flag,
  4175   5566     [],
  4176         -  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
  4177         -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
  4178         -	[Compiler flag to prevent dynamic linking])
  4179         -])# _LT_COMPILER_PIC
         5567  +  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
         5568  +])
  4180   5569   
  4181   5570   
  4182         -# _LT_LINKER_SHLIBS([TAGNAME])
  4183         -# ----------------------------
         5571  +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
         5572  +# ------------------------------------
  4184   5573   # See if the linker supports building shared libraries.
  4185         -m4_defun([_LT_LINKER_SHLIBS],
  4186         -[AC_REQUIRE([LT_PATH_LD])dnl
  4187         -AC_REQUIRE([LT_PATH_NM])dnl
  4188         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  4189         -m4_require([_LT_DECL_EGREP])dnl
  4190         -m4_require([_LT_DECL_SED])dnl
  4191         -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
  4192         -m4_require([_LT_TAG_COMPILER])dnl
         5574  +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
         5575  +[AC_REQUIRE([LT_AC_PROG_SED])dnl
  4193   5576   AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  4194         -m4_if([$1], [CXX], [
  4195         -  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
         5577  +ifelse([$1],[CXX],[
         5578  +  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4196   5579     case $host_os in
  4197   5580     aix[[4-9]]*)
  4198   5581       # If we're using GNU nm, then we don't want the "-C" option.
  4199   5582       # -C means demangle to AIX nm, but means don't demangle with GNU nm
  4200         -    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
  4201         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
         5583  +    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
         5584  +      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  4202   5585       else
  4203         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
         5586  +      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  4204   5587       fi
  4205   5588       ;;
  4206   5589     pw32*)
  4207         -    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
         5590  +    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
  4208   5591     ;;
  4209         -  cygwin* | mingw* | cegcc*)
  4210         -    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
         5592  +  cygwin* | mingw*)
         5593  +    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
  4211   5594     ;;
  4212   5595     linux* | k*bsd*-gnu)
  4213         -    _LT_TAGVAR(link_all_deplibs, $1)=no
         5596  +    _LT_AC_TAGVAR(link_all_deplibs, $1)=no
  4214   5597     ;;
  4215   5598     *)
  4216         -    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
         5599  +    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4217   5600     ;;
  4218   5601     esac
  4219         -  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
  4220         -], [
         5602  +  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
         5603  +],[
  4221   5604     runpath_var=
  4222         -  _LT_TAGVAR(allow_undefined_flag, $1)=
  4223         -  _LT_TAGVAR(always_export_symbols, $1)=no
  4224         -  _LT_TAGVAR(archive_cmds, $1)=
  4225         -  _LT_TAGVAR(archive_expsym_cmds, $1)=
  4226         -  _LT_TAGVAR(compiler_needs_object, $1)=no
  4227         -  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  4228         -  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
  4229         -  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4230         -  _LT_TAGVAR(hardcode_automatic, $1)=no
  4231         -  _LT_TAGVAR(hardcode_direct, $1)=no
  4232         -  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
  4233         -  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  4234         -  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  4235         -  _LT_TAGVAR(hardcode_libdir_separator, $1)=
  4236         -  _LT_TAGVAR(hardcode_minus_L, $1)=no
  4237         -  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  4238         -  _LT_TAGVAR(inherit_rpath, $1)=no
  4239         -  _LT_TAGVAR(link_all_deplibs, $1)=unknown
  4240         -  _LT_TAGVAR(module_cmds, $1)=
  4241         -  _LT_TAGVAR(module_expsym_cmds, $1)=
  4242         -  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
  4243         -  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
  4244         -  _LT_TAGVAR(thread_safe_flag_spec, $1)=
  4245         -  _LT_TAGVAR(whole_archive_flag_spec, $1)=
         5605  +  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
         5606  +  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
         5607  +  _LT_AC_TAGVAR(archive_cmds, $1)=
         5608  +  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
         5609  +  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
         5610  +  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
         5611  +  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         5612  +  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
         5613  +  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
         5614  +  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         5615  +  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
         5616  +  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
         5617  +  _LT_AC_TAGVAR(hardcode_direct, $1)=no
         5618  +  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
         5619  +  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         5620  +  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
         5621  +  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
         5622  +  _LT_AC_TAGVAR(module_cmds, $1)=
         5623  +  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
         5624  +  _LT_AC_TAGVAR(always_export_symbols, $1)=no
         5625  +  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
  4246   5626     # include_expsyms should be a list of space-separated symbols to be *always*
  4247   5627     # included in the symbol list
  4248         -  _LT_TAGVAR(include_expsyms, $1)=
         5628  +  _LT_AC_TAGVAR(include_expsyms, $1)=
  4249   5629     # exclude_expsyms can be an extended regexp of symbols to exclude
  4250   5630     # it will be wrapped by ` (' and `)$', so one must not match beginning or
  4251   5631     # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  4252   5632     # as well as any symbol that contains `d'.
  4253         -  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
         5633  +  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
  4254   5634     # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  4255   5635     # platforms (ab)use it in PIC code, but their linkers get confused if
  4256   5636     # the symbol is explicitly referenced.  Since portable code cannot
  4257   5637     # rely on this symbol name, it's probably fine to never include it in
  4258   5638     # preloaded symbol tables.
  4259   5639     # Exclude shared library initialization/finalization symbols.
  4260   5640   dnl Note also adjust exclude_expsyms for C++ above.
  4261   5641     extract_expsyms_cmds=
  4262         -
         5642  +  # Just being paranoid about ensuring that cc_basename is set.
         5643  +  _LT_CC_BASENAME([$compiler])
  4263   5644     case $host_os in
  4264         -  cygwin* | mingw* | pw32* | cegcc*)
         5645  +  cygwin* | mingw* | pw32*)
  4265   5646       # FIXME: the MSVC++ port hasn't been tested in a loooong time
  4266   5647       # When not using gcc, we currently assume that we are using
  4267   5648       # Microsoft Visual C++.
  4268   5649       if test "$GCC" != yes; then
  4269   5650         with_gnu_ld=no
  4270   5651       fi
  4271   5652       ;;
................................................................................
  4272   5653     interix*)
  4273   5654       # we just hope/assume this is gcc and not c89 (= MSVC++)
  4274   5655       with_gnu_ld=yes
  4275   5656       ;;
  4276   5657     openbsd*)
  4277   5658       with_gnu_ld=no
  4278   5659       ;;
  4279         -  linux* | k*bsd*-gnu)
  4280         -    _LT_TAGVAR(link_all_deplibs, $1)=no
  4281         -    ;;
  4282   5660     esac
  4283   5661   
  4284         -  _LT_TAGVAR(ld_shlibs, $1)=yes
         5662  +  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  4285   5663     if test "$with_gnu_ld" = yes; then
  4286   5664       # If archive_cmds runs LD, not CC, wlarc should be empty
  4287   5665       wlarc='${wl}'
  4288   5666   
  4289   5667       # Set some defaults for GNU ld with shared library support. These
  4290   5668       # are reset later if shared libraries are not supported. Putting them
  4291   5669       # here allows them to be overridden if necessary.
  4292   5670       runpath_var=LD_RUN_PATH
  4293         -    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4294         -    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
         5671  +    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
         5672  +    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  4295   5673       # ancient GNU ld didn't support --whole-archive et. al.
  4296         -    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
  4297         -      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  4298         -    else
  4299         -      _LT_TAGVAR(whole_archive_flag_spec, $1)=
         5674  +    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
         5675  +	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
         5676  +      else
         5677  +  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  4300   5678       fi
  4301   5679       supports_anon_versioning=no
  4302         -    case `$LD -v 2>&1` in
  4303         -      *GNU\ gold*) supports_anon_versioning=yes ;;
         5680  +    case `$LD -v 2>/dev/null` in
  4304   5681         *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
  4305   5682         *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
  4306   5683         *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
  4307   5684         *\ 2.11.*) ;; # other 2.11 versions
  4308   5685         *) supports_anon_versioning=yes ;;
  4309   5686       esac
  4310   5687   
  4311   5688       # See if GNU ld supports shared libraries.
  4312   5689       case $host_os in
  4313   5690       aix[[3-9]]*)
  4314   5691         # On AIX/PPC, the GNU linker is very broken
  4315   5692         if test "$host_cpu" != ia64; then
  4316         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4317         -	cat <<_LT_EOF 1>&2
         5693  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5694  +	cat <<EOF 1>&2
  4318   5695   
  4319   5696   *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  4320   5697   *** to be unable to reliably create shared libraries on AIX.
  4321   5698   *** Therefore, libtool is disabling shared libraries support.  If you
  4322   5699   *** really care for shared libraries, you may want to modify your PATH
  4323   5700   *** so that a non-GNU linker is found, and then restart.
  4324   5701   
  4325         -_LT_EOF
         5702  +EOF
  4326   5703         fi
  4327   5704         ;;
  4328   5705   
  4329   5706       amigaos*)
  4330         -      case $host_cpu in
  4331         -      powerpc)
  4332         -            # see comment about AmigaOS4 .so support
  4333         -            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4334         -            _LT_TAGVAR(archive_expsym_cmds, $1)=''
  4335         -        ;;
  4336         -      m68k)
  4337         -            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  4338         -            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4339         -            _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4340         -        ;;
  4341         -      esac
         5707  +      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
         5708  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         5709  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         5710  +
         5711  +      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
         5712  +      # that the semantics of dynamic libraries on AmigaOS, at least up
         5713  +      # to version 4, is to share data among multiple programs linked
         5714  +      # with the same dynamic library.  Since this doesn't match the
         5715  +      # behavior of shared libraries on other platforms, we can't use
         5716  +      # them.
         5717  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
  4342   5718         ;;
  4343   5719   
  4344   5720       beos*)
  4345         -      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4346         -	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
         5721  +      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5722  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  4347   5723   	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  4348   5724   	# support --undefined.  This deserves some investigation.  FIXME
  4349         -	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5725  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4350   5726         else
  4351         -	_LT_TAGVAR(ld_shlibs, $1)=no
         5727  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4352   5728         fi
  4353   5729         ;;
  4354   5730   
  4355         -    cygwin* | mingw* | pw32* | cegcc*)
  4356         -      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
         5731  +    cygwin* | mingw* | pw32*)
         5732  +      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
  4357   5733         # as there is no search path for DLLs.
  4358         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4359         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  4360         -      _LT_TAGVAR(always_export_symbols, $1)=no
  4361         -      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  4362         -      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
         5734  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         5735  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         5736  +      _LT_AC_TAGVAR(always_export_symbols, $1)=no
         5737  +      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
         5738  +      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
  4363   5739   
  4364         -      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
  4365         -        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
         5740  +      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         5741  +        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  4366   5742   	# If the export-symbols file already is a .def file (1st line
  4367   5743   	# is EXPORTS), use it as is; otherwise, prepend...
  4368         -	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
         5744  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  4369   5745   	  cp $export_symbols $output_objdir/$soname.def;
  4370   5746   	else
  4371   5747   	  echo EXPORTS > $output_objdir/$soname.def;
  4372   5748   	  cat $export_symbols >> $output_objdir/$soname.def;
  4373   5749   	fi~
  4374   5750   	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  4375   5751         else
  4376         -	_LT_TAGVAR(ld_shlibs, $1)=no
         5752  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4377   5753         fi
  4378   5754         ;;
  4379   5755   
  4380   5756       interix[[3-9]]*)
  4381         -      _LT_TAGVAR(hardcode_direct, $1)=no
  4382         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  4383         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  4384         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         5757  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         5758  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         5759  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         5760  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  4385   5761         # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
  4386   5762         # Instead, shared libraries are loaded at an image base (0x10000000 by
  4387   5763         # default) and relocated if they conflict, which is a slow very memory
  4388   5764         # consuming and fragmenting process.  To avoid this, we pick a random,
  4389   5765         # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
  4390   5766         # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
  4391         -      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  4392         -      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         5767  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
         5768  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  4393   5769         ;;
  4394   5770   
  4395         -    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
  4396         -      tmp_diet=no
  4397         -      if test "$host_os" = linux-dietlibc; then
  4398         -	case $cc_basename in
  4399         -	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
  4400         -	esac
  4401         -      fi
  4402         -      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
  4403         -	 && test "$tmp_diet" = no
  4404         -      then
         5771  +    gnu* | linux* | k*bsd*-gnu)
         5772  +      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  4405   5773   	tmp_addflag=
  4406         -	tmp_sharedflag='-shared'
  4407   5774   	case $cc_basename,$host_cpu in
  4408         -        pgcc*)				# Portland Group C compiler
  4409         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
         5775  +	pgcc*)				# Portland Group C compiler
         5776  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
  4410   5777   	  tmp_addflag=' $pic_flag'
  4411   5778   	  ;;
  4412   5779   	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
  4413         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
         5780  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
  4414   5781   	  tmp_addflag=' $pic_flag -Mnomain' ;;
  4415         -	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
         5782  +	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
  4416   5783   	  tmp_addflag=' -i_dynamic' ;;
  4417   5784   	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
  4418   5785   	  tmp_addflag=' -i_dynamic -nofor_main' ;;
  4419   5786   	ifc* | ifort*)			# Intel Fortran compiler
  4420   5787   	  tmp_addflag=' -nofor_main' ;;
  4421         -	lf95*)				# Lahey Fortran 8.1
  4422         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
  4423         -	  tmp_sharedflag='--shared' ;;
  4424         -	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
  4425         -	  tmp_sharedflag='-qmkshrobj'
  4426         -	  tmp_addflag= ;;
  4427   5788   	esac
  4428   5789   	case `$CC -V 2>&1 | sed 5q` in
  4429   5790   	*Sun\ C*)			# Sun C 5.9
  4430         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
  4431         -	  _LT_TAGVAR(compiler_needs_object, $1)=yes
         5791  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
  4432   5792   	  tmp_sharedflag='-G' ;;
  4433   5793   	*Sun\ F*)			# Sun Fortran 8.3
  4434   5794   	  tmp_sharedflag='-G' ;;
         5795  +	*)
         5796  +	  tmp_sharedflag='-shared' ;;
  4435   5797   	esac
  4436         -	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5798  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4437   5799   
  4438         -        if test "x$supports_anon_versioning" = xyes; then
  4439         -          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
  4440         -	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  4441         -	    echo "local: *; };" >> $output_objdir/$libname.ver~
  4442         -	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
  4443         -        fi
  4444         -
  4445         -	case $cc_basename in
  4446         -	xlf*)
  4447         -	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
  4448         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
  4449         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  4450         -	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
  4451         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
  4452         -	  if test "x$supports_anon_versioning" = xyes; then
  4453         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
  4454         -	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  4455         -	      echo "local: *; };" >> $output_objdir/$libname.ver~
  4456         -	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
  4457         -	  fi
  4458         -	  ;;
  4459         -	esac
         5800  +	if test $supports_anon_versioning = yes; then
         5801  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
         5802  +  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
         5803  +  $echo "local: *; };" >> $output_objdir/$libname.ver~
         5804  +	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
         5805  +	fi
         5806  +	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
  4460   5807         else
  4461         -        _LT_TAGVAR(ld_shlibs, $1)=no
         5808  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4462   5809         fi
  4463   5810         ;;
  4464   5811   
  4465   5812       netbsd* | netbsdelf*-gnu)
  4466         -      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  4467         -	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
         5813  +      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         5814  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
  4468   5815   	wlarc=
  4469   5816         else
  4470         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4471         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5817  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5818  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4472   5819         fi
  4473   5820         ;;
  4474   5821   
  4475   5822       solaris*)
  4476         -      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
  4477         -	_LT_TAGVAR(ld_shlibs, $1)=no
  4478         -	cat <<_LT_EOF 1>&2
         5823  +      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
         5824  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
         5825  +	cat <<EOF 1>&2
  4479   5826   
  4480   5827   *** Warning: The releases 2.8.* of the GNU linker cannot reliably
  4481   5828   *** create shared libraries on Solaris systems.  Therefore, libtool
  4482   5829   *** is disabling shared libraries support.  We urge you to upgrade GNU
  4483   5830   *** binutils to release 2.9.1 or newer.  Another option is to modify
  4484   5831   *** your PATH or compiler configuration so that the native linker is
  4485   5832   *** used, and then restart.
  4486   5833   
  4487         -_LT_EOF
  4488         -      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4489         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4490         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5834  +EOF
         5835  +      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5836  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5837  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4491   5838         else
  4492         -	_LT_TAGVAR(ld_shlibs, $1)=no
         5839  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4493   5840         fi
  4494   5841         ;;
  4495   5842   
  4496   5843       sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
  4497   5844         case `$LD -v 2>&1` in
  4498   5845           *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
  4499         -	_LT_TAGVAR(ld_shlibs, $1)=no
         5846  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4500   5847   	cat <<_LT_EOF 1>&2
  4501   5848   
  4502   5849   *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
  4503   5850   *** reliably create shared libraries on SCO systems.  Therefore, libtool
  4504   5851   *** is disabling shared libraries support.  We urge you to upgrade GNU
  4505   5852   *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
  4506   5853   *** your PATH or compiler configuration so that the native linker is
  4507   5854   *** used, and then restart.
  4508   5855   
  4509   5856   _LT_EOF
  4510   5857   	;;
  4511   5858   	*)
  4512         -	  # For security reasons, it is highly recommended that you always
  4513         -	  # use absolute paths for naming shared libraries, and exclude the
  4514         -	  # DT_RUNPATH tag from executables and libraries.  But doing so
  4515         -	  # requires that you compile everything twice, which is a pain.
  4516         -	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4517         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4518         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4519         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5859  +	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5860  +	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
         5861  +	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
         5862  +	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
  4520   5863   	  else
  4521         -	    _LT_TAGVAR(ld_shlibs, $1)=no
         5864  +	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
  4522   5865   	  fi
  4523   5866   	;;
  4524   5867         esac
  4525   5868         ;;
  4526   5869   
  4527   5870       sunos4*)
  4528         -      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
         5871  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  4529   5872         wlarc=
  4530         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4531         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         5873  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         5874  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4532   5875         ;;
  4533   5876   
  4534   5877       *)
  4535         -      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  4536         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4537         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
         5878  +      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         5879  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         5880  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  4538   5881         else
  4539         -	_LT_TAGVAR(ld_shlibs, $1)=no
         5882  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4540   5883         fi
  4541   5884         ;;
  4542   5885       esac
  4543   5886   
  4544         -    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
         5887  +    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
  4545   5888         runpath_var=
  4546         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  4547         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
  4548         -      _LT_TAGVAR(whole_archive_flag_spec, $1)=
         5889  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
         5890  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
         5891  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  4549   5892       fi
  4550   5893     else
  4551   5894       # PORTME fill in a description of your system's linker (not GNU ld)
  4552   5895       case $host_os in
  4553   5896       aix3*)
  4554         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  4555         -      _LT_TAGVAR(always_export_symbols, $1)=yes
  4556         -      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
         5897  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         5898  +      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
         5899  +      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
  4557   5900         # Note: this linker hardcodes the directories in LIBPATH if there
  4558   5901         # are no directories specified by -L.
  4559         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
         5902  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  4560   5903         if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
  4561   5904   	# Neither direct hardcoding nor static linking is supported with a
  4562   5905   	# broken collect2.
  4563         -	_LT_TAGVAR(hardcode_direct, $1)=unsupported
         5906  +	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
  4564   5907         fi
  4565   5908         ;;
  4566   5909   
  4567   5910       aix[[4-9]]*)
  4568   5911         if test "$host_cpu" = ia64; then
  4569   5912   	# On IA64, the linker does run time linking by default, so we don't
  4570   5913   	# have to do anything special.
  4571   5914   	aix_use_runtimelinking=no
  4572   5915   	exp_sym_flag='-Bexport'
  4573   5916   	no_entry_flag=""
  4574   5917         else
  4575   5918   	# If we're using GNU nm, then we don't want the "-C" option.
  4576   5919   	# -C means demangle to AIX nm, but means don't demangle with GNU nm
  4577         -	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
  4578         -	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
         5920  +	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
         5921  +	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  4579   5922   	else
  4580         -	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
         5923  +	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  4581   5924   	fi
  4582   5925   	aix_use_runtimelinking=no
  4583   5926   
  4584   5927   	# Test if we are trying to use run time linking or normal
  4585   5928   	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
  4586   5929   	# need to do runtime linking.
  4587   5930   	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
  4588   5931   	  for ld_flag in $LDFLAGS; do
  4589         -	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  4590         -	    aix_use_runtimelinking=yes
  4591         -	    break
  4592         -	  fi
         5932  +  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
         5933  +  	    aix_use_runtimelinking=yes
         5934  +  	    break
         5935  +  	  fi
  4593   5936   	  done
  4594   5937   	  ;;
  4595   5938   	esac
  4596   5939   
  4597   5940   	exp_sym_flag='-bexport'
  4598   5941   	no_entry_flag='-bnoentry'
  4599   5942         fi
................................................................................
  4600   5943   
  4601   5944         # When large executables or shared objects are built, AIX ld can
  4602   5945         # have problems creating the table of contents.  If linking a library
  4603   5946         # or program results in "error TOC overflow" add -mminimal-toc to
  4604   5947         # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
  4605   5948         # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  4606   5949   
  4607         -      _LT_TAGVAR(archive_cmds, $1)=''
  4608         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4609         -      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  4610         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  4611         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  4612         -      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
         5950  +      _LT_AC_TAGVAR(archive_cmds, $1)=''
         5951  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         5952  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         5953  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  4613   5954   
  4614   5955         if test "$GCC" = yes; then
  4615   5956   	case $host_os in aix4.[[012]]|aix4.[[012]].*)
  4616   5957   	# We only want to do this on AIX 4.2 and lower, the check
  4617   5958   	# below for broken collect2 doesn't work under 4.3+
  4618   5959   	  collect2name=`${CC} -print-prog-name=collect2`
  4619         -	  if test -f "$collect2name" &&
  4620         -	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
         5960  +	  if test -f "$collect2name" && \
         5961  +  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
  4621   5962   	  then
  4622         -	  # We have reworked collect2
  4623         -	  :
         5963  +  	  # We have reworked collect2
         5964  +  	  :
  4624   5965   	  else
  4625         -	  # We have old collect2
  4626         -	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
  4627         -	  # It fails to find uninstalled libraries when the uninstalled
  4628         -	  # path is not listed in the libpath.  Setting hardcode_minus_L
  4629         -	  # to unsupported forces relinking
  4630         -	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4631         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4632         -	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
         5966  +  	  # We have old collect2
         5967  +  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
         5968  +  	  # It fails to find uninstalled libraries when the uninstalled
         5969  +  	  # path is not listed in the libpath.  Setting hardcode_minus_L
         5970  +  	  # to unsupported forces relinking
         5971  +  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         5972  +  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         5973  +  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  4633   5974   	  fi
  4634   5975   	  ;;
  4635   5976   	esac
  4636   5977   	shared_flag='-shared'
  4637   5978   	if test "$aix_use_runtimelinking" = yes; then
  4638   5979   	  shared_flag="$shared_flag "'${wl}-G'
  4639   5980   	fi
  4640         -	_LT_TAGVAR(link_all_deplibs, $1)=no
  4641   5981         else
  4642   5982   	# not using gcc
  4643   5983   	if test "$host_cpu" = ia64; then
  4644         -	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  4645         -	# chokes on -Wl,-G. The following line is correct:
         5984  +  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
         5985  +  	# chokes on -Wl,-G. The following line is correct:
  4646   5986   	  shared_flag='-G'
  4647   5987   	else
  4648   5988   	  if test "$aix_use_runtimelinking" = yes; then
  4649   5989   	    shared_flag='${wl}-G'
  4650   5990   	  else
  4651   5991   	    shared_flag='${wl}-bM:SRE'
  4652   5992   	  fi
  4653   5993   	fi
  4654   5994         fi
  4655   5995   
  4656         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
  4657   5996         # It seems that -bexpall does not export symbols beginning with
  4658   5997         # underscore (_), so it is better to generate a list of symbols to export.
  4659         -      _LT_TAGVAR(always_export_symbols, $1)=yes
         5998  +      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  4660   5999         if test "$aix_use_runtimelinking" = yes; then
  4661   6000   	# Warning - without using the other runtime loading flags (-brtl),
  4662   6001   	# -berok will link without error, but may produce a broken library.
  4663         -	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
  4664         -        # Determine the default libpath from the value encoded in an
  4665         -        # empty executable.
  4666         -        _LT_SYS_MODULE_PATH_AIX
  4667         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  4668         -        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  4669         -      else
         6002  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
         6003  +       # Determine the default libpath from the value encoded in an empty executable.
         6004  +       _LT_AC_SYS_LIBPATH_AIX
         6005  +       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         6006  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         6007  +       else
  4670   6008   	if test "$host_cpu" = ia64; then
  4671         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  4672         -	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  4673         -	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
         6009  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
         6010  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
         6011  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  4674   6012   	else
  4675         -	 # Determine the default libpath from the value encoded in an
  4676         -	 # empty executable.
  4677         -	 _LT_SYS_MODULE_PATH_AIX
  4678         -	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
         6013  +	 # Determine the default libpath from the value encoded in an empty executable.
         6014  +	 _LT_AC_SYS_LIBPATH_AIX
         6015  +	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  4679   6016   	  # Warning - without using the other run time loading flags,
  4680   6017   	  # -berok will link without error, but may produce a broken library.
  4681         -	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  4682         -	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
         6018  +	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
         6019  +	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  4683   6020   	  # Exported symbols can be pulled into shared objects from archives
  4684         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
  4685         -	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
         6021  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
         6022  +	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  4686   6023   	  # This is similar to how AIX traditionally builds its shared libraries.
  4687         -	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
         6024  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  4688   6025   	fi
  4689   6026         fi
  4690   6027         ;;
  4691   6028   
  4692   6029       amigaos*)
  4693         -      case $host_cpu in
  4694         -      powerpc)
  4695         -            # see comment about AmigaOS4 .so support
  4696         -            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  4697         -            _LT_TAGVAR(archive_expsym_cmds, $1)=''
  4698         -        ;;
  4699         -      m68k)
  4700         -            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  4701         -            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4702         -            _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4703         -        ;;
  4704         -      esac
         6030  +      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
         6031  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6032  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6033  +      # see comment about different semantics on the GNU ld section
         6034  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
  4705   6035         ;;
  4706   6036   
  4707   6037       bsdi[[45]]*)
  4708         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
         6038  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
  4709   6039         ;;
  4710   6040   
  4711         -    cygwin* | mingw* | pw32* | cegcc*)
         6041  +    cygwin* | mingw* | pw32*)
  4712   6042         # When not using gcc, we currently assume that we are using
  4713   6043         # Microsoft Visual C++.
  4714   6044         # hardcode_libdir_flag_spec is actually meaningless, as there is
  4715   6045         # no search path for DLLs.
  4716         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
  4717         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
         6046  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
         6047  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  4718   6048         # Tell ltmain to make .lib files, not .a files.
  4719   6049         libext=lib
  4720   6050         # Tell ltmain to make .dll files, not .so files.
  4721   6051         shrext_cmds=".dll"
  4722   6052         # FIXME: Setting linknames here is a bad hack.
  4723         -      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
         6053  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
  4724   6054         # The linker will automatically build a .lib file if we build a DLL.
  4725         -      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
         6055  +      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
  4726   6056         # FIXME: Should let the user specify the lib program.
  4727         -      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
  4728         -      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
  4729         -      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
         6057  +      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
         6058  +      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
         6059  +      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  4730   6060         ;;
  4731   6061   
  4732   6062       darwin* | rhapsody*)
  4733         -      _LT_DARWIN_LINKER_FEATURES($1)
         6063  +      case $host_os in
         6064  +        rhapsody* | darwin1.[[012]])
         6065  +         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
         6066  +         ;;
         6067  +       *) # Darwin 1.3 on
         6068  +         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
         6069  +           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
         6070  +         else
         6071  +           case ${MACOSX_DEPLOYMENT_TARGET} in
         6072  +             10.[[012]])
         6073  +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
         6074  +               ;;
         6075  +             10.*)
         6076  +               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
         6077  +               ;;
         6078  +           esac
         6079  +         fi
         6080  +         ;;
         6081  +      esac
         6082  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6083  +      _LT_AC_TAGVAR(hardcode_direct, $1)=no
         6084  +      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
         6085  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
         6086  +      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
         6087  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         6088  +    if test "$GCC" = yes ; then
         6089  +    	output_verbose_link_cmd='echo'
         6090  +        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
         6091  +        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
         6092  +        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
         6093  +        _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
         6094  +    else
         6095  +      case $cc_basename in
         6096  +        xlc*)
         6097  +         output_verbose_link_cmd='echo'
         6098  +         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
         6099  +         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
         6100  +          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
         6101  +         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         6102  +          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
         6103  +          ;;
         6104  +       *)
         6105  +         _LT_AC_TAGVAR(ld_shlibs, $1)=no
         6106  +          ;;
         6107  +      esac
         6108  +    fi
  4734   6109         ;;
  4735   6110   
  4736   6111       dgux*)
  4737         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  4738         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4739         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6112  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6113  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6114  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4740   6115         ;;
  4741   6116   
  4742   6117       freebsd1*)
  4743         -      _LT_TAGVAR(ld_shlibs, $1)=no
         6118  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
  4744   6119         ;;
  4745   6120   
  4746   6121       # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  4747   6122       # support.  Future versions do this automatically, but an explicit c++rt0.o
  4748   6123       # does not break anything, and helps significantly (at the cost of a little
  4749   6124       # extra space).
  4750   6125       freebsd2.2*)
  4751         -      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
  4752         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  4753         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4754         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6126  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
         6127  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6128  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6129  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4755   6130         ;;
  4756   6131   
  4757   6132       # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  4758   6133       freebsd2*)
  4759         -      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  4760         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4761         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4762         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6134  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
         6135  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6136  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6137  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4763   6138         ;;
  4764   6139   
  4765   6140       # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  4766   6141       freebsd* | dragonfly*)
  4767         -      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
  4768         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  4769         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4770         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6142  +      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
         6143  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6144  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6145  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4771   6146         ;;
  4772   6147   
  4773   6148       hpux9*)
  4774   6149         if test "$GCC" = yes; then
  4775         -	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         6150  +	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  4776   6151         else
  4777         -	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
         6152  +	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  4778   6153         fi
  4779         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  4780         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  4781         -      _LT_TAGVAR(hardcode_direct, $1)=yes
         6154  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         6155  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6156  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  4782   6157   
  4783   6158         # hardcode_minus_L: Not really in the search PATH,
  4784   6159         # but as the default location of the library.
  4785         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4786         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6160  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6161  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  4787   6162         ;;
  4788   6163   
  4789   6164       hpux10*)
  4790   6165         if test "$GCC" = yes -a "$with_gnu_ld" = no; then
  4791         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
         6166  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
  4792   6167         else
  4793         -	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
         6168  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
  4794   6169         fi
  4795   6170         if test "$with_gnu_ld" = no; then
  4796         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  4797         -	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
  4798         -	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
  4799         -	_LT_TAGVAR(hardcode_direct, $1)=yes
  4800         -	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  4801         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6171  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         6172  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6173  +
         6174  +	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6175  +	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6176  +
  4802   6177   	# hardcode_minus_L: Not really in the search PATH,
  4803   6178   	# but as the default location of the library.
  4804         -	_LT_TAGVAR(hardcode_minus_L, $1)=yes
         6179  +	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  4805   6180         fi
  4806   6181         ;;
  4807   6182   
  4808   6183       hpux11*)
  4809   6184         if test "$GCC" = yes -a "$with_gnu_ld" = no; then
  4810   6185   	case $host_cpu in
  4811   6186   	hppa*64*)
  4812         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6187  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  4813   6188   	  ;;
  4814   6189   	ia64*)
  4815         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
         6190  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
  4816   6191   	  ;;
  4817   6192   	*)
  4818         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
         6193  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
  4819   6194   	  ;;
  4820   6195   	esac
  4821   6196         else
  4822   6197   	case $host_cpu in
  4823   6198   	hppa*64*)
  4824         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6199  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  4825   6200   	  ;;
  4826   6201   	ia64*)
  4827         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
         6202  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
  4828   6203   	  ;;
  4829   6204   	*)
  4830         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
         6205  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
  4831   6206   	  ;;
  4832   6207   	esac
  4833   6208         fi
  4834   6209         if test "$with_gnu_ld" = no; then
  4835         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  4836         -	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
         6210  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         6211  +	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  4837   6212   
  4838   6213   	case $host_cpu in
  4839   6214   	hppa*64*|ia64*)
  4840         -	  _LT_TAGVAR(hardcode_direct, $1)=no
  4841         -	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6215  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
         6216  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
         6217  +	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4842   6218   	  ;;
  4843   6219   	*)
  4844         -	  _LT_TAGVAR(hardcode_direct, $1)=yes
  4845         -	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  4846         -	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6220  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6221  +	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  4847   6222   
  4848   6223   	  # hardcode_minus_L: Not really in the search PATH,
  4849   6224   	  # but as the default location of the library.
  4850         -	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
         6225  +	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  4851   6226   	  ;;
  4852   6227   	esac
  4853   6228         fi
  4854   6229         ;;
  4855   6230   
  4856   6231       irix5* | irix6* | nonstopux*)
  4857   6232         if test "$GCC" = yes; then
  4858         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  4859         -	# Try to use the -exported_symbol ld option, if it does not
  4860         -	# work, assume that -exports_file does not work either and
  4861         -	# implicitly export all symbols.
  4862         -        save_LDFLAGS="$LDFLAGS"
  4863         -        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
  4864         -        AC_LINK_IFELSE(int foo(void) {},
  4865         -          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
  4866         -        )
  4867         -        LDFLAGS="$save_LDFLAGS"
         6233  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  4868   6234         else
  4869         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
  4870         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
         6235  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         6236  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
  4871   6237         fi
  4872         -      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
  4873         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4874         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  4875         -      _LT_TAGVAR(inherit_rpath, $1)=yes
  4876         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
         6238  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6239  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6240  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  4877   6241         ;;
  4878   6242   
  4879   6243       netbsd* | netbsdelf*-gnu)
  4880         -      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  4881         -	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
         6244  +      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
         6245  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
  4882   6246         else
  4883         -	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
         6247  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
  4884   6248         fi
  4885         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  4886         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4887         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6249  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6250  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6251  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4888   6252         ;;
  4889   6253   
  4890   6254       newsos6)
  4891         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  4892         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  4893         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4894         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  4895         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  4896         -      ;;
  4897         -
  4898         -    *nto* | *qnx*)
         6255  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6256  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6257  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6258  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         6259  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4899   6260         ;;
  4900   6261   
  4901   6262       openbsd*)
  4902   6263         if test -f /usr/libexec/ld.so; then
  4903         -	_LT_TAGVAR(hardcode_direct, $1)=yes
  4904         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  4905         -	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  4906         -	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  4907         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  4908         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
  4909         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  4910         -	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         6264  +	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6265  +	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6266  +	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
         6267  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
         6268  +	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
         6269  +	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         6270  +	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  4911   6271   	else
  4912   6272   	  case $host_os in
  4913   6273   	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
  4914         -	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  4915         -	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6274  +	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
         6275  +	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  4916   6276   	     ;;
  4917   6277   	   *)
  4918         -	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
  4919         -	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
         6278  +	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
         6279  +	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  4920   6280   	     ;;
  4921   6281   	  esac
  4922         -	fi
         6282  +        fi
  4923   6283         else
  4924         -	_LT_TAGVAR(ld_shlibs, $1)=no
         6284  +	_LT_AC_TAGVAR(ld_shlibs, $1)=no
  4925   6285         fi
  4926   6286         ;;
  4927   6287   
  4928   6288       os2*)
  4929         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  4930         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  4931         -      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  4932         -      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
  4933         -      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
         6289  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6290  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6291  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
         6292  +      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
         6293  +      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
  4934   6294         ;;
  4935   6295   
  4936   6296       osf3*)
  4937   6297         if test "$GCC" = yes; then
  4938         -	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  4939         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         6298  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         6299  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  4940   6300         else
  4941         -	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  4942         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
         6301  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
         6302  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  4943   6303         fi
  4944         -      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
  4945         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4946         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         6304  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6305  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  4947   6306         ;;
  4948   6307   
  4949   6308       osf4* | osf5*)	# as osf3* with the addition of -msym flag
  4950   6309         if test "$GCC" = yes; then
  4951         -	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  4952         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  4953         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         6310  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
         6311  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
         6312  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  4954   6313         else
  4955         -	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  4956         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
  4957         -	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
  4958         -	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
         6314  +	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
         6315  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
         6316  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
         6317  +	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
  4959   6318   
  4960   6319   	# Both c and cxx compiler support -rpath directly
  4961         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
         6320  +	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  4962   6321         fi
  4963         -      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
  4964         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         6322  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  4965   6323         ;;
  4966   6324   
  4967   6325       solaris*)
  4968         -      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
         6326  +      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
  4969   6327         if test "$GCC" = yes; then
  4970   6328   	wlarc='${wl}'
  4971         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  4972         -	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  4973         -	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
         6329  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6330  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         6331  +	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
  4974   6332         else
  4975         -	case `$CC -V 2>&1` in
  4976         -	*"Compilers 5.0"*)
  4977         -	  wlarc=''
  4978         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
  4979         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  4980         -	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
  4981         -	  ;;
  4982         -	*)
  4983         -	  wlarc='${wl}'
  4984         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
  4985         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  4986         -	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
  4987         -	  ;;
  4988         -	esac
         6333  +	wlarc=''
         6334  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6335  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
         6336  +  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
  4989   6337         fi
  4990         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  4991         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6338  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
         6339  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  4992   6340         case $host_os in
  4993   6341         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  4994   6342         *)
  4995   6343   	# The compiler driver will combine and reorder linker options,
  4996   6344   	# but understands `-z linker_flag'.  GCC discards it without `$wl',
  4997   6345   	# but is careful enough not to reorder.
  4998         -	# Supported since Solaris 2.6 (maybe 2.5.1?)
         6346  + 	# Supported since Solaris 2.6 (maybe 2.5.1?)
  4999   6347   	if test "$GCC" = yes; then
  5000         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
         6348  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
  5001   6349   	else
  5002         -	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
         6350  +	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
  5003   6351   	fi
  5004   6352   	;;
  5005   6353         esac
  5006         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
         6354  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  5007   6355         ;;
  5008   6356   
  5009   6357       sunos4*)
  5010   6358         if test "x$host_vendor" = xsequent; then
  5011   6359   	# Use $CC to link under sequent, because it throws in some extra .o
  5012   6360   	# files that make .init and .fini sections work.
  5013         -	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
         6361  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
  5014   6362         else
  5015         -	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
         6363  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
  5016   6364         fi
  5017         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5018         -      _LT_TAGVAR(hardcode_direct, $1)=yes
  5019         -      _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5020         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6365  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6366  +      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
         6367  +      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
         6368  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  5021   6369         ;;
  5022   6370   
  5023   6371       sysv4)
  5024   6372         case $host_vendor in
  5025   6373   	sni)
  5026         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5027         -	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
         6374  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6375  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
  5028   6376   	;;
  5029   6377   	siemens)
  5030   6378   	  ## LD is ld it makes a PLAMLIB
  5031   6379   	  ## CC just makes a GrossModule.
  5032         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
  5033         -	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
  5034         -	  _LT_TAGVAR(hardcode_direct, $1)=no
         6380  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
         6381  +	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
         6382  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
  5035   6383           ;;
  5036   6384   	motorola)
  5037         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5038         -	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
         6385  +	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6386  +	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
  5039   6387   	;;
  5040   6388         esac
  5041   6389         runpath_var='LD_RUN_PATH'
  5042         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6390  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  5043   6391         ;;
  5044   6392   
  5045   6393       sysv4.3*)
  5046         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5047         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5048         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
         6394  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6395  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6396  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
  5049   6397         ;;
  5050   6398   
  5051   6399       sysv4*MP*)
  5052   6400         if test -d /usr/nec; then
  5053         -	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5054         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6401  +	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6402  +	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  5055   6403   	runpath_var=LD_RUN_PATH
  5056   6404   	hardcode_runpath_var=yes
  5057         -	_LT_TAGVAR(ld_shlibs, $1)=yes
         6405  +	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
  5058   6406         fi
  5059   6407         ;;
  5060   6408   
  5061   6409       sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
  5062         -      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  5063         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5064         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6410  +      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         6411  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6412  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  5065   6413         runpath_var='LD_RUN_PATH'
  5066   6414   
  5067   6415         if test "$GCC" = yes; then
  5068         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5069         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6416  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6417  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5070   6418         else
  5071         -	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5072         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6419  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6420  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5073   6421         fi
  5074   6422         ;;
  5075   6423   
  5076   6424       sysv5* | sco3.2v5* | sco5v6*)
  5077   6425         # Note: We can NOT use -z defs as we might desire, because we do not
  5078   6426         # link with -lc, and that would cause any symbols used from libc to
  5079   6427         # always be unresolved, which means just about no library would
  5080   6428         # ever link correctly.  If we're not using GNU ld we use -z text
  5081   6429         # though, which does catch some bad symbols but isn't as heavy-handed
  5082   6430         # as -z defs.
  5083         -      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  5084         -      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
  5085         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5086         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5087         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
  5088         -      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  5089         -      _LT_TAGVAR(link_all_deplibs, $1)=yes
  5090         -      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
         6431  +      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
         6432  +      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
         6433  +      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
         6434  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
         6435  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
         6436  +      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
         6437  +      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
         6438  +      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  5091   6439         runpath_var='LD_RUN_PATH'
  5092   6440   
  5093   6441         if test "$GCC" = yes; then
  5094         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5095         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6442  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6443  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  5096   6444         else
  5097         -	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  5098         -	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
         6445  +	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
         6446  +	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  5099   6447         fi
  5100   6448         ;;
  5101   6449   
  5102   6450       uts4*)
  5103         -      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  5104         -      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5105         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
         6451  +      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
         6452  +      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
         6453  +      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  5106   6454         ;;
  5107   6455   
  5108   6456       *)
  5109         -      _LT_TAGVAR(ld_shlibs, $1)=no
         6457  +      _LT_AC_TAGVAR(ld_shlibs, $1)=no
  5110   6458         ;;
  5111   6459       esac
  5112         -
  5113         -    if test x$host_vendor = xsni; then
  5114         -      case $host in
  5115         -      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  5116         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
  5117         -	;;
  5118         -      esac
  5119         -    fi
  5120   6460     fi
  5121   6461   ])
  5122         -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
  5123         -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  5124         -
  5125         -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
  5126         -
  5127         -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
  5128         -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
  5129         -_LT_DECL([], [extract_expsyms_cmds], [2],
  5130         -    [The commands to extract the exported symbol list from a shared archive])
         6462  +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
         6463  +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  5131   6464   
  5132   6465   #
  5133   6466   # Do we need to explicitly link libc?
  5134   6467   #
  5135         -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
         6468  +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
  5136   6469   x|xyes)
  5137   6470     # Assume -lc should be added
  5138         -  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
         6471  +  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  5139   6472   
  5140   6473     if test "$enable_shared" = yes && test "$GCC" = yes; then
  5141         -    case $_LT_TAGVAR(archive_cmds, $1) in
         6474  +    case $_LT_AC_TAGVAR(archive_cmds, $1) in
  5142   6475       *'~'*)
  5143   6476         # FIXME: we may have to deal with multi-command sequences.
  5144   6477         ;;
  5145   6478       '$CC '*)
  5146   6479         # Test whether the compiler implicitly links with -lc since on some
  5147   6480         # systems, -lgcc has to come before -lc. If gcc already passes -lc
  5148   6481         # to ld, don't add -lc before -lgcc.
  5149   6482         AC_MSG_CHECKING([whether -lc should be explicitly linked in])
  5150         -      $RM conftest*
         6483  +      $rm conftest*
  5151   6484         echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  5152   6485   
  5153   6486         if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
  5154   6487           soname=conftest
  5155   6488           lib=conftest
  5156   6489           libobjs=conftest.$ac_objext
  5157   6490           deplibs=
  5158         -        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
  5159         -	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
         6491  +        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
         6492  +	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
  5160   6493           compiler_flags=-v
  5161   6494           linker_flags=-v
  5162   6495           verstring=
  5163   6496           output_objdir=.
  5164   6497           libname=conftest
  5165         -        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
  5166         -        _LT_TAGVAR(allow_undefined_flag, $1)=
  5167         -        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
         6498  +        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
         6499  +        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
         6500  +        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
  5168   6501           then
  5169         -	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
         6502  +	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  5170   6503           else
  5171         -	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
         6504  +	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  5172   6505           fi
  5173         -        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
         6506  +        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
  5174   6507         else
  5175   6508           cat conftest.err 1>&5
  5176   6509         fi
  5177         -      $RM conftest*
  5178         -      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
         6510  +      $rm conftest*
         6511  +      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
  5179   6512         ;;
  5180   6513       esac
  5181   6514     fi
  5182   6515     ;;
  5183   6516   esac
  5184         -
  5185         -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
  5186         -    [Whether or not to add -lc for building shared libraries])
  5187         -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
  5188         -    [enable_shared_with_static_runtimes], [0],
  5189         -    [Whether or not to disallow shared libs when runtime libs are static])
  5190         -_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
  5191         -    [Compiler flag to allow reflexive dlopens])
  5192         -_LT_TAGDECL([], [whole_archive_flag_spec], [1],
  5193         -    [Compiler flag to generate shared objects directly from archives])
  5194         -_LT_TAGDECL([], [compiler_needs_object], [1],
  5195         -    [Whether the compiler copes with passing no objects directly])
  5196         -_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
  5197         -    [Create an old-style archive from a shared archive])
  5198         -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
  5199         -    [Create a temporary old-style archive to link instead of a shared archive])
  5200         -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
  5201         -_LT_TAGDECL([], [archive_expsym_cmds], [2])
  5202         -_LT_TAGDECL([], [module_cmds], [2],
  5203         -    [Commands used to build a loadable module if different from building
  5204         -    a shared archive.])
  5205         -_LT_TAGDECL([], [module_expsym_cmds], [2])
  5206         -_LT_TAGDECL([], [with_gnu_ld], [1],
  5207         -    [Whether we are building with GNU ld or not])
  5208         -_LT_TAGDECL([], [allow_undefined_flag], [1],
  5209         -    [Flag that allows shared libraries with undefined symbols to be built])
  5210         -_LT_TAGDECL([], [no_undefined_flag], [1],
  5211         -    [Flag that enforces no undefined symbols])
  5212         -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
  5213         -    [Flag to hardcode $libdir into a binary during linking.
  5214         -    This must work even if $libdir does not exist])
  5215         -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
  5216         -    [[If ld is used when linking, flag to hardcode $libdir into a binary
  5217         -    during linking.  This must work even if $libdir does not exist]])
  5218         -_LT_TAGDECL([], [hardcode_libdir_separator], [1],
  5219         -    [Whether we need a single "-rpath" flag with a separated argument])
  5220         -_LT_TAGDECL([], [hardcode_direct], [0],
  5221         -    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  5222         -    DIR into the resulting binary])
  5223         -_LT_TAGDECL([], [hardcode_direct_absolute], [0],
  5224         -    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  5225         -    DIR into the resulting binary and the resulting library dependency is
  5226         -    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
  5227         -    library is relocated])
  5228         -_LT_TAGDECL([], [hardcode_minus_L], [0],
  5229         -    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  5230         -    into the resulting binary])
  5231         -_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
  5232         -    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  5233         -    into the resulting binary])
  5234         -_LT_TAGDECL([], [hardcode_automatic], [0],
  5235         -    [Set to "yes" if building a shared library automatically hardcodes DIR
  5236         -    into the library and all subsequent libraries and executables linked
  5237         -    against it])
  5238         -_LT_TAGDECL([], [inherit_rpath], [0],
  5239         -    [Set to yes if linker adds runtime paths of dependent libraries
  5240         -    to runtime path list])
  5241         -_LT_TAGDECL([], [link_all_deplibs], [0],
  5242         -    [Whether libtool must link a program against all its dependency libraries])
  5243         -_LT_TAGDECL([], [fix_srcfile_path], [1],
  5244         -    [Fix the shell variable $srcfile for the compiler])
  5245         -_LT_TAGDECL([], [always_export_symbols], [0],
  5246         -    [Set to "yes" if exported symbols are required])
  5247         -_LT_TAGDECL([], [export_symbols_cmds], [2],
  5248         -    [The commands to list exported symbols])
  5249         -_LT_TAGDECL([], [exclude_expsyms], [1],
  5250         -    [Symbols that should not be listed in the preloaded symbols])
  5251         -_LT_TAGDECL([], [include_expsyms], [1],
  5252         -    [Symbols that must always be exported])
  5253         -_LT_TAGDECL([], [prelink_cmds], [2],
  5254         -    [Commands necessary for linking programs (against libraries) with templates])
  5255         -_LT_TAGDECL([], [file_list_spec], [1],
  5256         -    [Specify filename containing input files])
  5257         -dnl FIXME: Not yet implemented
  5258         -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
  5259         -dnl    [Compiler flag to generate thread safe objects])
  5260         -])# _LT_LINKER_SHLIBS
  5261         -
  5262         -
  5263         -# _LT_LANG_C_CONFIG([TAG])
  5264         -# ------------------------
  5265         -# Ensure that the configuration variables for a C compiler are suitably
  5266         -# defined.  These variables are subsequently used by _LT_CONFIG to write
  5267         -# the compiler configuration to `libtool'.
  5268         -m4_defun([_LT_LANG_C_CONFIG],
  5269         -[m4_require([_LT_DECL_EGREP])dnl
  5270         -lt_save_CC="$CC"
  5271         -AC_LANG_PUSH(C)
  5272         -
  5273         -# Source file extension for C test sources.
  5274         -ac_ext=c
  5275         -
  5276         -# Object file extension for compiled C test sources.
  5277         -objext=o
  5278         -_LT_TAGVAR(objext, $1)=$objext
  5279         -
  5280         -# Code to be used in simple compile tests
  5281         -lt_simple_compile_test_code="int some_variable = 0;"
  5282         -
  5283         -# Code to be used in simple link tests
  5284         -lt_simple_link_test_code='int main(){return(0);}'
  5285         -
  5286         -_LT_TAG_COMPILER
  5287         -# Save the default compiler, since it gets overwritten when the other
  5288         -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
  5289         -compiler_DEFAULT=$CC
  5290         -
  5291         -# save warnings/boilerplate of simple test code
  5292         -_LT_COMPILER_BOILERPLATE
  5293         -_LT_LINKER_BOILERPLATE
  5294         -
  5295         -if test -n "$compiler"; then
  5296         -  _LT_COMPILER_NO_RTTI($1)
  5297         -  _LT_COMPILER_PIC($1)
  5298         -  _LT_COMPILER_C_O($1)
  5299         -  _LT_COMPILER_FILE_LOCKS($1)
  5300         -  _LT_LINKER_SHLIBS($1)
  5301         -  _LT_SYS_DYNAMIC_LINKER($1)
  5302         -  _LT_LINKER_HARDCODE_LIBPATH($1)
  5303         -  LT_SYS_DLOPEN_SELF
  5304         -  _LT_CMD_STRIPLIB
  5305         -
  5306         -  # Report which library types will actually be built
  5307         -  AC_MSG_CHECKING([if libtool supports shared libraries])
  5308         -  AC_MSG_RESULT([$can_build_shared])
  5309         -
  5310         -  AC_MSG_CHECKING([whether to build shared libraries])
  5311         -  test "$can_build_shared" = "no" && enable_shared=no
  5312         -
  5313         -  # On AIX, shared libraries and static libraries use the same namespace, and
  5314         -  # are all built from PIC.
  5315         -  case $host_os in
  5316         -  aix3*)
  5317         -    test "$enable_shared" = yes && enable_static=no
  5318         -    if test -n "$RANLIB"; then
  5319         -      archive_cmds="$archive_cmds~\$RANLIB \$lib"
  5320         -      postinstall_cmds='$RANLIB $lib'
  5321         -    fi
  5322         -    ;;
  5323         -
  5324         -  aix[[4-9]]*)
  5325         -    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  5326         -      test "$enable_shared" = yes && enable_static=no
  5327         -    fi
  5328         -    ;;
  5329         -  esac
  5330         -  AC_MSG_RESULT([$enable_shared])
  5331         -
  5332         -  AC_MSG_CHECKING([whether to build static libraries])
  5333         -  # Make sure either enable_shared or enable_static is yes.
  5334         -  test "$enable_shared" = yes || enable_static=yes
  5335         -  AC_MSG_RESULT([$enable_static])
  5336         -
  5337         -  _LT_CONFIG($1)
         6517  +])# AC_LIBTOOL_PROG_LD_SHLIBS
         6518  +
         6519  +
         6520  +# _LT_AC_FILE_LTDLL_C
         6521  +# -------------------
         6522  +# Be careful that the start marker always follows a newline.
         6523  +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
         6524  +# /* ltdll.c starts here */
         6525  +# #define WIN32_LEAN_AND_MEAN
         6526  +# #include <windows.h>
         6527  +# #undef WIN32_LEAN_AND_MEAN
         6528  +# #include <stdio.h>
         6529  +#
         6530  +# #ifndef __CYGWIN__
         6531  +# #  ifdef __CYGWIN32__
         6532  +# #    define __CYGWIN__ __CYGWIN32__
         6533  +# #  endif
         6534  +# #endif
         6535  +#
         6536  +# #ifdef __cplusplus
         6537  +# extern "C" {
         6538  +# #endif
         6539  +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
         6540  +# #ifdef __cplusplus
         6541  +# }
         6542  +# #endif
         6543  +#
         6544  +# #ifdef __CYGWIN__
         6545  +# #include <cygwin/cygwin_dll.h>
         6546  +# DECLARE_CYGWIN_DLL( DllMain );
         6547  +# #endif
         6548  +# HINSTANCE __hDllInstance_base;
         6549  +#
         6550  +# BOOL APIENTRY
         6551  +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
         6552  +# {
         6553  +#   __hDllInstance_base = hInst;
         6554  +#   return TRUE;
         6555  +# }
         6556  +# /* ltdll.c ends here */
         6557  +])# _LT_AC_FILE_LTDLL_C
         6558  +
         6559  +
         6560  +# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
         6561  +# ---------------------------------
         6562  +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
         6563  +
         6564  +
         6565  +# old names
         6566  +AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
         6567  +AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
         6568  +AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
         6569  +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
         6570  +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
         6571  +AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
         6572  +AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
         6573  +
         6574  +# This is just to silence aclocal about the macro not being used
         6575  +ifelse([AC_DISABLE_FAST_INSTALL])
         6576  +
         6577  +AC_DEFUN([LT_AC_PROG_GCJ],
         6578  +[AC_CHECK_TOOL(GCJ, gcj, no)
         6579  +  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
         6580  +  AC_SUBST(GCJFLAGS)
         6581  +])
         6582  +
         6583  +AC_DEFUN([LT_AC_PROG_RC],
         6584  +[AC_CHECK_TOOL(RC, windres, no)
         6585  +])
         6586  +
         6587  +
         6588  +# Cheap backport of AS_EXECUTABLE_P and required macros
         6589  +# from Autoconf 2.59; we should not use $as_executable_p directly.
         6590  +
         6591  +# _AS_TEST_PREPARE
         6592  +# ----------------
         6593  +m4_ifndef([_AS_TEST_PREPARE],
         6594  +[m4_defun([_AS_TEST_PREPARE],
         6595  +[if test -x / >/dev/null 2>&1; then
         6596  +  as_executable_p='test -x'
         6597  +else
         6598  +  as_executable_p='test -f'
  5338   6599   fi
  5339         -AC_LANG_POP
  5340         -CC="$lt_save_CC"
  5341         -])# _LT_LANG_C_CONFIG
  5342         -
  5343         -
  5344         -# _LT_PROG_CXX
  5345         -# ------------
  5346         -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
  5347         -# compiler, we have our own version here.
  5348         -m4_defun([_LT_PROG_CXX],
  5349         -[
  5350         -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
  5351         -AC_PROG_CXX
  5352         -if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
  5353         -    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
  5354         -    (test "X$CXX" != "Xg++"))) ; then
  5355         -  AC_PROG_CXXCPP
  5356         -else
  5357         -  _lt_caught_CXX_error=yes
  5358         -fi
  5359         -popdef([AC_MSG_ERROR])
  5360         -])# _LT_PROG_CXX
  5361         -
  5362         -dnl aclocal-1.4 backwards compatibility:
  5363         -dnl AC_DEFUN([_LT_PROG_CXX], [])
  5364         -
  5365         -
  5366         -# _LT_LANG_CXX_CONFIG([TAG])
  5367         -# --------------------------
  5368         -# Ensure that the configuration variables for a C++ compiler are suitably
  5369         -# defined.  These variables are subsequently used by _LT_CONFIG to write
  5370         -# the compiler configuration to `libtool'.
  5371         -m4_defun([_LT_LANG_CXX_CONFIG],
  5372         -[AC_REQUIRE([_LT_PROG_CXX])dnl
  5373         -m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  5374         -m4_require([_LT_DECL_EGREP])dnl
  5375         -
  5376         -AC_LANG_PUSH(C++)
  5377         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5378         -_LT_TAGVAR(allow_undefined_flag, $1)=
  5379         -_LT_TAGVAR(always_export_symbols, $1)=no
  5380         -_LT_TAGVAR(archive_expsym_cmds, $1)=
  5381         -_LT_TAGVAR(compiler_needs_object, $1)=no
  5382         -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
  5383         -_LT_TAGVAR(hardcode_direct, $1)=no
  5384         -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
  5385         -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  5386         -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  5387         -_LT_TAGVAR(hardcode_libdir_separator, $1)=
  5388         -_LT_TAGVAR(hardcode_minus_L, $1)=no
  5389         -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  5390         -_LT_TAGVAR(hardcode_automatic, $1)=no
  5391         -_LT_TAGVAR(inherit_rpath, $1)=no
  5392         -_LT_TAGVAR(module_cmds, $1)=
  5393         -_LT_TAGVAR(module_expsym_cmds, $1)=
  5394         -_LT_TAGVAR(link_all_deplibs, $1)=unknown
  5395         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  5396         -_LT_TAGVAR(no_undefined_flag, $1)=
  5397         -_LT_TAGVAR(whole_archive_flag_spec, $1)=
  5398         -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  5399         -
  5400         -# Source file extension for C++ test sources.
  5401         -ac_ext=cpp
  5402         -
  5403         -# Object file extension for compiled C++ test sources.
  5404         -objext=o
  5405         -_LT_TAGVAR(objext, $1)=$objext
  5406         -
  5407         -# No sense in running all these tests if we already determined that
  5408         -# the CXX compiler isn't working.  Some variables (like enable_shared)
  5409         -# are currently assumed to apply to all compilers on this platform,
  5410         -# and will be corrupted by setting them based on a non-working compiler.
  5411         -if test "$_lt_caught_CXX_error" != yes; then
  5412         -  # Code to be used in simple compile tests
  5413         -  lt_simple_compile_test_code="int some_variable = 0;"
  5414         -
  5415         -  # Code to be used in simple link tests
  5416         -  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
  5417         -
  5418         -  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  5419         -  _LT_TAG_COMPILER
  5420         -
  5421         -  # save warnings/boilerplate of simple test code
  5422         -  _LT_COMPILER_BOILERPLATE
  5423         -  _LT_LINKER_BOILERPLATE
  5424         -
  5425         -  # Allow CC to be a program name with arguments.
  5426         -  lt_save_CC=$CC
  5427         -  lt_save_LD=$LD
  5428         -  lt_save_GCC=$GCC
  5429         -  GCC=$GXX
  5430         -  lt_save_with_gnu_ld=$with_gnu_ld
  5431         -  lt_save_path_LD=$lt_cv_path_LD
  5432         -  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
  5433         -    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
  5434         -  else
  5435         -    $as_unset lt_cv_prog_gnu_ld
  5436         -  fi
  5437         -  if test -n "${lt_cv_path_LDCXX+set}"; then
  5438         -    lt_cv_path_LD=$lt_cv_path_LDCXX
  5439         -  else
  5440         -    $as_unset lt_cv_path_LD
  5441         -  fi
  5442         -  test -z "${LDCXX+set}" || LD=$LDCXX
  5443         -  CC=${CXX-"c++"}
  5444         -  compiler=$CC
  5445         -  _LT_TAGVAR(compiler, $1)=$CC
  5446         -  _LT_CC_BASENAME([$compiler])
  5447         -
  5448         -  if test -n "$compiler"; then
  5449         -    # We don't want -fno-exception when compiling C++ code, so set the
  5450         -    # no_builtin_flag separately
  5451         -    if test "$GXX" = yes; then
  5452         -      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  5453         -    else
  5454         -      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  5455         -    fi
  5456         -
  5457         -    if test "$GXX" = yes; then
  5458         -      # Set up default GNU C++ configuration
  5459         -
  5460         -      LT_PATH_LD
  5461         -
  5462         -      # Check if GNU C++ uses GNU ld as the underlying linker, since the
  5463         -      # archiving commands below assume that GNU ld is being used.
  5464         -      if test "$with_gnu_ld" = yes; then
  5465         -        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5466         -        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5467         -
  5468         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5469         -        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  5470         -
  5471         -        # If archive_cmds runs LD, not CC, wlarc should be empty
  5472         -        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
  5473         -        #     investigate it a little bit more. (MM)
  5474         -        wlarc='${wl}'
  5475         -
  5476         -        # ancient GNU ld didn't support --whole-archive et. al.
  5477         -        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
  5478         -	  $GREP 'no-whole-archive' > /dev/null; then
  5479         -          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  5480         -        else
  5481         -          _LT_TAGVAR(whole_archive_flag_spec, $1)=
  5482         -        fi
  5483         -      else
  5484         -        with_gnu_ld=no
  5485         -        wlarc=
  5486         -
  5487         -        # A generic and very simple default shared library creation
  5488         -        # command for GNU C++ for the case where it uses the native
  5489         -        # linker, instead of GNU ld.  If possible, this setting should
  5490         -        # overridden to take advantage of the native linker features on
  5491         -        # the platform it is being used on.
  5492         -        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  5493         -      fi
  5494         -
  5495         -      # Commands to make compiler produce verbose output that lists
  5496         -      # what "hidden" libraries, object files and flags are used when
  5497         -      # linking a shared library.
  5498         -      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
  5499         -
  5500         -    else
  5501         -      GXX=no
  5502         -      with_gnu_ld=no
  5503         -      wlarc=
  5504         -    fi
  5505         -
  5506         -    # PORTME: fill in a description of your system's C++ link characteristics
  5507         -    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  5508         -    _LT_TAGVAR(ld_shlibs, $1)=yes
  5509         -    case $host_os in
  5510         -      aix3*)
  5511         -        # FIXME: insert proper C++ library support
  5512         -        _LT_TAGVAR(ld_shlibs, $1)=no
  5513         -        ;;
  5514         -      aix[[4-9]]*)
  5515         -        if test "$host_cpu" = ia64; then
  5516         -          # On IA64, the linker does run time linking by default, so we don't
  5517         -          # have to do anything special.
  5518         -          aix_use_runtimelinking=no
  5519         -          exp_sym_flag='-Bexport'
  5520         -          no_entry_flag=""
  5521         -        else
  5522         -          aix_use_runtimelinking=no
  5523         -
  5524         -          # Test if we are trying to use run time linking or normal
  5525         -          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  5526         -          # need to do runtime linking.
  5527         -          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
  5528         -	    for ld_flag in $LDFLAGS; do
  5529         -	      case $ld_flag in
  5530         -	      *-brtl*)
  5531         -	        aix_use_runtimelinking=yes
  5532         -	        break
  5533         -	        ;;
  5534         -	      esac
  5535         -	    done
  5536         -	    ;;
  5537         -          esac
  5538         -
  5539         -          exp_sym_flag='-bexport'
  5540         -          no_entry_flag='-bnoentry'
  5541         -        fi
  5542         -
  5543         -        # When large executables or shared objects are built, AIX ld can
  5544         -        # have problems creating the table of contents.  If linking a library
  5545         -        # or program results in "error TOC overflow" add -mminimal-toc to
  5546         -        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
  5547         -        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  5548         -
  5549         -        _LT_TAGVAR(archive_cmds, $1)=''
  5550         -        _LT_TAGVAR(hardcode_direct, $1)=yes
  5551         -        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  5552         -        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  5553         -        _LT_TAGVAR(link_all_deplibs, $1)=yes
  5554         -        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
  5555         -
  5556         -        if test "$GXX" = yes; then
  5557         -          case $host_os in aix4.[[012]]|aix4.[[012]].*)
  5558         -          # We only want to do this on AIX 4.2 and lower, the check
  5559         -          # below for broken collect2 doesn't work under 4.3+
  5560         -	  collect2name=`${CC} -print-prog-name=collect2`
  5561         -	  if test -f "$collect2name" &&
  5562         -	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
  5563         -	  then
  5564         -	    # We have reworked collect2
  5565         -	    :
  5566         -	  else
  5567         -	    # We have old collect2
  5568         -	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
  5569         -	    # It fails to find uninstalled libraries when the uninstalled
  5570         -	    # path is not listed in the libpath.  Setting hardcode_minus_L
  5571         -	    # to unsupported forces relinking
  5572         -	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
  5573         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5574         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
  5575         -	  fi
  5576         -          esac
  5577         -          shared_flag='-shared'
  5578         -	  if test "$aix_use_runtimelinking" = yes; then
  5579         -	    shared_flag="$shared_flag "'${wl}-G'
  5580         -	  fi
  5581         -        else
  5582         -          # not using gcc
  5583         -          if test "$host_cpu" = ia64; then
  5584         -	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  5585         -	  # chokes on -Wl,-G. The following line is correct:
  5586         -	  shared_flag='-G'
  5587         -          else
  5588         -	    if test "$aix_use_runtimelinking" = yes; then
  5589         -	      shared_flag='${wl}-G'
  5590         -	    else
  5591         -	      shared_flag='${wl}-bM:SRE'
  5592         -	    fi
  5593         -          fi
  5594         -        fi
  5595         -
  5596         -        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
  5597         -        # It seems that -bexpall does not export symbols beginning with
  5598         -        # underscore (_), so it is better to generate a list of symbols to
  5599         -	# export.
  5600         -        _LT_TAGVAR(always_export_symbols, $1)=yes
  5601         -        if test "$aix_use_runtimelinking" = yes; then
  5602         -          # Warning - without using the other runtime loading flags (-brtl),
  5603         -          # -berok will link without error, but may produce a broken library.
  5604         -          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
  5605         -          # Determine the default libpath from the value encoded in an empty
  5606         -          # executable.
  5607         -          _LT_SYS_MODULE_PATH_AIX
  5608         -          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  5609         -
  5610         -          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  5611         -        else
  5612         -          if test "$host_cpu" = ia64; then
  5613         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  5614         -	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  5615         -	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  5616         -          else
  5617         -	    # Determine the default libpath from the value encoded in an
  5618         -	    # empty executable.
  5619         -	    _LT_SYS_MODULE_PATH_AIX
  5620         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  5621         -	    # Warning - without using the other run time loading flags,
  5622         -	    # -berok will link without error, but may produce a broken library.
  5623         -	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  5624         -	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  5625         -	    # Exported symbols can be pulled into shared objects from archives
  5626         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
  5627         -	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
  5628         -	    # This is similar to how AIX traditionally builds its shared
  5629         -	    # libraries.
  5630         -	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  5631         -          fi
  5632         -        fi
  5633         -        ;;
  5634         -
  5635         -      beos*)
  5636         -	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
  5637         -	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  5638         -	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  5639         -	  # support --undefined.  This deserves some investigation.  FIXME
  5640         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5641         -	else
  5642         -	  _LT_TAGVAR(ld_shlibs, $1)=no
  5643         -	fi
  5644         -	;;
  5645         -
  5646         -      chorus*)
  5647         -        case $cc_basename in
  5648         -          *)
  5649         -	  # FIXME: insert proper C++ library support
  5650         -	  _LT_TAGVAR(ld_shlibs, $1)=no
  5651         -	  ;;
  5652         -        esac
  5653         -        ;;
  5654         -
  5655         -      cygwin* | mingw* | pw32* | cegcc*)
  5656         -        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
  5657         -        # as there is no search path for DLLs.
  5658         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  5659         -        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
  5660         -        _LT_TAGVAR(always_export_symbols, $1)=no
  5661         -        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  5662         -
  5663         -        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
  5664         -          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  5665         -          # If the export-symbols file already is a .def file (1st line
  5666         -          # is EXPORTS), use it as is; otherwise, prepend...
  5667         -          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  5668         -	    cp $export_symbols $output_objdir/$soname.def;
  5669         -          else
  5670         -	    echo EXPORTS > $output_objdir/$soname.def;
  5671         -	    cat $export_symbols >> $output_objdir/$soname.def;
  5672         -          fi~
  5673         -          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  5674         -        else
  5675         -          _LT_TAGVAR(ld_shlibs, $1)=no
  5676         -        fi
  5677         -        ;;
  5678         -      darwin* | rhapsody*)
  5679         -        _LT_DARWIN_LINKER_FEATURES($1)
  5680         -	;;
  5681         -
  5682         -      dgux*)
  5683         -        case $cc_basename in
  5684         -          ec++*)
  5685         -	    # FIXME: insert proper C++ library support
  5686         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  5687         -	    ;;
  5688         -          ghcx*)
  5689         -	    # Green Hills C++ Compiler
  5690         -	    # FIXME: insert proper C++ library support
  5691         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  5692         -	    ;;
  5693         -          *)
  5694         -	    # FIXME: insert proper C++ library support
  5695         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  5696         -	    ;;
  5697         -        esac
  5698         -        ;;
  5699         -
  5700         -      freebsd[[12]]*)
  5701         -        # C++ shared libraries reported to be fairly broken before
  5702         -	# switch to ELF
  5703         -        _LT_TAGVAR(ld_shlibs, $1)=no
  5704         -        ;;
  5705         -
  5706         -      freebsd-elf*)
  5707         -        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5708         -        ;;
  5709         -
  5710         -      freebsd* | dragonfly*)
  5711         -        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
  5712         -        # conventions
  5713         -        _LT_TAGVAR(ld_shlibs, $1)=yes
  5714         -        ;;
  5715         -
  5716         -      gnu*)
  5717         -        ;;
  5718         -
  5719         -      hpux9*)
  5720         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  5721         -        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5722         -        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5723         -        _LT_TAGVAR(hardcode_direct, $1)=yes
  5724         -        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  5725         -				             # but as the default
  5726         -				             # location of the library.
  5727         -
  5728         -        case $cc_basename in
  5729         -          CC*)
  5730         -            # FIXME: insert proper C++ library support
  5731         -            _LT_TAGVAR(ld_shlibs, $1)=no
  5732         -            ;;
  5733         -          aCC*)
  5734         -            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  5735         -            # Commands to make compiler produce verbose output that lists
  5736         -            # what "hidden" libraries, object files and flags are used when
  5737         -            # linking a shared library.
  5738         -            #
  5739         -            # There doesn't appear to be a way to prevent this compiler from
  5740         -            # explicitly linking system object files so we need to strip them
  5741         -            # from the output so that they don't get included in the library
  5742         -            # dependencies.
  5743         -            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
  5744         -            ;;
  5745         -          *)
  5746         -            if test "$GXX" = yes; then
  5747         -              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  5748         -            else
  5749         -              # FIXME: insert proper C++ library support
  5750         -              _LT_TAGVAR(ld_shlibs, $1)=no
  5751         -            fi
  5752         -            ;;
  5753         -        esac
  5754         -        ;;
  5755         -
  5756         -      hpux10*|hpux11*)
  5757         -        if test $with_gnu_ld = no; then
  5758         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  5759         -	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5760         -
  5761         -          case $host_cpu in
  5762         -            hppa*64*|ia64*)
  5763         -              ;;
  5764         -            *)
  5765         -	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5766         -              ;;
  5767         -          esac
  5768         -        fi
  5769         -        case $host_cpu in
  5770         -          hppa*64*|ia64*)
  5771         -            _LT_TAGVAR(hardcode_direct, $1)=no
  5772         -            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5773         -            ;;
  5774         -          *)
  5775         -            _LT_TAGVAR(hardcode_direct, $1)=yes
  5776         -            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  5777         -            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  5778         -					         # but as the default
  5779         -					         # location of the library.
  5780         -            ;;
  5781         -        esac
  5782         -
  5783         -        case $cc_basename in
  5784         -          CC*)
  5785         -	    # FIXME: insert proper C++ library support
  5786         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  5787         -	    ;;
  5788         -          aCC*)
  5789         -	    case $host_cpu in
  5790         -	      hppa*64*)
  5791         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5792         -	        ;;
  5793         -	      ia64*)
  5794         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5795         -	        ;;
  5796         -	      *)
  5797         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5798         -	        ;;
  5799         -	    esac
  5800         -	    # Commands to make compiler produce verbose output that lists
  5801         -	    # what "hidden" libraries, object files and flags are used when
  5802         -	    # linking a shared library.
  5803         -	    #
  5804         -	    # There doesn't appear to be a way to prevent this compiler from
  5805         -	    # explicitly linking system object files so we need to strip them
  5806         -	    # from the output so that they don't get included in the library
  5807         -	    # dependencies.
  5808         -	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
  5809         -	    ;;
  5810         -          *)
  5811         -	    if test "$GXX" = yes; then
  5812         -	      if test $with_gnu_ld = no; then
  5813         -	        case $host_cpu in
  5814         -	          hppa*64*)
  5815         -	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5816         -	            ;;
  5817         -	          ia64*)
  5818         -	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5819         -	            ;;
  5820         -	          *)
  5821         -	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5822         -	            ;;
  5823         -	        esac
  5824         -	      fi
  5825         -	    else
  5826         -	      # FIXME: insert proper C++ library support
  5827         -	      _LT_TAGVAR(ld_shlibs, $1)=no
  5828         -	    fi
  5829         -	    ;;
  5830         -        esac
  5831         -        ;;
  5832         -
  5833         -      interix[[3-9]]*)
  5834         -	_LT_TAGVAR(hardcode_direct, $1)=no
  5835         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  5836         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  5837         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  5838         -	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
  5839         -	# Instead, shared libraries are loaded at an image base (0x10000000 by
  5840         -	# default) and relocated if they conflict, which is a slow very memory
  5841         -	# consuming and fragmenting process.  To avoid this, we pick a random,
  5842         -	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
  5843         -	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
  5844         -	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  5845         -	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  5846         -	;;
  5847         -      irix5* | irix6*)
  5848         -        case $cc_basename in
  5849         -          CC*)
  5850         -	    # SGI C++
  5851         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
  5852         -
  5853         -	    # Archives containing C++ object files must be created using
  5854         -	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
  5855         -	    # necessary to make sure instantiated templates are included
  5856         -	    # in the archive.
  5857         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
  5858         -	    ;;
  5859         -          *)
  5860         -	    if test "$GXX" = yes; then
  5861         -	      if test "$with_gnu_ld" = no; then
  5862         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  5863         -	      else
  5864         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
  5865         -	      fi
  5866         -	    fi
  5867         -	    _LT_TAGVAR(link_all_deplibs, $1)=yes
  5868         -	    ;;
  5869         -        esac
  5870         -        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5871         -        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5872         -        _LT_TAGVAR(inherit_rpath, $1)=yes
  5873         -        ;;
  5874         -
  5875         -      linux* | k*bsd*-gnu | kopensolaris*-gnu)
  5876         -        case $cc_basename in
  5877         -          KCC*)
  5878         -	    # Kuck and Associates, Inc. (KAI) C++ Compiler
  5879         -
  5880         -	    # KCC will only create a shared library if the output file
  5881         -	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
  5882         -	    # to its proper name (with version) after linking.
  5883         -	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  5884         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
  5885         -	    # Commands to make compiler produce verbose output that lists
  5886         -	    # what "hidden" libraries, object files and flags are used when
  5887         -	    # linking a shared library.
  5888         -	    #
  5889         -	    # There doesn't appear to be a way to prevent this compiler from
  5890         -	    # explicitly linking system object files so we need to strip them
  5891         -	    # from the output so that they don't get included in the library
  5892         -	    # dependencies.
  5893         -	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
  5894         -
  5895         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  5896         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  5897         -
  5898         -	    # Archives containing C++ object files must be created using
  5899         -	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  5900         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  5901         -	    ;;
  5902         -	  icpc* | ecpc* )
  5903         -	    # Intel C++
  5904         -	    with_gnu_ld=yes
  5905         -	    # version 8.0 and above of icpc choke on multiply defined symbols
  5906         -	    # if we add $predep_objects and $postdep_objects, however 7.1 and
  5907         -	    # earlier do not add the objects themselves.
  5908         -	    case `$CC -V 2>&1` in
  5909         -	      *"Version 7."*)
  5910         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5911         -		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5912         -		;;
  5913         -	      *)  # Version 8.0 or newer
  5914         -	        tmp_idyn=
  5915         -	        case $host_cpu in
  5916         -		  ia64*) tmp_idyn=' -i_dynamic';;
  5917         -		esac
  5918         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5919         -		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5920         -		;;
  5921         -	    esac
  5922         -	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  5923         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  5924         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  5925         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  5926         -	    ;;
  5927         -          pgCC* | pgcpp*)
  5928         -            # Portland Group C++ compiler
  5929         -	    case `$CC -V` in
  5930         -	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
  5931         -	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
  5932         -		rm -rf $tpldir~
  5933         -		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
  5934         -		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
  5935         -	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
  5936         -		rm -rf $tpldir~
  5937         -		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
  5938         -		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
  5939         -		$RANLIB $oldlib'
  5940         -	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
  5941         -		rm -rf $tpldir~
  5942         -		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
  5943         -		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  5944         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
  5945         -		rm -rf $tpldir~
  5946         -		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
  5947         -		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
  5948         -	      ;;
  5949         -	    *) # Version 6 will use weak symbols
  5950         -	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  5951         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
  5952         -	      ;;
  5953         -	    esac
  5954         -
  5955         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  5956         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  5957         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
  5958         -            ;;
  5959         -	  cxx*)
  5960         -	    # Compaq C++
  5961         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5962         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
  5963         -
  5964         -	    runpath_var=LD_RUN_PATH
  5965         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  5966         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  5967         -
  5968         -	    # Commands to make compiler produce verbose output that lists
  5969         -	    # what "hidden" libraries, object files and flags are used when
  5970         -	    # linking a shared library.
  5971         -	    #
  5972         -	    # There doesn't appear to be a way to prevent this compiler from
  5973         -	    # explicitly linking system object files so we need to strip them
  5974         -	    # from the output so that they don't get included in the library
  5975         -	    # dependencies.
  5976         -	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
  5977         -	    ;;
  5978         -	  xl*)
  5979         -	    # IBM XL 8.0 on PPC, with GNU ld
  5980         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  5981         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  5982         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  5983         -	    if test "x$supports_anon_versioning" = xyes; then
  5984         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
  5985         -		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
  5986         -		echo "local: *; };" >> $output_objdir/$libname.ver~
  5987         -		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
  5988         -	    fi
  5989         -	    ;;
  5990         -	  *)
  5991         -	    case `$CC -V 2>&1 | sed 5q` in
  5992         -	    *Sun\ C*)
  5993         -	      # Sun C++ 5.9
  5994         -	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  5995         -	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  5996         -	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
  5997         -	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  5998         -	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
  5999         -	      _LT_TAGVAR(compiler_needs_object, $1)=yes
  6000         -
  6001         -	      # Not sure whether something based on
  6002         -	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
  6003         -	      # would be better.
  6004         -	      output_verbose_link_cmd='echo'
  6005         -
  6006         -	      # Archives containing C++ object files must be created using
  6007         -	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
  6008         -	      # necessary to make sure instantiated templates are included
  6009         -	      # in the archive.
  6010         -	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  6011         -	      ;;
  6012         -	    esac
  6013         -	    ;;
  6014         -	esac
  6015         -	;;
  6016         -
  6017         -      lynxos*)
  6018         -        # FIXME: insert proper C++ library support
  6019         -	_LT_TAGVAR(ld_shlibs, $1)=no
  6020         -	;;
  6021         -
  6022         -      m88k*)
  6023         -        # FIXME: insert proper C++ library support
  6024         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6025         -	;;
  6026         -
  6027         -      mvs*)
  6028         -        case $cc_basename in
  6029         -          cxx*)
  6030         -	    # FIXME: insert proper C++ library support
  6031         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6032         -	    ;;
  6033         -	  *)
  6034         -	    # FIXME: insert proper C++ library support
  6035         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6036         -	    ;;
  6037         -	esac
  6038         -	;;
  6039         -
  6040         -      netbsd*)
  6041         -        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
  6042         -	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
  6043         -	  wlarc=
  6044         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  6045         -	  _LT_TAGVAR(hardcode_direct, $1)=yes
  6046         -	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6047         -	fi
  6048         -	# Workaround some broken pre-1.5 toolchains
  6049         -	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
  6050         -	;;
  6051         -
  6052         -      *nto* | *qnx*)
  6053         -        _LT_TAGVAR(ld_shlibs, $1)=yes
  6054         -	;;
  6055         -
  6056         -      openbsd2*)
  6057         -        # C++ shared libraries are fairly broken
  6058         -	_LT_TAGVAR(ld_shlibs, $1)=no
  6059         -	;;
  6060         -
  6061         -      openbsd*)
  6062         -	if test -f /usr/libexec/ld.so; then
  6063         -	  _LT_TAGVAR(hardcode_direct, $1)=yes
  6064         -	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6065         -	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
  6066         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  6067         -	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6068         -	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  6069         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
  6070         -	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  6071         -	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  6072         -	  fi
  6073         -	  output_verbose_link_cmd=echo
  6074         -	else
  6075         -	  _LT_TAGVAR(ld_shlibs, $1)=no
  6076         -	fi
  6077         -	;;
  6078         -
  6079         -      osf3* | osf4* | osf5*)
  6080         -        case $cc_basename in
  6081         -          KCC*)
  6082         -	    # Kuck and Associates, Inc. (KAI) C++ Compiler
  6083         -
  6084         -	    # KCC will only create a shared library if the output file
  6085         -	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
  6086         -	    # to its proper name (with version) after linking.
  6087         -	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  6088         -
  6089         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  6090         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6091         -
  6092         -	    # Archives containing C++ object files must be created using
  6093         -	    # the KAI C++ compiler.
  6094         -	    case $host in
  6095         -	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
  6096         -	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
  6097         -	    esac
  6098         -	    ;;
  6099         -          RCC*)
  6100         -	    # Rational C++ 2.4.1
  6101         -	    # FIXME: insert proper C++ library support
  6102         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6103         -	    ;;
  6104         -          cxx*)
  6105         -	    case $host in
  6106         -	      osf3*)
  6107         -	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  6108         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
  6109         -	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  6110         -		;;
  6111         -	      *)
  6112         -	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  6113         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
  6114         -	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
  6115         -	          echo "-hidden">> $lib.exp~
  6116         -	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
  6117         -	          $RM $lib.exp'
  6118         -	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  6119         -		;;
  6120         -	    esac
  6121         -
  6122         -	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6123         -
  6124         -	    # Commands to make compiler produce verbose output that lists
  6125         -	    # what "hidden" libraries, object files and flags are used when
  6126         -	    # linking a shared library.
  6127         -	    #
  6128         -	    # There doesn't appear to be a way to prevent this compiler from
  6129         -	    # explicitly linking system object files so we need to strip them
  6130         -	    # from the output so that they don't get included in the library
  6131         -	    # dependencies.
  6132         -	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
  6133         -	    ;;
  6134         -	  *)
  6135         -	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  6136         -	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  6137         -	      case $host in
  6138         -	        osf3*)
  6139         -	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  6140         -		  ;;
  6141         -	        *)
  6142         -	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  6143         -		  ;;
  6144         -	      esac
  6145         -
  6146         -	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  6147         -	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
  6148         -
  6149         -	      # Commands to make compiler produce verbose output that lists
  6150         -	      # what "hidden" libraries, object files and flags are used when
  6151         -	      # linking a shared library.
  6152         -	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
  6153         -
  6154         -	    else
  6155         -	      # FIXME: insert proper C++ library support
  6156         -	      _LT_TAGVAR(ld_shlibs, $1)=no
  6157         -	    fi
  6158         -	    ;;
  6159         -        esac
  6160         -        ;;
  6161         -
  6162         -      psos*)
  6163         -        # FIXME: insert proper C++ library support
  6164         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6165         -        ;;
  6166         -
  6167         -      sunos4*)
  6168         -        case $cc_basename in
  6169         -          CC*)
  6170         -	    # Sun C++ 4.x
  6171         -	    # FIXME: insert proper C++ library support
  6172         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6173         -	    ;;
  6174         -          lcc*)
  6175         -	    # Lucid
  6176         -	    # FIXME: insert proper C++ library support
  6177         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6178         -	    ;;
  6179         -          *)
  6180         -	    # FIXME: insert proper C++ library support
  6181         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6182         -	    ;;
  6183         -        esac
  6184         -        ;;
  6185         -
  6186         -      solaris*)
  6187         -        case $cc_basename in
  6188         -          CC*)
  6189         -	    # Sun C++ 4.2, 5.x and Centerline C++
  6190         -            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
  6191         -	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  6192         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  6193         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  6194         -	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
  6195         -
  6196         -	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  6197         -	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6198         -	    case $host_os in
  6199         -	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  6200         -	      *)
  6201         -		# The compiler driver will combine and reorder linker options,
  6202         -		# but understands `-z linker_flag'.
  6203         -	        # Supported since Solaris 2.6 (maybe 2.5.1?)
  6204         -		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
  6205         -	        ;;
  6206         -	    esac
  6207         -	    _LT_TAGVAR(link_all_deplibs, $1)=yes
  6208         -
  6209         -	    output_verbose_link_cmd='echo'
  6210         -
  6211         -	    # Archives containing C++ object files must be created using
  6212         -	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
  6213         -	    # necessary to make sure instantiated templates are included
  6214         -	    # in the archive.
  6215         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  6216         -	    ;;
  6217         -          gcx*)
  6218         -	    # Green Hills C++ Compiler
  6219         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  6220         -
  6221         -	    # The C++ compiler must be used to create the archive.
  6222         -	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
  6223         -	    ;;
  6224         -          *)
  6225         -	    # GNU C++ compiler with Solaris linker
  6226         -	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  6227         -	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
  6228         -	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
  6229         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  6230         -	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  6231         -		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
  6232         -
  6233         -	        # Commands to make compiler produce verbose output that lists
  6234         -	        # what "hidden" libraries, object files and flags are used when
  6235         -	        # linking a shared library.
  6236         -	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
  6237         -	      else
  6238         -	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
  6239         -	        # platform.
  6240         -	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  6241         -	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
  6242         -		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
  6243         -
  6244         -	        # Commands to make compiler produce verbose output that lists
  6245         -	        # what "hidden" libraries, object files and flags are used when
  6246         -	        # linking a shared library.
  6247         -	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
  6248         -	      fi
  6249         -
  6250         -	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
  6251         -	      case $host_os in
  6252         -		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  6253         -		*)
  6254         -		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
  6255         -		  ;;
  6256         -	      esac
  6257         -	    fi
  6258         -	    ;;
  6259         -        esac
  6260         -        ;;
  6261         -
  6262         -    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
  6263         -      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  6264         -      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6265         -      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6266         -      runpath_var='LD_RUN_PATH'
  6267         -
  6268         -      case $cc_basename in
  6269         -        CC*)
  6270         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6271         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6272         -	  ;;
  6273         -	*)
  6274         -	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6275         -	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6276         -	  ;;
  6277         -      esac
  6278         -      ;;
  6279         -
  6280         -      sysv5* | sco3.2v5* | sco5v6*)
  6281         -	# Note: We can NOT use -z defs as we might desire, because we do not
  6282         -	# link with -lc, and that would cause any symbols used from libc to
  6283         -	# always be unresolved, which means just about no library would
  6284         -	# ever link correctly.  If we're not using GNU ld we use -z text
  6285         -	# though, which does catch some bad symbols but isn't as heavy-handed
  6286         -	# as -z defs.
  6287         -	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  6288         -	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
  6289         -	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6290         -	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
  6291         -	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
  6292         -	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
  6293         -	_LT_TAGVAR(link_all_deplibs, $1)=yes
  6294         -	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  6295         -	runpath_var='LD_RUN_PATH'
  6296         -
  6297         -	case $cc_basename in
  6298         -          CC*)
  6299         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6300         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6301         -	    ;;
  6302         -	  *)
  6303         -	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6304         -	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  6305         -	    ;;
  6306         -	esac
  6307         -      ;;
  6308         -
  6309         -      tandem*)
  6310         -        case $cc_basename in
  6311         -          NCC*)
  6312         -	    # NonStop-UX NCC 3.20
  6313         -	    # FIXME: insert proper C++ library support
  6314         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6315         -	    ;;
  6316         -          *)
  6317         -	    # FIXME: insert proper C++ library support
  6318         -	    _LT_TAGVAR(ld_shlibs, $1)=no
  6319         -	    ;;
  6320         -        esac
  6321         -        ;;
  6322         -
  6323         -      vxworks*)
  6324         -        # FIXME: insert proper C++ library support
  6325         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6326         -        ;;
  6327         -
  6328         -      *)
  6329         -        # FIXME: insert proper C++ library support
  6330         -        _LT_TAGVAR(ld_shlibs, $1)=no
  6331         -        ;;
  6332         -    esac
  6333         -
  6334         -    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
  6335         -    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  6336         -
  6337         -    _LT_TAGVAR(GCC, $1)="$GXX"
  6338         -    _LT_TAGVAR(LD, $1)="$LD"
  6339         -
  6340         -    ## CAVEAT EMPTOR:
  6341         -    ## There is no encapsulation within the following macros, do not change
  6342         -    ## the running order or otherwise move them around unless you know exactly
  6343         -    ## what you are doing...
  6344         -    _LT_SYS_HIDDEN_LIBDEPS($1)
  6345         -    _LT_COMPILER_PIC($1)
  6346         -    _LT_COMPILER_C_O($1)
  6347         -    _LT_COMPILER_FILE_LOCKS($1)
  6348         -    _LT_LINKER_SHLIBS($1)
  6349         -    _LT_SYS_DYNAMIC_LINKER($1)
  6350         -    _LT_LINKER_HARDCODE_LIBPATH($1)
  6351         -
  6352         -    _LT_CONFIG($1)
  6353         -  fi # test -n "$compiler"
  6354         -
  6355         -  CC=$lt_save_CC
  6356         -  LDCXX=$LD
  6357         -  LD=$lt_save_LD
  6358         -  GCC=$lt_save_GCC
  6359         -  with_gnu_ld=$lt_save_with_gnu_ld
  6360         -  lt_cv_path_LDCXX=$lt_cv_path_LD
  6361         -  lt_cv_path_LD=$lt_save_path_LD
  6362         -  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
  6363         -  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
  6364         -fi # test "$_lt_caught_CXX_error" != yes
  6365         -
  6366         -AC_LANG_POP
  6367         -])# _LT_LANG_CXX_CONFIG
  6368         -
  6369         -
  6370         -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
  6371         -# ---------------------------------
  6372         -# Figure out "hidden" library dependencies from verbose
  6373         -# compiler output when linking a shared library.
  6374         -# Parse the compiler output and extract the necessary
  6375         -# objects, libraries and library flags.
  6376         -m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
  6377         -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
  6378         -# Dependencies to place before and after the object being linked:
  6379         -_LT_TAGVAR(predep_objects, $1)=
  6380         -_LT_TAGVAR(postdep_objects, $1)=
  6381         -_LT_TAGVAR(predeps, $1)=
  6382         -_LT_TAGVAR(postdeps, $1)=
  6383         -_LT_TAGVAR(compiler_lib_search_path, $1)=
  6384         -
  6385         -dnl we can't use the lt_simple_compile_test_code here,
  6386         -dnl because it contains code intended for an executable,
  6387         -dnl not a library.  It's possible we should let each
  6388         -dnl tag define a new lt_????_link_test_code variable,
  6389         -dnl but it's only used here...
  6390         -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
  6391         -int a;
  6392         -void foo (void) { a = 0; }
  6393         -_LT_EOF
  6394         -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
  6395         -class Foo
  6396         -{
  6397         -public:
  6398         -  Foo (void) { a = 0; }
  6399         -private:
  6400         -  int a;
  6401         -};
  6402         -_LT_EOF
  6403         -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
  6404         -      subroutine foo
  6405         -      implicit none
  6406         -      integer*4 a
  6407         -      a=0
  6408         -      return
  6409         -      end
  6410         -_LT_EOF
  6411         -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
  6412         -      subroutine foo
  6413         -      implicit none
  6414         -      integer a
  6415         -      a=0
  6416         -      return
  6417         -      end
  6418         -_LT_EOF
  6419         -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
  6420         -public class foo {
  6421         -  private int a;
  6422         -  public void bar (void) {
  6423         -    a = 0;
  6424         -  }
  6425         -};
  6426         -_LT_EOF
  6427         -])
  6428         -dnl Parse the compiler output and extract the necessary
  6429         -dnl objects, libraries and library flags.
  6430         -if AC_TRY_EVAL(ac_compile); then
  6431         -  # Parse the compiler output and extract the necessary
  6432         -  # objects, libraries and library flags.
  6433         -
  6434         -  # Sentinel used to keep track of whether or not we are before
  6435         -  # the conftest object file.
  6436         -  pre_test_object_deps_done=no
  6437         -
  6438         -  for p in `eval "$output_verbose_link_cmd"`; do
  6439         -    case $p in
  6440         -
  6441         -    -L* | -R* | -l*)
  6442         -       # Some compilers place space between "-{L,R}" and the path.
  6443         -       # Remove the space.
  6444         -       if test $p = "-L" ||
  6445         -          test $p = "-R"; then
  6446         -	 prev=$p
  6447         -	 continue
  6448         -       else
  6449         -	 prev=
  6450         -       fi
  6451         -
  6452         -       if test "$pre_test_object_deps_done" = no; then
  6453         -	 case $p in
  6454         -	 -L* | -R*)
  6455         -	   # Internal compiler library paths should come after those
  6456         -	   # provided the user.  The postdeps already come after the
  6457         -	   # user supplied libs so there is no need to process them.
  6458         -	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
  6459         -	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
  6460         -	   else
  6461         -	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
  6462         -	   fi
  6463         -	   ;;
  6464         -	 # The "-l" case would never come before the object being
  6465         -	 # linked, so don't bother handling this case.
  6466         -	 esac
  6467         -       else
  6468         -	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
  6469         -	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
  6470         -	 else
  6471         -	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
  6472         -	 fi
  6473         -       fi
  6474         -       ;;
  6475         -
  6476         -    *.$objext)
  6477         -       # This assumes that the test object file only shows up
  6478         -       # once in the compiler output.
  6479         -       if test "$p" = "conftest.$objext"; then
  6480         -	 pre_test_object_deps_done=yes
  6481         -	 continue
  6482         -       fi
  6483         -
  6484         -       if test "$pre_test_object_deps_done" = no; then
  6485         -	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
  6486         -	   _LT_TAGVAR(predep_objects, $1)="$p"
  6487         -	 else
  6488         -	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
  6489         -	 fi
  6490         -       else
  6491         -	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
  6492         -	   _LT_TAGVAR(postdep_objects, $1)="$p"
  6493         -	 else
  6494         -	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
  6495         -	 fi
  6496         -       fi
  6497         -       ;;
  6498         -
  6499         -    *) ;; # Ignore the rest.
  6500         -
  6501         -    esac
  6502         -  done
  6503         -
  6504         -  # Clean up.
  6505         -  rm -f a.out a.exe
  6506         -else
  6507         -  echo "libtool.m4: error: problem compiling $1 test program"
  6508         -fi
  6509         -
  6510         -$RM -f confest.$objext
  6511         -
  6512         -# PORTME: override above test on systems where it is broken
  6513         -m4_if([$1], [CXX],
  6514         -[case $host_os in
  6515         -interix[[3-9]]*)
  6516         -  # Interix 3.5 installs completely hosed .la files for C++, so rather than
  6517         -  # hack all around it, let's just trust "g++" to DTRT.
  6518         -  _LT_TAGVAR(predep_objects,$1)=
  6519         -  _LT_TAGVAR(postdep_objects,$1)=
  6520         -  _LT_TAGVAR(postdeps,$1)=
  6521         -  ;;
  6522         -
  6523         -linux*)
  6524         -  case `$CC -V 2>&1 | sed 5q` in
  6525         -  *Sun\ C*)
  6526         -    # Sun C++ 5.9
  6527         -
  6528         -    # The more standards-conforming stlport4 library is
  6529         -    # incompatible with the Cstd library. Avoid specifying
  6530         -    # it if it's in CXXFLAGS. Ignore libCrun as
  6531         -    # -library=stlport4 depends on it.
  6532         -    case " $CXX $CXXFLAGS " in
  6533         -    *" -library=stlport4 "*)
  6534         -      solaris_use_stlport4=yes
  6535         -      ;;
  6536         -    esac
  6537         -
  6538         -    if test "$solaris_use_stlport4" != yes; then
  6539         -      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
  6540         -    fi
  6541         -    ;;
  6542         -  esac
  6543         -  ;;
  6544         -
  6545         -solaris*)
  6546         -  case $cc_basename in
  6547         -  CC*)
  6548         -    # The more standards-conforming stlport4 library is
  6549         -    # incompatible with the Cstd library. Avoid specifying
  6550         -    # it if it's in CXXFLAGS. Ignore libCrun as
  6551         -    # -library=stlport4 depends on it.
  6552         -    case " $CXX $CXXFLAGS " in
  6553         -    *" -library=stlport4 "*)
  6554         -      solaris_use_stlport4=yes
  6555         -      ;;
  6556         -    esac
  6557         -
  6558         -    # Adding this requires a known-good setup of shared libraries for
  6559         -    # Sun compiler versions before 5.6, else PIC objects from an old
  6560         -    # archive will be linked into the output, leading to subtle bugs.
  6561         -    if test "$solaris_use_stlport4" != yes; then
  6562         -      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
  6563         -    fi
  6564         -    ;;
  6565         -  esac
  6566         -  ;;
  6567         -esac
  6568         -])
  6569         -
  6570         -case " $_LT_TAGVAR(postdeps, $1) " in
  6571         -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
  6572         -esac
  6573         - _LT_TAGVAR(compiler_lib_search_dirs, $1)=
  6574         -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
  6575         - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
  6576         -fi
  6577         -_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
  6578         -    [The directories searched by this compiler when creating a shared library])
  6579         -_LT_TAGDECL([], [predep_objects], [1],
  6580         -    [Dependencies to place before and after the objects being linked to
  6581         -    create a shared library])
  6582         -_LT_TAGDECL([], [postdep_objects], [1])
  6583         -_LT_TAGDECL([], [predeps], [1])
  6584         -_LT_TAGDECL([], [postdeps], [1])
  6585         -_LT_TAGDECL([], [compiler_lib_search_path], [1],
  6586         -    [The library search path used internally by the compiler when linking
  6587         -    a shared library])
  6588         -])# _LT_SYS_HIDDEN_LIBDEPS
  6589         -
  6590         -
  6591         -# _LT_PROG_F77
  6592         -# ------------
  6593         -# Since AC_PROG_F77 is broken, in that it returns the empty string
  6594         -# if there is no fortran compiler, we have our own version here.
  6595         -m4_defun([_LT_PROG_F77],
  6596         -[
  6597         -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
  6598         -AC_PROG_F77
  6599         -if test -z "$F77" || test "X$F77" = "Xno"; then
  6600         -  _lt_disable_F77=yes
  6601         -fi
  6602         -popdef([AC_MSG_ERROR])
  6603         -])# _LT_PROG_F77
  6604         -
  6605         -dnl aclocal-1.4 backwards compatibility:
  6606         -dnl AC_DEFUN([_LT_PROG_F77], [])
  6607         -
  6608         -
  6609         -# _LT_LANG_F77_CONFIG([TAG])
  6610         -# --------------------------
  6611         -# Ensure that the configuration variables for a Fortran 77 compiler are
  6612         -# suitably defined.  These variables are subsequently used by _LT_CONFIG
  6613         -# to write the compiler configuration to `libtool'.
  6614         -m4_defun([_LT_LANG_F77_CONFIG],
  6615         -[AC_REQUIRE([_LT_PROG_F77])dnl
  6616         -AC_LANG_PUSH(Fortran 77)
  6617         -
  6618         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6619         -_LT_TAGVAR(allow_undefined_flag, $1)=
  6620         -_LT_TAGVAR(always_export_symbols, $1)=no
  6621         -_LT_TAGVAR(archive_expsym_cmds, $1)=
  6622         -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
  6623         -_LT_TAGVAR(hardcode_direct, $1)=no
  6624         -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
  6625         -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  6626         -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  6627         -_LT_TAGVAR(hardcode_libdir_separator, $1)=
  6628         -_LT_TAGVAR(hardcode_minus_L, $1)=no
  6629         -_LT_TAGVAR(hardcode_automatic, $1)=no
  6630         -_LT_TAGVAR(inherit_rpath, $1)=no
  6631         -_LT_TAGVAR(module_cmds, $1)=
  6632         -_LT_TAGVAR(module_expsym_cmds, $1)=
  6633         -_LT_TAGVAR(link_all_deplibs, $1)=unknown
  6634         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  6635         -_LT_TAGVAR(no_undefined_flag, $1)=
  6636         -_LT_TAGVAR(whole_archive_flag_spec, $1)=
  6637         -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  6638         -
  6639         -# Source file extension for f77 test sources.
  6640         -ac_ext=f
  6641         -
  6642         -# Object file extension for compiled f77 test sources.
  6643         -objext=o
  6644         -_LT_TAGVAR(objext, $1)=$objext
  6645         -
  6646         -# No sense in running all these tests if we already determined that
  6647         -# the F77 compiler isn't working.  Some variables (like enable_shared)
  6648         -# are currently assumed to apply to all compilers on this platform,
  6649         -# and will be corrupted by setting them based on a non-working compiler.
  6650         -if test "$_lt_disable_F77" != yes; then
  6651         -  # Code to be used in simple compile tests
  6652         -  lt_simple_compile_test_code="\
  6653         -      subroutine t
  6654         -      return
  6655         -      end
  6656         -"
  6657         -
  6658         -  # Code to be used in simple link tests
  6659         -  lt_simple_link_test_code="\
  6660         -      program t
  6661         -      end
  6662         -"
  6663         -
  6664         -  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  6665         -  _LT_TAG_COMPILER
  6666         -
  6667         -  # save warnings/boilerplate of simple test code
  6668         -  _LT_COMPILER_BOILERPLATE
  6669         -  _LT_LINKER_BOILERPLATE
  6670         -
  6671         -  # Allow CC to be a program name with arguments.
  6672         -  lt_save_CC="$CC"
  6673         -  lt_save_GCC=$GCC
  6674         -  CC=${F77-"f77"}
  6675         -  compiler=$CC
  6676         -  _LT_TAGVAR(compiler, $1)=$CC
  6677         -  _LT_CC_BASENAME([$compiler])
  6678         -  GCC=$G77
  6679         -  if test -n "$compiler"; then
  6680         -    AC_MSG_CHECKING([if libtool supports shared libraries])
  6681         -    AC_MSG_RESULT([$can_build_shared])
  6682         -
  6683         -    AC_MSG_CHECKING([whether to build shared libraries])
  6684         -    test "$can_build_shared" = "no" && enable_shared=no
  6685         -
  6686         -    # On AIX, shared libraries and static libraries use the same namespace, and
  6687         -    # are all built from PIC.
  6688         -    case $host_os in
  6689         -      aix3*)
  6690         -        test "$enable_shared" = yes && enable_static=no
  6691         -        if test -n "$RANLIB"; then
  6692         -          archive_cmds="$archive_cmds~\$RANLIB \$lib"
  6693         -          postinstall_cmds='$RANLIB $lib'
  6694         -        fi
  6695         -        ;;
  6696         -      aix[[4-9]]*)
  6697         -	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  6698         -	  test "$enable_shared" = yes && enable_static=no
  6699         -	fi
  6700         -        ;;
  6701         -    esac
  6702         -    AC_MSG_RESULT([$enable_shared])
  6703         -
  6704         -    AC_MSG_CHECKING([whether to build static libraries])
  6705         -    # Make sure either enable_shared or enable_static is yes.
  6706         -    test "$enable_shared" = yes || enable_static=yes
  6707         -    AC_MSG_RESULT([$enable_static])
  6708         -
  6709         -    _LT_TAGVAR(GCC, $1)="$G77"
  6710         -    _LT_TAGVAR(LD, $1)="$LD"
  6711         -
  6712         -    ## CAVEAT EMPTOR:
  6713         -    ## There is no encapsulation within the following macros, do not change
  6714         -    ## the running order or otherwise move them around unless you know exactly
  6715         -    ## what you are doing...
  6716         -    _LT_COMPILER_PIC($1)
  6717         -    _LT_COMPILER_C_O($1)
  6718         -    _LT_COMPILER_FILE_LOCKS($1)
  6719         -    _LT_LINKER_SHLIBS($1)
  6720         -    _LT_SYS_DYNAMIC_LINKER($1)
  6721         -    _LT_LINKER_HARDCODE_LIBPATH($1)
  6722         -
  6723         -    _LT_CONFIG($1)
  6724         -  fi # test -n "$compiler"
  6725         -
  6726         -  GCC=$lt_save_GCC
  6727         -  CC="$lt_save_CC"
  6728         -fi # test "$_lt_disable_F77" != yes
  6729         -
  6730         -AC_LANG_POP
  6731         -])# _LT_LANG_F77_CONFIG
  6732         -
  6733         -
  6734         -# _LT_PROG_FC
  6735         -# -----------
  6736         -# Since AC_PROG_FC is broken, in that it returns the empty string
  6737         -# if there is no fortran compiler, we have our own version here.
  6738         -m4_defun([_LT_PROG_FC],
  6739         -[
  6740         -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
  6741         -AC_PROG_FC
  6742         -if test -z "$FC" || test "X$FC" = "Xno"; then
  6743         -  _lt_disable_FC=yes
  6744         -fi
  6745         -popdef([AC_MSG_ERROR])
  6746         -])# _LT_PROG_FC
  6747         -
  6748         -dnl aclocal-1.4 backwards compatibility:
  6749         -dnl AC_DEFUN([_LT_PROG_FC], [])
  6750         -
  6751         -
  6752         -# _LT_LANG_FC_CONFIG([TAG])
  6753         -# -------------------------
  6754         -# Ensure that the configuration variables for a Fortran compiler are
  6755         -# suitably defined.  These variables are subsequently used by _LT_CONFIG
  6756         -# to write the compiler configuration to `libtool'.
  6757         -m4_defun([_LT_LANG_FC_CONFIG],
  6758         -[AC_REQUIRE([_LT_PROG_FC])dnl
  6759         -AC_LANG_PUSH(Fortran)
  6760         -
  6761         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6762         -_LT_TAGVAR(allow_undefined_flag, $1)=
  6763         -_LT_TAGVAR(always_export_symbols, $1)=no
  6764         -_LT_TAGVAR(archive_expsym_cmds, $1)=
  6765         -_LT_TAGVAR(export_dynamic_flag_spec, $1)=
  6766         -_LT_TAGVAR(hardcode_direct, $1)=no
  6767         -_LT_TAGVAR(hardcode_direct_absolute, $1)=no
  6768         -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
  6769         -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  6770         -_LT_TAGVAR(hardcode_libdir_separator, $1)=
  6771         -_LT_TAGVAR(hardcode_minus_L, $1)=no
  6772         -_LT_TAGVAR(hardcode_automatic, $1)=no
  6773         -_LT_TAGVAR(inherit_rpath, $1)=no
  6774         -_LT_TAGVAR(module_cmds, $1)=
  6775         -_LT_TAGVAR(module_expsym_cmds, $1)=
  6776         -_LT_TAGVAR(link_all_deplibs, $1)=unknown
  6777         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  6778         -_LT_TAGVAR(no_undefined_flag, $1)=
  6779         -_LT_TAGVAR(whole_archive_flag_spec, $1)=
  6780         -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  6781         -
  6782         -# Source file extension for fc test sources.
  6783         -ac_ext=${ac_fc_srcext-f}
  6784         -
  6785         -# Object file extension for compiled fc test sources.
  6786         -objext=o
  6787         -_LT_TAGVAR(objext, $1)=$objext
  6788         -
  6789         -# No sense in running all these tests if we already determined that
  6790         -# the FC compiler isn't working.  Some variables (like enable_shared)
  6791         -# are currently assumed to apply to all compilers on this platform,
  6792         -# and will be corrupted by setting them based on a non-working compiler.
  6793         -if test "$_lt_disable_FC" != yes; then
  6794         -  # Code to be used in simple compile tests
  6795         -  lt_simple_compile_test_code="\
  6796         -      subroutine t
  6797         -      return
  6798         -      end
  6799         -"
  6800         -
  6801         -  # Code to be used in simple link tests
  6802         -  lt_simple_link_test_code="\
  6803         -      program t
  6804         -      end
  6805         -"
  6806         -
  6807         -  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  6808         -  _LT_TAG_COMPILER
  6809         -
  6810         -  # save warnings/boilerplate of simple test code
  6811         -  _LT_COMPILER_BOILERPLATE
  6812         -  _LT_LINKER_BOILERPLATE
  6813         -
  6814         -  # Allow CC to be a program name with arguments.
  6815         -  lt_save_CC="$CC"
  6816         -  lt_save_GCC=$GCC
  6817         -  CC=${FC-"f95"}
  6818         -  compiler=$CC
  6819         -  GCC=$ac_cv_fc_compiler_gnu
  6820         -
  6821         -  _LT_TAGVAR(compiler, $1)=$CC
  6822         -  _LT_CC_BASENAME([$compiler])
  6823         -
  6824         -  if test -n "$compiler"; then
  6825         -    AC_MSG_CHECKING([if libtool supports shared libraries])
  6826         -    AC_MSG_RESULT([$can_build_shared])
  6827         -
  6828         -    AC_MSG_CHECKING([whether to build shared libraries])
  6829         -    test "$can_build_shared" = "no" && enable_shared=no
  6830         -
  6831         -    # On AIX, shared libraries and static libraries use the same namespace, and
  6832         -    # are all built from PIC.
  6833         -    case $host_os in
  6834         -      aix3*)
  6835         -        test "$enable_shared" = yes && enable_static=no
  6836         -        if test -n "$RANLIB"; then
  6837         -          archive_cmds="$archive_cmds~\$RANLIB \$lib"
  6838         -          postinstall_cmds='$RANLIB $lib'
  6839         -        fi
  6840         -        ;;
  6841         -      aix[[4-9]]*)
  6842         -	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  6843         -	  test "$enable_shared" = yes && enable_static=no
  6844         -	fi
  6845         -        ;;
  6846         -    esac
  6847         -    AC_MSG_RESULT([$enable_shared])
  6848         -
  6849         -    AC_MSG_CHECKING([whether to build static libraries])
  6850         -    # Make sure either enable_shared or enable_static is yes.
  6851         -    test "$enable_shared" = yes || enable_static=yes
  6852         -    AC_MSG_RESULT([$enable_static])
  6853         -
  6854         -    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
  6855         -    _LT_TAGVAR(LD, $1)="$LD"
  6856         -
  6857         -    ## CAVEAT EMPTOR:
  6858         -    ## There is no encapsulation within the following macros, do not change
  6859         -    ## the running order or otherwise move them around unless you know exactly
  6860         -    ## what you are doing...
  6861         -    _LT_SYS_HIDDEN_LIBDEPS($1)
  6862         -    _LT_COMPILER_PIC($1)
  6863         -    _LT_COMPILER_C_O($1)
  6864         -    _LT_COMPILER_FILE_LOCKS($1)
  6865         -    _LT_LINKER_SHLIBS($1)
  6866         -    _LT_SYS_DYNAMIC_LINKER($1)
  6867         -    _LT_LINKER_HARDCODE_LIBPATH($1)
  6868         -
  6869         -    _LT_CONFIG($1)
  6870         -  fi # test -n "$compiler"
  6871         -
  6872         -  GCC=$lt_save_GCC
  6873         -  CC="$lt_save_CC"
  6874         -fi # test "$_lt_disable_FC" != yes
  6875         -
  6876         -AC_LANG_POP
  6877         -])# _LT_LANG_FC_CONFIG
  6878         -
  6879         -
  6880         -# _LT_LANG_GCJ_CONFIG([TAG])
  6881         -# --------------------------
  6882         -# Ensure that the configuration variables for the GNU Java Compiler compiler
  6883         -# are suitably defined.  These variables are subsequently used by _LT_CONFIG
  6884         -# to write the compiler configuration to `libtool'.
  6885         -m4_defun([_LT_LANG_GCJ_CONFIG],
  6886         -[AC_REQUIRE([LT_PROG_GCJ])dnl
  6887         -AC_LANG_SAVE
  6888         -
  6889         -# Source file extension for Java test sources.
  6890         -ac_ext=java
  6891         -
  6892         -# Object file extension for compiled Java test sources.
  6893         -objext=o
  6894         -_LT_TAGVAR(objext, $1)=$objext
  6895         -
  6896         -# Code to be used in simple compile tests
  6897         -lt_simple_compile_test_code="class foo {}"
  6898         -
  6899         -# Code to be used in simple link tests
  6900         -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
  6901         -
  6902         -# ltmain only uses $CC for tagged configurations so make sure $CC is set.
  6903         -_LT_TAG_COMPILER
  6904         -
  6905         -# save warnings/boilerplate of simple test code
  6906         -_LT_COMPILER_BOILERPLATE
  6907         -_LT_LINKER_BOILERPLATE
  6908         -
  6909         -# Allow CC to be a program name with arguments.
  6910         -lt_save_CC="$CC"
  6911         -lt_save_GCC=$GCC
  6912         -GCC=yes
  6913         -CC=${GCJ-"gcj"}
  6914         -compiler=$CC
  6915         -_LT_TAGVAR(compiler, $1)=$CC
  6916         -_LT_TAGVAR(LD, $1)="$LD"
  6917         -_LT_CC_BASENAME([$compiler])
  6918         -
  6919         -# GCJ did not exist at the time GCC didn't implicitly link libc in.
  6920         -_LT_TAGVAR(archive_cmds_need_lc, $1)=no
  6921         -
  6922         -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  6923         -
  6924         -if test -n "$compiler"; then
  6925         -  _LT_COMPILER_NO_RTTI($1)
  6926         -  _LT_COMPILER_PIC($1)
  6927         -  _LT_COMPILER_C_O($1)
  6928         -  _LT_COMPILER_FILE_LOCKS($1)
  6929         -  _LT_LINKER_SHLIBS($1)
  6930         -  _LT_LINKER_HARDCODE_LIBPATH($1)
  6931         -
  6932         -  _LT_CONFIG($1)
  6933         -fi
  6934         -
  6935         -AC_LANG_RESTORE
  6936         -
  6937         -GCC=$lt_save_GCC
  6938         -CC="$lt_save_CC"
  6939         -])# _LT_LANG_GCJ_CONFIG
  6940         -
  6941         -
  6942         -# _LT_LANG_RC_CONFIG([TAG])
  6943         -# -------------------------
  6944         -# Ensure that the configuration variables for the Windows resource compiler
  6945         -# are suitably defined.  These variables are subsequently used by _LT_CONFIG
  6946         -# to write the compiler configuration to `libtool'.
  6947         -m4_defun([_LT_LANG_RC_CONFIG],
  6948         -[AC_REQUIRE([LT_PROG_RC])dnl
  6949         -AC_LANG_SAVE
  6950         -
  6951         -# Source file extension for RC test sources.
  6952         -ac_ext=rc
  6953         -
  6954         -# Object file extension for compiled RC test sources.
  6955         -objext=o
  6956         -_LT_TAGVAR(objext, $1)=$objext
  6957         -
  6958         -# Code to be used in simple compile tests
  6959         -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
  6960         -
  6961         -# Code to be used in simple link tests
  6962         -lt_simple_link_test_code="$lt_simple_compile_test_code"
  6963         -
  6964         -# ltmain only uses $CC for tagged configurations so make sure $CC is set.
  6965         -_LT_TAG_COMPILER
  6966         -
  6967         -# save warnings/boilerplate of simple test code
  6968         -_LT_COMPILER_BOILERPLATE
  6969         -_LT_LINKER_BOILERPLATE
  6970         -
  6971         -# Allow CC to be a program name with arguments.
  6972         -lt_save_CC="$CC"
  6973         -lt_save_GCC=$GCC
  6974         -GCC=
  6975         -CC=${RC-"windres"}
  6976         -compiler=$CC
  6977         -_LT_TAGVAR(compiler, $1)=$CC
  6978         -_LT_CC_BASENAME([$compiler])
  6979         -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  6980         -
  6981         -if test -n "$compiler"; then
  6982         -  :
  6983         -  _LT_CONFIG($1)
  6984         -fi
  6985         -
  6986         -GCC=$lt_save_GCC
  6987         -AC_LANG_RESTORE
  6988         -CC="$lt_save_CC"
  6989         -])# _LT_LANG_RC_CONFIG
  6990         -
  6991         -
  6992         -# LT_PROG_GCJ
  6993         -# -----------
  6994         -AC_DEFUN([LT_PROG_GCJ],
  6995         -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
  6996         -  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
  6997         -    [AC_CHECK_TOOL(GCJ, gcj,)
  6998         -      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
  6999         -      AC_SUBST(GCJFLAGS)])])[]dnl
  7000         -])
  7001         -
  7002         -# Old name:
  7003         -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
  7004         -dnl aclocal-1.4 backwards compatibility:
  7005         -dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
  7006         -
  7007         -
  7008         -# LT_PROG_RC
  7009         -# ----------
  7010         -AC_DEFUN([LT_PROG_RC],
  7011         -[AC_CHECK_TOOL(RC, windres,)
  7012         -])
  7013         -
  7014         -# Old name:
  7015         -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
  7016         -dnl aclocal-1.4 backwards compatibility:
  7017         -dnl AC_DEFUN([LT_AC_PROG_RC], [])
  7018         -
  7019         -
  7020         -# _LT_DECL_EGREP
  7021         -# --------------
  7022         -# If we don't have a new enough Autoconf to choose the best grep
  7023         -# available, choose the one first in the user's PATH.
  7024         -m4_defun([_LT_DECL_EGREP],
  7025         -[AC_REQUIRE([AC_PROG_EGREP])dnl
  7026         -AC_REQUIRE([AC_PROG_FGREP])dnl
  7027         -test -z "$GREP" && GREP=grep
  7028         -_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
  7029         -_LT_DECL([], [EGREP], [1], [An ERE matcher])
  7030         -_LT_DECL([], [FGREP], [1], [A literal string matcher])
  7031         -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
  7032         -AC_SUBST([GREP])
  7033         -])
  7034         -
  7035         -
  7036         -# _LT_DECL_OBJDUMP
  7037         -# --------------
  7038         -# If we don't have a new enough Autoconf to choose the best objdump
  7039         -# available, choose the one first in the user's PATH.
  7040         -m4_defun([_LT_DECL_OBJDUMP],
  7041         -[AC_CHECK_TOOL(OBJDUMP, objdump, false)
  7042         -test -z "$OBJDUMP" && OBJDUMP=objdump
  7043         -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
  7044         -AC_SUBST([OBJDUMP])
  7045         -])
  7046         -
  7047         -
  7048         -# _LT_DECL_SED
  7049         -# ------------
  7050         -# Check for a fully-functional sed program, that truncates
  7051         -# as few characters as possible.  Prefer GNU sed if found.
  7052         -m4_defun([_LT_DECL_SED],
  7053         -[AC_PROG_SED
  7054         -test -z "$SED" && SED=sed
  7055         -Xsed="$SED -e 1s/^X//"
  7056         -_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
  7057         -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
  7058         -    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
  7059         -])# _LT_DECL_SED
  7060         -
  7061         -m4_ifndef([AC_PROG_SED], [
         6600  +])])# _AS_TEST_PREPARE
         6601  +
         6602  +# AS_EXECUTABLE_P
         6603  +# ---------------
         6604  +# Check whether a file is executable.
         6605  +m4_ifndef([AS_EXECUTABLE_P],
         6606  +[m4_defun([AS_EXECUTABLE_P],
         6607  +[AS_REQUIRE([_AS_TEST_PREPARE])dnl
         6608  +$as_executable_p $1[]dnl
         6609  +])])# AS_EXECUTABLE_P
         6610  +
  7062   6611   # NOTE: This macro has been submitted for inclusion into   #
  7063   6612   #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
  7064   6613   #  a released version of Autoconf we should remove this    #
  7065   6614   #  macro and use it instead.                               #
  7066         -
  7067         -m4_defun([AC_PROG_SED],
         6615  +# LT_AC_PROG_SED
         6616  +# --------------
         6617  +# Check for a fully-functional sed program, that truncates
         6618  +# as few characters as possible.  Prefer GNU sed if found.
         6619  +AC_DEFUN([LT_AC_PROG_SED],
  7068   6620   [AC_MSG_CHECKING([for a sed that does not truncate output])
  7069   6621   AC_CACHE_VAL(lt_cv_path_SED,
  7070   6622   [# Loop through the user's path and test for sed and gsed.
  7071   6623   # Then use that list of sed's as ones to test for truncation.
  7072   6624   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  7073   6625   for as_dir in $PATH
  7074   6626   do
  7075   6627     IFS=$as_save_IFS
  7076   6628     test -z "$as_dir" && as_dir=.
  7077   6629     for lt_ac_prog in sed gsed; do
  7078   6630       for ac_exec_ext in '' $ac_executable_extensions; do
  7079         -      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
         6631  +      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
  7080   6632           lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
  7081   6633         fi
  7082   6634       done
  7083   6635     done
  7084   6636   done
  7085   6637   IFS=$as_save_IFS
  7086   6638   lt_ac_max=0
................................................................................
  7113   6665       fi
  7114   6666     done
  7115   6667   done
  7116   6668   ])
  7117   6669   SED=$lt_cv_path_SED
  7118   6670   AC_SUBST([SED])
  7119   6671   AC_MSG_RESULT([$SED])
  7120         -])#AC_PROG_SED
  7121         -])#m4_ifndef
  7122         -
  7123         -# Old name:
  7124         -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
  7125         -dnl aclocal-1.4 backwards compatibility:
  7126         -dnl AC_DEFUN([LT_AC_PROG_SED], [])
  7127         -
  7128         -
  7129         -# _LT_CHECK_SHELL_FEATURES
  7130         -# ------------------------
  7131         -# Find out whether the shell is Bourne or XSI compatible,
  7132         -# or has some other useful features.
  7133         -m4_defun([_LT_CHECK_SHELL_FEATURES],
  7134         -[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
  7135         -# Try some XSI features
  7136         -xsi_shell=no
  7137         -( _lt_dummy="a/b/c"
  7138         -  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
  7139         -      = c,a/b,, \
  7140         -    && eval 'test $(( 1 + 1 )) -eq 2 \
  7141         -    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
  7142         -  && xsi_shell=yes
  7143         -AC_MSG_RESULT([$xsi_shell])
  7144         -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
  7145         -
  7146         -AC_MSG_CHECKING([whether the shell understands "+="])
  7147         -lt_shell_append=no
  7148         -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
  7149         -    >/dev/null 2>&1 \
  7150         -  && lt_shell_append=yes
  7151         -AC_MSG_RESULT([$lt_shell_append])
  7152         -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
  7153         -
  7154         -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  7155         -  lt_unset=unset
  7156         -else
  7157         -  lt_unset=false
  7158         -fi
  7159         -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
  7160         -
  7161         -# test EBCDIC or ASCII
  7162         -case `echo X|tr X '\101'` in
  7163         - A) # ASCII based system
  7164         -    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
  7165         -  lt_SP2NL='tr \040 \012'
  7166         -  lt_NL2SP='tr \015\012 \040\040'
  7167         -  ;;
  7168         - *) # EBCDIC based system
  7169         -  lt_SP2NL='tr \100 \n'
  7170         -  lt_NL2SP='tr \r\n \100\100'
  7171         -  ;;
  7172         -esac
  7173         -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
  7174         -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
  7175         -])# _LT_CHECK_SHELL_FEATURES
  7176         -
  7177         -
  7178         -# _LT_PROG_XSI_SHELLFNS
  7179         -# ---------------------
  7180         -# Bourne and XSI compatible variants of some useful shell functions.
  7181         -m4_defun([_LT_PROG_XSI_SHELLFNS],
  7182         -[case $xsi_shell in
  7183         -  yes)
  7184         -    cat << \_LT_EOF >> "$cfgfile"
  7185         -
  7186         -# func_dirname file append nondir_replacement
  7187         -# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
  7188         -# otherwise set result to NONDIR_REPLACEMENT.
  7189         -func_dirname ()
  7190         -{
  7191         -  case ${1} in
  7192         -    */*) func_dirname_result="${1%/*}${2}" ;;
  7193         -    *  ) func_dirname_result="${3}" ;;
  7194         -  esac
  7195         -}
  7196         -
  7197         -# func_basename file
  7198         -func_basename ()
  7199         -{
  7200         -  func_basename_result="${1##*/}"
  7201         -}
  7202         -
  7203         -# func_dirname_and_basename file append nondir_replacement
  7204         -# perform func_basename and func_dirname in a single function
  7205         -# call:
  7206         -#   dirname:  Compute the dirname of FILE.  If nonempty,
  7207         -#             add APPEND to the result, otherwise set result
  7208         -#             to NONDIR_REPLACEMENT.
  7209         -#             value returned in "$func_dirname_result"
  7210         -#   basename: Compute filename of FILE.
  7211         -#             value retuned in "$func_basename_result"
  7212         -# Implementation must be kept synchronized with func_dirname
  7213         -# and func_basename. For efficiency, we do not delegate to
  7214         -# those functions but instead duplicate the functionality here.
  7215         -func_dirname_and_basename ()
  7216         -{
  7217         -  case ${1} in
  7218         -    */*) func_dirname_result="${1%/*}${2}" ;;
  7219         -    *  ) func_dirname_result="${3}" ;;
  7220         -  esac
  7221         -  func_basename_result="${1##*/}"
  7222         -}
  7223         -
  7224         -# func_stripname prefix suffix name
  7225         -# strip PREFIX and SUFFIX off of NAME.
  7226         -# PREFIX and SUFFIX must not contain globbing or regex special
  7227         -# characters, hashes, percent signs, but SUFFIX may contain a leading
  7228         -# dot (in which case that matches only a dot).
  7229         -func_stripname ()
  7230         -{
  7231         -  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  7232         -  # positional parameters, so assign one to ordinary parameter first.
  7233         -  func_stripname_result=${3}
  7234         -  func_stripname_result=${func_stripname_result#"${1}"}
  7235         -  func_stripname_result=${func_stripname_result%"${2}"}
  7236         -}
  7237         -
  7238         -# func_opt_split
  7239         -func_opt_split ()
  7240         -{
  7241         -  func_opt_split_opt=${1%%=*}
  7242         -  func_opt_split_arg=${1#*=}
  7243         -}
  7244         -
  7245         -# func_lo2o object
  7246         -func_lo2o ()
  7247         -{
  7248         -  case ${1} in
  7249         -    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
  7250         -    *)    func_lo2o_result=${1} ;;
  7251         -  esac
  7252         -}
  7253         -
  7254         -# func_xform libobj-or-source
  7255         -func_xform ()
  7256         -{
  7257         -  func_xform_result=${1%.*}.lo
  7258         -}
  7259         -
  7260         -# func_arith arithmetic-term...
  7261         -func_arith ()
  7262         -{
  7263         -  func_arith_result=$(( $[*] ))
  7264         -}
  7265         -
  7266         -# func_len string
  7267         -# STRING may not start with a hyphen.
  7268         -func_len ()
  7269         -{
  7270         -  func_len_result=${#1}
  7271         -}
  7272         -
  7273         -_LT_EOF
  7274         -    ;;
  7275         -  *) # Bourne compatible functions.
  7276         -    cat << \_LT_EOF >> "$cfgfile"
  7277         -
  7278         -# func_dirname file append nondir_replacement
  7279         -# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
  7280         -# otherwise set result to NONDIR_REPLACEMENT.
  7281         -func_dirname ()
  7282         -{
  7283         -  # Extract subdirectory from the argument.
  7284         -  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
  7285         -  if test "X$func_dirname_result" = "X${1}"; then
  7286         -    func_dirname_result="${3}"
  7287         -  else
  7288         -    func_dirname_result="$func_dirname_result${2}"
  7289         -  fi
  7290         -}
  7291         -
  7292         -# func_basename file
  7293         -func_basename ()
  7294         -{
  7295         -  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
  7296         -}
  7297         -
  7298         -dnl func_dirname_and_basename
  7299         -dnl A portable version of this function is already defined in general.m4sh
  7300         -dnl so there is no need for it here.
  7301         -
  7302         -# func_stripname prefix suffix name
  7303         -# strip PREFIX and SUFFIX off of NAME.
  7304         -# PREFIX and SUFFIX must not contain globbing or regex special
  7305         -# characters, hashes, percent signs, but SUFFIX may contain a leading
  7306         -# dot (in which case that matches only a dot).
  7307         -# func_strip_suffix prefix name
  7308         -func_stripname ()
  7309         -{
  7310         -  case ${2} in
  7311         -    .*) func_stripname_result=`$ECHO "X${3}" \
  7312         -           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
  7313         -    *)  func_stripname_result=`$ECHO "X${3}" \
  7314         -           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
  7315         -  esac
  7316         -}
  7317         -
  7318         -# sed scripts:
  7319         -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
  7320         -my_sed_long_arg='1s/^-[[^=]]*=//'
  7321         -
  7322         -# func_opt_split
  7323         -func_opt_split ()
  7324         -{
  7325         -  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
  7326         -  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
  7327         -}
  7328         -
  7329         -# func_lo2o object
  7330         -func_lo2o ()
  7331         -{
  7332         -  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
  7333         -}
  7334         -
  7335         -# func_xform libobj-or-source
  7336         -func_xform ()
  7337         -{
  7338         -  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
  7339         -}
  7340         -
  7341         -# func_arith arithmetic-term...
  7342         -func_arith ()
  7343         -{
  7344         -  func_arith_result=`expr "$[@]"`
  7345         -}
  7346         -
  7347         -# func_len string
  7348         -# STRING may not start with a hyphen.
  7349         -func_len ()
  7350         -{
  7351         -  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
  7352         -}
  7353         -
  7354         -_LT_EOF
  7355         -esac
  7356         -
  7357         -case $lt_shell_append in
  7358         -  yes)
  7359         -    cat << \_LT_EOF >> "$cfgfile"
  7360         -
  7361         -# func_append var value
  7362         -# Append VALUE to the end of shell variable VAR.
  7363         -func_append ()
  7364         -{
  7365         -  eval "$[1]+=\$[2]"
  7366         -}
  7367         -_LT_EOF
  7368         -    ;;
  7369         -  *)
  7370         -    cat << \_LT_EOF >> "$cfgfile"
  7371         -
  7372         -# func_append var value
  7373         -# Append VALUE to the end of shell variable VAR.
  7374         -func_append ()
  7375         -{
  7376         -  eval "$[1]=\$$[1]\$[2]"
  7377         -}
  7378         -
  7379         -_LT_EOF
  7380         -    ;;
  7381         -  esac
  7382         -])
  7383         -
  7384         -# Helper functions for option handling.                    -*- Autoconf -*-
  7385         -#
  7386         -#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
  7387         -#   Written by Gary V. Vaughan, 2004
  7388         -#
  7389         -# This file is free software; the Free Software Foundation gives
  7390         -# unlimited permission to copy and/or distribute it, with or without
  7391         -# modifications, as long as this notice is preserved.
  7392         -
  7393         -# serial 6 ltoptions.m4
  7394         -
  7395         -# This is to help aclocal find these macros, as it can't see m4_define.
  7396         -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
  7397         -
  7398         -
  7399         -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
  7400         -# ------------------------------------------
  7401         -m4_define([_LT_MANGLE_OPTION],
  7402         -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
  7403         -
  7404         -
  7405         -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
  7406         -# ---------------------------------------
  7407         -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
  7408         -# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
  7409         -# saved as a flag.
  7410         -m4_define([_LT_SET_OPTION],
  7411         -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
  7412         -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
  7413         -        _LT_MANGLE_DEFUN([$1], [$2]),
  7414         -    [m4_warning([Unknown $1 option `$2'])])[]dnl
  7415         -])
  7416         -
  7417         -
  7418         -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
  7419         -# ------------------------------------------------------------
  7420         -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  7421         -m4_define([_LT_IF_OPTION],
  7422         -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
  7423         -
  7424         -
  7425         -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
  7426         -# -------------------------------------------------------
  7427         -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
  7428         -# are set.
  7429         -m4_define([_LT_UNLESS_OPTIONS],
  7430         -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
  7431         -	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
  7432         -		      [m4_define([$0_found])])])[]dnl
  7433         -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
  7434         -])[]dnl
  7435         -])
  7436         -
  7437         -
  7438         -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
  7439         -# ----------------------------------------
  7440         -# OPTION-LIST is a space-separated list of Libtool options associated
  7441         -# with MACRO-NAME.  If any OPTION has a matching handler declared with
  7442         -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
  7443         -# the unknown option and exit.
  7444         -m4_defun([_LT_SET_OPTIONS],
  7445         -[# Set options
  7446         -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
  7447         -    [_LT_SET_OPTION([$1], _LT_Option)])
  7448         -
  7449         -m4_if([$1],[LT_INIT],[
  7450         -  dnl
  7451         -  dnl Simply set some default values (i.e off) if boolean options were not
  7452         -  dnl specified:
  7453         -  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
  7454         -  ])
  7455         -  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
  7456         -  ])
  7457         -  dnl
  7458         -  dnl If no reference was made to various pairs of opposing options, then
  7459         -  dnl we run the default mode handler for the pair.  For example, if neither
  7460         -  dnl `shared' nor `disable-shared' was passed, we enable building of shared
  7461         -  dnl archives by default:
  7462         -  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
  7463         -  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
  7464         -  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
  7465         -  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
  7466         -  		   [_LT_ENABLE_FAST_INSTALL])
  7467         -  ])
  7468         -])# _LT_SET_OPTIONS
  7469         -
  7470         -
  7471         -
  7472         -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
  7473         -# -----------------------------------------
  7474         -m4_define([_LT_MANGLE_DEFUN],
  7475         -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
  7476         -
  7477         -
  7478         -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
  7479         -# -----------------------------------------------
  7480         -m4_define([LT_OPTION_DEFINE],
  7481         -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
  7482         -])# LT_OPTION_DEFINE
  7483         -
  7484         -
  7485         -# dlopen
  7486         -# ------
  7487         -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
  7488         -])
  7489         -
  7490         -AU_DEFUN([AC_LIBTOOL_DLOPEN],
  7491         -[_LT_SET_OPTION([LT_INIT], [dlopen])
  7492         -AC_DIAGNOSE([obsolete],
  7493         -[$0: Remove this warning and the call to _LT_SET_OPTION when you
  7494         -put the `dlopen' option into LT_INIT's first parameter.])
  7495         -])
  7496         -
  7497         -dnl aclocal-1.4 backwards compatibility:
  7498         -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
  7499         -
  7500         -
  7501         -# win32-dll
  7502         -# ---------
  7503         -# Declare package support for building win32 dll's.
  7504         -LT_OPTION_DEFINE([LT_INIT], [win32-dll],
  7505         -[enable_win32_dll=yes
  7506         -
  7507         -case $host in
  7508         -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
  7509         -  AC_CHECK_TOOL(AS, as, false)
  7510         -  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  7511         -  AC_CHECK_TOOL(OBJDUMP, objdump, false)
  7512         -  ;;
  7513         -esac
  7514         -
  7515         -test -z "$AS" && AS=as
  7516         -_LT_DECL([], [AS],      [0], [Assembler program])dnl
  7517         -
  7518         -test -z "$DLLTOOL" && DLLTOOL=dlltool
  7519         -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
  7520         -
  7521         -test -z "$OBJDUMP" && OBJDUMP=objdump
  7522         -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
  7523         -])# win32-dll
  7524         -
  7525         -AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
  7526         -[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7527         -_LT_SET_OPTION([LT_INIT], [win32-dll])
  7528         -AC_DIAGNOSE([obsolete],
  7529         -[$0: Remove this warning and the call to _LT_SET_OPTION when you
  7530         -put the `win32-dll' option into LT_INIT's first parameter.])
  7531         -])
  7532         -
  7533         -dnl aclocal-1.4 backwards compatibility:
  7534         -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
  7535         -
  7536         -
  7537         -# _LT_ENABLE_SHARED([DEFAULT])
  7538         -# ----------------------------
  7539         -# implement the --enable-shared flag, and supports the `shared' and
  7540         -# `disable-shared' LT_INIT options.
  7541         -# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
  7542         -m4_define([_LT_ENABLE_SHARED],
  7543         -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
  7544         -AC_ARG_ENABLE([shared],
  7545         -    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
  7546         -	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
  7547         -    [p=${PACKAGE-default}
  7548         -    case $enableval in
  7549         -    yes) enable_shared=yes ;;
  7550         -    no) enable_shared=no ;;
  7551         -    *)
  7552         -      enable_shared=no
  7553         -      # Look at the argument we got.  We use all the common list separators.
  7554         -      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  7555         -      for pkg in $enableval; do
  7556         -	IFS="$lt_save_ifs"
  7557         -	if test "X$pkg" = "X$p"; then
  7558         -	  enable_shared=yes
  7559         -	fi
  7560         -      done
  7561         -      IFS="$lt_save_ifs"
  7562         -      ;;
  7563         -    esac],
  7564         -    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
  7565         -
  7566         -    _LT_DECL([build_libtool_libs], [enable_shared], [0],
  7567         -	[Whether or not to build shared libraries])
  7568         -])# _LT_ENABLE_SHARED
  7569         -
  7570         -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
  7571         -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
  7572         -
  7573         -# Old names:
  7574         -AC_DEFUN([AC_ENABLE_SHARED],
  7575         -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
  7576         -])
  7577         -
  7578         -AC_DEFUN([AC_DISABLE_SHARED],
  7579         -[_LT_SET_OPTION([LT_INIT], [disable-shared])
  7580         -])
  7581         -
  7582         -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
  7583         -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
  7584         -
  7585         -dnl aclocal-1.4 backwards compatibility:
  7586         -dnl AC_DEFUN([AM_ENABLE_SHARED], [])
  7587         -dnl AC_DEFUN([AM_DISABLE_SHARED], [])
  7588         -
  7589         -
  7590         -
  7591         -# _LT_ENABLE_STATIC([DEFAULT])
  7592         -# ----------------------------
  7593         -# implement the --enable-static flag, and support the `static' and
  7594         -# `disable-static' LT_INIT options.
  7595         -# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
  7596         -m4_define([_LT_ENABLE_STATIC],
  7597         -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
  7598         -AC_ARG_ENABLE([static],
  7599         -    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
  7600         -	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
  7601         -    [p=${PACKAGE-default}
  7602         -    case $enableval in
  7603         -    yes) enable_static=yes ;;
  7604         -    no) enable_static=no ;;
  7605         -    *)
  7606         -     enable_static=no
  7607         -      # Look at the argument we got.  We use all the common list separators.
  7608         -      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  7609         -      for pkg in $enableval; do
  7610         -	IFS="$lt_save_ifs"
  7611         -	if test "X$pkg" = "X$p"; then
  7612         -	  enable_static=yes
  7613         -	fi
  7614         -      done
  7615         -      IFS="$lt_save_ifs"
  7616         -      ;;
  7617         -    esac],
  7618         -    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
  7619         -
  7620         -    _LT_DECL([build_old_libs], [enable_static], [0],
  7621         -	[Whether or not to build static libraries])
  7622         -])# _LT_ENABLE_STATIC
  7623         -
  7624         -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
  7625         -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
  7626         -
  7627         -# Old names:
  7628         -AC_DEFUN([AC_ENABLE_STATIC],
  7629         -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
  7630         -])
  7631         -
  7632         -AC_DEFUN([AC_DISABLE_STATIC],
  7633         -[_LT_SET_OPTION([LT_INIT], [disable-static])
  7634         -])
  7635         -
  7636         -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
  7637         -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
  7638         -
  7639         -dnl aclocal-1.4 backwards compatibility:
  7640         -dnl AC_DEFUN([AM_ENABLE_STATIC], [])
  7641         -dnl AC_DEFUN([AM_DISABLE_STATIC], [])
  7642         -
  7643         -
  7644         -
  7645         -# _LT_ENABLE_FAST_INSTALL([DEFAULT])
  7646         -# ----------------------------------
  7647         -# implement the --enable-fast-install flag, and support the `fast-install'
  7648         -# and `disable-fast-install' LT_INIT options.
  7649         -# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
  7650         -m4_define([_LT_ENABLE_FAST_INSTALL],
  7651         -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
  7652         -AC_ARG_ENABLE([fast-install],
  7653         -    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
  7654         -    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
  7655         -    [p=${PACKAGE-default}
  7656         -    case $enableval in
  7657         -    yes) enable_fast_install=yes ;;
  7658         -    no) enable_fast_install=no ;;
  7659         -    *)
  7660         -      enable_fast_install=no
  7661         -      # Look at the argument we got.  We use all the common list separators.
  7662         -      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  7663         -      for pkg in $enableval; do
  7664         -	IFS="$lt_save_ifs"
  7665         -	if test "X$pkg" = "X$p"; then
  7666         -	  enable_fast_install=yes
  7667         -	fi
  7668         -      done
  7669         -      IFS="$lt_save_ifs"
  7670         -      ;;
  7671         -    esac],
  7672         -    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
  7673         -
  7674         -_LT_DECL([fast_install], [enable_fast_install], [0],
  7675         -	 [Whether or not to optimize for fast installation])dnl
  7676         -])# _LT_ENABLE_FAST_INSTALL
  7677         -
  7678         -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
  7679         -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
  7680         -
  7681         -# Old names:
  7682         -AU_DEFUN([AC_ENABLE_FAST_INSTALL],
  7683         -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
  7684         -AC_DIAGNOSE([obsolete],
  7685         -[$0: Remove this warning and the call to _LT_SET_OPTION when you put
  7686         -the `fast-install' option into LT_INIT's first parameter.])
  7687         -])
  7688         -
  7689         -AU_DEFUN([AC_DISABLE_FAST_INSTALL],
  7690         -[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
  7691         -AC_DIAGNOSE([obsolete],
  7692         -[$0: Remove this warning and the call to _LT_SET_OPTION when you put
  7693         -the `disable-fast-install' option into LT_INIT's first parameter.])
  7694         -])
  7695         -
  7696         -dnl aclocal-1.4 backwards compatibility:
  7697         -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
  7698         -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
  7699         -
  7700         -
  7701         -# _LT_WITH_PIC([MODE])
  7702         -# --------------------
  7703         -# implement the --with-pic flag, and support the `pic-only' and `no-pic'
  7704         -# LT_INIT options.
  7705         -# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
  7706         -m4_define([_LT_WITH_PIC],
  7707         -[AC_ARG_WITH([pic],
  7708         -    [AS_HELP_STRING([--with-pic],
  7709         -	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
  7710         -    [pic_mode="$withval"],
  7711         -    [pic_mode=default])
  7712         -
  7713         -test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
  7714         -
  7715         -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
  7716         -])# _LT_WITH_PIC
  7717         -
  7718         -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
  7719         -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
  7720         -
  7721         -# Old name:
  7722         -AU_DEFUN([AC_LIBTOOL_PICMODE],
  7723         -[_LT_SET_OPTION([LT_INIT], [pic-only])
  7724         -AC_DIAGNOSE([obsolete],
  7725         -[$0: Remove this warning and the call to _LT_SET_OPTION when you
  7726         -put the `pic-only' option into LT_INIT's first parameter.])
  7727         -])
  7728         -
  7729         -dnl aclocal-1.4 backwards compatibility:
  7730         -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
  7731         -
  7732         -
  7733         -m4_define([_LTDL_MODE], [])
  7734         -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
  7735         -		 [m4_define([_LTDL_MODE], [nonrecursive])])
  7736         -LT_OPTION_DEFINE([LTDL_INIT], [recursive],
  7737         -		 [m4_define([_LTDL_MODE], [recursive])])
  7738         -LT_OPTION_DEFINE([LTDL_INIT], [subproject],
  7739         -		 [m4_define([_LTDL_MODE], [subproject])])
  7740         -
  7741         -m4_define([_LTDL_TYPE], [])
  7742         -LT_OPTION_DEFINE([LTDL_INIT], [installable],
  7743         -		 [m4_define([_LTDL_TYPE], [installable])])
  7744         -LT_OPTION_DEFINE([LTDL_INIT], [convenience],
  7745         -		 [m4_define([_LTDL_TYPE], [convenience])])
  7746         -
  7747         -# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
  7748         -#
  7749         -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
  7750         -# Written by Gary V. Vaughan, 2004
  7751         -#
  7752         -# This file is free software; the Free Software Foundation gives
  7753         -# unlimited permission to copy and/or distribute it, with or without
  7754         -# modifications, as long as this notice is preserved.
  7755         -
  7756         -# serial 6 ltsugar.m4
  7757         -
  7758         -# This is to help aclocal find these macros, as it can't see m4_define.
  7759         -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
  7760         -
  7761         -
  7762         -# lt_join(SEP, ARG1, [ARG2...])
  7763         -# -----------------------------
  7764         -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
  7765         -# associated separator.
  7766         -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
  7767         -# versions in m4sugar had bugs.
  7768         -m4_define([lt_join],
  7769         -[m4_if([$#], [1], [],
  7770         -       [$#], [2], [[$2]],
  7771         -       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
  7772         -m4_define([_lt_join],
  7773         -[m4_if([$#$2], [2], [],
  7774         -       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
  7775         -
  7776         -
  7777         -# lt_car(LIST)
  7778         -# lt_cdr(LIST)
  7779         -# ------------
  7780         -# Manipulate m4 lists.
  7781         -# These macros are necessary as long as will still need to support
  7782         -# Autoconf-2.59 which quotes differently.
  7783         -m4_define([lt_car], [[$1]])
  7784         -m4_define([lt_cdr],
  7785         -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
  7786         -       [$#], 1, [],
  7787         -       [m4_dquote(m4_shift($@))])])
  7788         -m4_define([lt_unquote], $1)
  7789         -
  7790         -
  7791         -# lt_append(MACRO-NAME, STRING, [SEPARATOR])
  7792         -# ------------------------------------------
  7793         -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
  7794         -# Note that neither SEPARATOR nor STRING are expanded; they are appended
  7795         -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
  7796         -# No SEPARATOR is output if MACRO-NAME was previously undefined (different
  7797         -# than defined and empty).
  7798         -#
  7799         -# This macro is needed until we can rely on Autoconf 2.62, since earlier
  7800         -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
  7801         -m4_define([lt_append],
  7802         -[m4_define([$1],
  7803         -	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
  7804         -
  7805         -
  7806         -
  7807         -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
  7808         -# ----------------------------------------------------------
  7809         -# Produce a SEP delimited list of all paired combinations of elements of
  7810         -# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
  7811         -# has the form PREFIXmINFIXSUFFIXn.
  7812         -# Needed until we can rely on m4_combine added in Autoconf 2.62.
  7813         -m4_define([lt_combine],
  7814         -[m4_if(m4_eval([$# > 3]), [1],
  7815         -       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
  7816         -[[m4_foreach([_Lt_prefix], [$2],
  7817         -	     [m4_foreach([_Lt_suffix],
  7818         -		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
  7819         -	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
  7820         -
  7821         -
  7822         -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
  7823         -# -----------------------------------------------------------------------
  7824         -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
  7825         -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
  7826         -m4_define([lt_if_append_uniq],
  7827         -[m4_ifdef([$1],
  7828         -	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
  7829         -		 [lt_append([$1], [$2], [$3])$4],
  7830         -		 [$5])],
  7831         -	  [lt_append([$1], [$2], [$3])$4])])
  7832         -
  7833         -
  7834         -# lt_dict_add(DICT, KEY, VALUE)
  7835         -# -----------------------------
  7836         -m4_define([lt_dict_add],
  7837         -[m4_define([$1($2)], [$3])])
  7838         -
  7839         -
  7840         -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
  7841         -# --------------------------------------------
  7842         -m4_define([lt_dict_add_subkey],
  7843         -[m4_define([$1($2:$3)], [$4])])
  7844         -
  7845         -
  7846         -# lt_dict_fetch(DICT, KEY, [SUBKEY])
  7847         -# ----------------------------------
  7848         -m4_define([lt_dict_fetch],
  7849         -[m4_ifval([$3],
  7850         -	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
  7851         -    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
  7852         -
  7853         -
  7854         -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
  7855         -# -----------------------------------------------------------------
  7856         -m4_define([lt_if_dict_fetch],
  7857         -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
  7858         -	[$5],
  7859         -    [$6])])
  7860         -
  7861         -
  7862         -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
  7863         -# --------------------------------------------------------------
  7864         -m4_define([lt_dict_filter],
  7865         -[m4_if([$5], [], [],
  7866         -  [lt_join(m4_quote(m4_default([$4], [[, ]])),
  7867         -           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
  7868         -		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
  7869         -])
  7870         -
  7871         -# ltversion.m4 -- version numbers			-*- Autoconf -*-
  7872         -#
  7873         -#   Copyright (C) 2004 Free Software Foundation, Inc.
  7874         -#   Written by Scott James Remnant, 2004
  7875         -#
  7876         -# This file is free software; the Free Software Foundation gives
  7877         -# unlimited permission to copy and/or distribute it, with or without
  7878         -# modifications, as long as this notice is preserved.
  7879         -
  7880         -# Generated from ltversion.in.
  7881         -
  7882         -# serial 3017 ltversion.m4
  7883         -# This file is part of GNU Libtool
  7884         -
  7885         -m4_define([LT_PACKAGE_VERSION], [2.2.6b])
  7886         -m4_define([LT_PACKAGE_REVISION], [1.3017])
  7887         -
  7888         -AC_DEFUN([LTVERSION_VERSION],
  7889         -[macro_version='2.2.6b'
  7890         -macro_revision='1.3017'
  7891         -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
  7892         -_LT_DECL(, macro_revision, 0)
  7893         -])
  7894         -
  7895         -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
  7896         -#
  7897         -#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
  7898         -#   Written by Scott James Remnant, 2004.
  7899         -#
  7900         -# This file is free software; the Free Software Foundation gives
  7901         -# unlimited permission to copy and/or distribute it, with or without
  7902         -# modifications, as long as this notice is preserved.
  7903         -
  7904         -# serial 4 lt~obsolete.m4
  7905         -
  7906         -# These exist entirely to fool aclocal when bootstrapping libtool.
  7907         -#
  7908         -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
  7909         -# which have later been changed to m4_define as they aren't part of the
  7910         -# exported API, or moved to Autoconf or Automake where they belong.
  7911         -#
  7912         -# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
  7913         -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
  7914         -# using a macro with the same name in our local m4/libtool.m4 it'll
  7915         -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
  7916         -# and doesn't know about Autoconf macros at all.)
  7917         -#
  7918         -# So we provide this file, which has a silly filename so it's always
  7919         -# included after everything else.  This provides aclocal with the
  7920         -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
  7921         -# because those macros already exist, or will be overwritten later.
  7922         -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
  7923         -#
  7924         -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
  7925         -# Yes, that means every name once taken will need to remain here until
  7926         -# we give up compatibility with versions before 1.7, at which point
  7927         -# we need to keep only those names which we still refer to.
  7928         -
  7929         -# This is to help aclocal find these macros, as it can't see m4_define.
  7930         -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
  7931         -
  7932         -m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
  7933         -m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
  7934         -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
  7935         -m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
  7936         -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
  7937         -m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
  7938         -m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
  7939         -m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
  7940         -m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
  7941         -m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
  7942         -m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
  7943         -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
  7944         -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
  7945         -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
  7946         -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
  7947         -m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
  7948         -m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
  7949         -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
  7950         -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
  7951         -m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
  7952         -m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
  7953         -m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
  7954         -m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
  7955         -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
  7956         -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
  7957         -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
  7958         -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
  7959         -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
  7960         -m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
  7961         -m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
  7962         -m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
  7963         -m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
  7964         -m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
  7965         -m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
  7966         -m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
  7967         -m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
  7968         -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
  7969         -m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
  7970         -m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
  7971         -m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
  7972         -m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
  7973         -m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
  7974         -m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
  7975         -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
  7976         -m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
  7977         -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
  7978         -m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
  7979         -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
  7980         -m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
  7981         -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
  7982         -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
  7983         -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
  7984         -m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
  7985         -m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
  7986         -m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
  7987         -
  7988         -# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
  7989         -# serial 1 (pkg-config-0.24)
  7990         -# 
  7991         -# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  7992         -#
  7993         -# This program is free software; you can redistribute it and/or modify
  7994         -# it under the terms of the GNU General Public License as published by
  7995         -# the Free Software Foundation; either version 2 of the License, or
  7996         -# (at your option) any later version.
  7997         -#
  7998         -# This program is distributed in the hope that it will be useful, but
  7999         -# WITHOUT ANY WARRANTY; without even the implied warranty of
  8000         -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  8001         -# General Public License for more details.
  8002         -#
  8003         -# You should have received a copy of the GNU General Public License
  8004         -# along with this program; if not, write to the Free Software
  8005         -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  8006         -#
  8007         -# As a special exception to the GNU General Public License, if you
  8008         -# distribute this file as part of a program that contains a
  8009         -# configuration script generated by Autoconf, you may include it under
  8010         -# the same distribution terms that you use for the rest of that program.
  8011         -
  8012         -# PKG_PROG_PKG_CONFIG([MIN-VERSION])
  8013         -# ----------------------------------
  8014         -AC_DEFUN([PKG_PROG_PKG_CONFIG],
  8015         -[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  8016         -m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
  8017         -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  8018         -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  8019         -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  8020         -
  8021         -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  8022         -	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  8023         -fi
  8024         -if test -n "$PKG_CONFIG"; then
  8025         -	_pkg_min_version=m4_default([$1], [0.9.0])
  8026         -	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  8027         -	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  8028         -		AC_MSG_RESULT([yes])
  8029         -	else
  8030         -		AC_MSG_RESULT([no])
  8031         -		PKG_CONFIG=""
  8032         -	fi
  8033         -fi[]dnl
  8034         -])# PKG_PROG_PKG_CONFIG
  8035         -
  8036         -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  8037         -#
  8038         -# Check to see whether a particular set of modules exists.  Similar
  8039         -# to PKG_CHECK_MODULES(), but does not set variables or print errors.
  8040         -#
  8041         -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  8042         -# only at the first occurence in configure.ac, so if the first place
  8043         -# it's called might be skipped (such as if it is within an "if", you
  8044         -# have to call PKG_CHECK_EXISTS manually
  8045         -# --------------------------------------------------------------
  8046         -AC_DEFUN([PKG_CHECK_EXISTS],
  8047         -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  8048         -if test -n "$PKG_CONFIG" && \
  8049         -    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  8050         -  m4_default([$2], [:])
  8051         -m4_ifvaln([$3], [else
  8052         -  $3])dnl
  8053         -fi])
  8054         -
  8055         -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  8056         -# ---------------------------------------------
  8057         -m4_define([_PKG_CONFIG],
  8058         -[if test -n "$$1"; then
  8059         -    pkg_cv_[]$1="$$1"
  8060         - elif test -n "$PKG_CONFIG"; then
  8061         -    PKG_CHECK_EXISTS([$3],
  8062         -                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
  8063         -		     [pkg_failed=yes])
  8064         - else
  8065         -    pkg_failed=untried
  8066         -fi[]dnl
  8067         -])# _PKG_CONFIG
  8068         -
  8069         -# _PKG_SHORT_ERRORS_SUPPORTED
  8070         -# -----------------------------
  8071         -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  8072         -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  8073         -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  8074         -        _pkg_short_errors_supported=yes
  8075         -else
  8076         -        _pkg_short_errors_supported=no
  8077         -fi[]dnl
  8078         -])# _PKG_SHORT_ERRORS_SUPPORTED
  8079         -
  8080         -
  8081         -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  8082         -# [ACTION-IF-NOT-FOUND])
  8083         -#
  8084         -#
  8085         -# Note that if there is a possibility the first call to
  8086         -# PKG_CHECK_MODULES might not happen, you should be sure to include an
  8087         -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  8088         -#
  8089         -#
  8090         -# --------------------------------------------------------------
  8091         -AC_DEFUN([PKG_CHECK_MODULES],
  8092         -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  8093         -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  8094         -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  8095         -
  8096         -pkg_failed=no
  8097         -AC_MSG_CHECKING([for $1])
  8098         -
  8099         -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  8100         -_PKG_CONFIG([$1][_LIBS], [libs], [$2])
  8101         -
  8102         -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  8103         -and $1[]_LIBS to avoid the need to call pkg-config.
  8104         -See the pkg-config man page for more details.])
  8105         -
  8106         -if test $pkg_failed = yes; then
  8107         -   	AC_MSG_RESULT([no])
  8108         -        _PKG_SHORT_ERRORS_SUPPORTED
  8109         -        if test $_pkg_short_errors_supported = yes; then
  8110         -	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
  8111         -        else 
  8112         -	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
  8113         -        fi
  8114         -	# Put the nasty error message in config.log where it belongs
  8115         -	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  8116         -
  8117         -	m4_default([$4], [AC_MSG_ERROR(
  8118         -[Package requirements ($2) were not met:
  8119         -
  8120         -$$1_PKG_ERRORS
  8121         -
  8122         -Consider adjusting the PKG_CONFIG_PATH environment variable if you
  8123         -installed software in a non-standard prefix.
  8124         -
  8125         -_PKG_TEXT])[]dnl
  8126         -        ])
  8127         -elif test $pkg_failed = untried; then
  8128         -     	AC_MSG_RESULT([no])
  8129         -	m4_default([$4], [AC_MSG_FAILURE(
  8130         -[The pkg-config script could not be found or is too old.  Make sure it
  8131         -is in your PATH or set the PKG_CONFIG environment variable to the full
  8132         -path to pkg-config.
  8133         -
  8134         -_PKG_TEXT
  8135         -
  8136         -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  8137         -        ])
  8138         -else
  8139         -	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  8140         -	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  8141         -        AC_MSG_RESULT([yes])
  8142         -	$3
  8143         -fi[]dnl
  8144         -])# PKG_CHECK_MODULES
  8145         -
  8146         -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
         6672  +])
         6673  +
         6674  +# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
  8147   6675   #
  8148   6676   # This file is free software; the Free Software Foundation
  8149   6677   # gives unlimited permission to copy and/or distribute it,
  8150   6678   # with or without modifications, as long as this notice is preserved.
  8151   6679   
  8152   6680   # AM_AUTOMAKE_VERSION(VERSION)
  8153   6681   # ----------------------------
  8154   6682   # Automake X.Y traces this macro to ensure aclocal.m4 has been
  8155   6683   # generated from the m4 files accompanying Automake X.Y.
  8156   6684   # (This private macro should not be called outside this file.)
  8157   6685   AC_DEFUN([AM_AUTOMAKE_VERSION],
  8158         -[am__api_version='1.11'
         6686  +[am__api_version='1.10'
  8159   6687   dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  8160   6688   dnl require some minimum version.  Point them to the right macro.
  8161         -m4_if([$1], [1.11.1], [],
         6689  +m4_if([$1], [1.10.1], [],
  8162   6690         [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  8163   6691   ])
  8164   6692   
  8165   6693   # _AM_AUTOCONF_VERSION(VERSION)
  8166   6694   # -----------------------------
  8167   6695   # aclocal traces this macro to find the Autoconf version.
  8168   6696   # This is a private macro too.  Using m4_define simplifies
  8169   6697   # the logic in aclocal, which can simply ignore this definition.
  8170   6698   m4_define([_AM_AUTOCONF_VERSION], [])
  8171   6699   
  8172   6700   # AM_SET_CURRENT_AUTOMAKE_VERSION
  8173   6701   # -------------------------------
  8174   6702   # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  8175         -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
         6703  +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
  8176   6704   AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  8177         -[AM_AUTOMAKE_VERSION([1.11.1])dnl
         6705  +[AM_AUTOMAKE_VERSION([1.10.1])dnl
  8178   6706   m4_ifndef([AC_AUTOCONF_VERSION],
  8179   6707     [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  8180         -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
         6708  +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
  8181   6709   
  8182   6710   # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
  8183   6711   
  8184   6712   # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
  8185   6713   #
  8186   6714   # This file is free software; the Free Software Foundation
  8187   6715   # gives unlimited permission to copy and/or distribute it,
................................................................................
  8230   6758   AC_PREREQ([2.50])dnl
  8231   6759   # expand $ac_aux_dir to an absolute path
  8232   6760   am_aux_dir=`cd $ac_aux_dir && pwd`
  8233   6761   ])
  8234   6762   
  8235   6763   # AM_CONDITIONAL                                            -*- Autoconf -*-
  8236   6764   
  8237         -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
         6765  +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
  8238   6766   # Free Software Foundation, Inc.
  8239   6767   #
  8240   6768   # This file is free software; the Free Software Foundation
  8241   6769   # gives unlimited permission to copy and/or distribute it,
  8242   6770   # with or without modifications, as long as this notice is preserved.
  8243   6771   
  8244         -# serial 9
         6772  +# serial 8
  8245   6773   
  8246   6774   # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  8247   6775   # -------------------------------------
  8248   6776   # Define a conditional.
  8249   6777   AC_DEFUN([AM_CONDITIONAL],
  8250   6778   [AC_PREREQ(2.52)dnl
  8251   6779    ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
  8252   6780   	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  8253   6781   AC_SUBST([$1_TRUE])dnl
  8254   6782   AC_SUBST([$1_FALSE])dnl
  8255   6783   _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  8256   6784   _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  8257         -m4_define([_AM_COND_VALUE_$1], [$2])dnl
  8258   6785   if $2; then
  8259   6786     $1_TRUE=
  8260   6787     $1_FALSE='#'
  8261   6788   else
  8262   6789     $1_TRUE='#'
  8263   6790     $1_FALSE=
  8264   6791   fi
  8265   6792   AC_CONFIG_COMMANDS_PRE(
  8266   6793   [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  8267   6794     AC_MSG_ERROR([[conditional "$1" was never defined.
  8268   6795   Usually this means the macro was only invoked conditionally.]])
  8269   6796   fi])])
  8270   6797   
  8271         -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
         6798  +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  8272   6799   # Free Software Foundation, Inc.
  8273   6800   #
  8274   6801   # This file is free software; the Free Software Foundation
  8275   6802   # gives unlimited permission to copy and/or distribute it,
  8276   6803   # with or without modifications, as long as this notice is preserved.
  8277   6804   
  8278         -# serial 10
         6805  +# serial 9
  8279   6806   
  8280   6807   # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  8281   6808   # written in clear, in which case automake, when reading aclocal.m4,
  8282   6809   # will think it sees a *use*, and therefore will trigger all it's
  8283   6810   # C support machinery.  Also note that it means that autoscan, seeing
  8284   6811   # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  8285   6812   
................................................................................
  8328   6855     # directory.
  8329   6856     mkdir sub
  8330   6857   
  8331   6858     am_cv_$1_dependencies_compiler_type=none
  8332   6859     if test "$am_compiler_list" = ""; then
  8333   6860        am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  8334   6861     fi
  8335         -  am__universal=false
  8336         -  m4_case([$1], [CC],
  8337         -    [case " $depcc " in #(
  8338         -     *\ -arch\ *\ -arch\ *) am__universal=true ;;
  8339         -     esac],
  8340         -    [CXX],
  8341         -    [case " $depcc " in #(
  8342         -     *\ -arch\ *\ -arch\ *) am__universal=true ;;
  8343         -     esac])
  8344         -
  8345   6862     for depmode in $am_compiler_list; do
  8346   6863       # Setup a source with many dependencies, because some compilers
  8347   6864       # like to wrap large dependency lists on column 80 (with \), and
  8348   6865       # we should not choose a depcomp mode which is confused by this.
  8349   6866       #
  8350   6867       # We need to recreate these files for each test, as the compiler may
  8351   6868       # overwrite some of them when testing with obscure command lines.
................................................................................
  8355   6872         echo '#include "conftst'$i'.h"' >> sub/conftest.c
  8356   6873         # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
  8357   6874         # Solaris 8's {/usr,}/bin/sh.
  8358   6875         touch sub/conftst$i.h
  8359   6876       done
  8360   6877       echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  8361   6878   
  8362         -    # We check with `-c' and `-o' for the sake of the "dashmstdout"
  8363         -    # mode.  It turns out that the SunPro C++ compiler does not properly
  8364         -    # handle `-M -o', and we need to detect this.  Also, some Intel
  8365         -    # versions had trouble with output in subdirs
  8366         -    am__obj=sub/conftest.${OBJEXT-o}
  8367         -    am__minus_obj="-o $am__obj"
  8368   6879       case $depmode in
  8369         -    gcc)
  8370         -      # This depmode causes a compiler race in universal mode.
  8371         -      test "$am__universal" = false || continue
  8372         -      ;;
  8373   6880       nosideeffect)
  8374   6881         # after this tag, mechanisms are not by side-effect, so they'll
  8375   6882         # only be used when explicitly requested
  8376   6883         if test "x$enable_dependency_tracking" = xyes; then
  8377   6884   	continue
  8378   6885         else
  8379   6886   	break
  8380   6887         fi
  8381   6888         ;;
  8382         -    msvisualcpp | msvcmsys)
  8383         -      # This compiler won't grok `-c -o', but also, the minuso test has
  8384         -      # not run yet.  These depmodes are late enough in the game, and
  8385         -      # so weak that their functioning should not be impacted.
  8386         -      am__obj=conftest.${OBJEXT-o}
  8387         -      am__minus_obj=
  8388         -      ;;
  8389   6889       none) break ;;
  8390   6890       esac
         6891  +    # We check with `-c' and `-o' for the sake of the "dashmstdout"
         6892  +    # mode.  It turns out that the SunPro C++ compiler does not properly
         6893  +    # handle `-M -o', and we need to detect this.
  8391   6894       if depmode=$depmode \
  8392         -       source=sub/conftest.c object=$am__obj \
         6895  +       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
  8393   6896          depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  8394         -       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
         6897  +       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
  8395   6898            >/dev/null 2>conftest.err &&
  8396   6899          grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  8397   6900          grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  8398         -       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
         6901  +       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
  8399   6902          ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  8400   6903         # icc doesn't choke on unknown options, it will just issue warnings
  8401   6904         # or remarks (even with -Werror).  So we grep stderr for any message
  8402   6905         # that says an option was ignored or not supported.
  8403   6906         # When given -MP, icc 7.0 and 7.1 complain thusly:
  8404   6907         #   icc: Command line warning: ignoring option '-M'; no argument required
  8405   6908         # The diagnosis changed in icc 8.0:
................................................................................
  8448   6951   AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  8449   6952   AC_SUBST([AMDEPBACKSLASH])dnl
  8450   6953   _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  8451   6954   ])
  8452   6955   
  8453   6956   # Generate code to set up dependency tracking.              -*- Autoconf -*-
  8454   6957   
  8455         -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
         6958  +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
  8456   6959   # Free Software Foundation, Inc.
  8457   6960   #
  8458   6961   # This file is free software; the Free Software Foundation
  8459   6962   # gives unlimited permission to copy and/or distribute it,
  8460   6963   # with or without modifications, as long as this notice is preserved.
  8461   6964   
  8462         -#serial 5
         6965  +#serial 3
  8463   6966   
  8464   6967   # _AM_OUTPUT_DEPENDENCY_COMMANDS
  8465   6968   # ------------------------------
  8466   6969   AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  8467         -[{
  8468         -  # Autoconf 2.62 quotes --file arguments for eval, but not when files
  8469         -  # are listed without --file.  Let's play safe and only enable the eval
  8470         -  # if we detect the quoting.
  8471         -  case $CONFIG_FILES in
  8472         -  *\'*) eval set x "$CONFIG_FILES" ;;
  8473         -  *)   set x $CONFIG_FILES ;;
  8474         -  esac
  8475         -  shift
  8476         -  for mf
  8477         -  do
  8478         -    # Strip MF so we end up with the name of the file.
  8479         -    mf=`echo "$mf" | sed -e 's/:.*$//'`
  8480         -    # Check whether this is an Automake generated Makefile or not.
  8481         -    # We used to match only the files named `Makefile.in', but
  8482         -    # some people rename them; so instead we look at the file content.
  8483         -    # Grep'ing the first line is not enough: some people post-process
  8484         -    # each Makefile.in and add a new line on top of each file to say so.
  8485         -    # Grep'ing the whole file is not good either: AIX grep has a line
  8486         -    # limit of 2048, but all sed's we know have understand at least 4000.
  8487         -    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  8488         -      dirpart=`AS_DIRNAME("$mf")`
  8489         -    else
  8490         -      continue
  8491         -    fi
  8492         -    # Extract the definition of DEPDIR, am__include, and am__quote
  8493         -    # from the Makefile without running `make'.
  8494         -    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  8495         -    test -z "$DEPDIR" && continue
  8496         -    am__include=`sed -n 's/^am__include = //p' < "$mf"`
  8497         -    test -z "am__include" && continue
  8498         -    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  8499         -    # When using ansi2knr, U may be empty or an underscore; expand it
  8500         -    U=`sed -n 's/^U = //p' < "$mf"`
  8501         -    # Find all dependency output files, they are included files with
  8502         -    # $(DEPDIR) in their names.  We invoke sed twice because it is the
  8503         -    # simplest approach to changing $(DEPDIR) to its actual value in the
  8504         -    # expansion.
  8505         -    for file in `sed -n "
  8506         -      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  8507         -	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
  8508         -      # Make sure the directory exists.
  8509         -      test -f "$dirpart/$file" && continue
  8510         -      fdir=`AS_DIRNAME(["$file"])`
  8511         -      AS_MKDIR_P([$dirpart/$fdir])
  8512         -      # echo "creating $dirpart/$file"
  8513         -      echo '# dummy' > "$dirpart/$file"
  8514         -    done
         6970  +[for mf in $CONFIG_FILES; do
         6971  +  # Strip MF so we end up with the name of the file.
         6972  +  mf=`echo "$mf" | sed -e 's/:.*$//'`
         6973  +  # Check whether this is an Automake generated Makefile or not.
         6974  +  # We used to match only the files named `Makefile.in', but
         6975  +  # some people rename them; so instead we look at the file content.
         6976  +  # Grep'ing the first line is not enough: some people post-process
         6977  +  # each Makefile.in and add a new line on top of each file to say so.
         6978  +  # Grep'ing the whole file is not good either: AIX grep has a line
         6979  +  # limit of 2048, but all sed's we know have understand at least 4000.
         6980  +  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
         6981  +    dirpart=`AS_DIRNAME("$mf")`
         6982  +  else
         6983  +    continue
         6984  +  fi
         6985  +  # Extract the definition of DEPDIR, am__include, and am__quote
         6986  +  # from the Makefile without running `make'.
         6987  +  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
         6988  +  test -z "$DEPDIR" && continue
         6989  +  am__include=`sed -n 's/^am__include = //p' < "$mf"`
         6990  +  test -z "am__include" && continue
         6991  +  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
         6992  +  # When using ansi2knr, U may be empty or an underscore; expand it
         6993  +  U=`sed -n 's/^U = //p' < "$mf"`
         6994  +  # Find all dependency output files, they are included files with
         6995  +  # $(DEPDIR) in their names.  We invoke sed twice because it is the
         6996  +  # simplest approach to changing $(DEPDIR) to its actual value in the
         6997  +  # expansion.
         6998  +  for file in `sed -n "
         6999  +    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
         7000  +       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
         7001  +    # Make sure the directory exists.
         7002  +    test -f "$dirpart/$file" && continue
         7003  +    fdir=`AS_DIRNAME(["$file"])`
         7004  +    AS_MKDIR_P([$dirpart/$fdir])
         7005  +    # echo "creating $dirpart/$file"
         7006  +    echo '# dummy' > "$dirpart/$file"
  8515   7007     done
  8516         -}
         7008  +done
  8517   7009   ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  8518   7010   
  8519   7011   
  8520   7012   # AM_OUTPUT_DEPENDENCY_COMMANDS
  8521   7013   # -----------------------------
  8522   7014   # This macro should only be invoked once -- use via AC_REQUIRE.
  8523   7015   #
................................................................................
  8529   7021        [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  8530   7022        [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  8531   7023   ])
  8532   7024   
  8533   7025   # Do all the work for Automake.                             -*- Autoconf -*-
  8534   7026   
  8535   7027   # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  8536         -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
         7028  +# 2005, 2006, 2008 Free Software Foundation, Inc.
  8537   7029   #
  8538   7030   # This file is free software; the Free Software Foundation
  8539   7031   # gives unlimited permission to copy and/or distribute it,
  8540   7032   # with or without modifications, as long as this notice is preserved.
  8541   7033   
  8542         -# serial 16
         7034  +# serial 13
  8543   7035   
  8544   7036   # This macro actually does too much.  Some checks are only needed if
  8545   7037   # your package does certain things.  But this isn't really a big deal.
  8546   7038   
  8547   7039   # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  8548   7040   # AM_INIT_AUTOMAKE([OPTIONS])
  8549   7041   # -----------------------------------------------
................................................................................
  8552   7044   # and VERSION should now be passed to AC_INIT and removed from
  8553   7045   # the call to AM_INIT_AUTOMAKE.
  8554   7046   # We support both call styles for the transition.  After
  8555   7047   # the next Automake release, Autoconf can make the AC_INIT
  8556   7048   # arguments mandatory, and then we can depend on a new Autoconf
  8557   7049   # release and drop the old call support.
  8558   7050   AC_DEFUN([AM_INIT_AUTOMAKE],
  8559         -[AC_PREREQ([2.62])dnl
         7051  +[AC_PREREQ([2.60])dnl
  8560   7052   dnl Autoconf wants to disallow AM_ names.  We explicitly allow
  8561   7053   dnl the ones we care about.
  8562   7054   m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  8563   7055   AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  8564   7056   AC_REQUIRE([AC_PROG_INSTALL])dnl
  8565   7057   if test "`cd $srcdir && pwd`" != "`pwd`"; then
  8566   7058     # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
................................................................................
  8603   7095   AC_REQUIRE([AM_SANITY_CHECK])dnl
  8604   7096   AC_REQUIRE([AC_ARG_PROGRAM])dnl
  8605   7097   AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
  8606   7098   AM_MISSING_PROG(AUTOCONF, autoconf)
  8607   7099   AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
  8608   7100   AM_MISSING_PROG(AUTOHEADER, autoheader)
  8609   7101   AM_MISSING_PROG(MAKEINFO, makeinfo)
  8610         -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  8611         -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
         7102  +AM_PROG_INSTALL_SH
         7103  +AM_PROG_INSTALL_STRIP
  8612   7104   AC_REQUIRE([AM_PROG_MKDIR_P])dnl
  8613   7105   # We need awk for the "check" target.  The system "awk" is bad on
  8614   7106   # some platforms.
  8615   7107   AC_REQUIRE([AC_PROG_AWK])dnl
  8616   7108   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  8617   7109   AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  8618   7110   _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  8619         -	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  8620         -			     [_AM_PROG_TAR([v7])])])
         7111  +              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
         7112  +	      		     [_AM_PROG_TAR([v7])])])
  8621   7113   _AM_IF_OPTION([no-dependencies],,
  8622   7114   [AC_PROVIDE_IFELSE([AC_PROG_CC],
  8623         -		  [_AM_DEPENDENCIES(CC)],
  8624         -		  [define([AC_PROG_CC],
  8625         -			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
         7115  +                  [_AM_DEPENDENCIES(CC)],
         7116  +                  [define([AC_PROG_CC],
         7117  +                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
  8626   7118   AC_PROVIDE_IFELSE([AC_PROG_CXX],
  8627         -		  [_AM_DEPENDENCIES(CXX)],
  8628         -		  [define([AC_PROG_CXX],
  8629         -			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
         7119  +                  [_AM_DEPENDENCIES(CXX)],
         7120  +                  [define([AC_PROG_CXX],
         7121  +                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
  8630   7122   AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  8631         -		  [_AM_DEPENDENCIES(OBJC)],
  8632         -		  [define([AC_PROG_OBJC],
  8633         -			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
         7123  +                  [_AM_DEPENDENCIES(OBJC)],
         7124  +                  [define([AC_PROG_OBJC],
         7125  +                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
  8634   7126   ])
  8635         -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
  8636         -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
  8637         -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
  8638         -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
  8639         -AC_CONFIG_COMMANDS_PRE(dnl
  8640         -[m4_provide_if([_AM_COMPILER_EXEEXT],
  8641         -  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  8642   7127   ])
  8643   7128   
  8644         -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
  8645         -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  8646         -dnl mangled by Autoconf and run in a shell conditional statement.
  8647         -m4_define([_AC_COMPILER_EXEEXT],
  8648         -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  8649         -
  8650   7129   
  8651   7130   # When config.status generates a header, we must update the stamp-h file.
  8652   7131   # This file resides in the same directory as the config header
  8653   7132   # that is generated.  The stamp files are numbered to have different names.
  8654   7133   
  8655   7134   # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  8656   7135   # loop where config.status creates the headers, so we can generate
................................................................................
  8665   7144         break ;;
  8666   7145       * )
  8667   7146         _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  8668   7147     esac
  8669   7148   done
  8670   7149   echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  8671   7150   
  8672         -# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
         7151  +# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
  8673   7152   #
  8674   7153   # This file is free software; the Free Software Foundation
  8675   7154   # gives unlimited permission to copy and/or distribute it,
  8676   7155   # with or without modifications, as long as this notice is preserved.
  8677   7156   
  8678   7157   # AM_PROG_INSTALL_SH
  8679   7158   # ------------------
  8680   7159   # Define $install_sh.
  8681   7160   AC_DEFUN([AM_PROG_INSTALL_SH],
  8682   7161   [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  8683         -if test x"${install_sh}" != xset; then
  8684         -  case $am_aux_dir in
  8685         -  *\ * | *\	*)
  8686         -    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  8687         -  *)
  8688         -    install_sh="\${SHELL} $am_aux_dir/install-sh"
  8689         -  esac
  8690         -fi
         7162  +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
  8691   7163   AC_SUBST(install_sh)])
  8692   7164   
  8693   7165   # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
  8694   7166   #
  8695   7167   # This file is free software; the Free Software Foundation
  8696   7168   # gives unlimited permission to copy and/or distribute it,
  8697   7169   # with or without modifications, as long as this notice is preserved.
................................................................................
  8710   7182   fi
  8711   7183   rmdir .tst 2>/dev/null
  8712   7184   AC_SUBST([am__leading_dot])])
  8713   7185   
  8714   7186   # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
  8715   7187   # From Jim Meyering
  8716   7188   
  8717         -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
         7189  +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
  8718   7190   # Free Software Foundation, Inc.
  8719   7191   #
  8720   7192   # This file is free software; the Free Software Foundation
  8721   7193   # gives unlimited permission to copy and/or distribute it,
  8722   7194   # with or without modifications, as long as this notice is preserved.
  8723   7195   
  8724         -# serial 5
         7196  +# serial 4
  8725   7197   
  8726         -# AM_MAINTAINER_MODE([DEFAULT-MODE])
  8727         -# ----------------------------------
  8728         -# Control maintainer-specific portions of Makefiles.
  8729         -# Default is to disable them, unless `enable' is passed literally.
  8730         -# For symmetry, `disable' may be passed as well.  Anyway, the user
  8731         -# can override the default with the --enable/--disable switch.
  8732   7198   AC_DEFUN([AM_MAINTAINER_MODE],
  8733         -[m4_case(m4_default([$1], [disable]),
  8734         -       [enable], [m4_define([am_maintainer_other], [disable])],
  8735         -       [disable], [m4_define([am_maintainer_other], [enable])],
  8736         -       [m4_define([am_maintainer_other], [enable])
  8737         -        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
  8738         -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
  8739         -  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
  8740         -  AC_ARG_ENABLE([maintainer-mode],
  8741         -[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
         7199  +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
         7200  +  dnl maintainer-mode is disabled by default
         7201  +  AC_ARG_ENABLE(maintainer-mode,
         7202  +[  --enable-maintainer-mode  enable make rules and dependencies not useful
  8742   7203   			  (and sometimes confusing) to the casual installer],
  8743         -      [USE_MAINTAINER_MODE=$enableval],
  8744         -      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
         7204  +      USE_MAINTAINER_MODE=$enableval,
         7205  +      USE_MAINTAINER_MODE=no)
  8745   7206     AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  8746         -  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
         7207  +  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
  8747   7208     MAINT=$MAINTAINER_MODE_TRUE
  8748         -  AC_SUBST([MAINT])dnl
         7209  +  AC_SUBST(MAINT)dnl
  8749   7210   ]
  8750   7211   )
  8751   7212   
  8752   7213   AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
  8753   7214   
  8754   7215   # Check to see how 'make' treats includes.	            -*- Autoconf -*-
  8755   7216   
  8756         -# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
         7217  +# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
  8757   7218   #
  8758   7219   # This file is free software; the Free Software Foundation
  8759   7220   # gives unlimited permission to copy and/or distribute it,
  8760   7221   # with or without modifications, as long as this notice is preserved.
  8761   7222   
  8762         -# serial 4
         7223  +# serial 3
  8763   7224   
  8764   7225   # AM_MAKE_INCLUDE()
  8765   7226   # -----------------
  8766   7227   # Check to see how make treats includes.
  8767   7228   AC_DEFUN([AM_MAKE_INCLUDE],
  8768   7229   [am_make=${MAKE-make}
  8769   7230   cat > confinc << 'END'
  8770   7231   am__doit:
  8771         -	@echo this is the am__doit target
         7232  +	@echo done
  8772   7233   .PHONY: am__doit
  8773   7234   END
  8774   7235   # If we don't find an include directive, just comment out the code.
  8775   7236   AC_MSG_CHECKING([for style of include used by $am_make])
  8776   7237   am__include="#"
  8777   7238   am__quote=
  8778   7239   _am_result=none
  8779   7240   # First try GNU make style include.
  8780   7241   echo "include confinc" > confmf
  8781         -# Ignore all kinds of additional output from `make'.
  8782         -case `$am_make -s -f confmf 2> /dev/null` in #(
  8783         -*the\ am__doit\ target*)
  8784         -  am__include=include
  8785         -  am__quote=
  8786         -  _am_result=GNU
  8787         -  ;;
  8788         -esac
         7242  +# We grep out `Entering directory' and `Leaving directory'
         7243  +# messages which can occur if `w' ends up in MAKEFLAGS.
         7244  +# In particular we don't look at `^make:' because GNU make might
         7245  +# be invoked under some other name (usually "gmake"), in which
         7246  +# case it prints its new name instead of `make'.
         7247  +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
         7248  +   am__include=include
         7249  +   am__quote=
         7250  +   _am_result=GNU
         7251  +fi
  8789   7252   # Now try BSD make style include.
  8790   7253   if test "$am__include" = "#"; then
  8791   7254      echo '.include "confinc"' > confmf
  8792         -   case `$am_make -s -f confmf 2> /dev/null` in #(
  8793         -   *the\ am__doit\ target*)
  8794         -     am__include=.include
  8795         -     am__quote="\""
  8796         -     _am_result=BSD
  8797         -     ;;
  8798         -   esac
         7255  +   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
         7256  +      am__include=.include
         7257  +      am__quote="\""
         7258  +      _am_result=BSD
         7259  +   fi
  8799   7260   fi
  8800   7261   AC_SUBST([am__include])
  8801   7262   AC_SUBST([am__quote])
  8802   7263   AC_MSG_RESULT([$_am_result])
  8803   7264   rm -f confinc confmf
  8804   7265   ])
  8805   7266   
  8806   7267   # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
  8807   7268   
  8808         -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
         7269  +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
  8809   7270   # Free Software Foundation, Inc.
  8810   7271   #
  8811   7272   # This file is free software; the Free Software Foundation
  8812   7273   # gives unlimited permission to copy and/or distribute it,
  8813   7274   # with or without modifications, as long as this notice is preserved.
  8814   7275   
  8815         -# serial 6
         7276  +# serial 5
  8816   7277   
  8817   7278   # AM_MISSING_PROG(NAME, PROGRAM)
  8818   7279   # ------------------------------
  8819   7280   AC_DEFUN([AM_MISSING_PROG],
  8820   7281   [AC_REQUIRE([AM_MISSING_HAS_RUN])
  8821   7282   $1=${$1-"${am_missing_run}$2"}
  8822   7283   AC_SUBST($1)])
................................................................................
  8825   7286   # AM_MISSING_HAS_RUN
  8826   7287   # ------------------
  8827   7288   # Define MISSING if not defined so far and test if it supports --run.
  8828   7289   # If it does, set am_missing_run to use it, otherwise, to nothing.
  8829   7290   AC_DEFUN([AM_MISSING_HAS_RUN],
  8830   7291   [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  8831   7292   AC_REQUIRE_AUX_FILE([missing])dnl
  8832         -if test x"${MISSING+set}" != xset; then
  8833         -  case $am_aux_dir in
  8834         -  *\ * | *\	*)
  8835         -    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  8836         -  *)
  8837         -    MISSING="\${SHELL} $am_aux_dir/missing" ;;
  8838         -  esac
  8839         -fi
         7293  +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
  8840   7294   # Use eval to expand $SHELL
  8841   7295   if eval "$MISSING --run true"; then
  8842   7296     am_missing_run="$MISSING --run "
  8843   7297   else
  8844   7298     am_missing_run=
  8845   7299     AC_MSG_WARN([`missing' script is too old or missing])
  8846   7300   fi
................................................................................
  8870   7324     [[\\/$]]* | ?:[[\\/]]*) ;;
  8871   7325     */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
  8872   7326   esac
  8873   7327   ])
  8874   7328   
  8875   7329   # Helper functions for option handling.                     -*- Autoconf -*-
  8876   7330   
  8877         -# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
         7331  +# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
  8878   7332   #
  8879   7333   # This file is free software; the Free Software Foundation
  8880   7334   # gives unlimited permission to copy and/or distribute it,
  8881   7335   # with or without modifications, as long as this notice is preserved.
  8882   7336   
  8883         -# serial 4
         7337  +# serial 3
  8884   7338   
  8885   7339   # _AM_MANGLE_OPTION(NAME)
  8886   7340   # -----------------------
  8887   7341   AC_DEFUN([_AM_MANGLE_OPTION],
  8888   7342   [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  8889   7343   
  8890   7344   # _AM_SET_OPTION(NAME)
................................................................................
  8893   7347   AC_DEFUN([_AM_SET_OPTION],
  8894   7348   [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
  8895   7349   
  8896   7350   # _AM_SET_OPTIONS(OPTIONS)
  8897   7351   # ----------------------------------
  8898   7352   # OPTIONS is a space-separated list of Automake options.
  8899   7353   AC_DEFUN([_AM_SET_OPTIONS],
  8900         -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
         7354  +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  8901   7355   
  8902   7356   # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  8903   7357   # -------------------------------------------
  8904   7358   # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  8905   7359   AC_DEFUN([_AM_IF_OPTION],
  8906   7360   [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  8907   7361   
  8908   7362   # Check to make sure that the build environment is sane.    -*- Autoconf -*-
  8909   7363   
  8910         -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
         7364  +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
  8911   7365   # Free Software Foundation, Inc.
  8912   7366   #
  8913   7367   # This file is free software; the Free Software Foundation
  8914   7368   # gives unlimited permission to copy and/or distribute it,
  8915   7369   # with or without modifications, as long as this notice is preserved.
  8916   7370   
  8917         -# serial 5
         7371  +# serial 4
  8918   7372   
  8919   7373   # AM_SANITY_CHECK
  8920   7374   # ---------------
  8921   7375   AC_DEFUN([AM_SANITY_CHECK],
  8922   7376   [AC_MSG_CHECKING([whether build environment is sane])
  8923   7377   # Just in case
  8924   7378   sleep 1
  8925   7379   echo timestamp > conftest.file
  8926         -# Reject unsafe characters in $srcdir or the absolute working directory
  8927         -# name.  Accept space and tab only in the latter.
  8928         -am_lf='
  8929         -'
  8930         -case `pwd` in
  8931         -  *[[\\\"\#\$\&\'\`$am_lf]]*)
  8932         -    AC_MSG_ERROR([unsafe absolute working directory name]);;
  8933         -esac
  8934         -case $srcdir in
  8935         -  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
  8936         -    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
  8937         -esac
  8938         -
  8939   7380   # Do `set' in a subshell so we don't clobber the current shell's
  8940   7381   # arguments.  Must try -L first in case configure is actually a
  8941   7382   # symlink; some systems play weird games with the mod time of symlinks
  8942   7383   # (eg FreeBSD returns the mod time of the symlink's containing
  8943   7384   # directory).
  8944   7385   if (
  8945         -   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
         7386  +   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
  8946   7387      if test "$[*]" = "X"; then
  8947   7388         # -L didn't work.
  8948         -      set X `ls -t "$srcdir/configure" conftest.file`
         7389  +      set X `ls -t $srcdir/configure conftest.file`
  8949   7390      fi
  8950   7391      rm -f conftest.file
  8951   7392      if test "$[*]" != "X $srcdir/configure conftest.file" \
  8952   7393         && test "$[*]" != "X conftest.file $srcdir/configure"; then
  8953   7394   
  8954   7395         # If neither matched, then we have a broken ls.  This can happen
  8955   7396         # if, for instance, CONFIG_SHELL is bash and it inherits a
................................................................................
  8994   7435   dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
  8995   7436   if test "$cross_compiling" != no; then
  8996   7437     AC_CHECK_TOOL([STRIP], [strip], :)
  8997   7438   fi
  8998   7439   INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  8999   7440   AC_SUBST([INSTALL_STRIP_PROGRAM])])
  9000   7441   
  9001         -# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
         7442  +# Copyright (C) 2006  Free Software Foundation, Inc.
  9002   7443   #
  9003   7444   # This file is free software; the Free Software Foundation
  9004   7445   # gives unlimited permission to copy and/or distribute it,
  9005   7446   # with or without modifications, as long as this notice is preserved.
  9006   7447   
  9007         -# serial 2
  9008         -
  9009   7448   # _AM_SUBST_NOTMAKE(VARIABLE)
  9010   7449   # ---------------------------
  9011   7450   # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  9012   7451   # This macro is traced by Automake.
  9013   7452   AC_DEFUN([_AM_SUBST_NOTMAKE])
  9014   7453   
  9015         -# AM_SUBST_NOTMAKE(VARIABLE)
  9016         -# ---------------------------
  9017         -# Public sister of _AM_SUBST_NOTMAKE.
  9018         -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  9019         -
  9020   7454   # Check how to create a tarball.                            -*- Autoconf -*-
  9021   7455   
  9022   7456   # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
  9023   7457   #
  9024   7458   # This file is free software; the Free Software Foundation
  9025   7459   # gives unlimited permission to copy and/or distribute it,
  9026   7460   # with or without modifications, as long as this notice is preserved.

Changes to config.guess.

     1         -/usr/share/automake-1.11/config.guess
            1  +#! /bin/sh
            2  +# Attempt to guess a canonical system name.
            3  +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
            4  +#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
            5  +#   Inc.
            6  +
            7  +timestamp='2007-07-22'
            8  +
            9  +# This file is free software; you can redistribute it and/or modify it
           10  +# under the terms of the GNU General Public License as published by
           11  +# the Free Software Foundation; either version 2 of the License, or
           12  +# (at your option) any later version.
           13  +#
           14  +# This program is distributed in the hope that it will be useful, but
           15  +# WITHOUT ANY WARRANTY; without even the implied warranty of
           16  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
           17  +# General Public License for more details.
           18  +#
           19  +# You should have received a copy of the GNU General Public License
           20  +# along with this program; if not, write to the Free Software
           21  +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
           22  +# 02110-1301, USA.
           23  +#
           24  +# As a special exception to the GNU General Public License, if you
           25  +# distribute this file as part of a program that contains a
           26  +# configuration script generated by Autoconf, you may include it under
           27  +# the same distribution terms that you use for the rest of that program.
           28  +
           29  +
           30  +# Originally written by Per Bothner <per@bothner.com>.
           31  +# Please send patches to <config-patches@gnu.org>.  Submit a context
           32  +# diff and a properly formatted ChangeLog entry.
           33  +#
           34  +# This script attempts to guess a canonical system name similar to
           35  +# config.sub.  If it succeeds, it prints the system name on stdout, and
           36  +# exits with 0.  Otherwise, it exits with 1.
           37  +#
           38  +# The plan is that this can be called by configure scripts if you
           39  +# don't specify an explicit build system type.
           40  +
           41  +me=`echo "$0" | sed -e 's,.*/,,'`
           42  +
           43  +usage="\
           44  +Usage: $0 [OPTION]
           45  +
           46  +Output the configuration name of the system \`$me' is run on.
           47  +
           48  +Operation modes:
           49  +  -h, --help         print this help, then exit
           50  +  -t, --time-stamp   print date of last modification, then exit
           51  +  -v, --version      print version number, then exit
           52  +
           53  +Report bugs and patches to <config-patches@gnu.org>."
           54  +
           55  +version="\
           56  +GNU config.guess ($timestamp)
           57  +
           58  +Originally written by Per Bothner.
           59  +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
           60  +Free Software Foundation, Inc.
           61  +
           62  +This is free software; see the source for copying conditions.  There is NO
           63  +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
           64  +
           65  +help="
           66  +Try \`$me --help' for more information."
           67  +
           68  +# Parse command line
           69  +while test $# -gt 0 ; do
           70  +  case $1 in
           71  +    --time-stamp | --time* | -t )
           72  +       echo "$timestamp" ; exit ;;
           73  +    --version | -v )
           74  +       echo "$version" ; exit ;;
           75  +    --help | --h* | -h )
           76  +       echo "$usage"; exit ;;
           77  +    -- )     # Stop option processing
           78  +       shift; break ;;
           79  +    - )	# Use stdin as input.
           80  +       break ;;
           81  +    -* )
           82  +       echo "$me: invalid option $1$help" >&2
           83  +       exit 1 ;;
           84  +    * )
           85  +       break ;;
           86  +  esac
           87  +done
           88  +
           89  +if test $# != 0; then
           90  +  echo "$me: too many arguments$help" >&2
           91  +  exit 1
           92  +fi
           93  +
           94  +trap 'exit 1' 1 2 15
           95  +
           96  +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
           97  +# compiler to aid in system detection is discouraged as it requires
           98  +# temporary files to be created and, as you can see below, it is a
           99  +# headache to deal with in a portable fashion.
          100  +
          101  +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
          102  +# use `HOST_CC' if defined, but it is deprecated.
          103  +
          104  +# Portable tmp directory creation inspired by the Autoconf team.
          105  +
          106  +set_cc_for_build='
          107  +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
          108  +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
          109  +: ${TMPDIR=/tmp} ;
          110  + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
          111  + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
          112  + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
          113  + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
          114  +dummy=$tmp/dummy ;
          115  +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
          116  +case $CC_FOR_BUILD,$HOST_CC,$CC in
          117  + ,,)    echo "int x;" > $dummy.c ;
          118  +	for c in cc gcc c89 c99 ; do
          119  +	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
          120  +	     CC_FOR_BUILD="$c"; break ;
          121  +	  fi ;
          122  +	done ;
          123  +	if test x"$CC_FOR_BUILD" = x ; then
          124  +	  CC_FOR_BUILD=no_compiler_found ;
          125  +	fi
          126  +	;;
          127  + ,,*)   CC_FOR_BUILD=$CC ;;
          128  + ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
          129  +esac ; set_cc_for_build= ;'
          130  +
          131  +# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
          132  +# (ghazi@noc.rutgers.edu 1994-08-24)
          133  +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
          134  +	PATH=$PATH:/.attbin ; export PATH
          135  +fi
          136  +
          137  +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
          138  +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
          139  +UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
          140  +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
          141  +
          142  +# Note: order is significant - the case branches are not exclusive.
          143  +
          144  +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          145  +    *:NetBSD:*:*)
          146  +	# NetBSD (nbsd) targets should (where applicable) match one or
          147  +	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
          148  +	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
          149  +	# switched to ELF, *-*-netbsd* would select the old
          150  +	# object file format.  This provides both forward
          151  +	# compatibility and a consistent mechanism for selecting the
          152  +	# object file format.
          153  +	#
          154  +	# Note: NetBSD doesn't particularly care about the vendor
          155  +	# portion of the name.  We always set it to "unknown".
          156  +	sysctl="sysctl -n hw.machine_arch"
          157  +	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
          158  +	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
          159  +	case "${UNAME_MACHINE_ARCH}" in
          160  +	    armeb) machine=armeb-unknown ;;
          161  +	    arm*) machine=arm-unknown ;;
          162  +	    sh3el) machine=shl-unknown ;;
          163  +	    sh3eb) machine=sh-unknown ;;
          164  +	    sh5el) machine=sh5le-unknown ;;
          165  +	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
          166  +	esac
          167  +	# The Operating System including object format, if it has switched
          168  +	# to ELF recently, or will in the future.
          169  +	case "${UNAME_MACHINE_ARCH}" in
          170  +	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
          171  +		eval $set_cc_for_build
          172  +		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
          173  +			| grep __ELF__ >/dev/null
          174  +		then
          175  +		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
          176  +		    # Return netbsd for either.  FIX?
          177  +		    os=netbsd
          178  +		else
          179  +		    os=netbsdelf
          180  +		fi
          181  +		;;
          182  +	    *)
          183  +	        os=netbsd
          184  +		;;
          185  +	esac
          186  +	# The OS release
          187  +	# Debian GNU/NetBSD machines have a different userland, and
          188  +	# thus, need a distinct triplet. However, they do not need
          189  +	# kernel version information, so it can be replaced with a
          190  +	# suitable tag, in the style of linux-gnu.
          191  +	case "${UNAME_VERSION}" in
          192  +	    Debian*)
          193  +		release='-gnu'
          194  +		;;
          195  +	    *)
          196  +		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
          197  +		;;
          198  +	esac
          199  +	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
          200  +	# contains redundant information, the shorter form:
          201  +	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
          202  +	echo "${machine}-${os}${release}"
          203  +	exit ;;
          204  +    *:OpenBSD:*:*)
          205  +	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
          206  +	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
          207  +	exit ;;
          208  +    *:ekkoBSD:*:*)
          209  +	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
          210  +	exit ;;
          211  +    *:SolidBSD:*:*)
          212  +	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
          213  +	exit ;;
          214  +    macppc:MirBSD:*:*)
          215  +	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
          216  +	exit ;;
          217  +    *:MirBSD:*:*)
          218  +	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
          219  +	exit ;;
          220  +    alpha:OSF1:*:*)
          221  +	case $UNAME_RELEASE in
          222  +	*4.0)
          223  +		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
          224  +		;;
          225  +	*5.*)
          226  +	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
          227  +		;;
          228  +	esac
          229  +	# According to Compaq, /usr/sbin/psrinfo has been available on
          230  +	# OSF/1 and Tru64 systems produced since 1995.  I hope that
          231  +	# covers most systems running today.  This code pipes the CPU
          232  +	# types through head -n 1, so we only detect the type of CPU 0.
          233  +	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
          234  +	case "$ALPHA_CPU_TYPE" in
          235  +	    "EV4 (21064)")
          236  +		UNAME_MACHINE="alpha" ;;
          237  +	    "EV4.5 (21064)")
          238  +		UNAME_MACHINE="alpha" ;;
          239  +	    "LCA4 (21066/21068)")
          240  +		UNAME_MACHINE="alpha" ;;
          241  +	    "EV5 (21164)")
          242  +		UNAME_MACHINE="alphaev5" ;;
          243  +	    "EV5.6 (21164A)")
          244  +		UNAME_MACHINE="alphaev56" ;;
          245  +	    "EV5.6 (21164PC)")
          246  +		UNAME_MACHINE="alphapca56" ;;
          247  +	    "EV5.7 (21164PC)")
          248  +		UNAME_MACHINE="alphapca57" ;;
          249  +	    "EV6 (21264)")
          250  +		UNAME_MACHINE="alphaev6" ;;
          251  +	    "EV6.7 (21264A)")
          252  +		UNAME_MACHINE="alphaev67" ;;
          253  +	    "EV6.8CB (21264C)")
          254  +		UNAME_MACHINE="alphaev68" ;;
          255  +	    "EV6.8AL (21264B)")
          256  +		UNAME_MACHINE="alphaev68" ;;
          257  +	    "EV6.8CX (21264D)")
          258  +		UNAME_MACHINE="alphaev68" ;;
          259  +	    "EV6.9A (21264/EV69A)")
          260  +		UNAME_MACHINE="alphaev69" ;;
          261  +	    "EV7 (21364)")
          262  +		UNAME_MACHINE="alphaev7" ;;
          263  +	    "EV7.9 (21364A)")
          264  +		UNAME_MACHINE="alphaev79" ;;
          265  +	esac
          266  +	# A Pn.n version is a patched version.
          267  +	# A Vn.n version is a released version.
          268  +	# A Tn.n version is a released field test version.
          269  +	# A Xn.n version is an unreleased experimental baselevel.
          270  +	# 1.2 uses "1.2" for uname -r.
          271  +	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
          272  +	exit ;;
          273  +    Alpha\ *:Windows_NT*:*)
          274  +	# How do we know it's Interix rather than the generic POSIX subsystem?
          275  +	# Should we change UNAME_MACHINE based on the output of uname instead
          276  +	# of the specific Alpha model?
          277  +	echo alpha-pc-interix
          278  +	exit ;;
          279  +    21064:Windows_NT:50:3)
          280  +	echo alpha-dec-winnt3.5
          281  +	exit ;;
          282  +    Amiga*:UNIX_System_V:4.0:*)
          283  +	echo m68k-unknown-sysv4
          284  +	exit ;;
          285  +    *:[Aa]miga[Oo][Ss]:*:*)
          286  +	echo ${UNAME_MACHINE}-unknown-amigaos
          287  +	exit ;;
          288  +    *:[Mm]orph[Oo][Ss]:*:*)
          289  +	echo ${UNAME_MACHINE}-unknown-morphos
          290  +	exit ;;
          291  +    *:OS/390:*:*)
          292  +	echo i370-ibm-openedition
          293  +	exit ;;
          294  +    *:z/VM:*:*)
          295  +	echo s390-ibm-zvmoe
          296  +	exit ;;
          297  +    *:OS400:*:*)
          298  +        echo powerpc-ibm-os400
          299  +	exit ;;
          300  +    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
          301  +	echo arm-acorn-riscix${UNAME_RELEASE}
          302  +	exit ;;
          303  +    arm:riscos:*:*|arm:RISCOS:*:*)
          304  +	echo arm-unknown-riscos
          305  +	exit ;;
          306  +    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
          307  +	echo hppa1.1-hitachi-hiuxmpp
          308  +	exit ;;
          309  +    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
          310  +	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
          311  +	if test "`(/bin/universe) 2>/dev/null`" = att ; then
          312  +		echo pyramid-pyramid-sysv3
          313  +	else
          314  +		echo pyramid-pyramid-bsd
          315  +	fi
          316  +	exit ;;
          317  +    NILE*:*:*:dcosx)
          318  +	echo pyramid-pyramid-svr4
          319  +	exit ;;
          320  +    DRS?6000:unix:4.0:6*)
          321  +	echo sparc-icl-nx6
          322  +	exit ;;
          323  +    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
          324  +	case `/usr/bin/uname -p` in
          325  +	    sparc) echo sparc-icl-nx7; exit ;;
          326  +	esac ;;
          327  +    sun4H:SunOS:5.*:*)
          328  +	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          329  +	exit ;;
          330  +    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
          331  +	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          332  +	exit ;;
          333  +    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
          334  +	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          335  +	exit ;;
          336  +    sun4*:SunOS:6*:*)
          337  +	# According to config.sub, this is the proper way to canonicalize
          338  +	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
          339  +	# it's likely to be more like Solaris than SunOS4.
          340  +	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          341  +	exit ;;
          342  +    sun4*:SunOS:*:*)
          343  +	case "`/usr/bin/arch -k`" in
          344  +	    Series*|S4*)
          345  +		UNAME_RELEASE=`uname -v`
          346  +		;;
          347  +	esac
          348  +	# Japanese Language versions have a version number like `4.1.3-JL'.
          349  +	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
          350  +	exit ;;
          351  +    sun3*:SunOS:*:*)
          352  +	echo m68k-sun-sunos${UNAME_RELEASE}
          353  +	exit ;;
          354  +    sun*:*:4.2BSD:*)
          355  +	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
          356  +	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
          357  +	case "`/bin/arch`" in
          358  +	    sun3)
          359  +		echo m68k-sun-sunos${UNAME_RELEASE}
          360  +		;;
          361  +	    sun4)
          362  +		echo sparc-sun-sunos${UNAME_RELEASE}
          363  +		;;
          364  +	esac
          365  +	exit ;;
          366  +    aushp:SunOS:*:*)
          367  +	echo sparc-auspex-sunos${UNAME_RELEASE}
          368  +	exit ;;
          369  +    # The situation for MiNT is a little confusing.  The machine name
          370  +    # can be virtually everything (everything which is not
          371  +    # "atarist" or "atariste" at least should have a processor
          372  +    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
          373  +    # to the lowercase version "mint" (or "freemint").  Finally
          374  +    # the system name "TOS" denotes a system which is actually not
          375  +    # MiNT.  But MiNT is downward compatible to TOS, so this should
          376  +    # be no problem.
          377  +    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
          378  +        echo m68k-atari-mint${UNAME_RELEASE}
          379  +	exit ;;
          380  +    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
          381  +	echo m68k-atari-mint${UNAME_RELEASE}
          382  +        exit ;;
          383  +    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
          384  +        echo m68k-atari-mint${UNAME_RELEASE}
          385  +	exit ;;
          386  +    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
          387  +        echo m68k-milan-mint${UNAME_RELEASE}
          388  +        exit ;;
          389  +    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
          390  +        echo m68k-hades-mint${UNAME_RELEASE}
          391  +        exit ;;
          392  +    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
          393  +        echo m68k-unknown-mint${UNAME_RELEASE}
          394  +        exit ;;
          395  +    m68k:machten:*:*)
          396  +	echo m68k-apple-machten${UNAME_RELEASE}
          397  +	exit ;;
          398  +    powerpc:machten:*:*)
          399  +	echo powerpc-apple-machten${UNAME_RELEASE}
          400  +	exit ;;
          401  +    RISC*:Mach:*:*)
          402  +	echo mips-dec-mach_bsd4.3
          403  +	exit ;;
          404  +    RISC*:ULTRIX:*:*)
          405  +	echo mips-dec-ultrix${UNAME_RELEASE}
          406  +	exit ;;
          407  +    VAX*:ULTRIX*:*:*)
          408  +	echo vax-dec-ultrix${UNAME_RELEASE}
          409  +	exit ;;
          410  +    2020:CLIX:*:* | 2430:CLIX:*:*)
          411  +	echo clipper-intergraph-clix${UNAME_RELEASE}
          412  +	exit ;;
          413  +    mips:*:*:UMIPS | mips:*:*:RISCos)
          414  +	eval $set_cc_for_build
          415  +	sed 's/^	//' << EOF >$dummy.c
          416  +#ifdef __cplusplus
          417  +#include <stdio.h>  /* for printf() prototype */
          418  +	int main (int argc, char *argv[]) {
          419  +#else
          420  +	int main (argc, argv) int argc; char *argv[]; {
          421  +#endif
          422  +	#if defined (host_mips) && defined (MIPSEB)
          423  +	#if defined (SYSTYPE_SYSV)
          424  +	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
          425  +	#endif
          426  +	#if defined (SYSTYPE_SVR4)
          427  +	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
          428  +	#endif
          429  +	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
          430  +	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
          431  +	#endif
          432  +	#endif
          433  +	  exit (-1);
          434  +	}
          435  +EOF
          436  +	$CC_FOR_BUILD -o $dummy $dummy.c &&
          437  +	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
          438  +	  SYSTEM_NAME=`$dummy $dummyarg` &&
          439  +	    { echo "$SYSTEM_NAME"; exit; }
          440  +	echo mips-mips-riscos${UNAME_RELEASE}
          441  +	exit ;;
          442  +    Motorola:PowerMAX_OS:*:*)
          443  +	echo powerpc-motorola-powermax
          444  +	exit ;;
          445  +    Motorola:*:4.3:PL8-*)
          446  +	echo powerpc-harris-powermax
          447  +	exit ;;
          448  +    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
          449  +	echo powerpc-harris-powermax
          450  +	exit ;;
          451  +    Night_Hawk:Power_UNIX:*:*)
          452  +	echo powerpc-harris-powerunix
          453  +	exit ;;
          454  +    m88k:CX/UX:7*:*)
          455  +	echo m88k-harris-cxux7
          456  +	exit ;;
          457  +    m88k:*:4*:R4*)
          458  +	echo m88k-motorola-sysv4
          459  +	exit ;;
          460  +    m88k:*:3*:R3*)
          461  +	echo m88k-motorola-sysv3
          462  +	exit ;;
          463  +    AViiON:dgux:*:*)
          464  +        # DG/UX returns AViiON for all architectures
          465  +        UNAME_PROCESSOR=`/usr/bin/uname -p`
          466  +	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
          467  +	then
          468  +	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
          469  +	       [ ${TARGET_BINARY_INTERFACE}x = x ]
          470  +	    then
          471  +		echo m88k-dg-dgux${UNAME_RELEASE}
          472  +	    else
          473  +		echo m88k-dg-dguxbcs${UNAME_RELEASE}
          474  +	    fi
          475  +	else
          476  +	    echo i586-dg-dgux${UNAME_RELEASE}
          477  +	fi
          478  + 	exit ;;
          479  +    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
          480  +	echo m88k-dolphin-sysv3
          481  +	exit ;;
          482  +    M88*:*:R3*:*)
          483  +	# Delta 88k system running SVR3
          484  +	echo m88k-motorola-sysv3
          485  +	exit ;;
          486  +    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
          487  +	echo m88k-tektronix-sysv3
          488  +	exit ;;
          489  +    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
          490  +	echo m68k-tektronix-bsd
          491  +	exit ;;
          492  +    *:IRIX*:*:*)
          493  +	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
          494  +	exit ;;
          495  +    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
          496  +	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
          497  +	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
          498  +    i*86:AIX:*:*)
          499  +	echo i386-ibm-aix
          500  +	exit ;;
          501  +    ia64:AIX:*:*)
          502  +	if [ -x /usr/bin/oslevel ] ; then
          503  +		IBM_REV=`/usr/bin/oslevel`
          504  +	else
          505  +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
          506  +	fi
          507  +	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
          508  +	exit ;;
          509  +    *:AIX:2:3)
          510  +	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
          511  +		eval $set_cc_for_build
          512  +		sed 's/^		//' << EOF >$dummy.c
          513  +		#include <sys/systemcfg.h>
          514  +
          515  +		main()
          516  +			{
          517  +			if (!__power_pc())
          518  +				exit(1);
          519  +			puts("powerpc-ibm-aix3.2.5");
          520  +			exit(0);
          521  +			}
          522  +EOF
          523  +		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
          524  +		then
          525  +			echo "$SYSTEM_NAME"
          526  +		else
          527  +			echo rs6000-ibm-aix3.2.5
          528  +		fi
          529  +	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
          530  +		echo rs6000-ibm-aix3.2.4
          531  +	else
          532  +		echo rs6000-ibm-aix3.2
          533  +	fi
          534  +	exit ;;
          535  +    *:AIX:*:[45])
          536  +	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
          537  +	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
          538  +		IBM_ARCH=rs6000
          539  +	else
          540  +		IBM_ARCH=powerpc
          541  +	fi
          542  +	if [ -x /usr/bin/oslevel ] ; then
          543  +		IBM_REV=`/usr/bin/oslevel`
          544  +	else
          545  +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
          546  +	fi
          547  +	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
          548  +	exit ;;
          549  +    *:AIX:*:*)
          550  +	echo rs6000-ibm-aix
          551  +	exit ;;
          552  +    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
          553  +	echo romp-ibm-bsd4.4
          554  +	exit ;;
          555  +    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
          556  +	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
          557  +	exit ;;                             # report: romp-ibm BSD 4.3
          558  +    *:BOSX:*:*)
          559  +	echo rs6000-bull-bosx
          560  +	exit ;;
          561  +    DPX/2?00:B.O.S.:*:*)
          562  +	echo m68k-bull-sysv3
          563  +	exit ;;
          564  +    9000/[34]??:4.3bsd:1.*:*)
          565  +	echo m68k-hp-bsd
          566  +	exit ;;
          567  +    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
          568  +	echo m68k-hp-bsd4.4
          569  +	exit ;;
          570  +    9000/[34678]??:HP-UX:*:*)
          571  +	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
          572  +	case "${UNAME_MACHINE}" in
          573  +	    9000/31? )            HP_ARCH=m68000 ;;
          574  +	    9000/[34]?? )         HP_ARCH=m68k ;;
          575  +	    9000/[678][0-9][0-9])
          576  +		if [ -x /usr/bin/getconf ]; then
          577  +		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
          578  +                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
          579  +                    case "${sc_cpu_version}" in
          580  +                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
          581  +                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
          582  +                      532)                      # CPU_PA_RISC2_0
          583  +                        case "${sc_kernel_bits}" in
          584  +                          32) HP_ARCH="hppa2.0n" ;;
          585  +                          64) HP_ARCH="hppa2.0w" ;;
          586  +			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
          587  +                        esac ;;
          588  +                    esac
          589  +		fi
          590  +		if [ "${HP_ARCH}" = "" ]; then
          591  +		    eval $set_cc_for_build
          592  +		    sed 's/^              //' << EOF >$dummy.c
          593  +
          594  +              #define _HPUX_SOURCE
          595  +              #include <stdlib.h>
          596  +              #include <unistd.h>
          597  +
          598  +              int main ()
          599  +              {
          600  +              #if defined(_SC_KERNEL_BITS)
          601  +                  long bits = sysconf(_SC_KERNEL_BITS);
          602  +              #endif
          603  +                  long cpu  = sysconf (_SC_CPU_VERSION);
          604  +
          605  +                  switch (cpu)
          606  +              	{
          607  +              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
          608  +              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
          609  +              	case CPU_PA_RISC2_0:
          610  +              #if defined(_SC_KERNEL_BITS)
          611  +              	    switch (bits)
          612  +              		{
          613  +              		case 64: puts ("hppa2.0w"); break;
          614  +              		case 32: puts ("hppa2.0n"); break;
          615  +              		default: puts ("hppa2.0"); break;
          616  +              		} break;
          617  +              #else  /* !defined(_SC_KERNEL_BITS) */
          618  +              	    puts ("hppa2.0"); break;
          619  +              #endif
          620  +              	default: puts ("hppa1.0"); break;
          621  +              	}
          622  +                  exit (0);
          623  +              }
          624  +EOF
          625  +		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
          626  +		    test -z "$HP_ARCH" && HP_ARCH=hppa
          627  +		fi ;;
          628  +	esac
          629  +	if [ ${HP_ARCH} = "hppa2.0w" ]
          630  +	then
          631  +	    eval $set_cc_for_build
          632  +
          633  +	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
          634  +	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
          635  +	    # generating 64-bit code.  GNU and HP use different nomenclature:
          636  +	    #
          637  +	    # $ CC_FOR_BUILD=cc ./config.guess
          638  +	    # => hppa2.0w-hp-hpux11.23
          639  +	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
          640  +	    # => hppa64-hp-hpux11.23
          641  +
          642  +	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
          643  +		grep __LP64__ >/dev/null
          644  +	    then
          645  +		HP_ARCH="hppa2.0w"
          646  +	    else
          647  +		HP_ARCH="hppa64"
          648  +	    fi
          649  +	fi
          650  +	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
          651  +	exit ;;
          652  +    ia64:HP-UX:*:*)
          653  +	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
          654  +	echo ia64-hp-hpux${HPUX_REV}
          655  +	exit ;;
          656  +    3050*:HI-UX:*:*)
          657  +	eval $set_cc_for_build
          658  +	sed 's/^	//' << EOF >$dummy.c
          659  +	#include <unistd.h>
          660  +	int
          661  +	main ()
          662  +	{
          663  +	  long cpu = sysconf (_SC_CPU_VERSION);
          664  +	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
          665  +	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
          666  +	     results, however.  */
          667  +	  if (CPU_IS_PA_RISC (cpu))
          668  +	    {
          669  +	      switch (cpu)
          670  +		{
          671  +		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
          672  +		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
          673  +		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
          674  +		  default: puts ("hppa-hitachi-hiuxwe2"); break;
          675  +		}
          676  +	    }
          677  +	  else if (CPU_IS_HP_MC68K (cpu))
          678  +	    puts ("m68k-hitachi-hiuxwe2");
          679  +	  else puts ("unknown-hitachi-hiuxwe2");
          680  +	  exit (0);
          681  +	}
          682  +EOF
          683  +	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
          684  +		{ echo "$SYSTEM_NAME"; exit; }
          685  +	echo unknown-hitachi-hiuxwe2
          686  +	exit ;;
          687  +    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
          688  +	echo hppa1.1-hp-bsd
          689  +	exit ;;
          690  +    9000/8??:4.3bsd:*:*)
          691  +	echo hppa1.0-hp-bsd
          692  +	exit ;;
          693  +    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
          694  +	echo hppa1.0-hp-mpeix
          695  +	exit ;;
          696  +    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
          697  +	echo hppa1.1-hp-osf
          698  +	exit ;;
          699  +    hp8??:OSF1:*:*)
          700  +	echo hppa1.0-hp-osf
          701  +	exit ;;
          702  +    i*86:OSF1:*:*)
          703  +	if [ -x /usr/sbin/sysversion ] ; then
          704  +	    echo ${UNAME_MACHINE}-unknown-osf1mk
          705  +	else
          706  +	    echo ${UNAME_MACHINE}-unknown-osf1
          707  +	fi
          708  +	exit ;;
          709  +    parisc*:Lites*:*:*)
          710  +	echo hppa1.1-hp-lites
          711  +	exit ;;
          712  +    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
          713  +	echo c1-convex-bsd
          714  +        exit ;;
          715  +    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
          716  +	if getsysinfo -f scalar_acc
          717  +	then echo c32-convex-bsd
          718  +	else echo c2-convex-bsd
          719  +	fi
          720  +        exit ;;
          721  +    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
          722  +	echo c34-convex-bsd
          723  +        exit ;;
          724  +    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
          725  +	echo c38-convex-bsd
          726  +        exit ;;
          727  +    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
          728  +	echo c4-convex-bsd
          729  +        exit ;;
          730  +    CRAY*Y-MP:*:*:*)
          731  +	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          732  +	exit ;;
          733  +    CRAY*[A-Z]90:*:*:*)
          734  +	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
          735  +	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
          736  +	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
          737  +	      -e 's/\.[^.]*$/.X/'
          738  +	exit ;;
          739  +    CRAY*TS:*:*:*)
          740  +	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          741  +	exit ;;
          742  +    CRAY*T3E:*:*:*)
          743  +	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          744  +	exit ;;
          745  +    CRAY*SV1:*:*:*)
          746  +	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          747  +	exit ;;
          748  +    *:UNICOS/mp:*:*)
          749  +	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
          750  +	exit ;;
          751  +    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
          752  +	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
          753  +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
          754  +        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
          755  +        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
          756  +        exit ;;
          757  +    5000:UNIX_System_V:4.*:*)
          758  +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
          759  +        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
          760  +        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
          761  +	exit ;;
          762  +    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
          763  +	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
          764  +	exit ;;
          765  +    sparc*:BSD/OS:*:*)
          766  +	echo sparc-unknown-bsdi${UNAME_RELEASE}
          767  +	exit ;;
          768  +    *:BSD/OS:*:*)
          769  +	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
          770  +	exit ;;
          771  +    *:FreeBSD:*:*)
          772  +	case ${UNAME_MACHINE} in
          773  +	    pc98)
          774  +		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          775  +	    amd64)
          776  +		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          777  +	    *)
          778  +		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
          779  +	esac
          780  +	exit ;;
          781  +    i*:CYGWIN*:*)
          782  +	echo ${UNAME_MACHINE}-pc-cygwin
          783  +	exit ;;
          784  +    *:MINGW*:*)
          785  +	echo ${UNAME_MACHINE}-pc-mingw32
          786  +	exit ;;
          787  +    i*:windows32*:*)
          788  +    	# uname -m includes "-pc" on this system.
          789  +    	echo ${UNAME_MACHINE}-mingw32
          790  +	exit ;;
          791  +    i*:PW*:*)
          792  +	echo ${UNAME_MACHINE}-pc-pw32
          793  +	exit ;;
          794  +    *:Interix*:[3456]*)
          795  +    	case ${UNAME_MACHINE} in
          796  +	    x86)
          797  +		echo i586-pc-interix${UNAME_RELEASE}
          798  +		exit ;;
          799  +	    EM64T | authenticamd)
          800  +		echo x86_64-unknown-interix${UNAME_RELEASE}
          801  +		exit ;;
          802  +	esac ;;
          803  +    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
          804  +	echo i${UNAME_MACHINE}-pc-mks
          805  +	exit ;;
          806  +    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
          807  +	# How do we know it's Interix rather than the generic POSIX subsystem?
          808  +	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
          809  +	# UNAME_MACHINE based on the output of uname instead of i386?
          810  +	echo i586-pc-interix
          811  +	exit ;;
          812  +    i*:UWIN*:*)
          813  +	echo ${UNAME_MACHINE}-pc-uwin
          814  +	exit ;;
          815  +    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
          816  +	echo x86_64-unknown-cygwin
          817  +	exit ;;
          818  +    p*:CYGWIN*:*)
          819  +	echo powerpcle-unknown-cygwin
          820  +	exit ;;
          821  +    prep*:SunOS:5.*:*)
          822  +	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
          823  +	exit ;;
          824  +    *:GNU:*:*)
          825  +	# the GNU system
          826  +	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
          827  +	exit ;;
          828  +    *:GNU/*:*:*)
          829  +	# other systems with GNU libc and userland
          830  +	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
          831  +	exit ;;
          832  +    i*86:Minix:*:*)
          833  +	echo ${UNAME_MACHINE}-pc-minix
          834  +	exit ;;
          835  +    arm*:Linux:*:*)
          836  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          837  +	exit ;;
          838  +    avr32*:Linux:*:*)
          839  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          840  +	exit ;;
          841  +    cris:Linux:*:*)
          842  +	echo cris-axis-linux-gnu
          843  +	exit ;;
          844  +    crisv32:Linux:*:*)
          845  +	echo crisv32-axis-linux-gnu
          846  +	exit ;;
          847  +    frv:Linux:*:*)
          848  +    	echo frv-unknown-linux-gnu
          849  +	exit ;;
          850  +    ia64:Linux:*:*)
          851  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          852  +	exit ;;
          853  +    m32r*:Linux:*:*)
          854  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          855  +	exit ;;
          856  +    m68*:Linux:*:*)
          857  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          858  +	exit ;;
          859  +    mips:Linux:*:*)
          860  +	eval $set_cc_for_build
          861  +	sed 's/^	//' << EOF >$dummy.c
          862  +	#undef CPU
          863  +	#undef mips
          864  +	#undef mipsel
          865  +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
          866  +	CPU=mipsel
          867  +	#else
          868  +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
          869  +	CPU=mips
          870  +	#else
          871  +	CPU=
          872  +	#endif
          873  +	#endif
          874  +EOF
          875  +	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
          876  +	    /^CPU/{
          877  +		s: ::g
          878  +		p
          879  +	    }'`"
          880  +	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
          881  +	;;
          882  +    mips64:Linux:*:*)
          883  +	eval $set_cc_for_build
          884  +	sed 's/^	//' << EOF >$dummy.c
          885  +	#undef CPU
          886  +	#undef mips64
          887  +	#undef mips64el
          888  +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
          889  +	CPU=mips64el
          890  +	#else
          891  +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
          892  +	CPU=mips64
          893  +	#else
          894  +	CPU=
          895  +	#endif
          896  +	#endif
          897  +EOF
          898  +	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
          899  +	    /^CPU/{
          900  +		s: ::g
          901  +		p
          902  +	    }'`"
          903  +	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
          904  +	;;
          905  +    or32:Linux:*:*)
          906  +	echo or32-unknown-linux-gnu
          907  +	exit ;;
          908  +    ppc:Linux:*:*)
          909  +	echo powerpc-unknown-linux-gnu
          910  +	exit ;;
          911  +    ppc64:Linux:*:*)
          912  +	echo powerpc64-unknown-linux-gnu
          913  +	exit ;;
          914  +    alpha:Linux:*:*)
          915  +	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          916  +	  EV5)   UNAME_MACHINE=alphaev5 ;;
          917  +	  EV56)  UNAME_MACHINE=alphaev56 ;;
          918  +	  PCA56) UNAME_MACHINE=alphapca56 ;;
          919  +	  PCA57) UNAME_MACHINE=alphapca56 ;;
          920  +	  EV6)   UNAME_MACHINE=alphaev6 ;;
          921  +	  EV67)  UNAME_MACHINE=alphaev67 ;;
          922  +	  EV68*) UNAME_MACHINE=alphaev68 ;;
          923  +        esac
          924  +	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
          925  +	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
          926  +	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
          927  +	exit ;;
          928  +    parisc:Linux:*:* | hppa:Linux:*:*)
          929  +	# Look for CPU level
          930  +	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
          931  +	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
          932  +	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
          933  +	  *)    echo hppa-unknown-linux-gnu ;;
          934  +	esac
          935  +	exit ;;
          936  +    parisc64:Linux:*:* | hppa64:Linux:*:*)
          937  +	echo hppa64-unknown-linux-gnu
          938  +	exit ;;
          939  +    s390:Linux:*:* | s390x:Linux:*:*)
          940  +	echo ${UNAME_MACHINE}-ibm-linux
          941  +	exit ;;
          942  +    sh64*:Linux:*:*)
          943  +    	echo ${UNAME_MACHINE}-unknown-linux-gnu
          944  +	exit ;;
          945  +    sh*:Linux:*:*)
          946  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          947  +	exit ;;
          948  +    sparc:Linux:*:* | sparc64:Linux:*:*)
          949  +	echo ${UNAME_MACHINE}-unknown-linux-gnu
          950  +	exit ;;
          951  +    vax:Linux:*:*)
          952  +	echo ${UNAME_MACHINE}-dec-linux-gnu
          953  +	exit ;;
          954  +    x86_64:Linux:*:*)
          955  +	echo x86_64-unknown-linux-gnu
          956  +	exit ;;
          957  +    xtensa:Linux:*:*)
          958  +    	echo xtensa-unknown-linux-gnu
          959  +	exit ;;
          960  +    i*86:Linux:*:*)
          961  +	# The BFD linker knows what the default object file format is, so
          962  +	# first see if it will tell us. cd to the root directory to prevent
          963  +	# problems with other programs or directories called `ld' in the path.
          964  +	# Set LC_ALL=C to ensure ld outputs messages in English.
          965  +	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
          966  +			 | sed -ne '/supported targets:/!d
          967  +				    s/[ 	][ 	]*/ /g
          968  +				    s/.*supported targets: *//
          969  +				    s/ .*//
          970  +				    p'`
          971  +        case "$ld_supported_targets" in
          972  +	  elf32-i386)
          973  +		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
          974  +		;;
          975  +	  a.out-i386-linux)
          976  +		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
          977  +		exit ;;
          978  +	  coff-i386)
          979  +		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
          980  +		exit ;;
          981  +	  "")
          982  +		# Either a pre-BFD a.out linker (linux-gnuoldld) or
          983  +		# one that does not give us useful --help.
          984  +		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
          985  +		exit ;;
          986  +	esac
          987  +	# Determine whether the default compiler is a.out or elf
          988  +	eval $set_cc_for_build
          989  +	sed 's/^	//' << EOF >$dummy.c
          990  +	#include <features.h>
          991  +	#ifdef __ELF__
          992  +	# ifdef __GLIBC__
          993  +	#  if __GLIBC__ >= 2
          994  +	LIBC=gnu
          995  +	#  else
          996  +	LIBC=gnulibc1
          997  +	#  endif
          998  +	# else
          999  +	LIBC=gnulibc1
         1000  +	# endif
         1001  +	#else
         1002  +	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
         1003  +	LIBC=gnu
         1004  +	#else
         1005  +	LIBC=gnuaout
         1006  +	#endif
         1007  +	#endif
         1008  +	#ifdef __dietlibc__
         1009  +	LIBC=dietlibc
         1010  +	#endif
         1011  +EOF
         1012  +	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
         1013  +	    /^LIBC/{
         1014  +		s: ::g
         1015  +		p
         1016  +	    }'`"
         1017  +	test x"${LIBC}" != x && {
         1018  +		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
         1019  +		exit
         1020  +	}
         1021  +	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
         1022  +	;;
         1023  +    i*86:DYNIX/ptx:4*:*)
         1024  +	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
         1025  +	# earlier versions are messed up and put the nodename in both
         1026  +	# sysname and nodename.
         1027  +	echo i386-sequent-sysv4
         1028  +	exit ;;
         1029  +    i*86:UNIX_SV:4.2MP:2.*)
         1030  +        # Unixware is an offshoot of SVR4, but it has its own version
         1031  +        # number series starting with 2...
         1032  +        # I am not positive that other SVR4 systems won't match this,
         1033  +	# I just have to hope.  -- rms.
         1034  +        # Use sysv4.2uw... so that sysv4* matches it.
         1035  +	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
         1036  +	exit ;;
         1037  +    i*86:OS/2:*:*)
         1038  +	# If we were able to find `uname', then EMX Unix compatibility
         1039  +	# is probably installed.
         1040  +	echo ${UNAME_MACHINE}-pc-os2-emx
         1041  +	exit ;;
         1042  +    i*86:XTS-300:*:STOP)
         1043  +	echo ${UNAME_MACHINE}-unknown-stop
         1044  +	exit ;;
         1045  +    i*86:atheos:*:*)
         1046  +	echo ${UNAME_MACHINE}-unknown-atheos
         1047  +	exit ;;
         1048  +    i*86:syllable:*:*)
         1049  +	echo ${UNAME_MACHINE}-pc-syllable
         1050  +	exit ;;
         1051  +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
         1052  +	echo i386-unknown-lynxos${UNAME_RELEASE}
         1053  +	exit ;;
         1054  +    i*86:*DOS:*:*)
         1055  +	echo ${UNAME_MACHINE}-pc-msdosdjgpp
         1056  +	exit ;;
         1057  +    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
         1058  +	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
         1059  +	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
         1060  +		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
         1061  +	else
         1062  +		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
         1063  +	fi
         1064  +	exit ;;
         1065  +    i*86:*:5:[678]*)
         1066  +    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
         1067  +	case `/bin/uname -X | grep "^Machine"` in
         1068  +	    *486*)	     UNAME_MACHINE=i486 ;;
         1069  +	    *Pentium)	     UNAME_MACHINE=i586 ;;
         1070  +	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
         1071  +	esac
         1072  +	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
         1073  +	exit ;;
         1074  +    i*86:*:3.2:*)
         1075  +	if test -f /usr/options/cb.name; then
         1076  +		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
         1077  +		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
         1078  +	elif /bin/uname -X 2>/dev/null >/dev/null ; then
         1079  +		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
         1080  +		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
         1081  +		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
         1082  +			&& UNAME_MACHINE=i586
         1083  +		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
         1084  +			&& UNAME_MACHINE=i686
         1085  +		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
         1086  +			&& UNAME_MACHINE=i686
         1087  +		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
         1088  +	else
         1089  +		echo ${UNAME_MACHINE}-pc-sysv32
         1090  +	fi
         1091  +	exit ;;
         1092  +    pc:*:*:*)
         1093  +	# Left here for compatibility:
         1094  +        # uname -m prints for DJGPP always 'pc', but it prints nothing about
         1095  +        # the processor, so we play safe by assuming i386.
         1096  +	echo i386-pc-msdosdjgpp
         1097  +        exit ;;
         1098  +    Intel:Mach:3*:*)
         1099  +	echo i386-pc-mach3
         1100  +	exit ;;
         1101  +    paragon:*:*:*)
         1102  +	echo i860-intel-osf1
         1103  +	exit ;;
         1104  +    i860:*:4.*:*) # i860-SVR4
         1105  +	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
         1106  +	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
         1107  +	else # Add other i860-SVR4 vendors below as they are discovered.
         1108  +	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
         1109  +	fi
         1110  +	exit ;;
         1111  +    mini*:CTIX:SYS*5:*)
         1112  +	# "miniframe"
         1113  +	echo m68010-convergent-sysv
         1114  +	exit ;;
         1115  +    mc68k:UNIX:SYSTEM5:3.51m)
         1116  +	echo m68k-convergent-sysv
         1117  +	exit ;;
         1118  +    M680?0:D-NIX:5.3:*)
         1119  +	echo m68k-diab-dnix
         1120  +	exit ;;
         1121  +    M68*:*:R3V[5678]*:*)
         1122  +	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
         1123  +    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
         1124  +	OS_REL=''
         1125  +	test -r /etc/.relid \
         1126  +	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
         1127  +	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
         1128  +	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
         1129  +	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
         1130  +	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
         1131  +    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         1132  +        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
         1133  +          && { echo i486-ncr-sysv4; exit; } ;;
         1134  +    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
         1135  +	echo m68k-unknown-lynxos${UNAME_RELEASE}
         1136  +	exit ;;
         1137  +    mc68030:UNIX_System_V:4.*:*)
         1138  +	echo m68k-atari-sysv4
         1139  +	exit ;;
         1140  +    TSUNAMI:LynxOS:2.*:*)
         1141  +	echo sparc-unknown-lynxos${UNAME_RELEASE}
         1142  +	exit ;;
         1143  +    rs6000:LynxOS:2.*:*)
         1144  +	echo rs6000-unknown-lynxos${UNAME_RELEASE}
         1145  +	exit ;;
         1146  +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
         1147  +	echo powerpc-unknown-lynxos${UNAME_RELEASE}
         1148  +	exit ;;
         1149  +    SM[BE]S:UNIX_SV:*:*)
         1150  +	echo mips-dde-sysv${UNAME_RELEASE}
         1151  +	exit ;;
         1152  +    RM*:ReliantUNIX-*:*:*)
         1153  +	echo mips-sni-sysv4
         1154  +	exit ;;
         1155  +    RM*:SINIX-*:*:*)
         1156  +	echo mips-sni-sysv4
         1157  +	exit ;;
         1158  +    *:SINIX-*:*:*)
         1159  +	if uname -p 2>/dev/null >/dev/null ; then
         1160  +		UNAME_MACHINE=`(uname -p) 2>/dev/null`
         1161  +		echo ${UNAME_MACHINE}-sni-sysv4
         1162  +	else
         1163  +		echo ns32k-sni-sysv
         1164  +	fi
         1165  +	exit ;;
         1166  +    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
         1167  +                      # says <Richard.M.Bartel@ccMail.Census.GOV>
         1168  +        echo i586-unisys-sysv4
         1169  +        exit ;;
         1170  +    *:UNIX_System_V:4*:FTX*)
         1171  +	# From Gerald Hewes <hewes@openmarket.com>.
         1172  +	# How about differentiating between stratus architectures? -djm
         1173  +	echo hppa1.1-stratus-sysv4
         1174  +	exit ;;
         1175  +    *:*:*:FTX*)
         1176  +	# From seanf@swdc.stratus.com.
         1177  +	echo i860-stratus-sysv4
         1178  +	exit ;;
         1179  +    i*86:VOS:*:*)
         1180  +	# From Paul.Green@stratus.com.
         1181  +	echo ${UNAME_MACHINE}-stratus-vos
         1182  +	exit ;;
         1183  +    *:VOS:*:*)
         1184  +	# From Paul.Green@stratus.com.
         1185  +	echo hppa1.1-stratus-vos
         1186  +	exit ;;
         1187  +    mc68*:A/UX:*:*)
         1188  +	echo m68k-apple-aux${UNAME_RELEASE}
         1189  +	exit ;;
         1190  +    news*:NEWS-OS:6*:*)
         1191  +	echo mips-sony-newsos6
         1192  +	exit ;;
         1193  +    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
         1194  +	if [ -d /usr/nec ]; then
         1195  +	        echo mips-nec-sysv${UNAME_RELEASE}
         1196  +	else
         1197  +	        echo mips-unknown-sysv${UNAME_RELEASE}
         1198  +	fi
         1199  +        exit ;;
         1200  +    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
         1201  +	echo powerpc-be-beos
         1202  +	exit ;;
         1203  +    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
         1204  +	echo powerpc-apple-beos
         1205  +	exit ;;
         1206  +    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
         1207  +	echo i586-pc-beos
         1208  +	exit ;;
         1209  +    SX-4:SUPER-UX:*:*)
         1210  +	echo sx4-nec-superux${UNAME_RELEASE}
         1211  +	exit ;;
         1212  +    SX-5:SUPER-UX:*:*)
         1213  +	echo sx5-nec-superux${UNAME_RELEASE}
         1214  +	exit ;;
         1215  +    SX-6:SUPER-UX:*:*)
         1216  +	echo sx6-nec-superux${UNAME_RELEASE}
         1217  +	exit ;;
         1218  +    SX-7:SUPER-UX:*:*)
         1219  +	echo sx7-nec-superux${UNAME_RELEASE}
         1220  +	exit ;;
         1221  +    SX-8:SUPER-UX:*:*)
         1222  +	echo sx8-nec-superux${UNAME_RELEASE}
         1223  +	exit ;;
         1224  +    SX-8R:SUPER-UX:*:*)
         1225  +	echo sx8r-nec-superux${UNAME_RELEASE}
         1226  +	exit ;;
         1227  +    Power*:Rhapsody:*:*)
         1228  +	echo powerpc-apple-rhapsody${UNAME_RELEASE}
         1229  +	exit ;;
         1230  +    *:Rhapsody:*:*)
         1231  +	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
         1232  +	exit ;;
         1233  +    *:Darwin:*:*)
         1234  +	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
         1235  +	case $UNAME_PROCESSOR in
         1236  +	    unknown) UNAME_PROCESSOR=powerpc ;;
         1237  +	esac
         1238  +	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
         1239  +	exit ;;
         1240  +    *:procnto*:*:* | *:QNX:[0123456789]*:*)
         1241  +	UNAME_PROCESSOR=`uname -p`
         1242  +	if test "$UNAME_PROCESSOR" = "x86"; then
         1243  +		UNAME_PROCESSOR=i386
         1244  +		UNAME_MACHINE=pc
         1245  +	fi
         1246  +	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
         1247  +	exit ;;
         1248  +    *:QNX:*:4*)
         1249  +	echo i386-pc-qnx
         1250  +	exit ;;
         1251  +    NSE-?:NONSTOP_KERNEL:*:*)
         1252  +	echo nse-tandem-nsk${UNAME_RELEASE}
         1253  +	exit ;;
         1254  +    NSR-?:NONSTOP_KERNEL:*:*)
         1255  +	echo nsr-tandem-nsk${UNAME_RELEASE}
         1256  +	exit ;;
         1257  +    *:NonStop-UX:*:*)
         1258  +	echo mips-compaq-nonstopux
         1259  +	exit ;;
         1260  +    BS2000:POSIX*:*:*)
         1261  +	echo bs2000-siemens-sysv
         1262  +	exit ;;
         1263  +    DS/*:UNIX_System_V:*:*)
         1264  +	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
         1265  +	exit ;;
         1266  +    *:Plan9:*:*)
         1267  +	# "uname -m" is not consistent, so use $cputype instead. 386
         1268  +	# is converted to i386 for consistency with other x86
         1269  +	# operating systems.
         1270  +	if test "$cputype" = "386"; then
         1271  +	    UNAME_MACHINE=i386
         1272  +	else
         1273  +	    UNAME_MACHINE="$cputype"
         1274  +	fi
         1275  +	echo ${UNAME_MACHINE}-unknown-plan9
         1276  +	exit ;;
         1277  +    *:TOPS-10:*:*)
         1278  +	echo pdp10-unknown-tops10
         1279  +	exit ;;
         1280  +    *:TENEX:*:*)
         1281  +	echo pdp10-unknown-tenex
         1282  +	exit ;;
         1283  +    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
         1284  +	echo pdp10-dec-tops20
         1285  +	exit ;;
         1286  +    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
         1287  +	echo pdp10-xkl-tops20
         1288  +	exit ;;
         1289  +    *:TOPS-20:*:*)
         1290  +	echo pdp10-unknown-tops20
         1291  +	exit ;;
         1292  +    *:ITS:*:*)
         1293  +	echo pdp10-unknown-its
         1294  +	exit ;;
         1295  +    SEI:*:*:SEIUX)
         1296  +        echo mips-sei-seiux${UNAME_RELEASE}
         1297  +	exit ;;
         1298  +    *:DragonFly:*:*)
         1299  +	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
         1300  +	exit ;;
         1301  +    *:*VMS:*:*)
         1302  +    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
         1303  +	case "${UNAME_MACHINE}" in
         1304  +	    A*) echo alpha-dec-vms ; exit ;;
         1305  +	    I*) echo ia64-dec-vms ; exit ;;
         1306  +	    V*) echo vax-dec-vms ; exit ;;
         1307  +	esac ;;
         1308  +    *:XENIX:*:SysV)
         1309  +	echo i386-pc-xenix
         1310  +	exit ;;
         1311  +    i*86:skyos:*:*)
         1312  +	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
         1313  +	exit ;;
         1314  +    i*86:rdos:*:*)
         1315  +	echo ${UNAME_MACHINE}-pc-rdos
         1316  +	exit ;;
         1317  +esac
         1318  +
         1319  +#echo '(No uname command or uname output not recognized.)' 1>&2
         1320  +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
         1321  +
         1322  +eval $set_cc_for_build
         1323  +cat >$dummy.c <<EOF
         1324  +#ifdef _SEQUENT_
         1325  +# include <sys/types.h>
         1326  +# include <sys/utsname.h>
         1327  +#endif
         1328  +main ()
         1329  +{
         1330  +#if defined (sony)
         1331  +#if defined (MIPSEB)
         1332  +  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
         1333  +     I don't know....  */
         1334  +  printf ("mips-sony-bsd\n"); exit (0);
         1335  +#else
         1336  +#include <sys/param.h>
         1337  +  printf ("m68k-sony-newsos%s\n",
         1338  +#ifdef NEWSOS4
         1339  +          "4"
         1340  +#else
         1341  +	  ""
         1342  +#endif
         1343  +         ); exit (0);
         1344  +#endif
         1345  +#endif
         1346  +
         1347  +#if defined (__arm) && defined (__acorn) && defined (__unix)
         1348  +  printf ("arm-acorn-riscix\n"); exit (0);
         1349  +#endif
         1350  +
         1351  +#if defined (hp300) && !defined (hpux)
         1352  +  printf ("m68k-hp-bsd\n"); exit (0);
         1353  +#endif
         1354  +
         1355  +#if defined (NeXT)
         1356  +#if !defined (__ARCHITECTURE__)
         1357  +#define __ARCHITECTURE__ "m68k"
         1358  +#endif
         1359  +  int version;
         1360  +  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
         1361  +  if (version < 4)
         1362  +    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
         1363  +  else
         1364  +    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
         1365  +  exit (0);
         1366  +#endif
         1367  +
         1368  +#if defined (MULTIMAX) || defined (n16)
         1369  +#if defined (UMAXV)
         1370  +  printf ("ns32k-encore-sysv\n"); exit (0);
         1371  +#else
         1372  +#if defined (CMU)
         1373  +  printf ("ns32k-encore-mach\n"); exit (0);
         1374  +#else
         1375  +  printf ("ns32k-encore-bsd\n"); exit (0);
         1376  +#endif
         1377  +#endif
         1378  +#endif
         1379  +
         1380  +#if defined (__386BSD__)
         1381  +  printf ("i386-pc-bsd\n"); exit (0);
         1382  +#endif
         1383  +
         1384  +#if defined (sequent)
         1385  +#if defined (i386)
         1386  +  printf ("i386-sequent-dynix\n"); exit (0);
         1387  +#endif
         1388  +#if defined (ns32000)
         1389  +  printf ("ns32k-sequent-dynix\n"); exit (0);
         1390  +#endif
         1391  +#endif
         1392  +
         1393  +#if defined (_SEQUENT_)
         1394  +    struct utsname un;
         1395  +
         1396  +    uname(&un);
         1397  +
         1398  +    if (strncmp(un.version, "V2", 2) == 0) {
         1399  +	printf ("i386-sequent-ptx2\n"); exit (0);
         1400  +    }
         1401  +    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
         1402  +	printf ("i386-sequent-ptx1\n"); exit (0);
         1403  +    }
         1404  +    printf ("i386-sequent-ptx\n"); exit (0);
         1405  +
         1406  +#endif
         1407  +
         1408  +#if defined (vax)
         1409  +# if !defined (ultrix)
         1410  +#  include <sys/param.h>
         1411  +#  if defined (BSD)
         1412  +#   if BSD == 43
         1413  +      printf ("vax-dec-bsd4.3\n"); exit (0);
         1414  +#   else
         1415  +#    if BSD == 199006
         1416  +      printf ("vax-dec-bsd4.3reno\n"); exit (0);
         1417  +#    else
         1418  +      printf ("vax-dec-bsd\n"); exit (0);
         1419  +#    endif
         1420  +#   endif
         1421  +#  else
         1422  +    printf ("vax-dec-bsd\n"); exit (0);
         1423  +#  endif
         1424  +# else
         1425  +    printf ("vax-dec-ultrix\n"); exit (0);
         1426  +# endif
         1427  +#endif
         1428  +
         1429  +#if defined (alliant) && defined (i860)
         1430  +  printf ("i860-alliant-bsd\n"); exit (0);
         1431  +#endif
         1432  +
         1433  +  exit (1);
         1434  +}
         1435  +EOF
         1436  +
         1437  +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
         1438  +	{ echo "$SYSTEM_NAME"; exit; }
         1439  +
         1440  +# Apollos put the system type in the environment.
         1441  +
         1442  +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
         1443  +
         1444  +# Convex versions that predate uname can use getsysinfo(1)
         1445  +
         1446  +if [ -x /usr/convex/getsysinfo ]
         1447  +then
         1448  +    case `getsysinfo -f cpu_type` in
         1449  +    c1*)
         1450  +	echo c1-convex-bsd
         1451  +	exit ;;
         1452  +    c2*)
         1453  +	if getsysinfo -f scalar_acc
         1454  +	then echo c32-convex-bsd
         1455  +	else echo c2-convex-bsd
         1456  +	fi
         1457  +	exit ;;
         1458  +    c34*)
         1459  +	echo c34-convex-bsd
         1460  +	exit ;;
         1461  +    c38*)
         1462  +	echo c38-convex-bsd
         1463  +	exit ;;
         1464  +    c4*)
         1465  +	echo c4-convex-bsd
         1466  +	exit ;;
         1467  +    esac
         1468  +fi
         1469  +
         1470  +cat >&2 <<EOF
         1471  +$0: unable to guess system type
         1472  +
         1473  +This script, last modified $timestamp, has failed to recognize
         1474  +the operating system you are using. It is advised that you
         1475  +download the most up to date version of the config scripts from
         1476  +
         1477  +  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
         1478  +and
         1479  +  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
         1480  +
         1481  +If the version you run ($0) is already up to date, please
         1482  +send the following data and any information you think might be
         1483  +pertinent to <config-patches@gnu.org> in order to provide the needed
         1484  +information to handle your system.
         1485  +
         1486  +config.guess timestamp = $timestamp
         1487  +
         1488  +uname -m = `(uname -m) 2>/dev/null || echo unknown`
         1489  +uname -r = `(uname -r) 2>/dev/null || echo unknown`
         1490  +uname -s = `(uname -s) 2>/dev/null || echo unknown`
         1491  +uname -v = `(uname -v) 2>/dev/null || echo unknown`
         1492  +
         1493  +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
         1494  +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
         1495  +
         1496  +hostinfo               = `(hostinfo) 2>/dev/null`
         1497  +/bin/universe          = `(/bin/universe) 2>/dev/null`
         1498  +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
         1499  +/bin/arch              = `(/bin/arch) 2>/dev/null`
         1500  +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
         1501  +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
         1502  +
         1503  +UNAME_MACHINE = ${UNAME_MACHINE}
         1504  +UNAME_RELEASE = ${UNAME_RELEASE}
         1505  +UNAME_SYSTEM  = ${UNAME_SYSTEM}
         1506  +UNAME_VERSION = ${UNAME_VERSION}
         1507  +EOF
         1508  +
         1509  +exit 1
         1510  +
         1511  +# Local variables:
         1512  +# eval: (add-hook 'write-file-hooks 'time-stamp)
         1513  +# time-stamp-start: "timestamp='"
         1514  +# time-stamp-format: "%:y-%02m-%02d"
         1515  +# time-stamp-end: "'"
         1516  +# End:

Changes to config.sub.

     1         -/usr/share/automake-1.11/config.sub
            1  +#! /bin/sh
            2  +# Configuration validation subroutine script.
            3  +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
            4  +#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
            5  +#   Inc.
            6  +
            7  +timestamp='2007-06-28'
            8  +
            9  +# This file is (in principle) common to ALL GNU software.
           10  +# The presence of a machine in this file suggests that SOME GNU software
           11  +# can handle that machine.  It does not imply ALL GNU software can.
           12  +#
           13  +# This file is free software; you can redistribute it and/or modify
           14  +# it under the terms of the GNU General Public License as published by
           15  +# the Free Software Foundation; either version 2 of the License, or
           16  +# (at your option) any later version.
           17  +#
           18  +# This program is distributed in the hope that it will be useful,
           19  +# but WITHOUT ANY WARRANTY; without even the implied warranty of
           20  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           21  +# GNU General Public License for more details.
           22  +#
           23  +# You should have received a copy of the GNU General Public License
           24  +# along with this program; if not, write to the Free Software
           25  +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
           26  +# 02110-1301, USA.
           27  +#
           28  +# As a special exception to the GNU General Public License, if you
           29  +# distribute this file as part of a program that contains a
           30  +# configuration script generated by Autoconf, you may include it under
           31  +# the same distribution terms that you use for the rest of that program.
           32  +
           33  +
           34  +# Please send patches to <config-patches@gnu.org>.  Submit a context
           35  +# diff and a properly formatted ChangeLog entry.
           36  +#
           37  +# Configuration subroutine to validate and canonicalize a configuration type.
           38  +# Supply the specified configuration type as an argument.
           39  +# If it is invalid, we print an error message on stderr and exit with code 1.
           40  +# Otherwise, we print the canonical config type on stdout and succeed.
           41  +
           42  +# This file is supposed to be the same for all GNU packages
           43  +# and recognize all the CPU types, system types and aliases
           44  +# that are meaningful with *any* GNU software.
           45  +# Each package is responsible for reporting which valid configurations
           46  +# it does not support.  The user should be able to distinguish
           47  +# a failure to support a valid configuration from a meaningless
           48  +# configuration.
           49  +
           50  +# The goal of this file is to map all the various variations of a given
           51  +# machine specification into a single specification in the form:
           52  +#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
           53  +# or in some cases, the newer four-part form:
           54  +#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
           55  +# It is wrong to echo any other type of specification.
           56  +
           57  +me=`echo "$0" | sed -e 's,.*/,,'`
           58  +
           59  +usage="\
           60  +Usage: $0 [OPTION] CPU-MFR-OPSYS
           61  +       $0 [OPTION] ALIAS
           62  +
           63  +Canonicalize a configuration name.
           64  +
           65  +Operation modes:
           66  +  -h, --help         print this help, then exit
           67  +  -t, --time-stamp   print date of last modification, then exit
           68  +  -v, --version      print version number, then exit
           69  +
           70  +Report bugs and patches to <config-patches@gnu.org>."
           71  +
           72  +version="\
           73  +GNU config.sub ($timestamp)
           74  +
           75  +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
           76  +Free Software Foundation, Inc.
           77  +
           78  +This is free software; see the source for copying conditions.  There is NO
           79  +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
           80  +
           81  +help="
           82  +Try \`$me --help' for more information."
           83  +
           84  +# Parse command line
           85  +while test $# -gt 0 ; do
           86  +  case $1 in
           87  +    --time-stamp | --time* | -t )
           88  +       echo "$timestamp" ; exit ;;
           89  +    --version | -v )
           90  +       echo "$version" ; exit ;;
           91  +    --help | --h* | -h )
           92  +       echo "$usage"; exit ;;
           93  +    -- )     # Stop option processing
           94  +       shift; break ;;
           95  +    - )	# Use stdin as input.
           96  +       break ;;
           97  +    -* )
           98  +       echo "$me: invalid option $1$help"
           99  +       exit 1 ;;
          100  +
          101  +    *local*)
          102  +       # First pass through any local machine types.
          103  +       echo $1
          104  +       exit ;;
          105  +
          106  +    * )
          107  +       break ;;
          108  +  esac
          109  +done
          110  +
          111  +case $# in
          112  + 0) echo "$me: missing argument$help" >&2
          113  +    exit 1;;
          114  + 1) ;;
          115  + *) echo "$me: too many arguments$help" >&2
          116  +    exit 1;;
          117  +esac
          118  +
          119  +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
          120  +# Here we must recognize all the valid KERNEL-OS combinations.
          121  +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
          122  +case $maybe_os in
          123  +  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
          124  +  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
          125  +  storm-chaos* | os2-emx* | rtmk-nova*)
          126  +    os=-$maybe_os
          127  +    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
          128  +    ;;
          129  +  *)
          130  +    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
          131  +    if [ $basic_machine != $1 ]
          132  +    then os=`echo $1 | sed 's/.*-/-/'`
          133  +    else os=; fi
          134  +    ;;
          135  +esac
          136  +
          137  +### Let's recognize common machines as not being operating systems so
          138  +### that things like config.sub decstation-3100 work.  We also
          139  +### recognize some manufacturers as not being operating systems, so we
          140  +### can provide default operating systems below.
          141  +case $os in
          142  +	-sun*os*)
          143  +		# Prevent following clause from handling this invalid input.
          144  +		;;
          145  +	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
          146  +	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
          147  +	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
          148  +	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
          149  +	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
          150  +	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
          151  +	-apple | -axis | -knuth | -cray)
          152  +		os=
          153  +		basic_machine=$1
          154  +		;;
          155  +	-sim | -cisco | -oki | -wec | -winbond)
          156  +		os=
          157  +		basic_machine=$1
          158  +		;;
          159  +	-scout)
          160  +		;;
          161  +	-wrs)
          162  +		os=-vxworks
          163  +		basic_machine=$1
          164  +		;;
          165  +	-chorusos*)
          166  +		os=-chorusos
          167  +		basic_machine=$1
          168  +		;;
          169  + 	-chorusrdb)
          170  + 		os=-chorusrdb
          171  +		basic_machine=$1
          172  + 		;;
          173  +	-hiux*)
          174  +		os=-hiuxwe2
          175  +		;;
          176  +	-sco6)
          177  +		os=-sco5v6
          178  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          179  +		;;
          180  +	-sco5)
          181  +		os=-sco3.2v5
          182  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          183  +		;;
          184  +	-sco4)
          185  +		os=-sco3.2v4
          186  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          187  +		;;
          188  +	-sco3.2.[4-9]*)
          189  +		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
          190  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          191  +		;;
          192  +	-sco3.2v[4-9]*)
          193  +		# Don't forget version if it is 3.2v4 or newer.
          194  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          195  +		;;
          196  +	-sco5v6*)
          197  +		# Don't forget version if it is 3.2v4 or newer.
          198  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          199  +		;;
          200  +	-sco*)
          201  +		os=-sco3.2v2
          202  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          203  +		;;
          204  +	-udk*)
          205  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          206  +		;;
          207  +	-isc)
          208  +		os=-isc2.2
          209  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          210  +		;;
          211  +	-clix*)
          212  +		basic_machine=clipper-intergraph
          213  +		;;
          214  +	-isc*)
          215  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
          216  +		;;
          217  +	-lynx*)
          218  +		os=-lynxos
          219  +		;;
          220  +	-ptx*)
          221  +		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
          222  +		;;
          223  +	-windowsnt*)
          224  +		os=`echo $os | sed -e 's/windowsnt/winnt/'`
          225  +		;;
          226  +	-psos*)
          227  +		os=-psos
          228  +		;;
          229  +	-mint | -mint[0-9]*)
          230  +		basic_machine=m68k-atari
          231  +		os=-mint
          232  +		;;
          233  +esac
          234  +
          235  +# Decode aliases for certain CPU-COMPANY combinations.
          236  +case $basic_machine in
          237  +	# Recognize the basic CPU types without company name.
          238  +	# Some are omitted here because they have special meanings below.
          239  +	1750a | 580 \
          240  +	| a29k \
          241  +	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
          242  +	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
          243  +	| am33_2.0 \
          244  +	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
          245  +	| bfin \
          246  +	| c4x | clipper \
          247  +	| d10v | d30v | dlx | dsp16xx \
          248  +	| fido | fr30 | frv \
          249  +	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
          250  +	| i370 | i860 | i960 | ia64 \
          251  +	| ip2k | iq2000 \
          252  +	| m32c | m32r | m32rle | m68000 | m68k | m88k \
          253  +	| maxq | mb | microblaze | mcore | mep \
          254  +	| mips | mipsbe | mipseb | mipsel | mipsle \
          255  +	| mips16 \
          256  +	| mips64 | mips64el \
          257  +	| mips64vr | mips64vrel \
          258  +	| mips64orion | mips64orionel \
          259  +	| mips64vr4100 | mips64vr4100el \
          260  +	| mips64vr4300 | mips64vr4300el \
          261  +	| mips64vr5000 | mips64vr5000el \
          262  +	| mips64vr5900 | mips64vr5900el \
          263  +	| mipsisa32 | mipsisa32el \
          264  +	| mipsisa32r2 | mipsisa32r2el \
          265  +	| mipsisa64 | mipsisa64el \
          266  +	| mipsisa64r2 | mipsisa64r2el \
          267  +	| mipsisa64sb1 | mipsisa64sb1el \
          268  +	| mipsisa64sr71k | mipsisa64sr71kel \
          269  +	| mipstx39 | mipstx39el \
          270  +	| mn10200 | mn10300 \
          271  +	| mt \
          272  +	| msp430 \
          273  +	| nios | nios2 \
          274  +	| ns16k | ns32k \
          275  +	| or32 \
          276  +	| pdp10 | pdp11 | pj | pjl \
          277  +	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
          278  +	| pyramid \
          279  +	| score \
          280  +	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
          281  +	| sh64 | sh64le \
          282  +	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
          283  +	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
          284  +	| spu | strongarm \
          285  +	| tahoe | thumb | tic4x | tic80 | tron \
          286  +	| v850 | v850e \
          287  +	| we32k \
          288  +	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
          289  +	| z8k)
          290  +		basic_machine=$basic_machine-unknown
          291  +		;;
          292  +	m6811 | m68hc11 | m6812 | m68hc12)
          293  +		# Motorola 68HC11/12.
          294  +		basic_machine=$basic_machine-unknown
          295  +		os=-none
          296  +		;;
          297  +	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
          298  +		;;
          299  +	ms1)
          300  +		basic_machine=mt-unknown
          301  +		;;
          302  +
          303  +	# We use `pc' rather than `unknown'
          304  +	# because (1) that's what they normally are, and
          305  +	# (2) the word "unknown" tends to confuse beginning users.
          306  +	i*86 | x86_64)
          307  +	  basic_machine=$basic_machine-pc
          308  +	  ;;
          309  +	# Object if more than one company name word.
          310  +	*-*-*)
          311  +		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
          312  +		exit 1
          313  +		;;
          314  +	# Recognize the basic CPU types with company name.
          315  +	580-* \
          316  +	| a29k-* \
          317  +	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
          318  +	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
          319  +	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
          320  +	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
          321  +	| avr-* | avr32-* \
          322  +	| bfin-* | bs2000-* \
          323  +	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
          324  +	| clipper-* | craynv-* | cydra-* \
          325  +	| d10v-* | d30v-* | dlx-* \
          326  +	| elxsi-* \
          327  +	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
          328  +	| h8300-* | h8500-* \
          329  +	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
          330  +	| i*86-* | i860-* | i960-* | ia64-* \
          331  +	| ip2k-* | iq2000-* \
          332  +	| m32c-* | m32r-* | m32rle-* \
          333  +	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
          334  +	| m88110-* | m88k-* | maxq-* | mcore-* \
          335  +	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
          336  +	| mips16-* \
          337  +	| mips64-* | mips64el-* \
          338  +	| mips64vr-* | mips64vrel-* \
          339  +	| mips64orion-* | mips64orionel-* \
          340  +	| mips64vr4100-* | mips64vr4100el-* \
          341  +	| mips64vr4300-* | mips64vr4300el-* \
          342  +	| mips64vr5000-* | mips64vr5000el-* \
          343  +	| mips64vr5900-* | mips64vr5900el-* \
          344  +	| mipsisa32-* | mipsisa32el-* \
          345  +	| mipsisa32r2-* | mipsisa32r2el-* \
          346  +	| mipsisa64-* | mipsisa64el-* \
          347  +	| mipsisa64r2-* | mipsisa64r2el-* \
          348  +	| mipsisa64sb1-* | mipsisa64sb1el-* \
          349  +	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
          350  +	| mipstx39-* | mipstx39el-* \
          351  +	| mmix-* \
          352  +	| mt-* \
          353  +	| msp430-* \
          354  +	| nios-* | nios2-* \
          355  +	| none-* | np1-* | ns16k-* | ns32k-* \
          356  +	| orion-* \
          357  +	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
          358  +	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
          359  +	| pyramid-* \
          360  +	| romp-* | rs6000-* \
          361  +	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
          362  +	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
          363  +	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
          364  +	| sparclite-* \
          365  +	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
          366  +	| tahoe-* | thumb-* \
          367  +	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
          368  +	| tron-* \
          369  +	| v850-* | v850e-* | vax-* \
          370  +	| we32k-* \
          371  +	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
          372  +	| xstormy16-* | xtensa-* \
          373  +	| ymp-* \
          374  +	| z8k-*)
          375  +		;;
          376  +	# Recognize the various machine names and aliases which stand
          377  +	# for a CPU type and a company and sometimes even an OS.
          378  +	386bsd)
          379  +		basic_machine=i386-unknown
          380  +		os=-bsd
          381  +		;;
          382  +	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
          383  +		basic_machine=m68000-att
          384  +		;;
          385  +	3b*)
          386  +		basic_machine=we32k-att
          387  +		;;
          388  +	a29khif)
          389  +		basic_machine=a29k-amd
          390  +		os=-udi
          391  +		;;
          392  +    	abacus)
          393  +		basic_machine=abacus-unknown
          394  +		;;
          395  +	adobe68k)
          396  +		basic_machine=m68010-adobe
          397  +		os=-scout
          398  +		;;
          399  +	alliant | fx80)
          400  +		basic_machine=fx80-alliant
          401  +		;;
          402  +	altos | altos3068)
          403  +		basic_machine=m68k-altos
          404  +		;;
          405  +	am29k)
          406  +		basic_machine=a29k-none
          407  +		os=-bsd
          408  +		;;
          409  +	amd64)
          410  +		basic_machine=x86_64-pc
          411  +		;;
          412  +	amd64-*)
          413  +		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
          414  +		;;
          415  +	amdahl)
          416  +		basic_machine=580-amdahl
          417  +		os=-sysv
          418  +		;;
          419  +	amiga | amiga-*)
          420  +		basic_machine=m68k-unknown
          421  +		;;
          422  +	amigaos | amigados)
          423  +		basic_machine=m68k-unknown
          424  +		os=-amigaos
          425  +		;;
          426  +	amigaunix | amix)
          427  +		basic_machine=m68k-unknown
          428  +		os=-sysv4
          429  +		;;
          430  +	apollo68)
          431  +		basic_machine=m68k-apollo
          432  +		os=-sysv
          433  +		;;
          434  +	apollo68bsd)
          435  +		basic_machine=m68k-apollo
          436  +		os=-bsd
          437  +		;;
          438  +	aux)
          439  +		basic_machine=m68k-apple
          440  +		os=-aux
          441  +		;;
          442  +	balance)
          443  +		basic_machine=ns32k-sequent
          444  +		os=-dynix
          445  +		;;
          446  +	c90)
          447  +		basic_machine=c90-cray
          448  +		os=-unicos
          449  +		;;
          450  +	convex-c1)
          451  +		basic_machine=c1-convex
          452  +		os=-bsd
          453  +		;;
          454  +	convex-c2)
          455  +		basic_machine=c2-convex
          456  +		os=-bsd
          457  +		;;
          458  +	convex-c32)
          459  +		basic_machine=c32-convex
          460  +		os=-bsd
          461  +		;;
          462  +	convex-c34)
          463  +		basic_machine=c34-convex
          464  +		os=-bsd
          465  +		;;
          466  +	convex-c38)
          467  +		basic_machine=c38-convex
          468  +		os=-bsd
          469  +		;;
          470  +	cray | j90)
          471  +		basic_machine=j90-cray
          472  +		os=-unicos
          473  +		;;
          474  +	craynv)
          475  +		basic_machine=craynv-cray
          476  +		os=-unicosmp
          477  +		;;
          478  +	cr16)
          479  +		basic_machine=cr16-unknown
          480  +		os=-elf
          481  +		;;
          482  +	crds | unos)
          483  +		basic_machine=m68k-crds
          484  +		;;
          485  +	crisv32 | crisv32-* | etraxfs*)
          486  +		basic_machine=crisv32-axis
          487  +		;;
          488  +	cris | cris-* | etrax*)
          489  +		basic_machine=cris-axis
          490  +		;;
          491  +	crx)
          492  +		basic_machine=crx-unknown
          493  +		os=-elf
          494  +		;;
          495  +	da30 | da30-*)
          496  +		basic_machine=m68k-da30
          497  +		;;
          498  +	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
          499  +		basic_machine=mips-dec
          500  +		;;
          501  +	decsystem10* | dec10*)
          502  +		basic_machine=pdp10-dec
          503  +		os=-tops10
          504  +		;;
          505  +	decsystem20* | dec20*)
          506  +		basic_machine=pdp10-dec
          507  +		os=-tops20
          508  +		;;
          509  +	delta | 3300 | motorola-3300 | motorola-delta \
          510  +	      | 3300-motorola | delta-motorola)
          511  +		basic_machine=m68k-motorola
          512  +		;;
          513  +	delta88)
          514  +		basic_machine=m88k-motorola
          515  +		os=-sysv3
          516  +		;;
          517  +	djgpp)
          518  +		basic_machine=i586-pc
          519  +		os=-msdosdjgpp
          520  +		;;
          521  +	dpx20 | dpx20-*)
          522  +		basic_machine=rs6000-bull
          523  +		os=-bosx
          524  +		;;
          525  +	dpx2* | dpx2*-bull)
          526  +		basic_machine=m68k-bull
          527  +		os=-sysv3
          528  +		;;
          529  +	ebmon29k)
          530  +		basic_machine=a29k-amd
          531  +		os=-ebmon
          532  +		;;
          533  +	elxsi)
          534  +		basic_machine=elxsi-elxsi
          535  +		os=-bsd
          536  +		;;
          537  +	encore | umax | mmax)
          538  +		basic_machine=ns32k-encore
          539  +		;;
          540  +	es1800 | OSE68k | ose68k | ose | OSE)
          541  +		basic_machine=m68k-ericsson
          542  +		os=-ose
          543  +		;;
          544  +	fx2800)
          545  +		basic_machine=i860-alliant
          546  +		;;
          547  +	genix)
          548  +		basic_machine=ns32k-ns
          549  +		;;
          550  +	gmicro)
          551  +		basic_machine=tron-gmicro
          552  +		os=-sysv
          553  +		;;
          554  +	go32)
          555  +		basic_machine=i386-pc
          556  +		os=-go32
          557  +		;;
          558  +	h3050r* | hiux*)
          559  +		basic_machine=hppa1.1-hitachi
          560  +		os=-hiuxwe2
          561  +		;;
          562  +	h8300hms)
          563  +		basic_machine=h8300-hitachi
          564  +		os=-hms
          565  +		;;
          566  +	h8300xray)
          567  +		basic_machine=h8300-hitachi
          568  +		os=-xray
          569  +		;;
          570  +	h8500hms)
          571  +		basic_machine=h8500-hitachi
          572  +		os=-hms
          573  +		;;
          574  +	harris)
          575  +		basic_machine=m88k-harris
          576  +		os=-sysv3
          577  +		;;
          578  +	hp300-*)
          579  +		basic_machine=m68k-hp
          580  +		;;
          581  +	hp300bsd)
          582  +		basic_machine=m68k-hp
          583  +		os=-bsd
          584  +		;;
          585  +	hp300hpux)
          586  +		basic_machine=m68k-hp
          587  +		os=-hpux
          588  +		;;
          589  +	hp3k9[0-9][0-9] | hp9[0-9][0-9])
          590  +		basic_machine=hppa1.0-hp
          591  +		;;
          592  +	hp9k2[0-9][0-9] | hp9k31[0-9])
          593  +		basic_machine=m68000-hp
          594  +		;;
          595  +	hp9k3[2-9][0-9])
          596  +		basic_machine=m68k-hp
          597  +		;;
          598  +	hp9k6[0-9][0-9] | hp6[0-9][0-9])
          599  +		basic_machine=hppa1.0-hp
          600  +		;;
          601  +	hp9k7[0-79][0-9] | hp7[0-79][0-9])
          602  +		basic_machine=hppa1.1-hp
          603  +		;;
          604  +	hp9k78[0-9] | hp78[0-9])
          605  +		# FIXME: really hppa2.0-hp
          606  +		basic_machine=hppa1.1-hp
          607  +		;;
          608  +	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
          609  +		# FIXME: really hppa2.0-hp
          610  +		basic_machine=hppa1.1-hp
          611  +		;;
          612  +	hp9k8[0-9][13679] | hp8[0-9][13679])
          613  +		basic_machine=hppa1.1-hp
          614  +		;;
          615  +	hp9k8[0-9][0-9] | hp8[0-9][0-9])
          616  +		basic_machine=hppa1.0-hp
          617  +		;;
          618  +	hppa-next)
          619  +		os=-nextstep3
          620  +		;;
          621  +	hppaosf)
          622  +		basic_machine=hppa1.1-hp
          623  +		os=-osf
          624  +		;;
          625  +	hppro)
          626  +		basic_machine=hppa1.1-hp
          627  +		os=-proelf
          628  +		;;
          629  +	i370-ibm* | ibm*)
          630  +		basic_machine=i370-ibm
          631  +		;;
          632  +# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
          633  +	i*86v32)
          634  +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          635  +		os=-sysv32
          636  +		;;
          637  +	i*86v4*)
          638  +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          639  +		os=-sysv4
          640  +		;;
          641  +	i*86v)
          642  +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          643  +		os=-sysv
          644  +		;;
          645  +	i*86sol2)
          646  +		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
          647  +		os=-solaris2
          648  +		;;
          649  +	i386mach)
          650  +		basic_machine=i386-mach
          651  +		os=-mach
          652  +		;;
          653  +	i386-vsta | vsta)
          654  +		basic_machine=i386-unknown
          655  +		os=-vsta
          656  +		;;
          657  +	iris | iris4d)
          658  +		basic_machine=mips-sgi
          659  +		case $os in
          660  +		    -irix*)
          661  +			;;
          662  +		    *)
          663  +			os=-irix4
          664  +			;;
          665  +		esac
          666  +		;;
          667  +	isi68 | isi)
          668  +		basic_machine=m68k-isi
          669  +		os=-sysv
          670  +		;;
          671  +	m88k-omron*)
          672  +		basic_machine=m88k-omron
          673  +		;;
          674  +	magnum | m3230)
          675  +		basic_machine=mips-mips
          676  +		os=-sysv
          677  +		;;
          678  +	merlin)
          679  +		basic_machine=ns32k-utek
          680  +		os=-sysv
          681  +		;;
          682  +	mingw32)
          683  +		basic_machine=i386-pc
          684  +		os=-mingw32
          685  +		;;
          686  +	mingw32ce)
          687  +		basic_machine=arm-unknown
          688  +		os=-mingw32ce
          689  +		;;
          690  +	miniframe)
          691  +		basic_machine=m68000-convergent
          692  +		;;
          693  +	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
          694  +		basic_machine=m68k-atari
          695  +		os=-mint
          696  +		;;
          697  +	mips3*-*)
          698  +		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
          699  +		;;
          700  +	mips3*)
          701  +		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
          702  +		;;
          703  +	monitor)
          704  +		basic_machine=m68k-rom68k
          705  +		os=-coff
          706  +		;;
          707  +	morphos)
          708  +		basic_machine=powerpc-unknown
          709  +		os=-morphos
          710  +		;;
          711  +	msdos)
          712  +		basic_machine=i386-pc
          713  +		os=-msdos
          714  +		;;
          715  +	ms1-*)
          716  +		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
          717  +		;;
          718  +	mvs)
          719  +		basic_machine=i370-ibm
          720  +		os=-mvs
          721  +		;;
          722  +	ncr3000)
          723  +		basic_machine=i486-ncr
          724  +		os=-sysv4
          725  +		;;
          726  +	netbsd386)
          727  +		basic_machine=i386-unknown
          728  +		os=-netbsd
          729  +		;;
          730  +	netwinder)
          731  +		basic_machine=armv4l-rebel
          732  +		os=-linux
          733  +		;;
          734  +	news | news700 | news800 | news900)
          735  +		basic_machine=m68k-sony
          736  +		os=-newsos
          737  +		;;
          738  +	news1000)
          739  +		basic_machine=m68030-sony
          740  +		os=-newsos
          741  +		;;
          742  +	news-3600 | risc-news)
          743  +		basic_machine=mips-sony
          744  +		os=-newsos
          745  +		;;
          746  +	necv70)
          747  +		basic_machine=v70-nec
          748  +		os=-sysv
          749  +		;;
          750  +	next | m*-next )
          751  +		basic_machine=m68k-next
          752  +		case $os in
          753  +		    -nextstep* )
          754  +			;;
          755  +		    -ns2*)
          756  +		      os=-nextstep2
          757  +			;;
          758  +		    *)
          759  +		      os=-nextstep3
          760  +			;;
          761  +		esac
          762  +		;;
          763  +	nh3000)
          764  +		basic_machine=m68k-harris
          765  +		os=-cxux
          766  +		;;
          767  +	nh[45]000)
          768  +		basic_machine=m88k-harris
          769  +		os=-cxux
          770  +		;;
          771  +	nindy960)
          772  +		basic_machine=i960-intel
          773  +		os=-nindy
          774  +		;;
          775  +	mon960)
          776  +		basic_machine=i960-intel
          777  +		os=-mon960
          778  +		;;
          779  +	nonstopux)
          780  +		basic_machine=mips-compaq
          781  +		os=-nonstopux
          782  +		;;
          783  +	np1)
          784  +		basic_machine=np1-gould
          785  +		;;
          786  +	nsr-tandem)
          787  +		basic_machine=nsr-tandem
          788  +		;;
          789  +	op50n-* | op60c-*)
          790  +		basic_machine=hppa1.1-oki
          791  +		os=-proelf
          792  +		;;
          793  +	openrisc | openrisc-*)
          794  +		basic_machine=or32-unknown
          795  +		;;
          796  +	os400)
          797  +		basic_machine=powerpc-ibm
          798  +		os=-os400
          799  +		;;
          800  +	OSE68000 | ose68000)
          801  +		basic_machine=m68000-ericsson
          802  +		os=-ose
          803  +		;;
          804  +	os68k)
          805  +		basic_machine=m68k-none
          806  +		os=-os68k
          807  +		;;
          808  +	pa-hitachi)
          809  +		basic_machine=hppa1.1-hitachi
          810  +		os=-hiuxwe2
          811  +		;;
          812  +	paragon)
          813  +		basic_machine=i860-intel
          814  +		os=-osf
          815  +		;;
          816  +	pbd)
          817  +		basic_machine=sparc-tti
          818  +		;;
          819  +	pbb)
          820  +		basic_machine=m68k-tti
          821  +		;;
          822  +	pc532 | pc532-*)
          823  +		basic_machine=ns32k-pc532
          824  +		;;
          825  +	pc98)
          826  +		basic_machine=i386-pc
          827  +		;;
          828  +	pc98-*)
          829  +		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
          830  +		;;
          831  +	pentium | p5 | k5 | k6 | nexgen | viac3)
          832  +		basic_machine=i586-pc
          833  +		;;
          834  +	pentiumpro | p6 | 6x86 | athlon | athlon_*)
          835  +		basic_machine=i686-pc
          836  +		;;
          837  +	pentiumii | pentium2 | pentiumiii | pentium3)
          838  +		basic_machine=i686-pc
          839  +		;;
          840  +	pentium4)
          841  +		basic_machine=i786-pc
          842  +		;;
          843  +	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
          844  +		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
          845  +		;;
          846  +	pentiumpro-* | p6-* | 6x86-* | athlon-*)
          847  +		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
          848  +		;;
          849  +	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
          850  +		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
          851  +		;;
          852  +	pentium4-*)
          853  +		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
          854  +		;;
          855  +	pn)
          856  +		basic_machine=pn-gould
          857  +		;;
          858  +	power)	basic_machine=power-ibm
          859  +		;;
          860  +	ppc)	basic_machine=powerpc-unknown
          861  +		;;
          862  +	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
          863  +		;;
          864  +	ppcle | powerpclittle | ppc-le | powerpc-little)
          865  +		basic_machine=powerpcle-unknown
          866  +		;;
          867  +	ppcle-* | powerpclittle-*)
          868  +		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
          869  +		;;
          870  +	ppc64)	basic_machine=powerpc64-unknown
          871  +		;;
          872  +	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
          873  +		;;
          874  +	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
          875  +		basic_machine=powerpc64le-unknown
          876  +		;;
          877  +	ppc64le-* | powerpc64little-*)
          878  +		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
          879  +		;;
          880  +	ps2)
          881  +		basic_machine=i386-ibm
          882  +		;;
          883  +	pw32)
          884  +		basic_machine=i586-unknown
          885  +		os=-pw32
          886  +		;;
          887  +	rdos)
          888  +		basic_machine=i386-pc
          889  +		os=-rdos
          890  +		;;
          891  +	rom68k)
          892  +		basic_machine=m68k-rom68k
          893  +		os=-coff
          894  +		;;
          895  +	rm[46]00)
          896  +		basic_machine=mips-siemens
          897  +		;;
          898  +	rtpc | rtpc-*)
          899  +		basic_machine=romp-ibm
          900  +		;;
          901  +	s390 | s390-*)
          902  +		basic_machine=s390-ibm
          903  +		;;
          904  +	s390x | s390x-*)
          905  +		basic_machine=s390x-ibm
          906  +		;;
          907  +	sa29200)
          908  +		basic_machine=a29k-amd
          909  +		os=-udi
          910  +		;;
          911  +	sb1)
          912  +		basic_machine=mipsisa64sb1-unknown
          913  +		;;
          914  +	sb1el)
          915  +		basic_machine=mipsisa64sb1el-unknown
          916  +		;;
          917  +	sde)
          918  +		basic_machine=mipsisa32-sde
          919  +		os=-elf
          920  +		;;
          921  +	sei)
          922  +		basic_machine=mips-sei
          923  +		os=-seiux
          924  +		;;
          925  +	sequent)
          926  +		basic_machine=i386-sequent
          927  +		;;
          928  +	sh)
          929  +		basic_machine=sh-hitachi
          930  +		os=-hms
          931  +		;;
          932  +	sh5el)
          933  +		basic_machine=sh5le-unknown
          934  +		;;
          935  +	sh64)
          936  +		basic_machine=sh64-unknown
          937  +		;;
          938  +	sparclite-wrs | simso-wrs)
          939  +		basic_machine=sparclite-wrs
          940  +		os=-vxworks
          941  +		;;
          942  +	sps7)
          943  +		basic_machine=m68k-bull
          944  +		os=-sysv2
          945  +		;;
          946  +	spur)
          947  +		basic_machine=spur-unknown
          948  +		;;
          949  +	st2000)
          950  +		basic_machine=m68k-tandem
          951  +		;;
          952  +	stratus)
          953  +		basic_machine=i860-stratus
          954  +		os=-sysv4
          955  +		;;
          956  +	sun2)
          957  +		basic_machine=m68000-sun
          958  +		;;
          959  +	sun2os3)
          960  +		basic_machine=m68000-sun
          961  +		os=-sunos3
          962  +		;;
          963  +	sun2os4)
          964  +		basic_machine=m68000-sun
          965  +		os=-sunos4
          966  +		;;
          967  +	sun3os3)
          968  +		basic_machine=m68k-sun
          969  +		os=-sunos3
          970  +		;;
          971  +	sun3os4)
          972  +		basic_machine=m68k-sun
          973  +		os=-sunos4
          974  +		;;
          975  +	sun4os3)
          976  +		basic_machine=sparc-sun
          977  +		os=-sunos3
          978  +		;;
          979  +	sun4os4)
          980  +		basic_machine=sparc-sun
          981  +		os=-sunos4
          982  +		;;
          983  +	sun4sol2)
          984  +		basic_machine=sparc-sun
          985  +		os=-solaris2
          986  +		;;
          987  +	sun3 | sun3-*)
          988  +		basic_machine=m68k-sun
          989  +		;;
          990  +	sun4)
          991  +		basic_machine=sparc-sun
          992  +		;;
          993  +	sun386 | sun386i | roadrunner)
          994  +		basic_machine=i386-sun
          995  +		;;
          996  +	sv1)
          997  +		basic_machine=sv1-cray
          998  +		os=-unicos
          999  +		;;
         1000  +	symmetry)
         1001  +		basic_machine=i386-sequent
         1002  +		os=-dynix
         1003  +		;;
         1004  +	t3e)
         1005  +		basic_machine=alphaev5-cray
         1006  +		os=-unicos
         1007  +		;;
         1008  +	t90)
         1009  +		basic_machine=t90-cray
         1010  +		os=-unicos
         1011  +		;;
         1012  +	tic54x | c54x*)
         1013  +		basic_machine=tic54x-unknown
         1014  +		os=-coff
         1015  +		;;
         1016  +	tic55x | c55x*)
         1017  +		basic_machine=tic55x-unknown
         1018  +		os=-coff
         1019  +		;;
         1020  +	tic6x | c6x*)
         1021  +		basic_machine=tic6x-unknown
         1022  +		os=-coff
         1023  +		;;
         1024  +	tx39)
         1025  +		basic_machine=mipstx39-unknown
         1026  +		;;
         1027  +	tx39el)
         1028  +		basic_machine=mipstx39el-unknown
         1029  +		;;
         1030  +	toad1)
         1031  +		basic_machine=pdp10-xkl
         1032  +		os=-tops20
         1033  +		;;
         1034  +	tower | tower-32)
         1035  +		basic_machine=m68k-ncr
         1036  +		;;
         1037  +	tpf)
         1038  +		basic_machine=s390x-ibm
         1039  +		os=-tpf
         1040  +		;;
         1041  +	udi29k)
         1042  +		basic_machine=a29k-amd
         1043  +		os=-udi
         1044  +		;;
         1045  +	ultra3)
         1046  +		basic_machine=a29k-nyu
         1047  +		os=-sym1
         1048  +		;;
         1049  +	v810 | necv810)
         1050  +		basic_machine=v810-nec
         1051  +		os=-none
         1052  +		;;
         1053  +	vaxv)
         1054  +		basic_machine=vax-dec
         1055  +		os=-sysv
         1056  +		;;
         1057  +	vms)
         1058  +		basic_machine=vax-dec
         1059  +		os=-vms
         1060  +		;;
         1061  +	vpp*|vx|vx-*)
         1062  +		basic_machine=f301-fujitsu
         1063  +		;;
         1064  +	vxworks960)
         1065  +		basic_machine=i960-wrs
         1066  +		os=-vxworks
         1067  +		;;
         1068  +	vxworks68)
         1069  +		basic_machine=m68k-wrs
         1070  +		os=-vxworks
         1071  +		;;
         1072  +	vxworks29k)
         1073  +		basic_machine=a29k-wrs
         1074  +		os=-vxworks
         1075  +		;;
         1076  +	w65*)
         1077  +		basic_machine=w65-wdc
         1078  +		os=-none
         1079  +		;;
         1080  +	w89k-*)
         1081  +		basic_machine=hppa1.1-winbond
         1082  +		os=-proelf
         1083  +		;;
         1084  +	xbox)
         1085  +		basic_machine=i686-pc
         1086  +		os=-mingw32
         1087  +		;;
         1088  +	xps | xps100)
         1089  +		basic_machine=xps100-honeywell
         1090  +		;;
         1091  +	ymp)
         1092  +		basic_machine=ymp-cray
         1093  +		os=-unicos
         1094  +		;;
         1095  +	z8k-*-coff)
         1096  +		basic_machine=z8k-unknown
         1097  +		os=-sim
         1098  +		;;
         1099  +	none)
         1100  +		basic_machine=none-none
         1101  +		os=-none
         1102  +		;;
         1103  +
         1104  +# Here we handle the default manufacturer of certain CPU types.  It is in
         1105  +# some cases the only manufacturer, in others, it is the most popular.
         1106  +	w89k)
         1107  +		basic_machine=hppa1.1-winbond
         1108  +		;;
         1109  +	op50n)
         1110  +		basic_machine=hppa1.1-oki
         1111  +		;;
         1112  +	op60c)
         1113  +		basic_machine=hppa1.1-oki
         1114  +		;;
         1115  +	romp)
         1116  +		basic_machine=romp-ibm
         1117  +		;;
         1118  +	mmix)
         1119  +		basic_machine=mmix-knuth
         1120  +		;;
         1121  +	rs6000)
         1122  +		basic_machine=rs6000-ibm
         1123  +		;;
         1124  +	vax)
         1125  +		basic_machine=vax-dec
         1126  +		;;
         1127  +	pdp10)
         1128  +		# there are many clones, so DEC is not a safe bet
         1129  +		basic_machine=pdp10-unknown
         1130  +		;;
         1131  +	pdp11)
         1132  +		basic_machine=pdp11-dec
         1133  +		;;
         1134  +	we32k)
         1135  +		basic_machine=we32k-att
         1136  +		;;
         1137  +	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
         1138  +		basic_machine=sh-unknown
         1139  +		;;
         1140  +	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
         1141  +		basic_machine=sparc-sun
         1142  +		;;
         1143  +	cydra)
         1144  +		basic_machine=cydra-cydrome
         1145  +		;;
         1146  +	orion)
         1147  +		basic_machine=orion-highlevel
         1148  +		;;
         1149  +	orion105)
         1150  +		basic_machine=clipper-highlevel
         1151  +		;;
         1152  +	mac | mpw | mac-mpw)
         1153  +		basic_machine=m68k-apple
         1154  +		;;
         1155  +	pmac | pmac-mpw)
         1156  +		basic_machine=powerpc-apple
         1157  +		;;
         1158  +	*-unknown)
         1159  +		# Make sure to match an already-canonicalized machine name.
         1160  +		;;
         1161  +	*)
         1162  +		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
         1163  +		exit 1
         1164  +		;;
         1165  +esac
         1166  +
         1167  +# Here we canonicalize certain aliases for manufacturers.
         1168  +case $basic_machine in
         1169  +	*-digital*)
         1170  +		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
         1171  +		;;
         1172  +	*-commodore*)
         1173  +		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
         1174  +		;;
         1175  +	*)
         1176  +		;;
         1177  +esac
         1178  +
         1179  +# Decode manufacturer-specific aliases for certain operating systems.
         1180  +
         1181  +if [ x"$os" != x"" ]
         1182  +then
         1183  +case $os in
         1184  +        # First match some system type aliases
         1185  +        # that might get confused with valid system types.
         1186  +	# -solaris* is a basic system type, with this one exception.
         1187  +	-solaris1 | -solaris1.*)
         1188  +		os=`echo $os | sed -e 's|solaris1|sunos4|'`
         1189  +		;;
         1190  +	-solaris)
         1191  +		os=-solaris2
         1192  +		;;
         1193  +	-svr4*)
         1194  +		os=-sysv4
         1195  +		;;
         1196  +	-unixware*)
         1197  +		os=-sysv4.2uw
         1198  +		;;
         1199  +	-gnu/linux*)
         1200  +		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
         1201  +		;;
         1202  +	# First accept the basic system types.
         1203  +	# The portable systems comes first.
         1204  +	# Each alternative MUST END IN A *, to match a version number.
         1205  +	# -sysv* is not here because it comes later, after sysvr4.
         1206  +	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
         1207  +	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
         1208  +	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
         1209  +	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
         1210  +	      | -aos* \
         1211  +	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
         1212  +	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
         1213  +	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
         1214  +	      | -openbsd* | -solidbsd* \
         1215  +	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
         1216  +	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
         1217  +	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
         1218  +	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
         1219  +	      | -chorusos* | -chorusrdb* \
         1220  +	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
         1221  +	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
         1222  +	      | -uxpv* | -beos* | -mpeix* | -udk* \
         1223  +	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
         1224  +	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
         1225  +	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
         1226  +	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
         1227  +	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
         1228  +	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
         1229  +	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
         1230  +	# Remember, each alternative MUST END IN *, to match a version number.
         1231  +		;;
         1232  +	-qnx*)
         1233  +		case $basic_machine in
         1234  +		    x86-* | i*86-*)
         1235  +			;;
         1236  +		    *)
         1237  +			os=-nto$os
         1238  +			;;
         1239  +		esac
         1240  +		;;
         1241  +	-nto-qnx*)
         1242  +		;;
         1243  +	-nto*)
         1244  +		os=`echo $os | sed -e 's|nto|nto-qnx|'`
         1245  +		;;
         1246  +	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
         1247  +	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
         1248  +	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
         1249  +		;;
         1250  +	-mac*)
         1251  +		os=`echo $os | sed -e 's|mac|macos|'`
         1252  +		;;
         1253  +	-linux-dietlibc)
         1254  +		os=-linux-dietlibc
         1255  +		;;
         1256  +	-linux*)
         1257  +		os=`echo $os | sed -e 's|linux|linux-gnu|'`
         1258  +		;;
         1259  +	-sunos5*)
         1260  +		os=`echo $os | sed -e 's|sunos5|solaris2|'`
         1261  +		;;
         1262  +	-sunos6*)
         1263  +		os=`echo $os | sed -e 's|sunos6|solaris3|'`
         1264  +		;;
         1265  +	-opened*)
         1266  +		os=-openedition
         1267  +		;;
         1268  +        -os400*)
         1269  +		os=-os400
         1270  +		;;
         1271  +	-wince*)
         1272  +		os=-wince
         1273  +		;;
         1274  +	-osfrose*)
         1275  +		os=-osfrose
         1276  +		;;
         1277  +	-osf*)
         1278  +		os=-osf
         1279  +		;;
         1280  +	-utek*)
         1281  +		os=-bsd
         1282  +		;;
         1283  +	-dynix*)
         1284  +		os=-bsd
         1285  +		;;
         1286  +	-acis*)
         1287  +		os=-aos
         1288  +		;;
         1289  +	-atheos*)
         1290  +		os=-atheos
         1291  +		;;
         1292  +	-syllable*)
         1293  +		os=-syllable
         1294  +		;;
         1295  +	-386bsd)
         1296  +		os=-bsd
         1297  +		;;
         1298  +	-ctix* | -uts*)
         1299  +		os=-sysv
         1300  +		;;
         1301  +	-nova*)
         1302  +		os=-rtmk-nova
         1303  +		;;
         1304  +	-ns2 )
         1305  +		os=-nextstep2
         1306  +		;;
         1307  +	-nsk*)
         1308  +		os=-nsk
         1309  +		;;
         1310  +	# Preserve the version number of sinix5.
         1311  +	-sinix5.*)
         1312  +		os=`echo $os | sed -e 's|sinix|sysv|'`
         1313  +		;;
         1314  +	-sinix*)
         1315  +		os=-sysv4
         1316  +		;;
         1317  +        -tpf*)
         1318  +		os=-tpf
         1319  +		;;
         1320  +	-triton*)
         1321  +		os=-sysv3
         1322  +		;;
         1323  +	-oss*)
         1324  +		os=-sysv3
         1325  +		;;
         1326  +	-svr4)
         1327  +		os=-sysv4
         1328  +		;;
         1329  +	-svr3)
         1330  +		os=-sysv3
         1331  +		;;
         1332  +	-sysvr4)
         1333  +		os=-sysv4
         1334  +		;;
         1335  +	# This must come after -sysvr4.
         1336  +	-sysv*)
         1337  +		;;
         1338  +	-ose*)
         1339  +		os=-ose
         1340  +		;;
         1341  +	-es1800*)
         1342  +		os=-ose
         1343  +		;;
         1344  +	-xenix)
         1345  +		os=-xenix
         1346  +		;;
         1347  +	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
         1348  +		os=-mint
         1349  +		;;
         1350  +	-aros*)
         1351  +		os=-aros
         1352  +		;;
         1353  +	-kaos*)
         1354  +		os=-kaos
         1355  +		;;
         1356  +	-zvmoe)
         1357  +		os=-zvmoe
         1358  +		;;
         1359  +	-none)
         1360  +		;;
         1361  +	*)
         1362  +		# Get rid of the `-' at the beginning of $os.
         1363  +		os=`echo $os | sed 's/[^-]*-//'`
         1364  +		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
         1365  +		exit 1
         1366  +		;;
         1367  +esac
         1368  +else
         1369  +
         1370  +# Here we handle the default operating systems that come with various machines.
         1371  +# The value should be what the vendor currently ships out the door with their
         1372  +# machine or put another way, the most popular os provided with the machine.
         1373  +
         1374  +# Note that if you're going to try to match "-MANUFACTURER" here (say,
         1375  +# "-sun"), then you have to tell the case statement up towards the top
         1376  +# that MANUFACTURER isn't an operating system.  Otherwise, code above
         1377  +# will signal an error saying that MANUFACTURER isn't an operating
         1378  +# system, and we'll never get to this point.
         1379  +
         1380  +case $basic_machine in
         1381  +        score-*)
         1382  +		os=-elf
         1383  +		;;
         1384  +        spu-*)
         1385  +		os=-elf
         1386  +		;;
         1387  +	*-acorn)
         1388  +		os=-riscix1.2
         1389  +		;;
         1390  +	arm*-rebel)
         1391  +		os=-linux
         1392  +		;;
         1393  +	arm*-semi)
         1394  +		os=-aout
         1395  +		;;
         1396  +        c4x-* | tic4x-*)
         1397  +        	os=-coff
         1398  +		;;
         1399  +	# This must come before the *-dec entry.
         1400  +	pdp10-*)
         1401  +		os=-tops20
         1402  +		;;
         1403  +	pdp11-*)
         1404  +		os=-none
         1405  +		;;
         1406  +	*-dec | vax-*)
         1407  +		os=-ultrix4.2
         1408  +		;;
         1409  +	m68*-apollo)
         1410  +		os=-domain
         1411  +		;;
         1412  +	i386-sun)
         1413  +		os=-sunos4.0.2
         1414  +		;;
         1415  +	m68000-sun)
         1416  +		os=-sunos3
         1417  +		# This also exists in the configure program, but was not the
         1418  +		# default.
         1419  +		# os=-sunos4
         1420  +		;;
         1421  +	m68*-cisco)
         1422  +		os=-aout
         1423  +		;;
         1424  +        mep-*)
         1425  +		os=-elf
         1426  +		;;
         1427  +	mips*-cisco)
         1428  +		os=-elf
         1429  +		;;
         1430  +	mips*-*)
         1431  +		os=-elf
         1432  +		;;
         1433  +	or32-*)
         1434  +		os=-coff
         1435  +		;;
         1436  +	*-tti)	# must be before sparc entry or we get the wrong os.
         1437  +		os=-sysv3
         1438  +		;;
         1439  +	sparc-* | *-sun)
         1440  +		os=-sunos4.1.1
         1441  +		;;
         1442  +	*-be)
         1443  +		os=-beos
         1444  +		;;
         1445  +	*-haiku)
         1446  +		os=-haiku
         1447  +		;;
         1448  +	*-ibm)
         1449  +		os=-aix
         1450  +		;;
         1451  +    	*-knuth)
         1452  +		os=-mmixware
         1453  +		;;
         1454  +	*-wec)
         1455  +		os=-proelf
         1456  +		;;
         1457  +	*-winbond)
         1458  +		os=-proelf
         1459  +		;;
         1460  +	*-oki)
         1461  +		os=-proelf
         1462  +		;;
         1463  +	*-hp)
         1464  +		os=-hpux
         1465  +		;;
         1466  +	*-hitachi)
         1467  +		os=-hiux
         1468  +		;;
         1469  +	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
         1470  +		os=-sysv
         1471  +		;;
         1472  +	*-cbm)
         1473  +		os=-amigaos
         1474  +		;;
         1475  +	*-dg)
         1476  +		os=-dgux
         1477  +		;;
         1478  +	*-dolphin)
         1479  +		os=-sysv3
         1480  +		;;
         1481  +	m68k-ccur)
         1482  +		os=-rtu
         1483  +		;;
         1484  +	m88k-omron*)
         1485  +		os=-luna
         1486  +		;;
         1487  +	*-next )
         1488  +		os=-nextstep
         1489  +		;;
         1490  +	*-sequent)
         1491  +		os=-ptx
         1492  +		;;
         1493  +	*-crds)
         1494  +		os=-unos
         1495  +		;;
         1496  +	*-ns)
         1497  +		os=-genix
         1498  +		;;
         1499  +	i370-*)
         1500  +		os=-mvs
         1501  +		;;
         1502  +	*-next)
         1503  +		os=-nextstep3
         1504  +		;;
         1505  +	*-gould)
         1506  +		os=-sysv
         1507  +		;;
         1508  +	*-highlevel)
         1509  +		os=-bsd
         1510  +		;;
         1511  +	*-encore)
         1512  +		os=-bsd
         1513  +		;;
         1514  +	*-sgi)
         1515  +		os=-irix
         1516  +		;;
         1517  +	*-siemens)
         1518  +		os=-sysv4
         1519  +		;;
         1520  +	*-masscomp)
         1521  +		os=-rtu
         1522  +		;;
         1523  +	f30[01]-fujitsu | f700-fujitsu)
         1524  +		os=-uxpv
         1525  +		;;
         1526  +	*-rom68k)
         1527  +		os=-coff
         1528  +		;;
         1529  +	*-*bug)
         1530  +		os=-coff
         1531  +		;;
         1532  +	*-apple)
         1533  +		os=-macos
         1534  +		;;
         1535  +	*-atari*)
         1536  +		os=-mint
         1537  +		;;
         1538  +	*)
         1539  +		os=-none
         1540  +		;;
         1541  +esac
         1542  +fi
         1543  +
         1544  +# Here we handle the case where we know the os, and the CPU type, but not the
         1545  +# manufacturer.  We pick the logical manufacturer.
         1546  +vendor=unknown
         1547  +case $basic_machine in
         1548  +	*-unknown)
         1549  +		case $os in
         1550  +			-riscix*)
         1551  +				vendor=acorn
         1552  +				;;
         1553  +			-sunos*)
         1554  +				vendor=sun
         1555  +				;;
         1556  +			-aix*)
         1557  +				vendor=ibm
         1558  +				;;
         1559  +			-beos*)
         1560  +				vendor=be
         1561  +				;;
         1562  +			-hpux*)
         1563  +				vendor=hp
         1564  +				;;
         1565  +			-mpeix*)
         1566  +				vendor=hp
         1567  +				;;
         1568  +			-hiux*)
         1569  +				vendor=hitachi
         1570  +				;;
         1571  +			-unos*)
         1572  +				vendor=crds
         1573  +				;;
         1574  +			-dgux*)
         1575  +				vendor=dg
         1576  +				;;
         1577  +			-luna*)
         1578  +				vendor=omron
         1579  +				;;
         1580  +			-genix*)
         1581  +				vendor=ns
         1582  +				;;
         1583  +			-mvs* | -opened*)
         1584  +				vendor=ibm
         1585  +				;;
         1586  +			-os400*)
         1587  +				vendor=ibm
         1588  +				;;
         1589  +			-ptx*)
         1590  +				vendor=sequent
         1591  +				;;
         1592  +			-tpf*)
         1593  +				vendor=ibm
         1594  +				;;
         1595  +			-vxsim* | -vxworks* | -windiss*)
         1596  +				vendor=wrs
         1597  +				;;
         1598  +			-aux*)
         1599  +				vendor=apple
         1600  +				;;
         1601  +			-hms*)
         1602  +				vendor=hitachi
         1603  +				;;
         1604  +			-mpw* | -macos*)
         1605  +				vendor=apple
         1606  +				;;
         1607  +			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
         1608  +				vendor=atari
         1609  +				;;
         1610  +			-vos*)
         1611  +				vendor=stratus
         1612  +				;;
         1613  +		esac
         1614  +		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
         1615  +		;;
         1616  +esac
         1617  +
         1618  +echo $basic_machine$os
         1619  +exit
         1620  +
         1621  +# Local variables:
         1622  +# eval: (add-hook 'write-file-hooks 'time-stamp)
         1623  +# time-stamp-start: "timestamp='"
         1624  +# time-stamp-format: "%:y-%02m-%02d"
         1625  +# time-stamp-end: "'"
         1626  +# End:

Changes to configure.

more than 10,000 changes

Changes to configure.ac.

     1      1   #                                               -*- Autoconf -*-
     2      2   # Process this file with autoconf to produce a configure script.
     3      3   
     4      4   AC_PREREQ(2.61)
     5         -AC_INIT(librasterlite, 1.1a, a.furieri @ lqt.it)
            5  +AC_INIT(librasterlite, 1.0, a.furieri @ lqt.it)
     6      6   AC_LANG(C) 
     7         -AC_CONFIG_AUX_DIR([.])
     8         -AC_CONFIG_MACRO_DIR([m4])
     9      7   
    10      8   AM_INIT_AUTOMAKE 
    11      9   AM_MAINTAINER_MODE
    12     10   
    13     11   # Checks for header files.
    14     12   AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
    15     13   AC_CHECK_HEADERS(stdio.h,,[AC_MSG_ERROR([cannot find stdio.h, bailing out])])
................................................................................
    46     44   AC_FUNC_LSTAT
    47     45   AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
    48     46   AC_FUNC_MEMCMP 
    49     47   AC_FUNC_STAT 
    50     48   AC_FUNC_STRFTIME
    51     49   AC_CHECK_FUNCS([memset sqrt strcasecmp strerror strncasecmp strstr fdatasync ftruncate getcwd gettimeofday localtime_r memmove strerror])
    52     50   
    53         -# Checks for required libraries
    54         -AC_CHECK_HEADERS(geotiff/geotiff.h)
    55         -AC_CHECK_HEADERS(libgeotiff/geotiff.h)
    56         -AC_CHECK_HEADERS(geotiff.h)
    57         -if test x"$ac_cv_header_geotiff_geotiff_h" != x"yes" && test x"$ac_cv_header_libgeotiff_geotiff_h" != x"yes" && test x"$ac_cv_header_geotiff_h" != x"yes"; then
    58         -    AC_MSG_ERROR(['libgeotiff' is required but the header (geotiff.h) doesn't seem to be installed on this system])
    59         -fi
    60         -AC_CHECK_LIB(geotiff,GTIFWriteKeys,,AC_MSG_ERROR(['libgeotiff' is required but it doesn't seems to be installed on this system.]),)
    61         -
    62         -PKG_CHECK_MODULES([LIBSPATIALITE], [spatialite], , AC_MSG_ERROR(['libspatialite' is required but it doesn't seem to be installed on this system.]))
    63         -AC_SUBST(LIBSPATIALITE_CFLAGS)
    64         -AC_SUBST(LIBSPATIALITE_LIBS)
    65         -
    66     51   AC_CONFIG_FILES([Makefile \
    67     52   		headers/Makefile \
           53  +		epsilon/Makefile \
    68     54   		lib/Makefile \
    69     55   		src/Makefile \
    70     56   		rasterlite.pc])
    71     57   
    72     58   AC_OUTPUT

Changes to depcomp.

     1         -/usr/share/automake-1.11/depcomp
            1  +#! /bin/sh
            2  +# depcomp - compile a program generating dependencies as side-effects
            3  +
            4  +scriptversion=2007-03-29.01
            5  +
            6  +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
            7  +# Foundation, Inc.
            8  +
            9  +# This program is free software; you can redistribute it and/or modify
           10  +# it under the terms of the GNU General Public License as published by
           11  +# the Free Software Foundation; either version 2, or (at your option)
           12  +# any later version.
           13  +
           14  +# This program is distributed in the hope that it will be useful,
           15  +# but WITHOUT ANY WARRANTY; without even the implied warranty of
           16  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           17  +# GNU General Public License for more details.
           18  +
           19  +# You should have received a copy of the GNU General Public License
           20  +# along with this program; if not, write to the Free Software
           21  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
           22  +# 02110-1301, USA.
           23  +
           24  +# As a special exception to the GNU General Public License, if you
           25  +# distribute this file as part of a program that contains a
           26  +# configuration script generated by Autoconf, you may include it under
           27  +# the same distribution terms that you use for the rest of that program.
           28  +
           29  +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
           30  +
           31  +case $1 in
           32  +  '')
           33  +     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
           34  +     exit 1;
           35  +     ;;
           36  +  -h | --h*)
           37  +    cat <<\EOF
           38  +Usage: depcomp [--help] [--version] PROGRAM [ARGS]
           39  +
           40  +Run PROGRAMS ARGS to compile a file, generating dependencies
           41  +as side-effects.
           42  +
           43  +Environment variables:
           44  +  depmode     Dependency tracking mode.
           45  +  source      Source file read by `PROGRAMS ARGS'.
           46  +  object      Object file output by `PROGRAMS ARGS'.
           47  +  DEPDIR      directory where to store dependencies.
           48  +  depfile     Dependency file to output.
           49  +  tmpdepfile  Temporary file to use when outputing dependencies.
           50  +  libtool     Whether libtool is used (yes/no).
           51  +
           52  +Report bugs to <bug-automake@gnu.org>.
           53  +EOF
           54  +    exit $?
           55  +    ;;
           56  +  -v | --v*)
           57  +    echo "depcomp $scriptversion"
           58  +    exit $?
           59  +    ;;
           60  +esac
           61  +
           62  +if test -z "$depmode" || test -z "$source" || test -z "$object"; then
           63  +  echo "depcomp: Variables source, object and depmode must be set" 1>&2
           64  +  exit 1
           65  +fi
           66  +
           67  +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
           68  +depfile=${depfile-`echo "$object" |
           69  +  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
           70  +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
           71  +
           72  +rm -f "$tmpdepfile"
           73  +
           74  +# Some modes work just like other modes, but use different flags.  We
           75  +# parameterize here, but still list the modes in the big case below,
           76  +# to make depend.m4 easier to write.  Note that we *cannot* use a case
           77  +# here, because this file can only contain one case statement.
           78  +if test "$depmode" = hp; then
           79  +  # HP compiler uses -M and no extra arg.
           80  +  gccflag=-M
           81  +  depmode=gcc
           82  +fi
           83  +
           84  +if test "$depmode" = dashXmstdout; then
           85  +   # This is just like dashmstdout with a different argument.
           86  +   dashmflag=-xM
           87  +   depmode=dashmstdout
           88  +fi
           89  +
           90  +case "$depmode" in
           91  +gcc3)
           92  +## gcc 3 implements dependency tracking that does exactly what
           93  +## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
           94  +## it if -MD -MP comes after the -MF stuff.  Hmm.
           95  +## Unfortunately, FreeBSD c89 acceptance of flags depends upon
           96  +## the command line argument order; so add the flags where they
           97  +## appear in depend2.am.  Note that the slowdown incurred here
           98  +## affects only configure: in makefiles, %FASTDEP% shortcuts this.
           99  +  for arg
          100  +  do
          101  +    case $arg in
          102  +    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
          103  +    *)  set fnord "$@" "$arg" ;;
          104  +    esac
          105  +    shift # fnord
          106  +    shift # $arg
          107  +  done
          108  +  "$@"
          109  +  stat=$?
          110  +  if test $stat -eq 0; then :
          111  +  else
          112  +    rm -f "$tmpdepfile"
          113  +    exit $stat
          114  +  fi
          115  +  mv "$tmpdepfile" "$depfile"
          116  +  ;;
          117  +
          118  +gcc)
          119  +## There are various ways to get dependency output from gcc.  Here's
          120  +## why we pick this rather obscure method:
          121  +## - Don't want to use -MD because we'd like the dependencies to end
          122  +##   up in a subdir.  Having to rename by hand is ugly.
          123  +##   (We might end up doing this anyway to support other compilers.)
          124  +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
          125  +##   -MM, not -M (despite what the docs say).
          126  +## - Using -M directly means running the compiler twice (even worse
          127  +##   than renaming).
          128  +  if test -z "$gccflag"; then
          129  +    gccflag=-MD,
          130  +  fi
          131  +  "$@" -Wp,"$gccflag$tmpdepfile"
          132  +  stat=$?
          133  +  if test $stat -eq 0; then :
          134  +  else
          135  +    rm -f "$tmpdepfile"
          136  +    exit $stat
          137  +  fi
          138  +  rm -f "$depfile"
          139  +  echo "$object : \\" > "$depfile"
          140  +  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
          141  +## The second -e expression handles DOS-style file names with drive letters.
          142  +  sed -e 's/^[^:]*: / /' \
          143  +      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
          144  +## This next piece of magic avoids the `deleted header file' problem.
          145  +## The problem is that when a header file which appears in a .P file
          146  +## is deleted, the dependency causes make to die (because there is
          147  +## typically no way to rebuild the header).  We avoid this by adding
          148  +## dummy dependencies for each header file.  Too bad gcc doesn't do
          149  +## this for us directly.
          150  +  tr ' ' '
          151  +' < "$tmpdepfile" |
          152  +## Some versions of gcc put a space before the `:'.  On the theory
          153  +## that the space means something, we add a space to the output as
          154  +## well.
          155  +## Some versions of the HPUX 10.20 sed can't process this invocation
          156  +## correctly.  Breaking it into two sed invocations is a workaround.
          157  +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
          158  +  rm -f "$tmpdepfile"
          159  +  ;;
          160  +
          161  +hp)
          162  +  # This case exists only to let depend.m4 do its work.  It works by
          163  +  # looking at the text of this script.  This case will never be run,
          164  +  # since it is checked for above.
          165  +  exit 1
          166  +  ;;
          167  +
          168  +sgi)
          169  +  if test "$libtool" = yes; then
          170  +    "$@" "-Wp,-MDupdate,$tmpdepfile"
          171  +  else
          172  +    "$@" -MDupdate "$tmpdepfile"
          173  +  fi
          174  +  stat=$?
          175  +  if test $stat -eq 0; then :
          176  +  else
          177  +    rm -f "$tmpdepfile"
          178  +    exit $stat
          179  +  fi
          180  +  rm -f "$depfile"
          181  +
          182  +  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
          183  +    echo "$object : \\" > "$depfile"
          184  +
          185  +    # Clip off the initial element (the dependent).  Don't try to be
          186  +    # clever and replace this with sed code, as IRIX sed won't handle
          187  +    # lines with more than a fixed number of characters (4096 in
          188  +    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
          189  +    # the IRIX cc adds comments like `#:fec' to the end of the
          190  +    # dependency line.
          191  +    tr ' ' '
          192  +' < "$tmpdepfile" \
          193  +    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
          194  +    tr '
          195  +' ' ' >> $depfile
          196  +    echo >> $depfile
          197  +
          198  +    # The second pass generates a dummy entry for each header file.
          199  +    tr ' ' '
          200  +' < "$tmpdepfile" \
          201  +   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
          202  +   >> $depfile
          203  +  else
          204  +    # The sourcefile does not contain any dependencies, so just
          205  +    # store a dummy comment line, to avoid errors with the Makefile
          206  +    # "include basename.Plo" scheme.
          207  +    echo "#dummy" > "$depfile"
          208  +  fi
          209  +  rm -f "$tmpdepfile"
          210  +  ;;
          211  +
          212  +aix)
          213  +  # The C for AIX Compiler uses -M and outputs the dependencies
          214  +  # in a .u file.  In older versions, this file always lives in the
          215  +  # current directory.  Also, the AIX compiler puts `$object:' at the
          216  +  # start of each line; $object doesn't have directory information.
          217  +  # Version 6 uses the directory in both cases.
          218  +  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
          219  +  test "x$dir" = "x$object" && dir=
          220  +  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
          221  +  if test "$libtool" = yes; then
          222  +    tmpdepfile1=$dir$base.u
          223  +    tmpdepfile2=$base.u
          224  +    tmpdepfile3=$dir.libs/$base.u
          225  +    "$@" -Wc,-M
          226  +  else
          227  +    tmpdepfile1=$dir$base.u
          228  +    tmpdepfile2=$dir$base.u
          229  +    tmpdepfile3=$dir$base.u
          230  +    "$@" -M
          231  +  fi
          232  +  stat=$?
          233  +
          234  +  if test $stat -eq 0; then :
          235  +  else
          236  +    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
          237  +    exit $stat
          238  +  fi
          239  +
          240  +  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
          241  +  do
          242  +    test -f "$tmpdepfile" && break
          243  +  done
          244  +  if test -f "$tmpdepfile"; then
          245  +    # Each line is of the form `foo.o: dependent.h'.
          246  +    # Do two passes, one to just change these to
          247  +    # `$object: dependent.h' and one to simply `dependent.h:'.
          248  +    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
          249  +    # That's a tab and a space in the [].
          250  +    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
          251  +  else
          252  +    # The sourcefile does not contain any dependencies, so just
          253  +    # store a dummy comment line, to avoid errors with the Makefile
          254  +    # "include basename.Plo" scheme.
          255  +    echo "#dummy" > "$depfile"
          256  +  fi
          257  +  rm -f "$tmpdepfile"
          258  +  ;;
          259  +
          260  +icc)
          261  +  # Intel's C compiler understands `-MD -MF file'.  However on
          262  +  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
          263  +  # ICC 7.0 will fill foo.d with something like
          264  +  #    foo.o: sub/foo.c
          265  +  #    foo.o: sub/foo.h
          266  +  # which is wrong.  We want:
          267  +  #    sub/foo.o: sub/foo.c
          268  +  #    sub/foo.o: sub/foo.h
          269  +  #    sub/foo.c:
          270  +  #    sub/foo.h:
          271  +  # ICC 7.1 will output
          272  +  #    foo.o: sub/foo.c sub/foo.h
          273  +  # and will wrap long lines using \ :
          274  +  #    foo.o: sub/foo.c ... \
          275  +  #     sub/foo.h ... \
          276  +  #     ...
          277  +
          278  +  "$@" -MD -MF "$tmpdepfile"
          279  +  stat=$?
          280  +  if test $stat -eq 0; then :
          281  +  else
          282  +    rm -f "$tmpdepfile"
          283  +    exit $stat
          284  +  fi
          285  +  rm -f "$depfile"
          286  +  # Each line is of the form `foo.o: dependent.h',
          287  +  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
          288  +  # Do two passes, one to just change these to
          289  +  # `$object: dependent.h' and one to simply `dependent.h:'.
          290  +  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
          291  +  # Some versions of the HPUX 10.20 sed can't process this invocation
          292  +  # correctly.  Breaking it into two sed invocations is a workaround.
          293  +  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
          294  +    sed -e 's/$/ :/' >> "$depfile"
          295  +  rm -f "$tmpdepfile"
          296  +  ;;
          297  +
          298  +hp2)
          299  +  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
          300  +  # compilers, which have integrated preprocessors.  The correct option
          301  +  # to use with these is +Maked; it writes dependencies to a file named
          302  +  # 'foo.d', which lands next to the object file, wherever that
          303  +  # happens to be.
          304  +  # Much of this is similar to the tru64 case; see comments there.
          305  +  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
          306  +  test "x$dir" = "x$object" && dir=
          307  +  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
          308  +  if test "$libtool" = yes; then
          309  +    tmpdepfile1=$dir$base.d
          310  +    tmpdepfile2=$dir.libs/$base.d
          311  +    "$@" -Wc,+Maked
          312  +  else
          313  +    tmpdepfile1=$dir$base.d
          314  +    tmpdepfile2=$dir$base.d
          315  +    "$@" +Maked
          316  +  fi
          317  +  stat=$?
          318  +  if test $stat -eq 0; then :
          319  +  else
          320  +     rm -f "$tmpdepfile1" "$tmpdepfile2"
          321  +     exit $stat
          322  +  fi
          323  +
          324  +  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
          325  +  do
          326  +    test -f "$tmpdepfile" && break
          327  +  done
          328  +  if test -f "$tmpdepfile"; then
          329  +    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
          330  +    # Add `dependent.h:' lines.
          331  +    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
          332  +  else
          333  +    echo "#dummy" > "$depfile"
          334  +  fi
          335  +  rm -f "$tmpdepfile" "$tmpdepfile2"
          336  +  ;;
          337  +
          338  +tru64)
          339  +   # The Tru64 compiler uses -MD to generate dependencies as a side
          340  +   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
          341  +   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
          342  +   # dependencies in `foo.d' instead, so we check for that too.
          343  +   # Subdirectories are respected.
          344  +   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
          345  +   test "x$dir" = "x$object" && dir=
          346  +   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
          347  +
          348  +   if test "$libtool" = yes; then
          349  +      # With Tru64 cc, shared objects can also be used to make a
          350  +      # static library.  This mechanism is used in libtool 1.4 series to
          351  +      # handle both shared and static libraries in a single compilation.
          352  +      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
          353  +      #
          354  +      # With libtool 1.5 this exception was removed, and libtool now
          355  +      # generates 2 separate objects for the 2 libraries.  These two
          356  +      # compilations output dependencies in $dir.libs/$base.o.d and
          357  +      # in $dir$base.o.d.  We have to check for both files, because
          358  +      # one of the two compilations can be disabled.  We should prefer
          359  +      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
          360  +      # automatically cleaned when .libs/ is deleted, while ignoring
          361  +      # the former would cause a distcleancheck panic.
          362  +      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
          363  +      tmpdepfile2=$dir$base.o.d          # libtool 1.5
          364  +      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
          365  +      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
          366  +      "$@" -Wc,-MD
          367  +   else
          368  +      tmpdepfile1=$dir$base.o.d
          369  +      tmpdepfile2=$dir$base.d
          370  +      tmpdepfile3=$dir$base.d
          371  +      tmpdepfile4=$dir$base.d
          372  +      "$@" -MD
          373  +   fi
          374  +
          375  +   stat=$?
          376  +   if test $stat -eq 0; then :
          377  +   else
          378  +      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
          379  +      exit $stat
          380  +   fi
          381  +
          382  +   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
          383  +   do
          384  +     test -f "$tmpdepfile" && break
          385  +   done
          386  +   if test -f "$tmpdepfile"; then
          387  +      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
          388  +      # That's a tab and a space in the [].
          389  +      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
          390  +   else
          391  +      echo "#dummy" > "$depfile"
          392  +   fi
          393  +   rm -f "$tmpdepfile"
          394  +   ;;
          395  +
          396  +#nosideeffect)
          397  +  # This comment above is used by automake to tell side-effect
          398  +  # dependency tracking mechanisms from slower ones.
          399  +
          400  +dashmstdout)
          401  +  # Important note: in order to support this mode, a compiler *must*
          402  +  # always write the preprocessed file to stdout, regardless of -o.
          403  +  "$@" || exit $?
          404  +
          405  +  # Remove the call to Libtool.
          406  +  if test "$libtool" = yes; then
          407  +    while test $1 != '--mode=compile'; do
          408  +      shift
          409  +    done
          410  +    shift
          411  +  fi
          412  +
          413  +  # Remove `-o $object'.
          414  +  IFS=" "
          415  +  for arg
          416  +  do
          417  +    case $arg in
          418  +    -o)
          419  +      shift
          420  +      ;;
          421  +    $object)
          422  +      shift
          423  +      ;;
          424  +    *)
          425  +      set fnord "$@" "$arg"
          426  +      shift # fnord
          427  +      shift # $arg
          428  +      ;;
          429  +    esac
          430  +  done
          431  +
          432  +  test -z "$dashmflag" && dashmflag=-M
          433  +  # Require at least two characters before searching for `:'
          434  +  # in the target name.  This is to cope with DOS-style filenames:
          435  +  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
          436  +  "$@" $dashmflag |
          437  +    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
          438  +  rm -f "$depfile"
          439  +  cat < "$tmpdepfile" > "$depfile"
          440  +  tr ' ' '
          441  +' < "$tmpdepfile" | \
          442  +## Some versions of the HPUX 10.20 sed can't process this invocation
          443  +## correctly.  Breaking it into two sed invocations is a workaround.
          444  +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
          445  +  rm -f "$tmpdepfile"
          446  +  ;;
          447  +
          448  +dashXmstdout)
          449  +  # This case only exists to satisfy depend.m4.  It is never actually
          450  +  # run, as this mode is specially recognized in the preamble.
          451  +  exit 1
          452  +  ;;
          453  +
          454  +makedepend)
          455  +  "$@" || exit $?
          456  +  # Remove any Libtool call
          457  +  if test "$libtool" = yes; then
          458  +    while test $1 != '--mode=compile'; do
          459  +      shift
          460  +    done
          461  +    shift
          462  +  fi
          463  +  # X makedepend
          464  +  shift
          465  +  cleared=no
          466  +  for arg in "$@"; do
          467  +    case $cleared in
          468  +    no)
          469  +      set ""; shift
          470  +      cleared=yes ;;
          471  +    esac
          472  +    case "$arg" in
          473  +    -D*|-I*)
          474  +      set fnord "$@" "$arg"; shift ;;
          475  +    # Strip any option that makedepend may not understand.  Remove
          476  +    # the object too, otherwise makedepend will parse it as a source file.
          477  +    -*|$object)
          478  +      ;;
          479  +    *)
          480  +      set fnord "$@" "$arg"; shift ;;
          481  +    esac
          482  +  done
          483  +  obj_suffix="`echo $object | sed 's/^.*\././'`"
          484  +  touch "$tmpdepfile"
          485  +  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
          486  +  rm -f "$depfile"
          487  +  cat < "$tmpdepfile" > "$depfile"
          488  +  sed '1,2d' "$tmpdepfile" | tr ' ' '
          489  +' | \
          490  +## Some versions of the HPUX 10.20 sed can't process this invocation
          491  +## correctly.  Breaking it into two sed invocations is a workaround.
          492  +    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
          493  +  rm -f "$tmpdepfile" "$tmpdepfile".bak
          494  +  ;;
          495  +
          496  +cpp)
          497  +  # Important note: in order to support this mode, a compiler *must*
          498  +  # always write the preprocessed file to stdout.
          499  +  "$@" || exit $?
          500  +
          501  +  # Remove the call to Libtool.
          502  +  if test "$libtool" = yes; then
          503  +    while test $1 != '--mode=compile'; do
          504  +      shift
          505  +    done
          506  +    shift
          507  +  fi
          508  +
          509  +  # Remove `-o $object'.
          510  +  IFS=" "
          511  +  for arg
          512  +  do
          513  +    case $arg in
          514  +    -o)
          515  +      shift
          516  +      ;;
          517  +    $object)
          518  +      shift
          519  +      ;;
          520  +    *)
          521  +      set fnord "$@" "$arg"
          522  +      shift # fnord
          523  +      shift # $arg
          524  +      ;;
          525  +    esac
          526  +  done
          527  +
          528  +  "$@" -E |
          529  +    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
          530  +       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
          531  +    sed '$ s: \\$::' > "$tmpdepfile"
          532  +  rm -f "$depfile"
          533  +  echo "$object : \\" > "$depfile"
          534  +  cat < "$tmpdepfile" >> "$depfile"
          535  +  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
          536  +  rm -f "$tmpdepfile"
          537  +  ;;
          538  +
          539  +msvisualcpp)
          540  +  # Important note: in order to support this mode, a compiler *must*
          541  +  # always write the preprocessed file to stdout, regardless of -o,
          542  +  # because we must use -o when running libtool.
          543  +  "$@" || exit $?
          544  +  IFS=" "
          545  +  for arg
          546  +  do
          547  +    case "$arg" in
          548  +    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
          549  +	set fnord "$@"
          550  +	shift
          551  +	shift
          552  +	;;
          553  +    *)
          554  +	set fnord "$@" "$arg"
          555  +	shift
          556  +	shift
          557  +	;;
          558  +    esac
          559  +  done
          560  +  "$@" -E |
          561  +  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
          562  +  rm -f "$depfile"
          563  +  echo "$object : \\" > "$depfile"
          564  +  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
          565  +  echo "	" >> "$depfile"
          566  +  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
          567  +  rm -f "$tmpdepfile"
          568  +  ;;
          569  +
          570  +none)
          571  +  exec "$@"
          572  +  ;;
          573  +
          574  +*)
          575  +  echo "Unknown depmode $depmode" 1>&2
          576  +  exit 1
          577  +  ;;
          578  +esac
          579  +
          580  +exit 0
          581  +
          582  +# Local Variables:
          583  +# mode: shell-script
          584  +# sh-indentation: 2
          585  +# eval: (add-hook 'write-file-hooks 'time-stamp)
          586  +# time-stamp-start: "scriptversion="
          587  +# time-stamp-format: "%:y-%02m-%02d.%02H"
          588  +# time-stamp-end: "$"
          589  +# End:

Added epsilon/Makefile.am.

            1  +INCLUDES = -I$(top_srcdir)/lib
            2  +METASOURCES = AUTO
            3  +noinst_LTLIBRARIES = libepsilon.la
            4  +libepsilon_la_SOURCES = bit_io.c checksum.c cobs.c color.c common.c dc_level.c \
            5  +	filter.c filterbank.c libmain.c list.c mem_alloc.c merge_split.c pad.c \
            6  +	resample.c speck.c
            7  +noinst_HEADERS = bit_io.h checksum.h cobs.h color.h common.h daub97lift.h \
            8  +	dc_level.h filter.h filterbank.h libmain.h list.h mem_alloc.h \
            9  +	merge_split.h pad.h resample.h speck.h epsilon.h
           10  +
           11  +EXTRA_DIST = msvc/stdint.h msvc/inttypes.h

Added epsilon/Makefile.in.

            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
            2  +# @configure_input@
            3  +
            4  +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
            6  +# This Makefile.in is free software; the Free Software Foundation
            7  +# gives unlimited permission to copy and/or distribute it,
            8  +# with or without modifications, as long as this notice is preserved.
            9  +
           10  +# This program is distributed in the hope that it will be useful,
           11  +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
           12  +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
           13  +# PARTICULAR PURPOSE.
           14  +
           15  +@SET_MAKE@
           16  +
           17  +
           18  +VPATH = @srcdir@
           19  +pkgdatadir = $(datadir)/@PACKAGE@
           20  +pkglibdir = $(libdir)/@PACKAGE@
           21  +pkgincludedir = $(includedir)/@PACKAGE@
           22  +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
           23  +install_sh_DATA = $(install_sh) -c -m 644
           24  +install_sh_PROGRAM = $(install_sh) -c
           25  +install_sh_SCRIPT = $(install_sh) -c
           26  +INSTALL_HEADER = $(INSTALL_DATA)
           27  +transform = $(program_transform_name)
           28  +NORMAL_INSTALL = :
           29  +PRE_INSTALL = :
           30  +POST_INSTALL = :
           31  +NORMAL_UNINSTALL = :
           32  +PRE_UNINSTALL = :
           33  +POST_UNINSTALL = :
           34  +build_triplet = @build@
           35  +host_triplet = @host@
           36  +subdir = epsilon
           37  +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
           38  +	$(srcdir)/Makefile.in
           39  +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
           40  +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
           41  +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
           42  +	$(ACLOCAL_M4)
           43  +mkinstalldirs = $(install_sh) -d
           44  +CONFIG_CLEAN_FILES =
           45  +LTLIBRARIES = $(noinst_LTLIBRARIES)
           46  +libepsilon_la_LIBADD =
           47  +am_libepsilon_la_OBJECTS = bit_io.lo checksum.lo cobs.lo color.lo \
           48  +	common.lo dc_level.lo filter.lo filterbank.lo libmain.lo \
           49  +	list.lo mem_alloc.lo merge_split.lo pad.lo resample.lo \
           50  +	speck.lo
           51  +libepsilon_la_OBJECTS = $(am_libepsilon_la_OBJECTS)
           52  +DEFAULT_INCLUDES = -I.@am__isrc@
           53  +depcomp = $(SHELL) $(top_srcdir)/depcomp
           54  +am__depfiles_maybe = depfiles
           55  +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
           56  +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
           57  +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
           58  +	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
           59  +	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
           60  +CCLD = $(CC)
           61  +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
           62  +	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
           63  +	$(LDFLAGS) -o $@
           64  +SOURCES = $(libepsilon_la_SOURCES)
           65  +DIST_SOURCES = $(libepsilon_la_SOURCES)
           66  +HEADERS = $(noinst_HEADERS)
           67  +ETAGS = etags
           68  +CTAGS = ctags
           69  +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
           70  +ACLOCAL = @ACLOCAL@
           71  +AMTAR = @AMTAR@
           72  +AR = @AR@
           73  +AS = @AS@
           74  +AUTOCONF = @AUTOCONF@
           75  +AUTOHEADER = @AUTOHEADER@
           76  +AUTOMAKE = @AUTOMAKE@
           77  +AWK = @AWK@
           78  +CC = @CC@
           79  +CCDEPMODE = @CCDEPMODE@
           80  +CFLAGS = @CFLAGS@
           81  +CPP = @CPP@
           82  +CPPFLAGS = @CPPFLAGS@
           83  +CXX = @CXX@
           84  +CXXCPP = @CXXCPP@
           85  +CXXDEPMODE = @CXXDEPMODE@
           86  +CXXFLAGS = @CXXFLAGS@
           87  +CYGPATH_W = @CYGPATH_W@
           88  +DEFS = @DEFS@
           89  +DEPDIR = @DEPDIR@
           90  +DLLTOOL = @DLLTOOL@
           91  +DSYMUTIL = @DSYMUTIL@
           92  +ECHO = @ECHO@
           93  +ECHO_C = @ECHO_C@
           94  +ECHO_N = @ECHO_N@
           95  +ECHO_T = @ECHO_T@
           96  +EGREP = @EGREP@
           97  +EXEEXT = @EXEEXT@
           98  +F77 = @F77@
           99  +FFLAGS = @FFLAGS@
          100  +GREP = @GREP@
          101  +INSTALL = @INSTALL@
          102  +INSTALL_DATA = @INSTALL_DATA@
          103  +INSTALL_PROGRAM = @INSTALL_PROGRAM@
          104  +INSTALL_SCRIPT = @INSTALL_SCRIPT@
          105  +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
          106  +LDFLAGS = @LDFLAGS@
          107  +LIBOBJS = @LIBOBJS@
          108  +LIBS = @LIBS@
          109  +LIBTOOL = @LIBTOOL@
          110  +LN_S = @LN_S@
          111  +LTLIBOBJS = @LTLIBOBJS@
          112  +MAINT = @MAINT@
          113  +MAKEINFO = @MAKEINFO@
          114  +MKDIR_P = @MKDIR_P@
          115  +NMEDIT = @NMEDIT@
          116  +OBJDUMP = @OBJDUMP@
          117  +OBJEXT = @OBJEXT@
          118  +PACKAGE = @PACKAGE@
          119  +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
          120  +PACKAGE_NAME = @PACKAGE_NAME@
          121  +PACKAGE_STRING = @PACKAGE_STRING@
          122  +PACKAGE_TARNAME = @PACKAGE_TARNAME@
          123  +PACKAGE_VERSION = @PACKAGE_VERSION@
          124  +PATH_SEPARATOR = @PATH_SEPARATOR@
          125  +RANLIB = @RANLIB@
          126  +SED = @SED@
          127  +SET_MAKE = @SET_MAKE@
          128  +SHELL = @SHELL@
          129  +STRIP = @STRIP@
          130  +VERSION = @VERSION@
          131  +abs_builddir = @abs_builddir@
          132  +abs_srcdir = @abs_srcdir@
          133  +abs_top_builddir = @abs_top_builddir@
          134  +abs_top_srcdir = @abs_top_srcdir@
          135  +ac_ct_CC = @ac_ct_CC@
          136  +ac_ct_CXX = @ac_ct_CXX@
          137  +ac_ct_F77 = @ac_ct_F77@
          138  +am__include = @am__include@
          139  +am__leading_dot = @am__leading_dot@
          140  +am__quote = @am__quote@
          141  +am__tar = @am__tar@
          142  +am__untar = @am__untar@
          143  +bindir = @bindir@
          144  +build = @build@
          145  +build_alias = @build_alias@
          146  +build_cpu = @build_cpu@
          147  +build_os = @build_os@
          148  +build_vendor = @build_vendor@
          149  +builddir = @builddir@
          150  +datadir = @datadir@
          151  +datarootdir = @datarootdir@
          152  +docdir = @docdir@
          153  +dvidir = @dvidir@
          154  +exec_prefix = @exec_prefix@
          155  +host = @host@
          156  +host_alias = @host_alias@
          157  +host_cpu = @host_cpu@
          158  +host_os = @host_os@
          159  +host_vendor = @host_vendor@
          160  +htmldir = @htmldir@
          161  +includedir = @includedir@
          162  +infodir = @infodir@
          163  +install_sh = @install_sh@
          164  +libdir = @libdir@
          165  +libexecdir = @libexecdir@
          166  +localedir = @localedir@
          167  +localstatedir = @localstatedir@
          168  +mandir = @mandir@
          169  +mkdir_p = @mkdir_p@
          170  +oldincludedir = @oldincludedir@
          171  +pdfdir = @pdfdir@
          172  +prefix = @prefix@
          173  +program_transform_name = @program_transform_name@
          174  +psdir = @psdir@
          175  +sbindir = @sbindir@
          176  +sharedstatedir = @sharedstatedir@
          177  +srcdir = @srcdir@
          178  +sysconfdir = @sysconfdir@
          179  +target_alias = @target_alias@
          180  +top_builddir = @top_builddir@
          181  +top_srcdir = @top_srcdir@
          182  +INCLUDES = -I$(top_srcdir)/lib
          183  +METASOURCES = AUTO
          184  +noinst_LTLIBRARIES = libepsilon.la
          185  +libepsilon_la_SOURCES = bit_io.c checksum.c cobs.c color.c common.c dc_level.c \
          186  +	filter.c filterbank.c libmain.c list.c mem_alloc.c merge_split.c pad.c \
          187  +	resample.c speck.c
          188  +
          189  +noinst_HEADERS = bit_io.h checksum.h cobs.h color.h common.h daub97lift.h \
          190  +	dc_level.h filter.h filterbank.h libmain.h list.h mem_alloc.h \
          191  +	merge_split.h pad.h resample.h speck.h epsilon.h
          192  +
          193  +EXTRA_DIST = msvc/stdint.h msvc/inttypes.h
          194  +all: all-am
          195  +
          196  +.SUFFIXES:
          197  +.SUFFIXES: .c .lo .o .obj
          198  +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
          199  +	@for dep in $?; do \
          200  +	  case '$(am__configure_deps)' in \
          201  +	    *$$dep*) \
          202  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          203  +		&& exit 0; \
          204  +	      exit 1;; \
          205  +	  esac; \
          206  +	done; \
          207  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  epsilon/Makefile'; \
          208  +	cd $(top_srcdir) && \
          209  +	  $(AUTOMAKE) --foreign  epsilon/Makefile
          210  +.PRECIOUS: Makefile
          211  +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          212  +	@case '$?' in \
          213  +	  *config.status*) \
          214  +	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          215  +	  *) \
          216  +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
          217  +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
          218  +	esac;
          219  +
          220  +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
          221  +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
          222  +
          223  +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
          224  +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
          225  +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
          226  +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
          227  +
          228  +clean-noinstLTLIBRARIES:
          229  +	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
          230  +	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
          231  +	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
          232  +	  test "$$dir" != "$$p" || dir=.; \
          233  +	  echo "rm -f \"$${dir}/so_locations\""; \
          234  +	  rm -f "$${dir}/so_locations"; \
          235  +	done
          236  +libepsilon.la: $(libepsilon_la_OBJECTS) $(libepsilon_la_DEPENDENCIES) 
          237  +	$(LINK)  $(libepsilon_la_OBJECTS) $(libepsilon_la_LIBADD) $(LIBS)
          238  +
          239  +mostlyclean-compile:
          240  +	-rm -f *.$(OBJEXT)
          241  +
          242  +distclean-compile:
          243  +	-rm -f *.tab.c
          244  +
          245  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_io.Plo@am__quote@
          246  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksum.Plo@am__quote@
          247  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobs.Plo@am__quote@
          248  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color.Plo@am__quote@
          249  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@
          250  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dc_level.Plo@am__quote@
          251  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Plo@am__quote@
          252  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filterbank.Plo@am__quote@
          253  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmain.Plo@am__quote@
          254  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@
          255  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem_alloc.Plo@am__quote@
          256  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/merge_split.Plo@am__quote@
          257  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pad.Plo@am__quote@
          258  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resample.Plo@am__quote@
          259  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/speck.Plo@am__quote@
          260  +
          261  +.c.o:
          262  +@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
          263  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          264  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
          265  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
          266  +@am__fastdepCC_FALSE@	$(COMPILE) -c $<
          267  +
          268  +.c.obj:
          269  +@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
          270  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          271  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
          272  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
          273  +@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
          274  +
          275  +.c.lo:
          276  +@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
          277  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
          278  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
          279  +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
          280  +@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
          281  +
          282  +mostlyclean-libtool:
          283  +	-rm -f *.lo
          284  +
          285  +clean-libtool:
          286  +	-rm -rf .libs _libs
          287  +
          288  +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
          289  +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
          290  +	unique=`for i in $$list; do \
          291  +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          292  +	  done | \
          293  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
          294  +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
          295  +	mkid -fID $$unique
          296  +tags: TAGS
          297  +
          298  +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          299  +		$(TAGS_FILES) $(LISP)
          300  +	tags=; \
          301  +	here=`pwd`; \
          302  +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
          303  +	unique=`for i in $$list; do \
          304  +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          305  +	  done | \
          306  +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          307  +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
          308  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
          309  +	  test -n "$$unique" || unique=$$empty_fix; \
          310  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          311  +	    $$tags $$unique; \
          312  +	fi
          313  +ctags: CTAGS
          314  +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          315  +		$(TAGS_FILES) $(LISP)
          316  +	tags=; \
          317  +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
          318  +	unique=`for i in $$list; do \
          319  +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          320  +	  done | \
          321  +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          322  +	      END { if (nonempty) { for (i in files) print i; }; }'`; \
          323  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
          324  +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
          325  +	     $$tags $$unique
          326  +
          327  +GTAGS:
          328  +	here=`$(am__cd) $(top_builddir) && pwd` \
          329  +	  && cd $(top_srcdir) \
          330  +	  && gtags -i $(GTAGS_ARGS) $$here
          331  +
          332  +distclean-tags:
          333  +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
          334  +
          335  +distdir: $(DISTFILES)
          336  +	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
          337  +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
          338  +	list='$(DISTFILES)'; \
          339  +	  dist_files=`for file in $$list; do echo $$file; done | \
          340  +	  sed -e "s|^$$srcdirstrip/||;t" \
          341  +	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
          342  +	case $$dist_files in \
          343  +	  */*) $(MKDIR_P) `echo "$$dist_files" | \
          344  +			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
          345  +			   sort -u` ;; \
          346  +	esac; \
          347  +	for file in $$dist_files; do \
          348  +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
          349  +	  if test -d $$d/$$file; then \
          350  +	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
          351  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          352  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
          353  +	    fi; \
          354  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
          355  +	  else \
          356  +	    test -f $(distdir)/$$file \
          357  +	    || cp -p $$d/$$file $(distdir)/$$file \
          358  +	    || exit 1; \
          359  +	  fi; \
          360  +	done
          361  +check-am: all-am
          362  +check: check-am
          363  +all-am: Makefile $(LTLIBRARIES) $(HEADERS)
          364  +installdirs:
          365  +install: install-am
          366  +install-exec: install-exec-am
          367  +install-data: install-data-am
          368  +uninstall: uninstall-am
          369  +
          370  +install-am: all-am
          371  +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
          372  +
          373  +installcheck: installcheck-am
          374  +install-strip:
          375  +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
          376  +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          377  +	  `test -z '$(STRIP)' || \
          378  +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
          379  +mostlyclean-generic:
          380  +
          381  +clean-generic:
          382  +
          383  +distclean-generic:
          384  +	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
          385  +
          386  +maintainer-clean-generic:
          387  +	@echo "This command is intended for maintainers to use"
          388  +	@echo "it deletes files that may require special tools to rebuild."
          389  +clean: clean-am
          390  +
          391  +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
          392  +	mostlyclean-am
          393  +
          394  +distclean: distclean-am
          395  +	-rm -rf ./$(DEPDIR)
          396  +	-rm -f Makefile
          397  +distclean-am: clean-am distclean-compile distclean-generic \
          398  +	distclean-tags
          399  +
          400  +dvi: dvi-am
          401  +
          402  +dvi-am:
          403  +
          404  +html: html-am
          405  +
          406  +info: info-am
          407  +
          408  +info-am:
          409  +
          410  +install-data-am:
          411  +
          412  +install-dvi: install-dvi-am
          413  +
          414  +install-exec-am:
          415  +
          416  +install-html: install-html-am
          417  +
          418  +install-info: install-info-am
          419  +
          420  +install-man:
          421  +
          422  +install-pdf: install-pdf-am
          423  +
          424  +install-ps: install-ps-am
          425  +
          426  +installcheck-am:
          427  +
          428  +maintainer-clean: maintainer-clean-am
          429  +	-rm -rf ./$(DEPDIR)
          430  +	-rm -f Makefile
          431  +maintainer-clean-am: distclean-am maintainer-clean-generic
          432  +
          433  +mostlyclean: mostlyclean-am
          434  +
          435  +mostlyclean-am: mostlyclean-compile mostlyclean-generic \
          436  +	mostlyclean-libtool
          437  +
          438  +pdf: pdf-am
          439  +
          440  +pdf-am:
          441  +
          442  +ps: ps-am
          443  +
          444  +ps-am:
          445  +
          446  +uninstall-am:
          447  +
          448  +.MAKE: install-am install-strip
          449  +
          450  +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
          451  +	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
          452  +	distclean-compile distclean-generic distclean-libtool \
          453  +	distclean-tags distdir dvi dvi-am html html-am info info-am \
          454  +	install install-am install-data install-data-am install-dvi \
          455  +	install-dvi-am install-exec install-exec-am install-html \
          456  +	install-html-am install-info install-info-am install-man \
          457  +	install-pdf install-pdf-am install-ps install-ps-am \
          458  +	install-strip installcheck installcheck-am installdirs \
          459  +	maintainer-clean maintainer-clean-generic mostlyclean \
          460  +	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
          461  +	pdf pdf-am ps ps-am tags uninstall uninstall-am
          462  +
          463  +# Tell versions [3.59,3.63) of GNU make to not export all variables.
          464  +# Otherwise a system limit (for SysV at least) may be exceeded.
          465  +.NOEXPORT:

Added epsilon/bit_io.c.

            1  +/*
            2  + * $Id: bit_io.c,v 1.12 2008/03/25 19:31:44 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <bit_io.h>
           26  +
           27  +void
           28  +init_bits (bit_buffer * bb, unsigned char *buf, int size)
           29  +{
           30  +    assert (size > 0);
           31  +
           32  +    bb->start = bb->next = buf;
           33  +    bb->end = bb->start + size;
           34  +    bb->bits = bb->pending = 0;
           35  +}
           36  +
           37  +int
           38  +write_bits (bit_buffer * bb, int value, int size)
           39  +{
           40  +    assert (size <= 24);
           41  +
           42  +    /* No more space available */
           43  +    if (bb->next >= bb->end)
           44  +      {
           45  +	  return BIT_BUFFER_OVERFLOW;
           46  +      }
           47  +
           48  +    /* Save requested number of bits */
           49  +    bb->bits |= (value << bb->pending);
           50  +    bb->pending += size;
           51  +
           52  +    /* Write complete octets */
           53  +    while (bb->pending >= 8)
           54  +      {
           55  +	  if (bb->next >= bb->end)
           56  +	    {
           57  +		return BIT_BUFFER_OVERFLOW;
           58  +	    }
           59  +
           60  +	  *bb->next++ = (unsigned char) (bb->bits & 0xff);
           61  +
           62  +	  bb->bits >>= 8;
           63  +	  bb->pending -= 8;
           64  +      }
           65  +
           66  +    return BIT_BUFFER_OK;
           67  +}
           68  +
           69  +int
           70  +read_bits (bit_buffer * bb, int *value, int size)
           71  +{
           72  +    assert (size <= 24);
           73  +
           74  +    /* Read missing bytes */
           75  +    while (bb->pending < size)
           76  +      {
           77  +	  if (bb->next >= bb->end)
           78  +	    {
           79  +		return BIT_BUFFER_UNDERFLOW;
           80  +	    }
           81  +
           82  +	  bb->bits |= (*bb->next++ << bb->pending);
           83  +	  bb->pending += 8;
           84  +      }
           85  +
           86  +    *value = bb->bits & (~(~0 << size));
           87  +
           88  +    bb->bits >>= size;
           89  +    bb->pending -= size;
           90  +
           91  +    return BIT_BUFFER_OK;
           92  +}
           93  +
           94  +int
           95  +flush_bits (bit_buffer * bb)
           96  +{
           97  +    if (bb->pending)
           98  +      {
           99  +	  return write_bits (bb, 0UL, 8);
          100  +      }
          101  +    else
          102  +      {
          103  +	  return BIT_BUFFER_OK;
          104  +      }
          105  +}

Added epsilon/bit_io.h.

            1  +/*
            2  + * $Id: bit_io.h,v 1.15 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Bit I/O
           27  + *
           28  + *  This file contains bit I/O routines. */
           29  +
           30  +#ifndef __BIT_IO_H__
           31  +#define __BIT_IO_H__
           32  +
           33  +#ifdef __cplusplus
           34  +extern "C"
           35  +{
           36  +#endif
           37  +
           38  +/** \addtogroup bit_io Bit I/O */
           39  +/*@{*/
           40  +
           41  +#include <common.h>
           42  +
           43  +/** All bits are successfuly processed */
           44  +#define BIT_BUFFER_OK           0
           45  +/** Cannot write bits, output buffer is full */
           46  +#define BIT_BUFFER_OVERFLOW     1
           47  +/** Cannot read bits, input buffer is empty */
           48  +#define BIT_BUFFER_UNDERFLOW    2
           49  +
           50  +/** Bit-buffer structure
           51  + *
           52  + *  This structure represents bit-buffer. */
           53  +    typedef struct bit_buffer_tag
           54  +    {
           55  +    /** Start of buffer */
           56  +	unsigned char *start;
           57  +    /** End of buffer */
           58  +	unsigned char *end;
           59  +    /** Next input/output byte */
           60  +	unsigned char *next;
           61  +    /** Bit buffer */
           62  +	unsigned long bits;
           63  +    /** Pending bits */
           64  +	int pending;
           65  +    } bit_buffer;
           66  +
           67  +/** Write one zero bit */
           68  +#define write_0(_bb)            write_bits(_bb, 0UL, 1)
           69  +/** Write one unity bit */
           70  +#define write_1(_bb)            write_bits(_bb, 1UL, 1)
           71  +/** Read one bit */
           72  +#define read_bit(_bb, _bit)     read_bits(_bb, _bit, 1)
           73  +
           74  +/** Initialize bit-buffer for reading or writting
           75  + *
           76  + *  This function initializes bit-buffer \a bb for reading or
           77  + *  writting bits.
           78  + *
           79  + *  \param bb Bit-buffer to initialize
           80  + *  \param buf Actual input/output buffer
           81  + *  \param size Actual buffer size
           82  + *
           83  + *  \return \c VOID */
           84  +    void init_bits (bit_buffer * bb, unsigned char *buf, int size);
           85  +
           86  +/** Write bits
           87  + *
           88  + *  This function writes \a size least significant bits of
           89  + *  the \a value to the bit-buffer \a bb.
           90  + *
           91  + *  \note The function expects that \a size <= 24.
           92  + *
           93  + *  \param bb Bit-buffer
           94  + *  \param value Bits to write
           95  + *  \param size Number of bits to write
           96  + *
           97  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
           98  +    int write_bits (bit_buffer * bb, int value, int size);
           99  +
          100  +/** Read bits
          101  + *
          102  + *  This function reads \a size least significant bits
          103  + *  from the bit-buffer \a bb  into the \a value argument.
          104  + *
          105  + *  \note Function expects that \a size <= 24.
          106  + *
          107  + *  \param bb Bit-buffer
          108  + *  \param value Location to store the bits
          109  + *  \param size Number of bits to read
          110  + *
          111  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          112  +    int read_bits (bit_buffer * bb, int *value, int size);
          113  +
          114  +/** Flush bits
          115  + *
          116  + *  This function flushes all pending bits if there are any.
          117  + *
          118  + *  \param bb Bit-buffer
          119  + *
          120  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          121  +    int flush_bits (bit_buffer * bb);
          122  +
          123  +/*@}*/
          124  +
          125  +#ifdef __cplusplus
          126  +}
          127  +#endif
          128  +
          129  +#endif				/* __BIT_IO_H__ */

Added epsilon/checksum.c.

            1  +/*
            2  + * $Id: checksum.c,v 1.13 2007/07/21 15:15:25 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <checksum.h>
           26  +
           27  +/* largest prime smaller than 65536 */
           28  +#define BASE 65521
           29  +
           30  +/* NMAX is the largest n such that 255 * n (n + 1) / 2 + (n + 1) * (BASE - 1) <= 2^32 - 1 */
           31  +#define NMAX 5552
           32  +
           33  +/* Loop unrolling hack */
           34  +#define SUM1(data, i) { s1 += data[i]; s2 += s1; }
           35  +#define SUM2(data, i) SUM1(data, i); SUM1(data, i + 1);
           36  +#define SUM4(data, i) SUM2(data, i); SUM2(data, i + 2);
           37  +#define SUM8(data, i) SUM4(data, i); SUM4(data, i + 4);
           38  +#define SUM16(data)   SUM8(data, 0); SUM8(data, 8)
           39  +
           40  +/* CRC32 polynomial */
           41  +#define CRC32_POLY 0xedb88320L
           42  +
           43  +/* CRC32 precalculated table */
           44  +local crc32_t crc32_table[256] = {
           45  +    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
           46  +    0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
           47  +    0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
           48  +    0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
           49  +    0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
           50  +    0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
           51  +    0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
           52  +    0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
           53  +    0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
           54  +    0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
           55  +    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
           56  +    0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
           57  +    0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
           58  +    0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
           59  +    0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
           60  +    0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
           61  +    0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
           62  +    0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
           63  +    0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
           64  +    0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
           65  +    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
           66  +    0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
           67  +    0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
           68  +    0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
           69  +    0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
           70  +    0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
           71  +    0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
           72  +    0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
           73  +    0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
           74  +    0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
           75  +    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
           76  +    0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
           77  +    0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
           78  +    0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
           79  +    0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
           80  +    0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
           81  +    0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
           82  +    0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
           83  +    0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
           84  +    0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
           85  +    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
           86  +    0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
           87  +    0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
           88  +    0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
           89  +    0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
           90  +    0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
           91  +    0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
           92  +    0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
           93  +    0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
           94  +    0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
           95  +    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
           96  +    0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
           97  +    0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
           98  +    0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
           99  +    0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
          100  +    0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
          101  +    0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
          102  +    0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
          103  +    0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
          104  +    0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
          105  +    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
          106  +    0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
          107  +    0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
          108  +    0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
          109  +};
          110  +
          111  +crc32_t
          112  +epsilon_adler32 (unsigned char *data, int length)
          113  +{
          114  +    crc32_t s1 = 1;
          115  +    crc32_t s2 = 0;
          116  +    int k;
          117  +
          118  +    assert (length >= 0);
          119  +
          120  +    if (length == 0)
          121  +      {
          122  +	  return 1;
          123  +      }
          124  +
          125  +    while (length > 0)
          126  +      {
          127  +	  k = length < NMAX ? length : NMAX;
          128  +	  length -= k;
          129  +
          130  +	  while (k >= 16)
          131  +	    {
          132  +		SUM16 (data);
          133  +		data += 16;
          134  +		k -= 16;
          135  +	    }
          136  +
          137  +	  if (k != 0)
          138  +	      do
          139  +		{
          140  +		    s1 += *data++;
          141  +		    s2 += s1;
          142  +		}
          143  +	      while (--k);
          144  +
          145  +	  s1 %= BASE;
          146  +	  s2 %= BASE;
          147  +      }
          148  +
          149  +    return (s2 << 16) | s1;
          150  +}
          151  +
          152  +crc32_t
          153  +epsilon_crc32 (unsigned char *data, int length)
          154  +{
          155  +    crc32_t crc = 0xffffffff;
          156  +    int i;
          157  +    assert (length >= 0);
          158  +
          159  +    for (i = 0; i < length; i++)
          160  +      {
          161  +	  crc = crc32_table[(crc ^ data[i]) & 0xff] ^ (crc >> 8);
          162  +      }
          163  +    return crc ^ 0xffffffff;
          164  +}
          165  +
          166  +/* This auxilliary function is used for CRC-32 table
          167  + * generation. It is not exported or used by the program. */
          168  +local void
          169  +make_crc32_table (void)
          170  +{
          171  +    crc32_t crc;
          172  +    int n, k;
          173  +
          174  +    printf ("local crc32_t crc32_table[256] = {\n");
          175  +
          176  +    for (n = 0; n < 256; n++)
          177  +      {
          178  +	  crc = (crc32_t) n;
          179  +
          180  +	  for (k = 0; k < 8; k++)
          181  +	    {
          182  +		if (crc & 1)
          183  +		  {
          184  +		      crc = CRC32_POLY ^ (crc >> 1);
          185  +		  }
          186  +		else
          187  +		  {
          188  +		      crc >>= 1;
          189  +		  }
          190  +	    }
          191  +
          192  +	  if ((n & 0x03) == 0)
          193  +	    {
          194  +		printf ("    ");
          195  +	    }
          196  +
          197  +	  printf ("0x%08x,%s", crc, (n & 0x03) == 0x03 ? "" : " ");
          198  +
          199  +	  if ((n & 0x03) == 0x03)
          200  +	    {
          201  +		printf ("\n");
          202  +	    }
          203  +      }
          204  +
          205  +    printf ("};\n");
          206  +}

Added epsilon/checksum.h.

            1  +/*
            2  + * $Id: checksum.h,v 1.13 2007/07/21 15:15:25 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Checksum calculation
           27  + *
           28  + *  This file contains routines for CRC-32 and ADLER-32 checksum
           29  + *  calculation. At the moment program uses only CRC-32 algorithm.
           30  + *
           31  + *  \section References
           32  + *
           33  + *  <a href="http://www.ross.net/crc/">A Painless Guide to CRC Error Detection Algorithms</a><br>
           34  + *  <a href="http://en.wikipedia.org/wiki/CRC32">Wikipedia: CRC-32</a><br>
           35  + *  <a href="http://en.wikipedia.org/wiki/Adler-32">Wikipedia: ADLER-32</a> */
           36  +
           37  +#ifndef __CHECKSUM_H__
           38  +#define __CHECKSUM_H__
           39  +
           40  +#ifdef __cplusplus
           41  +extern "C"
           42  +{
           43  +#endif
           44  +
           45  +/** \addtogroup checksum Checksum calculation */
           46  +/*@{*/
           47  +
           48  +#include <common.h>
           49  +#include <epsilon.h>
           50  +
           51  +/** Compute ADLER-32 checksum
           52  + *
           53  + *  This function computes ADLER-32 checksum.
           54  + *
           55  + *  \param data Data to sum
           56  + *  \param length Data length
           57  + *
           58  + *  \return Checksum */
           59  +    crc32_t epsilon_adler32 (unsigned char *data, int length);
           60  +
           61  +/** Compute CRC-32 checksum
           62  + *
           63  + *  This function computes CRC-32 checksum.
           64  + *
           65  + *  \param data Data to sum
           66  + *  \param length Data length
           67  + *
           68  + *  \return Checksum */
           69  +    crc32_t epsilon_crc32 (unsigned char *data, int length);
           70  +
           71  +/*@}*/
           72  +
           73  +#ifdef __cplusplus
           74  +}
           75  +#endif
           76  +
           77  +#endif				/* __CHECKSUM_H__ */

Added epsilon/cobs.c.

            1  +/*
            2  + * $Id: cobs.c,v 1.12 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <cobs.h>
           26  +
           27  +#define FINISH_BLOCK(_x) (*code_ptr = (_x), \
           28  +                           code_ptr = output_data++, \
           29  +                           code = 0x01)
           30  +
           31  +int
           32  +stuff_data (unsigned char *input_data, unsigned char *output_data,
           33  +	    int input_length, int output_length)
           34  +{
           35  +    unsigned char *input_end = input_data + input_length;
           36  +    unsigned char *output_start = output_data;
           37  +
           38  +    unsigned char *code_ptr = output_data++;
           39  +    unsigned char code = 0x01;
           40  +
           41  +    /* Sanity checks */
           42  +    assert (input_length > 0);
           43  +    assert (output_length >= input_length + input_length / 254 + 1);
           44  +
           45  +    while (input_data < input_end)
           46  +      {
           47  +	  if (*input_data == 0)
           48  +	    {
           49  +		FINISH_BLOCK (code);
           50  +	    }
           51  +	  else
           52  +	    {
           53  +		*output_data++ = *input_data;
           54  +		code++;
           55  +
           56  +		if (code == 0xff)
           57  +		  {
           58  +		      FINISH_BLOCK (code);
           59  +		  }
           60  +	    }
           61  +
           62  +	  input_data++;
           63  +      }
           64  +
           65  +    FINISH_BLOCK (code);
           66  +
           67  +    return output_data - output_start - 1;
           68  +}
           69  +
           70  +int
           71  +unstuff_data (unsigned char *input_data, unsigned char *output_data,
           72  +	      int input_length, int output_length)
           73  +{
           74  +    unsigned char *input_end = input_data + input_length;
           75  +    unsigned char *output_end = output_data + output_length;
           76  +    unsigned char *output_start = output_data;
           77  +
           78  +    /* Sanity checks */
           79  +    assert (input_length > 0);
           80  +    assert (output_length >= input_length);
           81  +
           82  +    while (input_data < input_end)
           83  +      {
           84  +	  int code = *input_data++;
           85  +	  int i;
           86  +
           87  +	  for (i = 1;
           88  +	       (i < code) && (input_data < input_end)
           89  +	       && (output_data < output_end); i++)
           90  +	    {
           91  +		*output_data++ = *input_data++;
           92  +	    }
           93  +
           94  +	  if ((code > 0x00) && (code < 0xff) &&
           95  +	      (input_data < input_end) && (output_data < output_end))
           96  +	    {
           97  +		*output_data++ = 0;
           98  +	    }
           99  +      }
          100  +
          101  +    return output_data - output_start;
          102  +}

Added epsilon/cobs.h.

            1  +/*
            2  + * $Id: cobs.h,v 1.14 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Byte stuffing
           27  + *
           28  + *  This file contains routines for efficient byte stuffing.
           29  + *  The algorithm used here called COBS, which is stands for Consistent
           30  + *  Overhead Byte Stuffing. Byte stuffing is very useful for parallel
           31  + *  image processing and improves overall system robustness.
           32  + *
           33  + *  \section References
           34  + *
           35  + *  Stuart Cheshire and Mary Baker, "Consistent Overhead Byte Stuffing".
           36  + *  IEEE/ACM Transactions on Networking. vol. 7 pp. 159-172 April 1999. */
           37  +
           38  +#ifndef __COBS_H__
           39  +#define __COBS_H__
           40  +
           41  +#ifdef __cplusplus
           42  +extern "C"
           43  +{
           44  +#endif
           45  +
           46  +/** \addtogroup stuffing Byte stuffing */
           47  +/*@{*/
           48  +
           49  +#include <common.h>
           50  +
           51  +/** Byte stuffing
           52  + *
           53  + *  This function performes byte stuffing. All zero-valued
           54  + *  bytes in the \a input_data will be eliminated. The result
           55  + *  will be stored in the \a output_data. This operation involves
           56  + *  some marginal data expansion, no more than 0.4% at worst case.
           57  + *
           58  + *  \param input_data Input data
           59  + *  \param output_data Output data
           60  + *  \param input_length Input data length
           61  + *  \param output_length Output data length
           62  + *
           63  + *  \return Number of bytes actually used in the \a output_data
           64  + *
           65  + *  \note Caller must allocate enough space for the \a output_data
           66  + *  beforehand. This value can be calculated by the following
           67  + *  formula: \a input_length + (\a input_length / 254) + 1. */
           68  +    int stuff_data (unsigned char *input_data, unsigned char *output_data,
           69  +		    int input_length, int output_length);
           70  +
           71  +/** Byte unstuffing
           72  + *
           73  + *  This function is inverse to the previous one. It recovers original data.
           74  + *  The result will be stored in the \a output_data.
           75  + *
           76  + *  \param input_data Input data
           77  + *  \param output_data Output data
           78  + *  \param input_length Input data length
           79  + *  \param output_length Output data length
           80  + *
           81  + *  \return Number of bytes actually used in the \a output_data
           82  + *
           83  + *  \note Caller must allocate enough space for the \a output_data
           84  + *  beforehand. Safe value is \a input_length.  */
           85  +    int unstuff_data (unsigned char *input_data, unsigned char *output_data,
           86  +		      int input_length, int output_length);
           87  +
           88  +/*@}*/
           89  +
           90  +#ifdef __cplusplus
           91  +}
           92  +#endif
           93  +
           94  +#endif				/* __COBS_H__ */

Added epsilon/color.c.

            1  +/*
            2  + * $Id: color.c,v 1.13 2008/03/29 21:37:06 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <color.h>
           26  +
           27  +/* Look-up tables for increase RGB to YCbCr conversion speed */
           28  +
           29  +local double O_299000[256] = {
           30  +    0, 0.299, 0.598, 0.897, 1.196, 1.495, 1.794, 2.093,
           31  +    2.392, 2.691, 2.99, 3.289, 3.588, 3.887, 4.186, 4.485,
           32  +    4.784, 5.083, 5.382, 5.681, 5.98, 6.279, 6.578, 6.877,
           33  +    7.176, 7.475, 7.774, 8.073, 8.372, 8.671, 8.97, 9.269,
           34  +    9.568, 9.867, 10.166, 10.465, 10.764, 11.063, 11.362, 11.661,
           35  +    11.96, 12.259, 12.558, 12.857, 13.156, 13.455, 13.754, 14.053,
           36  +    14.352, 14.651, 14.95, 15.249, 15.548, 15.847, 16.146, 16.445,
           37  +    16.744, 17.043, 17.342, 17.641, 17.94, 18.239, 18.538, 18.837,
           38  +    19.136, 19.435, 19.734, 20.033, 20.332, 20.631, 20.93, 21.229,
           39  +    21.528, 21.827, 22.126, 22.425, 22.724, 23.023, 23.322, 23.621,
           40  +    23.92, 24.219, 24.518, 24.817, 25.116, 25.415, 25.714, 26.013,
           41  +    26.312, 26.611, 26.91, 27.209, 27.508, 27.807, 28.106, 28.405,
           42  +    28.704, 29.003, 29.302, 29.601, 29.9, 30.199, 30.498, 30.797,
           43  +    31.096, 31.395, 31.694, 31.993, 32.292, 32.591, 32.89, 33.189,
           44  +    33.488, 33.787, 34.086, 34.385, 34.684, 34.983, 35.282, 35.581,
           45  +    35.88, 36.179, 36.478, 36.777, 37.076, 37.375, 37.674, 37.973,
           46  +    38.272, 38.571, 38.87, 39.169, 39.468, 39.767, 40.066, 40.365,
           47  +    40.664, 40.963, 41.262, 41.561, 41.86, 42.159, 42.458, 42.757,
           48  +    43.056, 43.355, 43.654, 43.953, 44.252, 44.551, 44.85, 45.149,
           49  +    45.448, 45.747, 46.046, 46.345, 46.644, 46.943, 47.242, 47.541,
           50  +    47.84, 48.139, 48.438, 48.737, 49.036, 49.335, 49.634, 49.933,
           51  +    50.232, 50.531, 50.83, 51.129, 51.428, 51.727, 52.026, 52.325,
           52  +    52.624, 52.923, 53.222, 53.521, 53.82, 54.119, 54.418, 54.717,
           53  +    55.016, 55.315, 55.614, 55.913, 56.212, 56.511, 56.81, 57.109,
           54  +    57.408, 57.707, 58.006, 58.305, 58.604, 58.903, 59.202, 59.501,
           55  +    59.8, 60.099, 60.398, 60.697, 60.996, 61.295, 61.594, 61.893,
           56  +    62.192, 62.491, 62.79, 63.089, 63.388, 63.687, 63.986, 64.285,
           57  +    64.584, 64.883, 65.182, 65.481, 65.78, 66.079, 66.378, 66.677,
           58  +    66.976, 67.275, 67.574, 67.873, 68.172, 68.471, 68.77, 69.069,
           59  +    69.368, 69.667, 69.966, 70.265, 70.564, 70.863, 71.162, 71.461,
           60  +    71.76, 72.059, 72.358, 72.657, 72.956, 73.255, 73.554, 73.853,
           61  +    74.152, 74.451, 74.75, 75.049, 75.348, 75.647, 75.946, 76.245,
           62  +};
           63  +
           64  +local double O_587000[256] = {
           65  +    0, 0.587, 1.174, 1.761, 2.348, 2.935, 3.522, 4.109,
           66  +    4.696, 5.283, 5.87, 6.457, 7.044, 7.631, 8.218, 8.805,
           67  +    9.392, 9.979, 10.566, 11.153, 11.74, 12.327, 12.914, 13.501,
           68  +    14.088, 14.675, 15.262, 15.849, 16.436, 17.023, 17.61, 18.197,
           69  +    18.784, 19.371, 19.958, 20.545, 21.132, 21.719, 22.306, 22.893,
           70  +    23.48, 24.067, 24.654, 25.241, 25.828, 26.415, 27.002, 27.589,
           71  +    28.176, 28.763, 29.35, 29.937, 30.524, 31.111, 31.698, 32.285,
           72  +    32.872, 33.459, 34.046, 34.633, 35.22, 35.807, 36.394, 36.981,
           73  +    37.568, 38.155, 38.742, 39.329, 39.916, 40.503, 41.09, 41.677,
           74  +    42.264, 42.851, 43.438, 44.025, 44.612, 45.199, 45.786, 46.373,
           75  +    46.96, 47.547, 48.134, 48.721, 49.308, 49.895, 50.482, 51.069,
           76  +    51.656, 52.243, 52.83, 53.417, 54.004, 54.591, 55.178, 55.765,
           77  +    56.352, 56.939, 57.526, 58.113, 58.7, 59.287, 59.874, 60.461,
           78  +    61.048, 61.635, 62.222, 62.809, 63.396, 63.983, 64.57, 65.157,
           79  +    65.744, 66.331, 66.918, 67.505, 68.092, 68.679, 69.266, 69.853,
           80  +    70.44, 71.027, 71.614, 72.201, 72.788, 73.375, 73.962, 74.549,
           81  +    75.136, 75.723, 76.31, 76.897, 77.484, 78.071, 78.658, 79.245,
           82  +    79.832, 80.419, 81.006, 81.593, 82.18, 82.767, 83.354, 83.941,
           83  +    84.528, 85.115, 85.702, 86.289, 86.876, 87.463, 88.05, 88.637,
           84  +    89.224, 89.811, 90.398, 90.985, 91.572, 92.159, 92.746, 93.333,
           85  +    93.92, 94.507, 95.094, 95.681, 96.268, 96.855, 97.442, 98.029,
           86  +    98.616, 99.203, 99.79, 100.377, 100.964, 101.551, 102.138, 102.725,
           87  +    103.312, 103.899, 104.486, 105.073, 105.66, 106.247, 106.834, 107.421,
           88  +    108.008, 108.595, 109.182, 109.769, 110.356, 110.943, 111.53, 112.117,
           89  +    112.704, 113.291, 113.878, 114.465, 115.052, 115.639, 116.226, 116.813,
           90  +    117.4, 117.987, 118.574, 119.161, 119.748, 120.335, 120.922, 121.509,
           91  +    122.096, 122.683, 123.27, 123.857, 124.444, 125.031, 125.618, 126.205,
           92  +    126.792, 127.379, 127.966, 128.553, 129.14, 129.727, 130.314, 130.901,
           93  +    131.488, 132.075, 132.662, 133.249, 133.836, 134.423, 135.01, 135.597,
           94  +    136.184, 136.771, 137.358, 137.945, 138.532, 139.119, 139.706, 140.293,
           95  +    140.88, 141.467, 142.054, 142.641, 143.228, 143.815, 144.402, 144.989,
           96  +    145.576, 146.163, 146.75, 147.337, 147.924, 148.511, 149.098, 149.685,
           97  +};
           98  +
           99  +local double O_114000[256] = {
          100  +    0, 0.114, 0.228, 0.342, 0.456, 0.57, 0.684, 0.798,
          101  +    0.912, 1.026, 1.14, 1.254, 1.368, 1.482, 1.596, 1.71,
          102  +    1.824, 1.938, 2.052, 2.166, 2.28, 2.394, 2.508, 2.622,
          103  +    2.736, 2.85, 2.964, 3.078, 3.192, 3.306, 3.42, 3.534,
          104  +    3.648, 3.762, 3.876, 3.99, 4.104, 4.218, 4.332, 4.446,
          105  +    4.56, 4.674, 4.788, 4.902, 5.016, 5.13, 5.244, 5.358,
          106  +    5.472, 5.586, 5.7, 5.814, 5.928, 6.042, 6.156, 6.27,
          107  +    6.384, 6.498, 6.612, 6.726, 6.84, 6.954, 7.068, 7.182,
          108  +    7.296, 7.41, 7.524, 7.638, 7.752, 7.866, 7.98, 8.094,
          109  +    8.208, 8.322, 8.436, 8.55, 8.664, 8.778, 8.892, 9.006,
          110  +    9.12, 9.234, 9.348, 9.462, 9.576, 9.69, 9.804, 9.918,
          111  +    10.032, 10.146, 10.26, 10.374, 10.488, 10.602, 10.716, 10.83,
          112  +    10.944, 11.058, 11.172, 11.286, 11.4, 11.514, 11.628, 11.742,
          113  +    11.856, 11.97, 12.084, 12.198, 12.312, 12.426, 12.54, 12.654,
          114  +    12.768, 12.882, 12.996, 13.11, 13.224, 13.338, 13.452, 13.566,
          115  +    13.68, 13.794, 13.908, 14.022, 14.136, 14.25, 14.364, 14.478,
          116  +    14.592, 14.706, 14.82, 14.934, 15.048, 15.162, 15.276, 15.39,
          117  +    15.504, 15.618, 15.732, 15.846, 15.96, 16.074, 16.188, 16.302,
          118  +    16.416, 16.53, 16.644, 16.758, 16.872, 16.986, 17.1, 17.214,
          119  +    17.328, 17.442, 17.556, 17.67, 17.784, 17.898, 18.012, 18.126,
          120  +    18.24, 18.354, 18.468, 18.582, 18.696, 18.81, 18.924, 19.038,
          121  +    19.152, 19.266, 19.38, 19.494, 19.608, 19.722, 19.836, 19.95,
          122  +    20.064, 20.178, 20.292, 20.406, 20.52, 20.634, 20.748, 20.862,
          123  +    20.976, 21.09, 21.204, 21.318, 21.432, 21.546, 21.66, 21.774,
          124  +    21.888, 22.002, 22.116, 22.23, 22.344, 22.458, 22.572, 22.686,
          125  +    22.8, 22.914, 23.028, 23.142, 23.256, 23.37, 23.484, 23.598,
          126  +    23.712, 23.826, 23.94, 24.054, 24.168, 24.282, 24.396, 24.51,
          127  +    24.624, 24.738, 24.852, 24.966, 25.08, 25.194, 25.308, 25.422,
          128  +    25.536, 25.65, 25.764, 25.878, 25.992, 26.106, 26.22, 26.334,
          129  +    26.448, 26.562, 26.676, 26.79, 26.904, 27.018, 27.132, 27.246,
          130  +    27.36, 27.474, 27.588, 27.702, 27.816, 27.93, 28.044, 28.158,
          131  +    28.272, 28.386, 28.5, 28.614, 28.728, 28.842, 28.956, 29.07,
          132  +};
          133  +
          134  +local double O_168736[256] = {
          135  +    0, 0.168736, 0.337472, 0.506208, 0.674944, 0.84368, 1.01242, 1.18115,
          136  +    1.34989, 1.51862, 1.68736, 1.8561, 2.02483, 2.19357, 2.3623, 2.53104,
          137  +    2.69978, 2.86851, 3.03725, 3.20598, 3.37472, 3.54346, 3.71219, 3.88093,
          138  +    4.04966, 4.2184, 4.38714, 4.55587, 4.72461, 4.89334, 5.06208, 5.23082,
          139  +    5.39955, 5.56829, 5.73702, 5.90576, 6.0745, 6.24323, 6.41197, 6.5807,
          140  +    6.74944, 6.91818, 7.08691, 7.25565, 7.42438, 7.59312, 7.76186, 7.93059,
          141  +    8.09933, 8.26806, 8.4368, 8.60554, 8.77427, 8.94301, 9.11174, 9.28048,
          142  +    9.44922, 9.61795, 9.78669, 9.95542, 10.1242, 10.2929, 10.4616, 10.6304,
          143  +    10.7991, 10.9678, 11.1366, 11.3053, 11.474, 11.6428, 11.8115, 11.9803,
          144  +    12.149, 12.3177, 12.4865, 12.6552, 12.8239, 12.9927, 13.1614, 13.3301,
          145  +    13.4989, 13.6676, 13.8364, 14.0051, 14.1738, 14.3426, 14.5113, 14.68,
          146  +    14.8488, 15.0175, 15.1862, 15.355, 15.5237, 15.6924, 15.8612, 16.0299,
          147  +    16.1987, 16.3674, 16.5361, 16.7049, 16.8736, 17.0423, 17.2111, 17.3798,
          148  +    17.5485, 17.7173, 17.886, 18.0548, 18.2235, 18.3922, 18.561, 18.7297,
          149  +    18.8984, 19.0672, 19.2359, 19.4046, 19.5734, 19.7421, 19.9108, 20.0796,
          150  +    20.2483, 20.4171, 20.5858, 20.7545, 20.9233, 21.092, 21.2607, 21.4295,
          151  +    21.5982, 21.7669, 21.9357, 22.1044, 22.2732, 22.4419, 22.6106, 22.7794,
          152  +    22.9481, 23.1168, 23.2856, 23.4543, 23.623, 23.7918, 23.9605, 24.1292,
          153  +    24.298, 24.4667, 24.6355, 24.8042, 24.9729, 25.1417, 25.3104, 25.4791,
          154  +    25.6479, 25.8166, 25.9853, 26.1541, 26.3228, 26.4916, 26.6603, 26.829,
          155  +    26.9978, 27.1665, 27.3352, 27.504, 27.6727, 27.8414, 28.0102, 28.1789,
          156  +    28.3476, 28.5164, 28.6851, 28.8539, 29.0226, 29.1913, 29.3601, 29.5288,
          157  +    29.6975, 29.8663, 30.035, 30.2037, 30.3725, 30.5412, 30.71, 30.8787,
          158  +    31.0474, 31.2162, 31.3849, 31.5536, 31.7224, 31.8911, 32.0598, 32.2286,
          159  +    32.3973, 32.566, 32.7348, 32.9035, 33.0723, 33.241, 33.4097, 33.5785,
          160  +    33.7472, 33.9159, 34.0847, 34.2534, 34.4221, 34.5909, 34.7596, 34.9284,
          161  +    35.0971, 35.2658, 35.4346, 35.6033, 35.772, 35.9408, 36.1095, 36.2782,
          162  +    36.447, 36.6157, 36.7844, 36.9532, 37.1219, 37.2907, 37.4594, 37.6281,
          163  +    37.7969, 37.9656, 38.1343, 38.3031, 38.4718, 38.6405, 38.8093, 38.978,
          164  +    39.1468, 39.3155, 39.4842, 39.653, 39.8217, 39.9904, 40.1592, 40.3279,
          165  +    40.4966, 40.6654, 40.8341, 41.0028, 41.1716, 41.3403, 41.5091, 41.6778,
          166  +    41.8465, 42.0153, 42.184, 42.3527, 42.5215, 42.6902, 42.8589, 43.0277,
          167  +};
          168  +
          169  +local double O_331264[256] = {
          170  +    0, 0.331264, 0.662528, 0.993792, 1.32506, 1.65632, 1.98758, 2.31885,
          171  +    2.65011, 2.98138, 3.31264, 3.6439, 3.97517, 4.30643, 4.6377, 4.96896,
          172  +    5.30022, 5.63149, 5.96275, 6.29402, 6.62528, 6.95654, 7.28781, 7.61907,
          173  +    7.95034, 8.2816, 8.61286, 8.94413, 9.27539, 9.60666, 9.93792, 10.2692,
          174  +    10.6004, 10.9317, 11.263, 11.5942, 11.9255, 12.2568, 12.588, 12.9193,
          175  +    13.2506, 13.5818, 13.9131, 14.2444, 14.5756, 14.9069, 15.2381, 15.5694,
          176  +    15.9007, 16.2319, 16.5632, 16.8945, 17.2257, 17.557, 17.8883, 18.2195,
          177  +    18.5508, 18.882, 19.2133, 19.5446, 19.8758, 20.2071, 20.5384, 20.8696,
          178  +    21.2009, 21.5322, 21.8634, 22.1947, 22.526, 22.8572, 23.1885, 23.5197,
          179  +    23.851, 24.1823, 24.5135, 24.8448, 25.1761, 25.5073, 25.8386, 26.1699,
          180  +    26.5011, 26.8324, 27.1636, 27.4949, 27.8262, 28.1574, 28.4887, 28.82,
          181  +    29.1512, 29.4825, 29.8138, 30.145, 30.4763, 30.8076, 31.1388, 31.4701,
          182  +    31.8013, 32.1326, 32.4639, 32.7951, 33.1264, 33.4577, 33.7889, 34.1202,
          183  +    34.4515, 34.7827, 35.114, 35.4452, 35.7765, 36.1078, 36.439, 36.7703,
          184  +    37.1016, 37.4328, 37.7641, 38.0954, 38.4266, 38.7579, 39.0892, 39.4204,
          185  +    39.7517, 40.0829, 40.4142, 40.7455, 41.0767, 41.408, 41.7393, 42.0705,
          186  +    42.4018, 42.7331, 43.0643, 43.3956, 43.7268, 44.0581, 44.3894, 44.7206,
          187  +    45.0519, 45.3832, 45.7144, 46.0457, 46.377, 46.7082, 47.0395, 47.3708,
          188  +    47.702, 48.0333, 48.3645, 48.6958, 49.0271, 49.3583, 49.6896, 50.0209,
          189  +    50.3521, 50.6834, 51.0147, 51.3459, 51.6772, 52.0084, 52.3397, 52.671,
          190  +    53.0022, 53.3335, 53.6648, 53.996, 54.3273, 54.6586, 54.9898, 55.3211,
          191  +    55.6524, 55.9836, 56.3149, 56.6461, 56.9774, 57.3087, 57.6399, 57.9712,
          192  +    58.3025, 58.6337, 58.965, 59.2963, 59.6275, 59.9588, 60.29, 60.6213,
          193  +    60.9526, 61.2838, 61.6151, 61.9464, 62.2776, 62.6089, 62.9402, 63.2714,
          194  +    63.6027, 63.934, 64.2652, 64.5965, 64.9277, 65.259, 65.5903, 65.9215,
          195  +    66.2528, 66.5841, 66.9153, 67.2466, 67.5779, 67.9091, 68.2404, 68.5716,
          196  +    68.9029, 69.2342, 69.5654, 69.8967, 70.228, 70.5592, 70.8905, 71.2218,
          197  +    71.553, 71.8843, 72.2156, 72.5468, 72.8781, 73.2093, 73.5406, 73.8719,
          198  +    74.2031, 74.5344, 74.8657, 75.1969, 75.5282, 75.8595, 76.1907, 76.522,
          199  +    76.8532, 77.1845, 77.5158, 77.847, 78.1783, 78.5096, 78.8408, 79.1721,
          200  +    79.5034, 79.8346, 80.1659, 80.4972, 80.8284, 81.1597, 81.4909, 81.8222,
          201  +    82.1535, 82.4847, 82.816, 83.1473, 83.4785, 83.8098, 84.1411, 84.4723,
          202  +};
          203  +
          204  +local double O_500000[256] = {
          205  +    0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5,
          206  +    4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5,
          207  +    8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5,
          208  +    12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5,
          209  +    16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5,
          210  +    20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5,
          211  +    24, 24.5, 25, 25.5, 26, 26.5, 27, 27.5,
          212  +    28, 28.5, 29, 29.5, 30, 30.5, 31, 31.5,
          213  +    32, 32.5, 33, 33.5, 34, 34.5, 35, 35.5,
          214  +    36, 36.5, 37, 37.5, 38, 38.5, 39, 39.5,
          215  +    40, 40.5, 41, 41.5, 42, 42.5, 43, 43.5,
          216  +    44, 44.5, 45, 45.5, 46, 46.5, 47, 47.5,
          217  +    48, 48.5, 49, 49.5, 50, 50.5, 51, 51.5,
          218  +    52, 52.5, 53, 53.5, 54, 54.5, 55, 55.5,
          219  +    56, 56.5, 57, 57.5, 58, 58.5, 59, 59.5,
          220  +    60, 60.5, 61, 61.5, 62, 62.5, 63, 63.5,
          221  +    64, 64.5, 65, 65.5, 66, 66.5, 67, 67.5,
          222  +    68, 68.5, 69, 69.5, 70, 70.5, 71, 71.5,
          223  +    72, 72.5, 73, 73.5, 74, 74.5, 75, 75.5,
          224  +    76, 76.5, 77, 77.5, 78, 78.5, 79, 79.5,
          225  +    80, 80.5, 81, 81.5, 82, 82.5, 83, 83.5,
          226  +    84, 84.5, 85, 85.5, 86, 86.5, 87, 87.5,
          227  +    88, 88.5, 89, 89.5, 90, 90.5, 91, 91.5,
          228  +    92, 92.5, 93, 93.5, 94, 94.5, 95, 95.5,
          229  +    96, 96.5, 97, 97.5, 98, 98.5, 99, 99.5,
          230  +    100, 100.5, 101, 101.5, 102, 102.5, 103, 103.5,
          231  +    104, 104.5, 105, 105.5, 106, 106.5, 107, 107.5,
          232  +    108, 108.5, 109, 109.5, 110, 110.5, 111, 111.5,
          233  +    112, 112.5, 113, 113.5, 114, 114.5, 115, 115.5,
          234  +    116, 116.5, 117, 117.5, 118, 118.5, 119, 119.5,
          235  +    120, 120.5, 121, 121.5, 122, 122.5, 123, 123.5,
          236  +    124, 124.5, 125, 125.5, 126, 126.5, 127, 127.5,
          237  +};
          238  +
          239  +local double O_418688[256] = {
          240  +    0, 0.418688, 0.837376, 1.25606, 1.67475, 2.09344, 2.51213, 2.93082,
          241  +    3.3495, 3.76819, 4.18688, 4.60557, 5.02426, 5.44294, 5.86163, 6.28032,
          242  +    6.69901, 7.1177, 7.53638, 7.95507, 8.37376, 8.79245, 9.21114, 9.62982,
          243  +    10.0485, 10.4672, 10.8859, 11.3046, 11.7233, 12.142, 12.5606, 12.9793,
          244  +    13.398, 13.8167, 14.2354, 14.6541, 15.0728, 15.4915, 15.9101, 16.3288,
          245  +    16.7475, 17.1662, 17.5849, 18.0036, 18.4223, 18.841, 19.2596, 19.6783,
          246  +    20.097, 20.5157, 20.9344, 21.3531, 21.7718, 22.1905, 22.6092, 23.0278,
          247  +    23.4465, 23.8652, 24.2839, 24.7026, 25.1213, 25.54, 25.9587, 26.3773,
          248  +    26.796, 27.2147, 27.6334, 28.0521, 28.4708, 28.8895, 29.3082, 29.7268,
          249  +    30.1455, 30.5642, 30.9829, 31.4016, 31.8203, 32.239, 32.6577, 33.0764,
          250  +    33.495, 33.9137, 34.3324, 34.7511, 35.1698, 35.5885, 36.0072, 36.4259,
          251  +    36.8445, 37.2632, 37.6819, 38.1006, 38.5193, 38.938, 39.3567, 39.7754,
          252  +    40.194, 40.6127, 41.0314, 41.4501, 41.8688, 42.2875, 42.7062, 43.1249,
          253  +    43.5436, 43.9622, 44.3809, 44.7996, 45.2183, 45.637, 46.0557, 46.4744,
          254  +    46.8931, 47.3117, 47.7304, 48.1491, 48.5678, 48.9865, 49.4052, 49.8239,
          255  +    50.2426, 50.6612, 51.0799, 51.4986, 51.9173, 52.336, 52.7547, 53.1734,
          256  +    53.5921, 54.0108, 54.4294, 54.8481, 55.2668, 55.6855, 56.1042, 56.5229,
          257  +    56.9416, 57.3603, 57.7789, 58.1976, 58.6163, 59.035, 59.4537, 59.8724,
          258  +    60.2911, 60.7098, 61.1284, 61.5471, 61.9658, 62.3845, 62.8032, 63.2219,
          259  +    63.6406, 64.0593, 64.478, 64.8966, 65.3153, 65.734, 66.1527, 66.5714,
          260  +    66.9901, 67.4088, 67.8275, 68.2461, 68.6648, 69.0835, 69.5022, 69.9209,
          261  +    70.3396, 70.7583, 71.177, 71.5956, 72.0143, 72.433, 72.8517, 73.2704,
          262  +    73.6891, 74.1078, 74.5265, 74.9452, 75.3638, 75.7825, 76.2012, 76.6199,
          263  +    77.0386, 77.4573, 77.876, 78.2947, 78.7133, 79.132, 79.5507, 79.9694,
          264  +    80.3881, 80.8068, 81.2255, 81.6442, 82.0628, 82.4815, 82.9002, 83.3189,
          265  +    83.7376, 84.1563, 84.575, 84.9937, 85.4124, 85.831, 86.2497, 86.6684,
          266  +    87.0871, 87.5058, 87.9245, 88.3432, 88.7619, 89.1805, 89.5992, 90.0179,
          267  +    90.4366, 90.8553, 91.274, 91.6927, 92.1114, 92.53, 92.9487, 93.3674,
          268  +    93.7861, 94.2048, 94.6235, 95.0422, 95.4609, 95.8796, 96.2982, 96.7169,
          269  +    97.1356, 97.5543, 97.973, 98.3917, 98.8104, 99.2291, 99.6477, 100.066,
          270  +    100.485, 100.904, 101.322, 101.741, 102.16, 102.579, 102.997, 103.416,
          271  +    103.835, 104.253, 104.672, 105.091, 105.509, 105.928, 106.347, 106.765,
          272  +};
          273  +
          274  +local double O_081312[256] = {
          275  +    0, 0.081312, 0.162624, 0.243936, 0.325248, 0.40656, 0.487872, 0.569184,
          276  +    0.650496, 0.731808, 0.81312, 0.894432, 0.975744, 1.05706, 1.13837, 1.21968,
          277  +    1.30099, 1.3823, 1.46362, 1.54493, 1.62624, 1.70755, 1.78886, 1.87018,
          278  +    1.95149, 2.0328, 2.11411, 2.19542, 2.27674, 2.35805, 2.43936, 2.52067,
          279  +    2.60198, 2.6833, 2.76461, 2.84592, 2.92723, 3.00854, 3.08986, 3.17117,
          280  +    3.25248, 3.33379, 3.4151, 3.49642, 3.57773, 3.65904, 3.74035, 3.82166,
          281  +    3.90298, 3.98429, 4.0656, 4.14691, 4.22822, 4.30954, 4.39085, 4.47216,
          282  +    4.55347, 4.63478, 4.7161, 4.79741, 4.87872, 4.96003, 5.04134, 5.12266,
          283  +    5.20397, 5.28528, 5.36659, 5.4479, 5.52922, 5.61053, 5.69184, 5.77315,
          284  +    5.85446, 5.93578, 6.01709, 6.0984, 6.17971, 6.26102, 6.34234, 6.42365,
          285  +    6.50496, 6.58627, 6.66758, 6.7489, 6.83021, 6.91152, 6.99283, 7.07414,
          286  +    7.15546, 7.23677, 7.31808, 7.39939, 7.4807, 7.56202, 7.64333, 7.72464,
          287  +    7.80595, 7.88726, 7.96858, 8.04989, 8.1312, 8.21251, 8.29382, 8.37514,
          288  +    8.45645, 8.53776, 8.61907, 8.70038, 8.7817, 8.86301, 8.94432, 9.02563,
          289  +    9.10694, 9.18826, 9.26957, 9.35088, 9.43219, 9.5135, 9.59482, 9.67613,
          290  +    9.75744, 9.83875, 9.92006, 10.0014, 10.0827, 10.164, 10.2453, 10.3266,
          291  +    10.4079, 10.4892, 10.5706, 10.6519, 10.7332, 10.8145, 10.8958, 10.9771,
          292  +    11.0584, 11.1397, 11.2211, 11.3024, 11.3837, 11.465, 11.5463, 11.6276,
          293  +    11.7089, 11.7902, 11.8716, 11.9529, 12.0342, 12.1155, 12.1968, 12.2781,
          294  +    12.3594, 12.4407, 12.522, 12.6034, 12.6847, 12.766, 12.8473, 12.9286,
          295  +    13.0099, 13.0912, 13.1725, 13.2539, 13.3352, 13.4165, 13.4978, 13.5791,
          296  +    13.6604, 13.7417, 13.823, 13.9044, 13.9857, 14.067, 14.1483, 14.2296,
          297  +    14.3109, 14.3922, 14.4735, 14.5548, 14.6362, 14.7175, 14.7988, 14.8801,
          298  +    14.9614, 15.0427, 15.124, 15.2053, 15.2867, 15.368, 15.4493, 15.5306,
          299  +    15.6119, 15.6932, 15.7745, 15.8558, 15.9372, 16.0185, 16.0998, 16.1811,
          300  +    16.2624, 16.3437, 16.425, 16.5063, 16.5876, 16.669, 16.7503, 16.8316,
          301  +    16.9129, 16.9942, 17.0755, 17.1568, 17.2381, 17.3195, 17.4008, 17.4821,
          302  +    17.5634, 17.6447, 17.726, 17.8073, 17.8886, 17.97, 18.0513, 18.1326,
          303  +    18.2139, 18.2952, 18.3765, 18.4578, 18.5391, 18.6204, 18.7018, 18.7831,
          304  +    18.8644, 18.9457, 19.027, 19.1083, 19.1896, 19.2709, 19.3523, 19.4336,
          305  +    19.5149, 19.5962, 19.6775, 19.7588, 19.8401, 19.9214, 20.0028, 20.0841,
          306  +    20.1654, 20.2467, 20.328, 20.4093, 20.4906, 20.5719, 20.6532, 20.7346,
          307  +};
          308  +
          309  +void
          310  +convert_RGB_to_YCbCr (coeff_t ** R, coeff_t ** G, coeff_t ** B,
          311  +		      coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
          312  +		      int width, int height)
          313  +{
          314  +    int i, j;
          315  +
          316  +    assert (width > 0);
          317  +    assert (height > 0);
          318  +
          319  +    /* Perhaps one should optimize this code with integer-valued
          320  +     * look-up tables. On the other hand, the rest of the program
          321  +     * (e.g. wavelet transform, resampling etc.) still using FPU.
          322  +     * Moreover, additional rounding operation (even with proper
          323  +     * rescaling) will involve some marginal image distortion. */
          324  +    for (i = 0; i < height; i++)
          325  +      {
          326  +	  for (j = 0; j < width; j++)
          327  +	    {
          328  +		int r = (int) R[i][j];
          329  +		int g = (int) G[i][j];
          330  +		int b = (int) B[i][j];
          331  +
          332  +		Y[i][j] = O_299000[r] + O_587000[g] + O_114000[b];
          333  +		Cb[i][j] = -O_168736[r] - O_331264[g] + O_500000[b] + 128.0;
          334  +		Cr[i][j] = O_500000[r] - O_418688[g] - O_081312[b] + 128.0;
          335  +	    }
          336  +      }
          337  +}
          338  +
          339  +void
          340  +convert_YCbCr_to_RGB (coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
          341  +		      coeff_t ** R, coeff_t ** G, coeff_t ** B,
          342  +		      int width, int height)
          343  +{
          344  +    int i, j;
          345  +
          346  +    assert (width > 0);
          347  +    assert (height > 0);
          348  +
          349  +    /* Due to rounding and quantization errors output RGB values
          350  +     * may not be enclosed within [0..255] interval. To solve
          351  +     * this problem the values are clipped after transformation. */
          352  +    for (i = 0; i < height; i++)
          353  +      {
          354  +	  for (j = 0; j < width; j++)
          355  +	    {
          356  +		R[i][j] = CLIP (Y[i][j] + (Cr[i][j] - 128.0) * 1.402);
          357  +		G[i][j] =
          358  +		    CLIP (Y[i][j] - (Cb[i][j] - 128.0) * 0.34413 -
          359  +			  (Cr[i][j] - 128.0) * 0.71414);
          360  +		B[i][j] = CLIP (Y[i][j] + (Cb[i][j] - 128.0) * 1.772);
          361  +	    }
          362  +      }
          363  +}
          364  +
          365  +void
          366  +clip_channel (coeff_t ** channel, int width, int height)
          367  +{
          368  +    int i, j;
          369  +
          370  +    assert (width > 0);
          371  +    assert (height > 0);
          372  +
          373  +    for (i = 0; i < height; i++)
          374  +      {
          375  +	  for (j = 0; j < width; j++)
          376  +	    {
          377  +		channel[i][j] = CLIP (channel[i][j]);
          378  +	    }
          379  +      }
          380  +}

Added epsilon/color.h.

            1  +/*
            2  + * $Id: color.h,v 1.16 2008/03/29 21:37:06 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Color space convertion
           27  + *
           28  + *  This file contains routines for color space conversion.
           29  + *
           30  + *  \section References
           31  + *
           32  + *  International Telecommunications Union, ITU-R BT.601 */
           33  +
           34  +#ifndef __COLOR_H__
           35  +#define __COLOR_H__
           36  +
           37  +#ifdef __cplusplus
           38  +extern "C"
           39  +{
           40  +#endif
           41  +
           42  +/** \addtogroup color Color space conversion */
           43  +/*@{*/
           44  +
           45  +#include <common.h>
           46  +
           47  +/** Round value to the nearest integer */
           48  +#define ROUND(_x)               ((_x) < 0 ? (int) ((_x) - 0.5) : (int) ((_x) + 0.5))
           49  +/** Enclose value in the [0..255] interval */
           50  +#define CLIP(_x)                ((_x) < 0 ? 0 : ((_x) > 255 ? 255 : ROUND((_x))))
           51  +
           52  +/** RGB to YCbCr conversion
           53  + *
           54  + *  This function converts image from RGB to YCbCr color space.
           55  + *
           56  + *  \param R Red channel
           57  + *  \param G Green channel
           58  + *  \param B Blue channel
           59  + *  \param Y Luma channel
           60  + *  \param Cb Chroma-blue channel
           61  + *  \param Cr Chroma-red channel
           62  + *  \param width Image width
           63  + *  \param height Image height
           64  + *
           65  + *  \return \c VOID */
           66  +    void convert_RGB_to_YCbCr (coeff_t ** R, coeff_t ** G, coeff_t ** B,
           67  +			       coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
           68  +			       int width, int height);
           69  +
           70  +/** YCbCr to RGB conversion
           71  + *
           72  + *  This function converts image from YCbCr to RGB color space.
           73  + *
           74  + *  \param Y Luma channel
           75  + *  \param Cb Chroma-blue channel
           76  + *  \param Cr Chroma-red channel
           77  + *  \param R Red channel
           78  + *  \param G Green channel
           79  + *  \param B Blue channel
           80  + *  \param width Image width
           81  + *  \param height Image height
           82  + *
           83  + *  \return \c VOID
           84  + *
           85  + *  \note On return, all values are enclosed within [0..255] interval. */
           86  +    void convert_YCbCr_to_RGB (coeff_t ** Y, coeff_t ** Cb, coeff_t ** Cr,
           87  +			       coeff_t ** R, coeff_t ** G, coeff_t ** B,
           88  +			       int width, int height);
           89  +
           90  +/** Channel clipping
           91  + *
           92  + *  This function encloses (clips) each \a channel value within [0..255] interval
           93  + *  with appropriative rounding.
           94  + *
           95  + *  \param channel Channel to clip
           96  + *  \param width Image width
           97  + *  \param height Image height
           98  + *
           99  + *  \return \c VOID */
          100  +    void clip_channel (coeff_t ** channel, int width, int height);
          101  +
          102  +/*@}*/
          103  +
          104  +#ifdef __cplusplus
          105  +}
          106  +#endif
          107  +
          108  +#endif				/* __COLOR_H__ */

Added epsilon/common.c.

            1  +/*
            2  + * $Id: common.c,v 1.13 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +
           26  +int
           27  +number_of_bits (int value)
           28  +{
           29  +    int bits;
           30  +
           31  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 3));
           32  +    if (bits)
           33  +	return bits + 24;
           34  +
           35  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 2));
           36  +    if (bits)
           37  +	return bits + 16;
           38  +
           39  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 1));
           40  +    if (bits)
           41  +	return bits + 8;
           42  +
           43  +    bits = NUMBER_OF_BITS (GET_BYTE (value, 0));
           44  +    if (bits)
           45  +	return bits;
           46  +
           47  +    return 0;
           48  +}
           49  +
           50  +int
           51  +is_power_of_two (int value)
           52  +{
           53  +    return (value == (1 << (number_of_bits (value) - 1)));
           54  +}

Added epsilon/common.h.

            1  +/*
            2  + * $Id: common.h,v 1.27 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Useful macro and defines
           27  + *
           28  + *  This file contains useful macro and defines which are
           29  + *  common to all library parts. */
           30  +
           31  +#ifndef __COMMON_H__
           32  +#define __COMMON_H__
           33  +
           34  +#ifdef __cplusplus
           35  +extern "C"
           36  +{
           37  +#endif
           38  +
           39  +/** \addtogroup misc Miscellanea */
           40  +/*@{*/
           41  +
           42  +#ifdef HAVE_CONFIG_H
           43  +# include <config.h>
           44  +#endif
           45  +
           46  +#include <stdlib.h>
           47  +#include <stdio.h>
           48  +#include <assert.h>
           49  +#include <sys/types.h>
           50  +
           51  +/** Maximum value */
           52  +#define MAX(_x, _y)             ((_x) > (_y) ? (_x) : (_y))
           53  +/** Minimum value */
           54  +#define MIN(_x, _y)             ((_x) < (_y) ? (_x) : (_y))
           55  +/** Absolute value */
           56  +#define ABS(_x)                 ((_x) >= 0 ? (_x) : -(_x))
           57  +/** Square root */
           58  +#define SQRT2                   1.414213562373095
           59  +/** Very helpful definition */
           60  +#define local                   static
           61  +
           62  +/** Table to speed-up number_of_bits() calculation */
           63  +    local int number_of_bits_table[256] = {
           64  +	0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
           65  +	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
           66  +	6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
           67  +	6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
           68  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           69  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           70  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           71  +	7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
           72  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           73  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           74  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           75  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           76  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           77  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           78  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           79  +	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
           80  +    };
           81  +
           82  +/** Number of bits in a byte value */
           83  +#define NUMBER_OF_BITS(_x) (number_of_bits_table[(_x)])
           84  +/** Extract one byte from integer */
           85  +#define GET_BYTE(_x, _i) (((unsigned char *) &(_x))[(_i)])
           86  +
           87  +/** Type definition for filter coefficients */
           88  +    typedef double coeff_t;
           89  +
           90  +/** Number of bits in the value
           91  + *
           92  + *  This function computes the number of bits in the \a value
           93  + *  (e.g. number_of_bits(13) = 4).
           94  + *
           95  + *  \param value Target value
           96  + *
           97  + *  \return Number of bits */
           98  +    int number_of_bits (int value);
           99  +
          100  +/** Check whether the \a value is a power of two or not
          101  + *
          102  + *  This function checks whether the \a value is a
          103  + *  power of two or not.
          104  + *
          105  + *  \param value Target value
          106  + *
          107  + *  \return \c 1 if \a value is a power of two and \c 0 otherwise */
          108  +    int is_power_of_two (int value);
          109  +
          110  +/*@}*/
          111  +
          112  +#ifdef __cplusplus
          113  +}
          114  +#endif
          115  +
          116  +#endif /* __COMMON_H__ */

Added epsilon/daub97lift.h.

            1  +/*
            2  + * $Id: daub97lift.h,v 1.2 2008/03/29 19:57:31 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Daubechies 9/7 wavelet transform (Lifting)
           27  + *
           28  + *  This file contains lifting implementation of a famous Daubechies 9/7
           29  + *  wavelet transform. Lifting transforms are faster than generic
           30  + *  filter-based counterparts, but they lack uniformity.
           31  + *
           32  + *  \section References
           33  + *
           34  + *  <a href="http://qccpack.sourceforge.net/">QccPack, James E. Fowler</a> */
           35  +
           36  +#ifndef __DAUB97LIFT_H__
           37  +#define __DAUB97LIFT_H__
           38  +
           39  +#ifdef __cplusplus
           40  +extern "C"
           41  +{
           42  +#endif
           43  +
           44  +/** \addtogroup daub97lift Daubechies 9/7 wavelet transform (Lifting) */
           45  +/*@{*/
           46  +
           47  +#ifdef HAVE_CONFIG_H
           48  +# include <config.h>
           49  +#endif
           50  +
           51  +#include <common.h>
           52  +
           53  +/** ALPHA coefficient */
           54  +#define ALPHA     -1.58615986717275
           55  +/** BETA coefficient */
           56  +#define BETA      -0.05297864003258
           57  +/** GAMMA coefficient */
           58  +#define GAMMA      0.88293362717904
           59  +/** DELTA coefficient */
           60  +#define DELTA      0.44350482244527
           61  +/** EPSILON coefficient */
           62  +#define EPSILON    1.14960430535816
           63  +
           64  +/** One dimensional Daubechies 9/7 wavelet decomposition
           65  + *
           66  + *  This function performes one stage of 1D wavelet decomposition
           67  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
           68  + *  stored in \a signal_out. On return, the first half of \a signal_out
           69  + *  will be occupied with lowpass coefficients, the second half - with highpass
           70  + *  coefficients.
           71  + *
           72  + *  \param signal_in Input signal
           73  + *  \param signal_out Output signal
           74  + *  \param signal_length Signal length
           75  + *
           76  + *  \return \c VOID
           77  + *
           78  + *  \note \a signal_length should be even. */
           79  +    inline local void daub97lift_analysis_1D_even (coeff_t * signal_in,
           80  +						   coeff_t * signal_out,
           81  +						   int signal_length);
           82  +
           83  +/** One dimensional wavelet reconstruction
           84  + *
           85  + *  This function performes one stage of 1D wavelet reconstruction
           86  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
           87  + *  stored in \a signal_out.
           88  + *
           89  + *  \param signal_in Input signal
           90  + *  \param signal_out Output signal
           91  + *  \param signal_length Signal length
           92  + *
           93  + *  \return \c VOID
           94  + *
           95  + *  \note \a signal_length should be even. */
           96  +    inline local void daub97lift_synthesis_1D_even (coeff_t * signal_in,
           97  +						    coeff_t * signal_out,
           98  +						    int signal_length);
           99  +
          100  +/** One dimensional Daubechies 9/7 wavelet decomposition
          101  + *
          102  + *  This function performes one stage of 1D wavelet decomposition
          103  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
          104  + *  stored in \a signal_out. On return, the first half of \a signal_out
          105  + *  will be occupied with lowpass coefficients, the second half - with highpass
          106  + *  coefficients.
          107  + *
          108  + *  \param signal_in Input signal
          109  + *  \param signal_out Output signal
          110  + *  \param signal_length Signal length
          111  + *
          112  + *  \return \c VOID
          113  + *
          114  + *  \note \a signal_length should be odd, as a consequence
          115  + *  there will be one extra lowpass coefficient. */
          116  +    inline local void daub97lift_analysis_1D_odd (coeff_t * signal_in,
          117  +						  coeff_t * signal_out,
          118  +						  int signal_length);
          119  +
          120  +/** One dimensional wavelet reconstruction
          121  + *
          122  + *  This function performes one stage of 1D wavelet reconstruction
          123  + *  of \a signal_in using Daubechies 9/7 lifting transform. The result is
          124  + *  stored in \a signal_out.
          125  + *
          126  + *  \param signal_in Input signal
          127  + *  \param signal_out Output signal
          128  + *  \param signal_length Signal length
          129  + *
          130  + *  \return \c VOID
          131  + *
          132  + *  \note \a signal_length should be odd. */
          133  +    inline local void daub97lift_synthesis_1D_odd (coeff_t * signal_in,
          134  +						   coeff_t * signal_out,
          135  +						   int signal_length);
          136  +
          137  +/* Those functions are placed here in order to be inline-ed */
          138  +
          139  +    inline local void daub97lift_analysis_1D_even (coeff_t * signal_in,
          140  +						   coeff_t * signal_out,
          141  +						   int signal_length)
          142  +    {
          143  +	int i;
          144  +
          145  +	for (i = 1; i < signal_length - 2; i += 2)
          146  +	  {
          147  +	      signal_in[i] += ALPHA * (signal_in[i - 1] + signal_in[i + 1]);
          148  +	  }
          149  +
          150  +	signal_in[signal_length - 1] +=
          151  +	    2 * ALPHA * signal_in[signal_length - 2];
          152  +	signal_in[0] += 2 * BETA * signal_in[1];
          153  +
          154  +	for (i = 2; i < signal_length; i += 2)
          155  +	  {
          156  +	      signal_in[i] += BETA * (signal_in[i + 1] + signal_in[i - 1]);
          157  +	  }
          158  +
          159  +	for (i = 1; i < signal_length - 2; i += 2)
          160  +	  {
          161  +	      signal_in[i] += GAMMA * (signal_in[i - 1] + signal_in[i + 1]);
          162  +	  }
          163  +
          164  +	signal_in[signal_length - 1] +=
          165  +	    2 * GAMMA * signal_in[signal_length - 2];
          166  +	signal_in[0] = EPSILON * (signal_in[0] + 2 * DELTA * signal_in[1]);
          167  +
          168  +	for (i = 2; i < signal_length; i += 2)
          169  +	  {
          170  +	      signal_in[i] =
          171  +		  EPSILON * (signal_in[i] +
          172  +			     DELTA * (signal_in[i + 1] + signal_in[i - 1]));
          173  +	  }
          174  +
          175  +	for (i = 1; i < signal_length; i += 2)
          176  +	  {
          177  +	      signal_in[i] /= (-EPSILON);
          178  +	  }
          179  +
          180  +	{
          181  +	    int half = signal_length / 2;
          182  +	    coeff_t *even = signal_out;
          183  +	    coeff_t *odd = signal_out + half;
          184  +
          185  +	    for (i = 0; i < half; i++)
          186  +	      {
          187  +		  even[i] = signal_in[i * 2];
          188  +		  odd[i] = signal_in[i * 2 + 1];
          189  +	      }
          190  +	}
          191  +    }
          192  +
          193  +    inline local void daub97lift_synthesis_1D_even (coeff_t * signal_in,
          194  +						    coeff_t * signal_out,
          195  +						    int signal_length)
          196  +    {
          197  +	int i;
          198  +
          199  +	{
          200  +	    int half = signal_length / 2;
          201  +	    coeff_t *even = signal_in;
          202  +	    coeff_t *odd = signal_in + half;
          203  +
          204  +	    for (i = 0; i < half; i++)
          205  +	      {
          206  +		  signal_out[i * 2] = even[i];
          207  +		  signal_out[i * 2 + 1] = odd[i];
          208  +	      }
          209  +	}
          210  +
          211  +	for (i = 1; i < signal_length; i += 2)
          212  +	  {
          213  +	      signal_out[i] *= (-EPSILON);
          214  +	  }
          215  +
          216  +	signal_out[0] = signal_out[0] / EPSILON - 2 * DELTA * signal_out[1];
          217  +
          218  +	for (i = 2; i < signal_length; i += 2)
          219  +	  {
          220  +	      signal_out[i] =
          221  +		  signal_out[i] / EPSILON - DELTA * (signal_out[i + 1] +
          222  +						     signal_out[i - 1]);
          223  +	  }
          224  +
          225  +	for (i = 1; i < signal_length - 2; i += 2)
          226  +	  {
          227  +	      signal_out[i] -= GAMMA * (signal_out[i - 1] + signal_out[i + 1]);
          228  +	  }
          229  +
          230  +	signal_out[signal_length - 1] -=
          231  +	    2 * GAMMA * signal_out[signal_length - 2];
          232  +	signal_out[0] -= 2 * BETA * signal_out[1];
          233  +
          234  +	for (i = 2; i < signal_length; i += 2)
          235  +	  {
          236  +	      signal_out[i] -= BETA * (signal_out[i + 1] + signal_out[i - 1]);
          237  +	  }
          238  +
          239  +	for (i = 1; i < signal_length - 2; i += 2)
          240  +	  {
          241  +	      signal_out[i] -= ALPHA * (signal_out[i - 1] + signal_out[i + 1]);
          242  +	  }
          243  +
          244  +	signal_out[signal_length - 1] -=
          245  +	    2 * ALPHA * signal_out[signal_length - 2];
          246  +    }
          247  +
          248  +    inline local void daub97lift_analysis_1D_odd (coeff_t * signal_in,
          249  +						  coeff_t * signal_out,
          250  +						  int signal_length)
          251  +    {
          252  +	int i;
          253  +
          254  +	for (i = 1; i < signal_length - 1; i += 2)
          255  +	  {
          256  +	      signal_in[i] += ALPHA * (signal_in[i - 1] + signal_in[i + 1]);
          257  +	  }
          258  +
          259  +	signal_in[0] += 2 * BETA * signal_in[1];
          260  +
          261  +	for (i = 2; i < signal_length - 2; i += 2)
          262  +	  {
          263  +	      signal_in[i] += BETA * (signal_in[i + 1] + signal_in[i - 1]);
          264  +	  }
          265  +
          266  +	signal_in[signal_length - 1] += 2 * BETA * signal_in[signal_length - 2];
          267  +
          268  +	for (i = 1; i < signal_length - 1; i += 2)
          269  +	  {
          270  +	      signal_in[i] += GAMMA * (signal_in[i - 1] + signal_in[i + 1]);
          271  +	  }
          272  +
          273  +	signal_in[0] = EPSILON * (signal_in[0] + 2 * DELTA * signal_in[1]);
          274  +
          275  +	for (i = 2; i < signal_length - 2; i += 2)
          276  +	  {
          277  +	      signal_in[i] =
          278  +		  EPSILON * (signal_in[i] +
          279  +			     DELTA * (signal_in[i + 1] + signal_in[i - 1]));
          280  +	  }
          281  +
          282  +	signal_in[signal_length - 1] = EPSILON * (signal_in[signal_length - 1] +
          283  +						  2 * DELTA *
          284  +						  signal_in[signal_length - 2]);
          285  +
          286  +	for (i = 1; i < signal_length - 1; i += 2)
          287  +	  {
          288  +	      signal_in[i] /= (-EPSILON);
          289  +	  }
          290  +
          291  +	{
          292  +	    int half = signal_length / 2 + 1;
          293  +	    coeff_t *even = signal_out;
          294  +	    coeff_t *odd = signal_out + half;
          295  +
          296  +	    for (i = 0; i < half - 1; i++)
          297  +	      {
          298  +		  even[i] = signal_in[i * 2];
          299  +		  odd[i] = signal_in[i * 2 + 1];
          300  +	      }
          301  +
          302  +	    even[half - 1] = signal_in[signal_length - 1];
          303  +	}
          304  +    }
          305  +
          306  +    inline local void daub97lift_synthesis_1D_odd (coeff_t * signal_in,
          307  +						   coeff_t * signal_out,
          308  +						   int signal_length)
          309  +    {
          310  +	int i;
          311  +
          312  +	{
          313  +	    int half = signal_length / 2 + 1;
          314  +	    coeff_t *even = signal_in;
          315  +	    coeff_t *odd = signal_in + half;
          316  +
          317  +	    for (i = 0; i < half - 1; i++)
          318  +	      {
          319  +		  signal_out[i * 2] = even[i];
          320  +		  signal_out[i * 2 + 1] = odd[i];
          321  +	      }
          322  +
          323  +	    signal_out[signal_length - 1] = even[half - 1];
          324  +	}
          325  +
          326  +	for (i = 1; i < signal_length - 1; i += 2)
          327  +	  {
          328  +	      signal_out[i] *= (-EPSILON);
          329  +	  }
          330  +
          331  +	signal_out[0] = signal_out[0] / EPSILON - 2 * DELTA * signal_out[1];
          332  +
          333  +	for (i = 2; i < signal_length - 2; i += 2)
          334  +	  {
          335  +	      signal_out[i] =
          336  +		  signal_out[i] / EPSILON - DELTA * (signal_out[i + 1] +
          337  +						     signal_out[i - 1]);
          338  +	  }
          339  +
          340  +	signal_out[signal_length - 1] =
          341  +	    signal_out[signal_length - 1] / EPSILON -
          342  +	    2 * DELTA * signal_out[signal_length - 2];
          343  +
          344  +	for (i = 1; i < signal_length - 1; i += 2)
          345  +	  {
          346  +	      signal_out[i] -= GAMMA * (signal_out[i - 1] + signal_out[i + 1]);
          347  +	  }
          348  +
          349  +	signal_out[0] -= 2 * BETA * signal_out[1];
          350  +
          351  +	for (i = 2; i < signal_length - 2; i += 2)
          352  +	  {
          353  +	      signal_out[i] -= BETA * (signal_out[i + 1] + signal_out[i - 1]);
          354  +	  }
          355  +
          356  +	signal_out[signal_length - 1] -=
          357  +	    2 * BETA * signal_out[signal_length - 2];
          358  +
          359  +	for (i = 1; i < signal_length - 1; i += 2)
          360  +	  {
          361  +	      signal_out[i] -= ALPHA * (signal_out[i - 1] + signal_out[i + 1]);
          362  +	  }
          363  +    }
          364  +
          365  +/*@}*/
          366  +
          367  +#ifdef __cplusplus
          368  +}
          369  +#endif
          370  +
          371  +#endif /* __DAUB97LIFT_H__ */

Added epsilon/dc_level.c.

            1  +/*
            2  + * $Id: dc_level.c,v 1.9 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <dc_level.h>
           26  +
           27  +coeff_t
           28  +dc_level_shift (coeff_t ** channel, int width, int height)
           29  +{
           30  +    int i, j;
           31  +    coeff_t average = 0.0;
           32  +
           33  +    for (i = 0; i < height; i++)
           34  +      {
           35  +	  for (j = 0; j < width; j++)
           36  +	    {
           37  +		average += channel[i][j];
           38  +	    }
           39  +      }
           40  +
           41  +    average = average / (width * height);
           42  +
           43  +    for (i = 0; i < height; i++)
           44  +      {
           45  +	  for (j = 0; j < width; j++)
           46  +	    {
           47  +		channel[i][j] -= average;
           48  +	    }
           49  +      }
           50  +
           51  +    return average;
           52  +}
           53  +
           54  +void
           55  +dc_level_unshift (coeff_t ** channel, coeff_t average, int width, int height)
           56  +{
           57  +    int i, j;
           58  +
           59  +    for (i = 0; i < height; i++)
           60  +      {
           61  +	  for (j = 0; j < width; j++)
           62  +	    {
           63  +		channel[i][j] += average;
           64  +	    }
           65  +      }
           66  +}

Added epsilon/dc_level.h.

            1  +/*
            2  + * $Id: dc_level.h,v 1.11 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief DC level shift
           27  + *
           28  + *  In order to further improve codec perfomance, input signal must be
           29  + *  centered around zero before applying wavelet transform. One can
           30  + *  accomplish this by subtracting mean value from each image sample.
           31  + *  This preprocessing step results in wavelet coefficient magnitude
           32  + *  decrease, which in turn, reduces number of bits required for
           33  + *  image encoding. After decoding, one have to perform the inverse
           34  + *  operation, i.e. add stored mean value to each reconstructed image sample. */
           35  +
           36  +#ifndef __DC_LEVEL_H__
           37  +#define __DC_LEVEL_H__
           38  +
           39  +#ifdef __cplusplus
           40  +extern "C"
           41  +{
           42  +#endif
           43  +
           44  +/** \addtogroup dc_level DC level shift */
           45  +/*@{*/
           46  +
           47  +#include <common.h>
           48  +
           49  +/** DC level shift
           50  + *
           51  + *  This function subtracts mean value from each image sample.
           52  + *
           53  + *  \param channel Image channel
           54  + *  \param width Image width
           55  + *  \param height Image height
           56  + *
           57  + *  \return Mean value */
           58  +    coeff_t dc_level_shift (coeff_t ** channel, int width, int height);
           59  +
           60  +/** DC level unshift
           61  + *
           62  + *  This function adds stored mean value to each
           63  + *  reconstructed image sample.
           64  + *
           65  + *  \param channel Image channel
           66  + *  \param average Average (mean) value
           67  + *  \param width Image width
           68  + *  \param height Image height
           69  + *
           70  + *  \return \c VOID */
           71  +    void dc_level_unshift (coeff_t ** channel, coeff_t average, int width,
           72  +			   int height);
           73  +
           74  +/*@}*/
           75  +
           76  +#ifdef __cplusplus
           77  +}
           78  +#endif
           79  +
           80  +#endif				/* __DC_LEVEL_H__ */

Added epsilon/epsilon.h.

            1  +/*
            2  + * $Id: epsilon.h,v 1.58 2007/07/22 15:45:02 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Top-level library interface
           27  + *
           28  + *  This file contains top-level library interface. This is the
           29  + *  only header that user program needs to include. */
           30  +
           31  +/** \mainpage EPSILON - wavelet image compression library
           32  + *
           33  + *  \section about_sec About
           34  + *
           35  + *  EPSILON is an OpenSource wavelet image compression library.
           36  + *  The library consists of several independed modules and have
           37  + *  very simple and clear layout. Each module is intensively
           38  + *  tested and carefully documented. This manual can be thought
           39  + *  as an exhaustive library API reference. It covers top-level
           40  + *  library interface as well as library internals. Being included
           41  + *  into the source code the information presented here is
           42  + *  always up to date.
           43  + *
           44  + *  \section contact_sec Contact
           45  + *
           46  + *  Feedback, bug-reports and patches are welcome.
           47  + *  Feel free to write: Alexander Simakov,
           48  + *  &lt;<a href="mailto:xander@entropyware.info">xander@entropyware.info</a>&gt;
           49  + *
           50  + *  <a href="http://epsilon-project.sourceforge.net">http://epsilon-project.sourceforge.net</a><br> */
           51  +
           52  +#ifndef __EPSILON_H__
           53  +#define __EPSILON_H__
           54  +
           55  +#ifdef __cplusplus
           56  +extern "C"
           57  +{
           58  +#endif
           59  +
           60  +#include <inttypes.h>
           61  +
           62  +/** \addtogroup toplevel Top-level library interface */
           63  +/*@{*/
           64  +
           65  +/** Block marker
           66  + *
           67  + *  Each block in the stream should be terminated
           68  + *  with one or more \ref EPS_MARKER values. This
           69  + *  technique greatly improves overall system
           70  + *  robustness and leads to quick stream
           71  + *  resynchronization. */
           72  +#define EPS_MARKER              0x00
           73  +
           74  +/** GRAYSCALE block
           75  + *
           76  + *  This type of blocks is intended for storing grayscale
           77  + *  image data. */
           78  +#define EPS_GRAYSCALE_BLOCK     1
           79  +
           80  +/** TRUECOLOR block
           81  + *
           82  + *  This type of blocks is intended for storing truecolor
           83  + *  image data. */
           84  +#define EPS_TRUECOLOR_BLOCK     2
           85  +
           86  +/** Maximal (recomended) block width and height */
           87  +#define EPS_MAX_BLOCK_SIZE       1024
           88  +/** Minimal (recomended) block width and height */
           89  +#define EPS_MIN_BLOCK_SIZE       32
           90  +
           91  +/** Minimal (mandatory) buffer size for GRAYSCALE block */
           92  +#define EPS_MIN_GRAYSCALE_BUF   256
           93  +/** Maximal (recomended) buffer size for GRAYSCALE block */
           94  +#define EPS_MAX_GRAYSCALE_BUF   2 * EPS_MAX_BLOCK_SIZE * EPS_MAX_BLOCK_SIZE
           95  +/** Minimal (mandatory) buffer size for TRUECOLOR block */
           96  +#define EPS_MIN_TRUECOLOR_BUF   256
           97  +/** Maximal (recomended) buffer size for TRUECOLOR block */
           98  +#define EPS_MAX_TRUECOLOR_BUF   6 * EPS_MAX_BLOCK_SIZE * EPS_MAX_BLOCK_SIZE
           99  +
          100  +/** Normal mode
          101  + *
          102  + *  This mode assumes that image is square and height = width = 2 ^ N. */
          103  +#define EPS_MODE_NORMAL         0
          104  +
          105  +/** OTLPF mode
          106  + *
          107  + *  This mode also assumes that image is square, but height = width = (2 ^ N) + 1.
          108  + *  In a few words, OTLPF is some kind of hack to reduce boundary artefacts
          109  + *  when image is broken into several tiles. Due to mathematical constrains
          110  + *  this method can be applied to biorthogonal filters only. */
          111  +#define EPS_MODE_OTLPF          1
          112  +
          113  +/** Data or header CRC is correct */
          114  +#define EPS_GOOD_CRC            0
          115  +/** Data or header CRC is incorrect */
          116  +#define EPS_BAD_CRC             1
          117  +
          118  +/** Extract all filterbank IDs */
          119  +#define EPS_FB_ID               0
          120  +/** Extract all filterbank names */
          121  +#define EPS_FB_NAME             1
          122  +/** Extract all filterbank orthogonality types */
          123  +#define EPS_FB_TYPE             2
          124  +
          125  +/** Default bit-budget percent for the Y channel */
          126  +#define EPS_Y_RT                90
          127  +/** Default bit-budget percent for the Cb channel */
          128  +#define EPS_Cb_RT               5
          129  +/** Default bit-budget percent for the Cr channel */
          130  +#define EPS_Cr_RT               5
          131  +
          132  +/** Minimal value for bit-budget percent value */
          133  +#define EPS_MIN_RT              1
          134  +/** Maximal value for bit-budget percent value */
          135  +#define EPS_MAX_RT              98
          136  +
          137  +/** Perform no image resampling */
          138  +#define EPS_RESAMPLE_444        0
          139  +/** Resample image according to the 4:2:0 scheme */
          140  +#define EPS_RESAMPLE_420        1
          141  +
          142  +/** Successful operation */
          143  +#define EPS_OK                  0
          144  +/** Incorrect function parameter */
          145  +#define EPS_PARAM_ERROR         1
          146  +/** Incorrect data format */
          147  +#define EPS_FORMAT_ERROR        2
          148  +/** Specified filterbank is not supported */
          149  +#define EPS_UNSUPPORTED_FB      3
          150  +
          151  +/** Type definition for CRC32 value */
          152  +    typedef uint32_t crc32_t;
          153  +
          154  +/** GRAYSCALE block header */
          155  +    typedef struct gs_hdr_tag
          156  +    {
          157  +    /** Image width */
          158  +	int W;
          159  +    /** Image height */
          160  +	int H;
          161  +    /** Block width */
          162  +	int w;
          163  +    /** Block height */
          164  +	int h;
          165  +    /** Block X coordinate */
          166  +	int x;
          167  +    /** Block Y coordinate */
          168  +	int y;
          169  +    /** Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF */
          170  +	int mode;
          171  +    /** DC value */
          172  +	int dc;
          173  +    /** Filterbank ID (should not be modified or released) */
          174  +	char *fb_id;
          175  +    } gs_hdr;
          176  +
          177  +/** TRUECOLOR block header */
          178  +    typedef struct tc_hdr_tag
          179  +    {
          180  +    /** Image width */
          181  +	int W;
          182  +    /** Image height */
          183  +	int H;
          184  +    /** Block width */
          185  +	int w;
          186  +    /** Block height */
          187  +	int h;
          188  +    /** Block X coordinate */
          189  +	int x;
          190  +    /** Block Y coordinate */
          191  +	int y;
          192  +    /** Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF */
          193  +	int mode;
          194  +    /** Either \ref EPS_RESAMPLE_444 or \ref EPS_RESAMPLE_420 */
          195  +	int resample;
          196  +    /** DC value of the Y channel */
          197  +	int dc_Y;
          198  +    /** DC value of the Cb channel */
          199  +	int dc_Cb;
          200  +    /** DC value of the Cr channel */
          201  +	int dc_Cr;
          202  +    /** Initial ratio of the Y channel */
          203  +	int Y_rt;
          204  +    /** Initial ratio of the Cb channel */
          205  +	int Cb_rt;
          206  +    /** Initial ratio of the Cr channel */
          207  +	int Cr_rt;
          208  +    /** Filterbank ID (should not be modified or released) */
          209  +	char *fb_id;
          210  +    } tc_hdr;
          211  +
          212  +/** Generic block header */
          213  +    typedef struct eps_block_header_tag
          214  +    {
          215  +    /** Block type
          216  +     *
          217  +     *  Either \ref EPS_GRAYSCALE_BLOCK or \ref EPS_TRUECOLOR_BLOCK. */
          218  +	int block_type;
          219  +
          220  +    /** Header size in bytes */
          221  +	int hdr_size;
          222  +    /** Data size in bytes */
          223  +	int data_size;
          224  +
          225  +    /** Header CRC */
          226  +	crc32_t chk;
          227  +    /** Data CRC */
          228  +	crc32_t crc;
          229  +
          230  +    /** Header CRC flag
          231  +     *
          232  +     *  Either \ref EPS_GOOD_CRC or \ref EPS_BAD_CRC */
          233  +	int chk_flag;
          234  +    /** Data CRC flag
          235  +     *
          236  +     *  Either \ref EPS_GOOD_CRC or \ref EPS_BAD_CRC */
          237  +	int crc_flag;
          238  +
          239  +	union
          240  +	{
          241  +	/** Special information for GRAYSCALE blocks */
          242  +	    gs_hdr gs;
          243  +	/** Special information for TRUECOLOR blocks */
          244  +	    tc_hdr tc;
          245  +	} uhdr;
          246  +    } eps_block_header;
          247  +
          248  +/** Query available filterbanks
          249  + *
          250  + *  Depending on the \a type parameter this function
          251  + *  composes a \c NULL terminated list of all available
          252  + *  filterbank IDs, names or orthogonality types.
          253  + *
          254  + *  \note The caller should subsequently release allocated list
          255  + *  (using \ref eps_free_fb_info function) when it is no longer
          256  + *  required.
          257  + *
          258  + *  \note The caller should not modify allocated structure.
          259  +
          260  + *  \param type Type of information: either \ref EPS_FB_ID or
          261  + *  \ref EPS_FB_NAME or \ref EPS_FB_TYPE
          262  + *
          263  + *  \return List of strings */
          264  +    char **eps_get_fb_info (int type);
          265  +
          266  +/** Release filterbank information
          267  + *
          268  + *  This function releases filterbank infomation,
          269  + *  allocated by the \ref eps_get_fb_info function.
          270  + *
          271  + *  \param info List of strings
          272  + *
          273  + *  \return \c VOID */
          274  +    void eps_free_fb_info (char **info);
          275  +
          276  +/** Memory allocation
          277  + *
          278  + *  This function allocates one-dimensional array of desired size.
          279  + *
          280  + *  \param size Size in bytes
          281  + *
          282  + *  \return Array pointer
          283  + *
          284  + *  \warning This function halts the program if all virtual memory
          285  + *  is exhausted. */
          286  +    void **eps_xmalloc (int size);
          287  +
          288  +/** 2D-malloc
          289  + *
          290  + *  This function allocates two-dimensional array of desired size.
          291  + *
          292  + *  \param width Array width
          293  + *  \param height Array height
          294  + *  \param size Element size
          295  + *
          296  + *  \return Array pointer
          297  + *
          298  + *  \warning This function halts the program if all virtual memory
          299  + *  is exhausted. */
          300  +    void **eps_malloc_2D (int width, int height, int size);
          301  +
          302  +/** 2D-free
          303  + *
          304  + *  This function releases two-dimensional array allocated by \ref eps_malloc_2D.
          305  + *
          306  + *  \param ptr Array pointer
          307  + *  \param width Array width
          308  + *  \param height Array height
          309  + *
          310  + *  \return \c VOID */
          311  +    void eps_free_2D (void **ptr, int width, int height);
          312  +
          313  +/** Read block header
          314  + *
          315  + *  This function performes a broad range of tasks:
          316  + *
          317  + *  <ul>
          318  + *  <li>Read and parse block header</li>
          319  + *  <li>Check header consistency</li>
          320  + *  <li>Check header and data CRC</li>
          321  + *  <li>Fill special \ref eps_block_header structure with
          322  + *  gathered information (it is worthwhile to mention that
          323  + *  all decoding functions in the library rely on this
          324  + *  structure)</li>
          325  + *  </ul>
          326  + *
          327  + *  The \ref eps_block_header structure consists of two parts:
          328  + *  general part and special part. The first one holds information
          329  + *  that is common for all block types. The second one holds
          330  + *  information that is specific for a particular block type.
          331  + *
          332  + *  \note The data buffer \a buf should hold \b whole block
          333  + *  without markers.
          334  + *
          335  + *  \param buf Data buffer
          336  + *  \param buf_size Buffer size
          337  + *  \param hdr Block header
          338  + *
          339  + *  \return The function returns either \ref EPS_OK (the header
          340  + *  is well-formed, the \a hdr structure is filled appropriately)
          341  + *  or \ref EPS_PARAM_ERROR (your should not get this error
          342  + *  unless you pass a \c NULL pointer, negative buffer size or
          343  + *  something like that) or \ref EPS_FORMAT_ERROR (the header is
          344  + *  malformed, block should be ignored). */
          345  +    int eps_read_block_header (unsigned char *buf, int buf_size,
          346  +			       eps_block_header * hdr);
          347  +
          348  +/** Encode a GRAYSCALE block
          349  + *
          350  + *  This function encodes a signle grayscale image \a block of
          351  + *  size \a w by \a h pixels as block of type \ref EPS_GRAYSCALE_BLOCK.
          352  + *  It is assumed that the \a block is taken from the image of size
          353  + *  \a W by \a H pixels at position (\a x, \a y). All these parameters
          354  + *  should be consistent. The encoded data is stored in the \a buf
          355  + *  of size \a buf_size.
          356  + *
          357  + *  \note The most surprising thing here is that you can choose almost
          358  + *  any (see note below) \a buf_size you wish! Thus you can precisely
          359  + *  control encoding bit-rate. This technique is called embedded coding.
          360  + *  In a few words, any encoded prefix can be used to decode a whole
          361  + *  image. So, you can safely truncate stream at any point.
          362  + *
          363  + *  \note The caller should allocate at least \ref EPS_MIN_GRAYSCALE_BUF
          364  + *  bytes for the \a buf.
          365  + *
          366  + *  \note On successful return, the value pointed by the \a buf_size
          367  + *  will be overwritten with a real amount of bytes used in the
          368  + *  \a buf (it will be less then or equal to the original \a buf_size
          369  + *  value).
          370  + *
          371  + *  \note Depending on the \a mode parameter maximal \a block
          372  + *  width or height is either \ref EPS_MAX_BLOCK_SIZE (if \a mode =
          373  + *  \ref EPS_MODE_NORMAL) or \ref EPS_MAX_BLOCK_SIZE + 1
          374  + *  (if \a mode = \ref EPS_MODE_OTLPF).
          375  + *
          376  + *  \note There is no restrictions on the image size itself.
          377  + *
          378  + *  \note The caller should select a value for the \a fb_id
          379  + *  parameter from the list generated by the \ref eps_get_fb_info
          380  + *  function.
          381  + *
          382  + *  \note The caller should not use orthogonal filterbanks
          383  + *  with \a mode = \ref EPS_MODE_OTLPF. Orthogonality type
          384  + *  can be queried with the \ref eps_get_fb_info function.
          385  + *
          386  + *  \param block Image block
          387  + *  \param W Image width
          388  + *  \param H Image height
          389  + *  \param w Block width
          390  + *  \param h Block height
          391  + *  \param x Block X coordinate
          392  + *  \param y Block Y coordinate
          393  + *  \param buf Buffer
          394  + *  \param buf_size Buffer size
          395  + *  \param fb_id Filterbank ID
          396  + *  \param mode Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF
          397  + *
          398  + *  \return The function returns either \ref EPS_OK (the block is
          399  + *  successfully encoded), or \ref EPS_PARAM_ERROR (one or more
          400  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank with
          401  + *  specified \a fb_id not found). */
          402  +    int eps_encode_grayscale_block (unsigned char **block, int W, int H, int w,
          403  +				    int h, int x, int y, unsigned char *buf,
          404  +				    int *buf_size, char *fb_id, int mode);
          405  +
          406  +/** Decode a GRAYSCALE block
          407  + *
          408  + *  This function decodes a GRAYSCALE image \a block from
          409  + *  the \a buf. Block and image dimensions as well as other
          410  + *  necessary information is taken from the \a hdr structure
          411  + *  filled by the \ref eps_read_block_header function
          412  + *  beforehand.
          413  + *
          414  + *  \note The caller should not invoke this function if the \a buf
          415  + *  contains no data, i.e. \ref eps_block_header::data_size = 0.
          416  + *
          417  + *  \note The caller should allocate an image \a block
          418  + *  beforehand. Block dimensions as well as other information
          419  + *  is available in the \a hdr structure.
          420  + *
          421  + *  \param block Image block
          422  + *  \param buf Buffer
          423  + *  \param hdr Block header
          424  + *
          425  + *  \return The function returns either \ref EPS_OK (the block is
          426  + *  successfully decoded), or \ref EPS_PARAM_ERROR (one or more
          427  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank
          428  + *  used by encoder not found). */
          429  +    int eps_decode_grayscale_block (unsigned char **block, unsigned char *buf,
          430  +				    eps_block_header * hdr);
          431  +
          432  +/** Encode a TRUECOLOR block
          433  + *
          434  + *  This function encodes a generic RGB truecolor image block.
          435  + *  The original RGB data is arranged in three arrays: \a block_R,
          436  + *  \a block_G and \a block_B respectively. All components should
          437  + *  have equal dimensions: \a w by \a h pixels. It is assumed that
          438  + *  the block is taken from the image of size \a W by \a H pixels
          439  + *  at position (\a x, \a y). All these parameters should be
          440  + *  consistent. The encoded data is stored in the \a buf of size
          441  + *  \a buf_size.
          442  + *
          443  + *  \note The most surprising thing here is that you can choose almost
          444  + *  any (see note below) \a buf_size you wish! Thus you can precisely
          445  + *  control encoding bit-rate. This technique is called embedded coding.
          446  + *  In a few words, any encoded prefix can be used to decode a whole
          447  + *  image. So, you can safely truncate stream at any point.
          448  + *
          449  + *  \note The caller should allocate at least \ref EPS_MIN_TRUECOLOR_BUF
          450  + *  bytes for the \a buf.
          451  + *
          452  + *  \note The overall bit-budget available for the encoder is
          453  + *  \a buf_size bytes. The caller should divide it between
          454  + *  three channels (Y, Cb, Cr) using the following parameters:
          455  + *  \a Y_rt, \a Cb_rt and \a Cr_rt. The function will report an
          456  + *  error unless  \a Y_rt + \a Cb_rt + \a Cr_rt equals to 100%.
          457  + *  If no matter you can use default values: \ref EPS_Y_RT,
          458  + *  \ref EPS_Cb_RT and \ref EPS_Cr_RT.
          459  + *
          460  + *  \note On successful return, the value pointed by the \a buf_size
          461  + *  will be overwritten with a real amount of bytes used in the
          462  + *  \a buf (it will be less then or equal to the original \a buf_size
          463  + *  value).
          464  + *
          465  + *  \note Depending on the \a mode parameter maximal block
          466  + *  width or height is either \ref EPS_MAX_BLOCK_SIZE (if \a mode =
          467  + *  \ref EPS_MODE_NORMAL) or \ref EPS_MAX_BLOCK_SIZE + 1
          468  + *  (if \a mode = \ref EPS_MODE_OTLPF).
          469  + *
          470  + *  \note There is no restrictions on the image size itself.
          471  + *
          472  + *  \note The caller should select a value for the \a fb_id
          473  + *  parameter from the list generated by the \ref eps_get_fb_info
          474  + *  function.
          475  + *
          476  + *  \note The caller should not use orthogonal filterbanks
          477  + *  with \a mode = \ref EPS_MODE_OTLPF. Orthogonality type
          478  + *  can be queried with the \ref eps_get_fb_info function.
          479  + *
          480  + *  \param block_R Red component
          481  + *  \param block_G Green component
          482  + *  \param block_B Blue component
          483  + *  \param W Image width
          484  + *  \param H Image height
          485  + *  \param w Block width
          486  + *  \param h Block height
          487  + *  \param x Block X coordinate
          488  + *  \param y Block Y coordinate
          489  + *  \param resample Resampling scheme: either \ref EPS_RESAMPLE_444 or \ref EPS_RESAMPLE_420
          490  + *  \param buf Buffer
          491  + *  \param buf_size Buffer size
          492  + *  \param Y_rt Bit-budget percent for the Y channel
          493  + *  \param Cb_rt Bit-budget percent for the Cb channel
          494  + *  \param Cr_rt Bit-budget percent for the Cr channel
          495  + *  \param fb_id Filterbank ID
          496  + *  \param mode Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF
          497  + *
          498  + *  \return The function returns either \ref EPS_OK (the block is
          499  + *  successfully encoded), or \ref EPS_PARAM_ERROR (one or more
          500  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank
          501  + *  with specified \a fb_id not found). */
          502  +    int eps_encode_truecolor_block (unsigned char **block_R,
          503  +				    unsigned char **block_G,
          504  +				    unsigned char **block_B,
          505  +				    int W, int H, int w, int h,
          506  +				    int x, int y, int resample,
          507  +				    unsigned char *buf, int *buf_size,
          508  +				    int Y_rt, int Cb_rt, int Cr_rt,
          509  +				    char *fb_id, int mode);
          510  +
          511  +/** Decode a TRUECOLOR block
          512  + *
          513  + *  This function decodes a TRUECOLOR image block from
          514  + *  the \a buf. The resulted RGB data will be stored in the
          515  + *  \a block_R, \a block_G, and \a block_B arrays
          516  + *  respectively. Block and image dimensions as well as
          517  + *  other necessary information is taken from the \a hdr
          518  + *  structure filled by the \ref eps_read_block_header
          519  + *  function beforehand.
          520  + *
          521  + *  \note The caller should not invoke this function if the \a buf
          522  + *  contains no data, i.e. \ref eps_block_header::data_size = 0.
          523  + *
          524  + *  \note The caller should allocate \a block_R, \a block_G,
          525  + *  and \a block_B arrays beforehand. Block dimensions as well
          526  + *  as other information is available in the \a hdr structure.
          527  + *
          528  + *  \param block_R Red component
          529  + *  \param block_G Green component
          530  + *  \param block_B Blue component
          531  + *  \param buf Buffer
          532  + *  \param hdr Block header
          533  + *
          534  + *  \return The function returns either \ref EPS_OK (the block is
          535  + *  successfully decoded), or \ref EPS_PARAM_ERROR (one or more
          536  + *  parameters are incorrect) or \ref EPS_UNSUPPORTED_FB (filterbank
          537  + *  used by encoder not found) or \ref EPS_FORMAT_ERROR
          538  + *  (unsupported data format). */
          539  +    int eps_decode_truecolor_block (unsigned char **block_R,
          540  +				    unsigned char **block_G,
          541  +				    unsigned char **block_B,
          542  +				    unsigned char *buf, eps_block_header * hdr);
          543  +
          544  +/** Truncate block
          545  + *
          546  + *  This function truncates already encoded GRAYSCALE
          547  + *  or TRUECOLOR block. Due to embedded encoding
          548  + *  truncation is equivalent to block re-compression.
          549  + *
          550  + *  \param buf_in Input buffer
          551  + *  \param buf_out Output buffer
          552  + *  \param hdr Block header
          553  + *  \param truncate_size Desired truncated block size
          554  + *
          555  + *  \note On successful return, the value pointed by the
          556  + *  \a truncate_size parameter will be overwritten with a
          557  + *  real amount of bytes used in the \a buf_out (it will
          558  + *  be less then or equal to the original \a truncate_size value).
          559  + *
          560  + *  \note Minimal value for the \a truncate_size parameter can be
          561  + *  calculated as MAX(\ref EPS_MIN_GRAYSCALE_BUF, \ref EPS_MIN_TRUECOLOR_BUF).
          562  + *
          563  + *  \return The function returns either \ref EPS_OK (the block is
          564  + *  successfully truncated), or \ref EPS_PARAM_ERROR (one or more
          565  + *  parameters are incorrect). */
          566  +    int eps_truncate_block (unsigned char *buf_in, unsigned char *buf_out,
          567  +			    eps_block_header * hdr, int *truncate_size);
          568  +
          569  +/*@}*/
          570  +
          571  +#ifdef __cplusplus
          572  +}
          573  +#endif
          574  +
          575  +#endif				/* __EPSILON_H__ */

Added epsilon/filter.c.

            1  +/*
            2  + * $Id: filter.c,v 1.18 2008/03/30 07:38:53 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <filter.h>
           26  +#include <filterbank.h>
           27  +#include <daub97lift.h>
           28  +#include <mem_alloc.h>
           29  +#include <string.h>
           30  +
           31  +inline local int
           32  +periodic_extension (int index, int length)
           33  +{
           34  +    if (index >= 0)
           35  +      {
           36  +	  if (index < length)
           37  +	    {
           38  +		return index;
           39  +	    }
           40  +	  else
           41  +	    {
           42  +		return (index % length);
           43  +	    }
           44  +      }
           45  +    else
           46  +      {
           47  +	  return (length - 1 - (ABS (index) - 1) % length);
           48  +      }
           49  +}
           50  +
           51  +inline local int
           52  +symmetric_W_extension (int index, int length)
           53  +{
           54  +    if ((index >= 0) && (index < length))
           55  +      {
           56  +	  return index;
           57  +      }
           58  +
           59  +    if (length == 1)
           60  +      {
           61  +	  return 0;
           62  +      }
           63  +
           64  +    index = ABS (index) % (2 * length - 2);
           65  +
           66  +    if (index >= length)
           67  +      {
           68  +	  index = 2 * length - 2 - index;
           69  +      }
           70  +
           71  +    return index;
           72  +}
           73  +
           74  +inline local int
           75  +symmetric_H_extension (int index, int length)
           76  +{
           77  +    if ((index >= 0) && (index < length))
           78  +      {
           79  +	  return index;
           80  +      }
           81  +
           82  +    if (length == 1)
           83  +      {
           84  +	  return 0;
           85  +      }
           86  +
           87  +    index = (ABS (index) - (index < 0)) % (2 * length);
           88  +
           89  +    if (index >= length)
           90  +      {
           91  +	  index = 2 * length - index - 1;
           92  +      }
           93  +
           94  +    return index;
           95  +}
           96  +
           97  +inline local void
           98  +downsample_signal (coeff_t * input_signal, coeff_t * output_signal,
           99  +		   int input_length, int output_length, int phase)
          100  +{
          101  +    int i, j;
          102  +
          103  +    for (i = phase, j = 0; i < input_length; i += 2, j++)
          104  +      {
          105  +	  output_signal[j] = input_signal[i];
          106  +      }
          107  +}
          108  +
          109  +inline local void
          110  +upsample_signal (coeff_t * input_signal, coeff_t * output_signal,
          111  +		 int input_length, int output_length, int phase)
          112  +{
          113  +    int i, j, k;
          114  +
          115  +    for (i = 0, j = phase; i < input_length; i++, j += 2)
          116  +      {
          117  +	  output_signal[j] = input_signal[i];
          118  +      }
          119  +
          120  +    for (k = phase ^ 1; k < output_length; k += 2)
          121  +      {
          122  +	  output_signal[k] = 0;
          123  +      }
          124  +}
          125  +
          126  +inline local void
          127  +filter_periodic (coeff_t * input_signal, coeff_t * output_signal,
          128  +		 int signal_length, filter_t * filter)
          129  +{
          130  +    int i, j, k;
          131  +
          132  +    switch (filter->causality)
          133  +      {
          134  +      case CAUSAL:
          135  +	  {
          136  +	      for (i = 0; i < signal_length; i += 1)
          137  +		{
          138  +		    output_signal[i] = 0;
          139  +		    for (j = 0; j < filter->length; j++)
          140  +		      {
          141  +			  k = periodic_extension (i - j, signal_length);
          142  +			  output_signal[i] +=
          143  +			      input_signal[k] * filter->coeffs[j];
          144  +		      }
          145  +		}
          146  +
          147  +	      break;
          148  +	  }
          149  +      case ANTICAUSAL:
          150  +	  {
          151  +	      for (i = 0; i < signal_length; i += 2)
          152  +		{
          153  +		    output_signal[i] = 0;
          154  +		    for (j = 0; j < filter->length; j++)
          155  +		      {
          156  +			  k = periodic_extension (i + j, signal_length);
          157  +			  output_signal[i] +=
          158  +			      input_signal[k] * filter->coeffs[filter->length -
          159  +							       j - 1];
          160  +		      }
          161  +		}
          162  +
          163  +	      break;
          164  +	  }
          165  +      default:
          166  +	  {
          167  +	      assert (0);
          168  +	      break;
          169  +	  }
          170  +      }
          171  +}
          172  +
          173  +inline local void
          174  +filter_symmetric (coeff_t * input_signal, coeff_t * output_signal,
          175  +		  int signal_length, filter_t * filter)
          176  +{
          177  +    int i, j, k1, k2;
          178  +
          179  +    switch (filter->causality)
          180  +      {
          181  +      case SYMMETRIC_WHOLE:
          182  +	  {
          183  +	      if (filter->type == LOWPASS_ANALYSIS)
          184  +		{
          185  +		    for (i = 0; i < signal_length; i += 2)
          186  +		      {
          187  +			  output_signal[i] =
          188  +			      input_signal[i] * filter->coeffs[0];
          189  +			  for (j = 1; j < filter->length; j++)
          190  +			    {
          191  +				k1 = symmetric_W_extension (i + j,
          192  +							    signal_length);
          193  +				k2 = symmetric_W_extension (i - j,
          194  +							    signal_length);
          195  +				output_signal[i] +=
          196  +				    (input_signal[k1] +
          197  +				     input_signal[k2]) * filter->coeffs[j];
          198  +			    }
          199  +		      }
          200  +		}
          201  +	      else if (filter->type == HIGHPASS_ANALYSIS)
          202  +		{
          203  +		    for (i = 1; i < signal_length; i += 2)
          204  +		      {
          205  +			  output_signal[i] =
          206  +			      input_signal[i] * filter->coeffs[0];
          207  +			  for (j = 1; j < filter->length; j++)
          208  +			    {
          209  +				k1 = symmetric_W_extension (i + j,
          210  +							    signal_length);
          211  +				k2 = symmetric_W_extension (i - j,
          212  +							    signal_length);
          213  +				output_signal[i] +=
          214  +				    (input_signal[k1] +
          215  +				     input_signal[k2]) * filter->coeffs[j];
          216  +			    }
          217  +		      }
          218  +		}
          219  +	      else
          220  +		{
          221  +		    for (i = 0; i < signal_length; i++)
          222  +		      {
          223  +			  output_signal[i] =
          224  +			      input_signal[i] * filter->coeffs[0];
          225  +			  for (j = 1; j < filter->length; j++)
          226  +			    {
          227  +				k1 = symmetric_W_extension (i + j,
          228  +							    signal_length);
          229  +				k2 = symmetric_W_extension (i - j,
          230  +							    signal_length);
          231  +				output_signal[i] +=
          232  +				    (input_signal[k1] +
          233  +				     input_signal[k2]) * filter->coeffs[j];
          234  +			    }
          235  +		      }
          236  +		}
          237  +
          238  +	      break;
          239  +	  }
          240  +	  /* Some day I hope to add 'case SYMMETRIC_HALF' here */
          241  +      default:
          242  +	  {
          243  +	      assert (0);
          244  +	      break;
          245  +	  }
          246  +      }
          247  +}
          248  +
          249  +local void
          250  +analysis_1D (coeff_t * input_signal, coeff_t * output_signal,
          251  +	     coeff_t * temp, int signal_length, filterbank_t * fb)
          252  +{
          253  +    coeff_t *lowpass;
          254  +    coeff_t *highpass;
          255  +
          256  +    /* Sanity checks */
          257  +    assert (signal_length > 0);
          258  +    assert ((fb->type == BIORTHOGONAL) || ((fb->type == ORTHOGONAL)
          259  +					   && !(signal_length & 1)));
          260  +
          261  +    /* Trivial case */
          262  +    if (signal_length == 1)
          263  +      {
          264  +	  output_signal[0] = input_signal[0] * SQRT2;
          265  +	  return;
          266  +      }
          267  +
          268  +    if (fb->type == ORTHOGONAL)
          269  +      {
          270  +	  lowpass = output_signal;
          271  +	  highpass = output_signal + signal_length / 2;
          272  +
          273  +	  /* Lowpass analysis */
          274  +	  filter_periodic (input_signal, temp, signal_length,
          275  +			   fb->lowpass_analysis);
          276  +	  downsample_signal (temp, lowpass, signal_length, signal_length / 2,
          277  +			     PHASE_EVEN);
          278  +
          279  +	  /* Highpass analysis */
          280  +	  filter_periodic (input_signal, temp, signal_length,
          281  +			   fb->highpass_analysis);
          282  +	  downsample_signal (temp, highpass, signal_length, signal_length / 2,
          283  +			     PHASE_EVEN);
          284  +      }
          285  +    else
          286  +      {
          287  +	  lowpass = output_signal;
          288  +	  highpass = output_signal + signal_length / 2 + (signal_length & 1);
          289  +
          290  +	  /* Lowpass analysis */
          291  +	  filter_symmetric (input_signal, temp, signal_length,
          292  +			    fb->lowpass_analysis);
          293  +	  downsample_signal (temp, lowpass, signal_length,
          294  +			     (signal_length + 1) / 2, PHASE_EVEN);
          295  +
          296  +	  /* Highpass analysis */
          297  +	  filter_symmetric (input_signal, temp, signal_length,
          298  +			    fb->highpass_analysis);
          299  +	  downsample_signal (temp, highpass, signal_length, signal_length / 2,
          300  +			     PHASE_ODD);
          301  +      }
          302  +}
          303  +
          304  +local void
          305  +synthesis_1D (coeff_t * input_signal, coeff_t * output_signal,
          306  +	      coeff_t * temp1, coeff_t * temp2, coeff_t * temp3,
          307  +	      int signal_length, filterbank_t * fb)
          308  +{
          309  +    coeff_t *lowpass;
          310  +    coeff_t *highpass;
          311  +    int i;
          312  +
          313  +    /* Sanity checks */
          314  +    assert (signal_length > 0);
          315  +    assert ((fb->type == BIORTHOGONAL) || ((fb->type == ORTHOGONAL)
          316  +					   && !(signal_length & 1)));
          317  +
          318  +    /* Trivial case */
          319  +    if (signal_length == 1)
          320  +      {
          321  +	  output_signal[0] = input_signal[0] / SQRT2;
          322  +	  return;
          323  +      }
          324  +
          325  +    if (fb->type == ORTHOGONAL)
          326  +      {
          327  +	  lowpass = input_signal;
          328  +	  highpass = input_signal + signal_length / 2;
          329  +
          330  +	  /* Lowpass synthesis */
          331  +	  upsample_signal (lowpass, temp1, signal_length / 2, signal_length,
          332  +			   PHASE_EVEN);
          333  +	  filter_periodic (temp1, temp2, signal_length, fb->lowpass_synthesis);
          334  +
          335  +	  /* Highpass synthesis */
          336  +	  upsample_signal (highpass, temp1, signal_length / 2, signal_length,
          337  +			   PHASE_EVEN);
          338  +	  filter_periodic (temp1, temp3, signal_length, fb->highpass_synthesis);
          339  +      }
          340  +    else
          341  +      {
          342  +	  lowpass = input_signal;
          343  +	  highpass = input_signal + signal_length / 2 + (signal_length & 1);
          344  +
          345  +	  /* Lowpass synthesis */
          346  +	  upsample_signal (lowpass, temp1, (signal_length + 1) / 2,
          347  +			   signal_length, PHASE_EVEN);
          348  +	  filter_symmetric (temp1, temp2, signal_length, fb->lowpass_synthesis);
          349  +
          350  +	  /* Highpass synthesis */
          351  +	  upsample_signal (highpass, temp1, signal_length / 2, signal_length,
          352  +			   PHASE_ODD);
          353  +	  filter_symmetric (temp1, temp3, signal_length,
          354  +			    fb->highpass_synthesis);
          355  +      }
          356  +
          357  +    /* Combine arrays */
          358  +    for (i = 0; i < signal_length; i++)
          359  +      {
          360  +	  output_signal[i] = temp2[i] + temp3[i];
          361  +      }
          362  +}
          363  +
          364  +void
          365  +analysis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          366  +	     int signal_length, int mode, filterbank_t * fb)
          367  +{
          368  +    coeff_t *input;
          369  +    coeff_t *output;
          370  +    coeff_t *temp;
          371  +
          372  +    int scale, length;
          373  +    int scales;
          374  +    int i, j;
          375  +
          376  +    assert (signal_length > 1);
          377  +
          378  +    /* Transform as many times as possible */
          379  +    scales = number_of_bits (signal_length) - 1;
          380  +
          381  +    /* Sanity checks */
          382  +    assert (((mode == MODE_NORMAL) && (signal_length == 1 << scales)) ||
          383  +	    ((mode == MODE_OTLPF) && (signal_length == (1 << scales) + 1)));
          384  +
          385  +    input = xmalloc (signal_length * sizeof (coeff_t));
          386  +    output = xmalloc (signal_length * sizeof (coeff_t));
          387  +    temp = xmalloc (signal_length * sizeof (coeff_t));
          388  +
          389  +    for (i = 0; i < signal_length; i++)
          390  +      {
          391  +	  for (j = 0; j < signal_length; j++)
          392  +	    {
          393  +		output_signal[i][j] = input_signal[i][j];
          394  +	    }
          395  +      }
          396  +
          397  +    /* Transform image */
          398  +    for (scale = 0; scale < scales; scale++)
          399  +      {
          400  +	  length = mode + (1 << (scales - scale));
          401  +
          402  +	  /* Transform rows */
          403  +	  for (i = 0; i < length; i++)
          404  +	    {
          405  +		for (j = 0; j < length; j++)
          406  +		  {
          407  +		      input[j] = output_signal[i][j];
          408  +		  }
          409  +
          410  +		if (!strcmp (fb->id, "daub97lift"))
          411  +		  {
          412  +		      if (length % 2)
          413  +			{
          414  +			    daub97lift_analysis_1D_odd (input, output, length);
          415  +			}
          416  +		      else
          417  +			{
          418  +			    daub97lift_analysis_1D_even (input, output, length);
          419  +			}
          420  +		  }
          421  +		else
          422  +		  {
          423  +		      analysis_1D (input, output, temp, length, fb);
          424  +		  }
          425  +
          426  +		for (j = 0; j < length; j++)
          427  +		  {
          428  +		      output_signal[i][j] = output[j];
          429  +		  }
          430  +	    }
          431  +
          432  +	  /* Transform columns */
          433  +	  for (i = 0; i < length; i++)
          434  +	    {
          435  +		for (j = 0; j < length; j++)
          436  +		  {
          437  +		      input[j] = output_signal[j][i];
          438  +		  }
          439  +
          440  +		if (!strcmp (fb->id, "daub97lift"))
          441  +		  {
          442  +		      if (length % 2)
          443  +			{
          444  +			    daub97lift_analysis_1D_odd (input, output, length);
          445  +			}
          446  +		      else
          447  +			{
          448  +			    daub97lift_analysis_1D_even (input, output, length);
          449  +			}
          450  +		  }
          451  +		else
          452  +		  {
          453  +		      analysis_1D (input, output, temp, length, fb);
          454  +		  }
          455  +
          456  +		for (j = 0; j < length; j++)
          457  +		  {
          458  +		      output_signal[j][i] = output[j];
          459  +		  }
          460  +	    }
          461  +      }
          462  +
          463  +    free (input);
          464  +    free (output);
          465  +    free (temp);
          466  +}
          467  +
          468  +void
          469  +synthesis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          470  +	      int signal_length, int mode, filterbank_t * fb)
          471  +{
          472  +    coeff_t *input;
          473  +    coeff_t *output;
          474  +    coeff_t *temp1;
          475  +    coeff_t *temp2;
          476  +    coeff_t *temp3;
          477  +
          478  +    int scale, length;
          479  +    int scales;
          480  +    int i, j;
          481  +
          482  +    assert (signal_length > 1);
          483  +
          484  +    /* Transform as many times as possible */
          485  +    scales = number_of_bits (signal_length) - 1;
          486  +
          487  +    /* Sanity checks */
          488  +    assert (((mode == MODE_NORMAL) && (signal_length == 1 << scales)) ||
          489  +	    ((mode == MODE_OTLPF) && (signal_length == (1 << scales) + 1)));
          490  +
          491  +    /* Temporary arrays */
          492  +    input = xmalloc (signal_length * sizeof (coeff_t));
          493  +    output = xmalloc (signal_length * sizeof (coeff_t));
          494  +    temp1 = xmalloc (signal_length * sizeof (coeff_t));
          495  +    temp2 = xmalloc (signal_length * sizeof (coeff_t));
          496  +    temp3 = xmalloc (signal_length * sizeof (coeff_t));
          497  +
          498  +    for (i = 0; i < signal_length; i++)
          499  +      {
          500  +	  for (j = 0; j < signal_length; j++)
          501  +	    {
          502  +		output_signal[i][j] = input_signal[i][j];
          503  +	    }
          504  +      }
          505  +
          506  +    /* Transform image */
          507  +    for (scale = 0; scale < scales; scale++)
          508  +      {
          509  +	  length = mode + (1 << (scale + 1));
          510  +
          511  +	  /* Transform rows */
          512  +	  for (i = 0; i < length; i++)
          513  +	    {
          514  +		for (j = 0; j < length; j++)
          515  +		  {
          516  +		      input[j] = output_signal[i][j];
          517  +		  }
          518  +
          519  +		if (!strcmp (fb->id, "daub97lift"))
          520  +		  {
          521  +		      if (length % 2)
          522  +			{
          523  +			    daub97lift_synthesis_1D_odd (input, output, length);
          524  +			}
          525  +		      else
          526  +			{
          527  +			    daub97lift_synthesis_1D_even (input, output,
          528  +							  length);
          529  +			}
          530  +		  }
          531  +		else
          532  +		  {
          533  +		      synthesis_1D (input, output, temp1, temp2, temp3, length,
          534  +				    fb);
          535  +		  }
          536  +
          537  +		for (j = 0; j < length; j++)
          538  +		  {
          539  +		      output_signal[i][j] = output[j];
          540  +		  }
          541  +	    }
          542  +
          543  +	  /* Transform columns */
          544  +	  for (i = 0; i < length; i++)
          545  +	    {
          546  +		for (j = 0; j < length; j++)
          547  +		  {
          548  +		      input[j] = output_signal[j][i];
          549  +		  }
          550  +
          551  +		if (!strcmp (fb->id, "daub97lift"))
          552  +		  {
          553  +		      if (length % 2)
          554  +			{
          555  +			    daub97lift_synthesis_1D_odd (input, output, length);
          556  +			}
          557  +		      else
          558  +			{
          559  +			    daub97lift_synthesis_1D_even (input, output,
          560  +							  length);
          561  +			}
          562  +		  }
          563  +		else
          564  +		  {
          565  +		      synthesis_1D (input, output, temp1, temp2, temp3, length,
          566  +				    fb);
          567  +		  }
          568  +
          569  +		for (j = 0; j < length; j++)
          570  +		  {
          571  +		      output_signal[j][i] = output[j];
          572  +		  }
          573  +	    }
          574  +      }
          575  +
          576  +    /* Release temporary arrays */
          577  +    free (input);
          578  +    free (output);
          579  +    free (temp1);
          580  +    free (temp2);
          581  +    free (temp3);
          582  +}

Added epsilon/filter.h.

            1  +/*
            2  + * $Id: filter.h,v 1.19 2008/03/28 22:52:29 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Signal filtering
           27  + *
           28  + *  Wavelet transform implementation based on filter banks.
           29  + *
           30  + *  \section References
           31  + *
           32  + *  Gilbert Strang, Truong Nguyen "Wavelets and Filter Banks".
           33  + *
           34  + *  Jianxin Wei, Mark Pickering, Michael Frater, John Arnold,
           35  + *  John Boman, Wenjun Zeng "Boundary Artefact Reduction Using
           36  + *  Odd Tile Length and the Low Pass First Convention (OTLPF)". */
           37  +
           38  +#ifndef __FILTER_H__
           39  +#define __FILTER_H__
           40  +
           41  +#ifdef __cplusplus
           42  +extern "C"
           43  +{
           44  +#endif
           45  +
           46  +#if defined(_MSC_VER) && !defined(__cplusplus)
           47  +#define inline	__inline
           48  +#endif				/* not MSVC C compiler */
           49  +
           50  +/** \addtogroup wavelet Wavelet transform */
           51  +/*@{*/
           52  +
           53  +#include <common.h>
           54  +#include <filterbank.h>
           55  +
           56  +/** Normal mode
           57  + *
           58  + *  This mode assumes that image is square and height = width = 2 ^ N. */
           59  +#define MODE_NORMAL             0
           60  +/** OTLPF mode
           61  + *
           62  + *  This mode also assumes that image is square, but height = width = (2 ^ N) + 1.
           63  + *  In a few words, OTLPF is some kind of hack to reduce boundary artefacts
           64  + *  when image is broken into several tiles. Due to mathematical constrains
           65  + *  this method can be applied to biorthogonal filters only. For more
           66  + *  information see references. */
           67  +#define MODE_OTLPF              1
           68  +
           69  +/** Periodic signal extension
           70  + *
           71  + *  This function extends signal in a periodic fashion.
           72  + *  For example: ... 2 3 4 | 1 2 3 4 | 1 2 3 ...
           73  + *  This kind of extension is used with orthogonal filters.
           74  + *
           75  + *  \param index Sample index
           76  + *  \param length Signal length
           77  + *
           78  + *  \return Real sample index within array bounds
           79  + *
           80  + *  \note Actually, signal is not extended as the function name states.
           81  + *  This function just computes real sample index within array bounds. */
           82  +    inline local int periodic_extension (int index, int length);
           83  +
           84  +/** Symmetric-whole signal extension
           85  + *
           86  + *  This function extends signal in symmetric-whole fasion.
           87  + *  For example: ... 4 3 2 | 1 2 3 4 | 3 2 1 ... This kind
           88  + *  of extension is used with biorthogonal filters of odd length.
           89  + *
           90  + *  \param index Sample index
           91  + *  \param length Signal length
           92  + *
           93  + *  \return Real sample index within array bounds
           94  + *
           95  + *  \note Actually, signal is not extended as the function name states.
           96  + *  This function just computes real sample index within array bounds. */
           97  +    inline local int symmetric_W_extension (int index, int length);
           98  +
           99  +/** Symmetric-half signal extension
          100  + *
          101  + *  This function extends signal in symmetric-half fasion.
          102  + *  For example: ... 3 2 1 | 1 2 3 4 | 4 3 2 ... (i.e. boundary
          103  + *  samples are duplicated). This kind of extension is used with
          104  + *  biorthogonal filters of even length.
          105  + *
          106  + *  \param index Sample index
          107  + *  \param length Signal length
          108  + *
          109  + *  \return Real sample index within array bounds
          110  + *
          111  + *  \note Actually, signal is not extended as the function name states.
          112  + *  This function just computes real sample index within array bounds. */
          113  +    inline local int symmetric_H_extension (int index, int length);
          114  +
          115  +/** Signal downsampling
          116  + *
          117  + *  This function downsamples signal by the factor of two. Depending
          118  + *  on \a phase, #PHASE_EVEN or #PHASE_ODD, odd-numbered (1, 3, 5, ...)
          119  + *  or even-numbered (0, 2, 4, ...) samples are rejected respectively.
          120  + *
          121  + *  \param input_signal Input signal
          122  + *  \param output_signal Output signal
          123  + *  \param input_length Input signal length
          124  + *  \param output_length Output signal length
          125  + *  \param phase Downsampling phase
          126  + *
          127  + *  \return \c VOID
          128  + *
          129  + *  \note Caller must allocate enough space for \a output_signal beforehand. */
          130  +    inline local void downsample_signal (coeff_t * input_signal,
          131  +					 coeff_t * output_signal,
          132  +					 int input_length, int output_length,
          133  +					 int phase);
          134  +
          135  +/** Signal upsampling
          136  + *
          137  + *  This function is inverse to the previous one. It inserts zeros between
          138  + *  \a input_signal samples. Depending on \a phase, #PHASE_EVEN or #PHASE_ODD,
          139  + *  zeros are insered into the odd-numbered (1, 3, 5, ...) or
          140  + *  even-numbered (0, 2, 4, ...) positions respectively.
          141  + *
          142  + *  \param input_signal Input signal
          143  + *  \param output_signal Output signal
          144  + *  \param input_length Input signal length
          145  + *  \param output_length Output signal length
          146  + *  \param phase Upsampling phase
          147  + *
          148  + *  \return \c VOID
          149  + *
          150  + *  \note Caller must allocate enough space for \a output_signal beforehand. */
          151  +    inline local void upsample_signal (coeff_t * input_signal,
          152  +				       coeff_t * output_signal,
          153  +				       int input_length, int output_length,
          154  +				       int phase);
          155  +
          156  +/** Periodic signal filtering
          157  + *
          158  + *  This function filters \a input_signal of length \a signal_length
          159  + *  into the \a output_signal using specified \a filter. Boundary
          160  + *  samples are evaluated using peridic extension.
          161  + *
          162  + *  \param input_signal Input signal
          163  + *  \param output_signal Output signal
          164  + *  \param signal_length Signal length
          165  + *  \param filter Filter
          166  + *
          167  + *  \return \c VOID
          168  + *
          169  + *  \note \a filter must be orthogonal.
          170  + *  \note \a signal_length must be even. */
          171  +    inline local void filter_periodic (coeff_t * input_signal,
          172  +				       coeff_t * output_signal,
          173  +				       int signal_length, filter_t * filter);
          174  +
          175  +/** Symmetric signal filtering
          176  + *
          177  + *  This function filters \a input_signal of length \a signal_length
          178  + *  into the \a output_signal using specified \a filter. Boundary
          179  + *  samples are evaluated using symmetric extension.
          180  + *
          181  + *  \param input_signal Input signal
          182  + *  \param output_signal Output signal
          183  + *  \param signal_length Signal length
          184  + *  \param filter Filter
          185  + *
          186  + *  \return \c VOID
          187  + *
          188  + *  \note \a filter must be biorthogonal.
          189  + *  \note \a signal_length can be either even or odd.
          190  + *
          191  + *  \todo Add support for even-length biorthogonal filters. */
          192  +    inline local void filter_symmetric (coeff_t * input_signal,
          193  +					coeff_t * output_signal,
          194  +					int signal_length, filter_t * filter);
          195  +
          196  +/** One dimensional wavelet decomposition
          197  + *
          198  + *  This function performes one stage of 1D wavelet decomposition
          199  + *  of \a input_signal using filter bank \a fb. The result is
          200  + *  stored in \a output_signal. This operation requires one temporary
          201  + *  array of length \a signal_length. On return, the first half of \a output_signal
          202  + *  will be occupied with lowpass coefficients, the second half - with highpass
          203  + *  coefficients.
          204  + *
          205  + *  \param input_signal Input signal
          206  + *  \param output_signal Output signal
          207  + *  \param temp Temporary array
          208  + *  \param signal_length Signal length
          209  + *  \param fb Filter bank
          210  + *
          211  + *  \return \c VOID
          212  + *
          213  + *  \note If \a signal_length is odd and \a fb is biorthogonal, then
          214  + *  there will be one extra lowpass coefficient. */
          215  +    local void analysis_1D (coeff_t * input_signal, coeff_t * output_signal,
          216  +			    coeff_t * temp, int signal_length,
          217  +			    filterbank_t * fb);
          218  +
          219  +/** One dimensional wavelet reconstruction
          220  + *
          221  + *  This function performes one stage of 1D wavelet reconstruction
          222  + *  of \a input_signal using filter bank \a fb. The result is
          223  + *  stored in \a output_signal. This operation requires tree temporary
          224  + *  arrays of length \a signal_length.
          225  + *
          226  + *  \param input_signal Input signal
          227  + *  \param output_signal Output signal
          228  + *  \param temp1 Temporary array 1
          229  + *  \param temp2 Temporary array 2
          230  + *  \param temp3 Temporary array 3
          231  + *  \param signal_length Signal length
          232  + *  \param fb Filter bank
          233  + *
          234  + *  \return \c VOID */
          235  +    local void synthesis_1D (coeff_t * input_signal, coeff_t * output_signal,
          236  +			     coeff_t * temp1, coeff_t * temp2, coeff_t * temp3,
          237  +			     int signal_length, filterbank_t * fb);
          238  +
          239  +/** Two dimensional wavelet decomposition
          240  + *
          241  + *  This function performes N stages of 2D wavelet decomposition of
          242  + *  \a input_signal using filter bank \a fb. Image is assumed to be square:
          243  + *  if \a mode = #MODE_NORMAL, then width = height = signal_length = 2 ^ N;
          244  + *  if \a mode = #MODE_OTLPF, then width = height = signal_length = (2 ^ N) + 1.
          245  + *
          246  + *  \param input_signal Input signal
          247  + *  \param output_signal Output signal
          248  + *  \param signal_length Signal length (width = height)
          249  + *  \param mode Either #MODE_NORMAL or #MODE_OTLPF
          250  + *  \param fb Filter bank
          251  + *
          252  + *  \return \c VOID */
          253  +    void analysis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          254  +		      int signal_length, int mode, filterbank_t * fb);
          255  +
          256  +/** Two dimensional wavelet reconstruction
          257  + *
          258  + *  This function performes N stages of 2D wavelet reconstruction of
          259  + *  \a input_signal using filter bank \a fb. Image is assumed to be square:
          260  + *  if \a mode = #MODE_NORMAL, then width = height = signal_length = 2 ^ N;
          261  + *  if \a mode = #MODE_OTLPF, then width = height = signal_length = (2 ^ N) + 1.
          262  + *
          263  + *  \param input_signal Input signal
          264  + *  \param output_signal Output signal
          265  + *  \param signal_length Signal length (width = height)
          266  + *  \param mode Either #MODE_NORMAL or #MODE_OTLPF
          267  + *  \param fb Filter bank
          268  + *
          269  + *  \return \c VOID */
          270  +    void synthesis_2D (coeff_t ** input_signal, coeff_t ** output_signal,
          271  +		       int signal_length, int mode, filterbank_t * fb);
          272  +
          273  +/*@}*/
          274  +
          275  +#ifdef __cplusplus
          276  +}
          277  +#endif
          278  +
          279  +#endif				/* __FILTER_H__ */

Added epsilon/filterbank.c.

            1  +/*
            2  + * $Id: filterbank.c,v 1.12 2008/03/28 22:52:29 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <filterbank.h>
           26  +
           27  +/* Haar filter. */
           28  +
           29  +static coeff_t haar_lowpass_analysis_coeffs[] = {
           30  +    0.7071067811865475,
           31  +    0.7071067811865475,
           32  +};
           33  +
           34  +static coeff_t haar_highpass_analysis_coeffs[] = {
           35  +    0.7071067811865475,
           36  +    -0.7071067811865475,
           37  +};
           38  +
           39  +static coeff_t haar_lowpass_synthesis_coeffs[] = {
           40  +    0.7071067811865475,
           41  +    0.7071067811865475,
           42  +};
           43  +
           44  +static coeff_t haar_highpass_synthesis_coeffs[] = {
           45  +    -0.7071067811865475,
           46  +    0.7071067811865475,
           47  +};
           48  +
           49  +static filter_t haar_lowpass_analysis = {
           50  +    2,
           51  +    ANTICAUSAL,
           52  +    LOWPASS_ANALYSIS,
           53  +    haar_lowpass_analysis_coeffs,
           54  +};
           55  +
           56  +static filter_t haar_highpass_analysis = {
           57  +    2,
           58  +    ANTICAUSAL,
           59  +    HIGHPASS_ANALYSIS,
           60  +    haar_highpass_analysis_coeffs,
           61  +};
           62  +
           63  +static filter_t haar_lowpass_synthesis = {
           64  +    2,
           65  +    CAUSAL,
           66  +    LOWPASS_SYNTHESIS,
           67  +    haar_lowpass_synthesis_coeffs,
           68  +};
           69  +
           70  +static filter_t haar_highpass_synthesis = {
           71  +    2,
           72  +    CAUSAL,
           73  +    HIGHPASS_SYNTHESIS,
           74  +    haar_highpass_synthesis_coeffs,
           75  +};
           76  +
           77  +static filterbank_t haar = {
           78  +    "haar",
           79  +    "Haar",
           80  +    ORTHOGONAL,
           81  +    &haar_lowpass_analysis,
           82  +    &haar_highpass_analysis,
           83  +    &haar_lowpass_synthesis,
           84  +    &haar_highpass_synthesis,
           85  +};
           86  +
           87  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
           88  + * Communications on Pure and Applied Mathematics, vol. 41,
           89  + * pp. 909-996, 1988. */
           90  +
           91  +static coeff_t daub4_lowpass_analysis_coeffs[] = {
           92  +    0.4829629131445341,
           93  +    0.8365163037378077,
           94  +    0.2241438680420134,
           95  +    -0.1294095225512603,
           96  +};
           97  +
           98  +static coeff_t daub4_highpass_analysis_coeffs[] = {
           99  +    -0.1294095225512603,
          100  +    -0.2241438680420134,
          101  +    0.8365163037378077,
          102  +    -0.4829629131445341,
          103  +};
          104  +
          105  +static coeff_t daub4_lowpass_synthesis_coeffs[] = {
          106  +    -0.1294095225512603,
          107  +    0.2241438680420134,
          108  +    0.8365163037378077,
          109  +    0.4829629131445341,
          110  +};
          111  +
          112  +static coeff_t daub4_highpass_synthesis_coeffs[] = {
          113  +    -0.4829629131445341,
          114  +    0.8365163037378077,
          115  +    -0.2241438680420134,
          116  +    -0.1294095225512603,
          117  +};
          118  +
          119  +static filter_t daub4_lowpass_analysis = {
          120  +    4,
          121  +    ANTICAUSAL,
          122  +    LOWPASS_ANALYSIS,
          123  +    daub4_lowpass_analysis_coeffs,
          124  +};
          125  +
          126  +static filter_t daub4_highpass_analysis = {
          127  +    4,
          128  +    ANTICAUSAL,
          129  +    HIGHPASS_ANALYSIS,
          130  +    daub4_highpass_analysis_coeffs,
          131  +};
          132  +
          133  +static filter_t daub4_lowpass_synthesis = {
          134  +    4,
          135  +    CAUSAL,
          136  +    LOWPASS_SYNTHESIS,
          137  +    daub4_lowpass_synthesis_coeffs,
          138  +};
          139  +
          140  +static filter_t daub4_highpass_synthesis = {
          141  +    4,
          142  +    CAUSAL,
          143  +    HIGHPASS_SYNTHESIS,
          144  +    daub4_highpass_synthesis_coeffs,
          145  +};
          146  +
          147  +static filterbank_t daub4 = {
          148  +    "daub4",
          149  +    "Daubechies D4",
          150  +    ORTHOGONAL,
          151  +    &daub4_lowpass_analysis,
          152  +    &daub4_highpass_analysis,
          153  +    &daub4_lowpass_synthesis,
          154  +    &daub4_highpass_synthesis,
          155  +};
          156  +
          157  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          158  + * Communications on Pure and Applied Mathematics, vol. 41,
          159  + * pp. 909-996, 1988. */
          160  +
          161  +static coeff_t daub6_lowpass_analysis_coeffs[] = {
          162  +    0.3326705529500825,
          163  +    0.8068915093110924,
          164  +    0.4598775021184914,
          165  +    -0.1350110200102546,
          166  +    -0.0854412738820267,
          167  +    0.0352262918857095,
          168  +};
          169  +
          170  +static coeff_t daub6_highpass_analysis_coeffs[] = {
          171  +    0.0352262918857095,
          172  +    0.0854412738820267,
          173  +    -0.1350110200102546,
          174  +    -0.4598775021184914,
          175  +    0.8068915093110924,
          176  +    -0.3326705529500825,
          177  +};
          178  +
          179  +static coeff_t daub6_lowpass_synthesis_coeffs[] = {
          180  +    0.0352262918857095,
          181  +    -0.0854412738820267,
          182  +    -0.1350110200102546,
          183  +    0.4598775021184914,
          184  +    0.8068915093110924,
          185  +    0.3326705529500825,
          186  +};
          187  +
          188  +static coeff_t daub6_highpass_synthesis_coeffs[] = {
          189  +    -0.3326705529500825,
          190  +    0.8068915093110924,
          191  +    -0.4598775021184914,
          192  +    -0.1350110200102546,
          193  +    0.0854412738820267,
          194  +    0.0352262918857095,
          195  +};
          196  +
          197  +static filter_t daub6_lowpass_analysis = {
          198  +    6,
          199  +    ANTICAUSAL,
          200  +    LOWPASS_ANALYSIS,
          201  +    daub6_lowpass_analysis_coeffs,
          202  +};
          203  +
          204  +static filter_t daub6_highpass_analysis = {
          205  +    6,
          206  +    ANTICAUSAL,
          207  +    HIGHPASS_ANALYSIS,
          208  +    daub6_highpass_analysis_coeffs,
          209  +};
          210  +
          211  +static filter_t daub6_lowpass_synthesis = {
          212  +    6,
          213  +    CAUSAL,
          214  +    LOWPASS_SYNTHESIS,
          215  +    daub6_lowpass_synthesis_coeffs,
          216  +};
          217  +
          218  +static filter_t daub6_highpass_synthesis = {
          219  +    6,
          220  +    CAUSAL,
          221  +    HIGHPASS_SYNTHESIS,
          222  +    daub6_highpass_synthesis_coeffs,
          223  +};
          224  +
          225  +static filterbank_t daub6 = {
          226  +    "daub6",
          227  +    "Daubechies D6",
          228  +    ORTHOGONAL,
          229  +    &daub6_lowpass_analysis,
          230  +    &daub6_highpass_analysis,
          231  +    &daub6_lowpass_synthesis,
          232  +    &daub6_highpass_synthesis,
          233  +};
          234  +
          235  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          236  + * Communications on Pure and Applied Mathematics, vol. 41,
          237  + * pp. 909-996, 1988. */
          238  +
          239  +static coeff_t daub8_lowpass_analysis_coeffs[] = {
          240  +    0.2303778133088964,
          241  +    0.7148465705529154,
          242  +    0.6308807679398587,
          243  +    -0.0279837694168599,
          244  +    -0.1870348117190931,
          245  +    0.0308413818355607,
          246  +    0.0328830116668852,
          247  +    -0.0105974017850690,
          248  +};
          249  +
          250  +static coeff_t daub8_highpass_analysis_coeffs[] = {
          251  +    -0.0105974017850690,
          252  +    -0.0328830116668852,
          253  +    0.0308413818355607,
          254  +    0.1870348117190931,
          255  +    -0.0279837694168599,
          256  +    -0.6308807679398587,
          257  +    0.7148465705529154,
          258  +    -0.2303778133088964,
          259  +};
          260  +
          261  +static coeff_t daub8_lowpass_synthesis_coeffs[] = {
          262  +    -0.0105974017850690,
          263  +    0.0328830116668852,
          264  +    0.0308413818355607,
          265  +    -0.1870348117190931,
          266  +    -0.0279837694168599,
          267  +    0.6308807679398587,
          268  +    0.7148465705529154,
          269  +    0.2303778133088964,
          270  +};
          271  +
          272  +static coeff_t daub8_highpass_synthesis_coeffs[] = {
          273  +    -0.2303778133088964,
          274  +    0.7148465705529154,
          275  +    -0.6308807679398587,
          276  +    -0.0279837694168599,
          277  +    0.1870348117190931,
          278  +    0.0308413818355607,
          279  +    -0.0328830116668852,
          280  +    -0.0105974017850690,
          281  +};
          282  +
          283  +static filter_t daub8_lowpass_analysis = {
          284  +    8,
          285  +    ANTICAUSAL,
          286  +    LOWPASS_ANALYSIS,
          287  +    daub8_lowpass_analysis_coeffs,
          288  +};
          289  +
          290  +static filter_t daub8_highpass_analysis = {
          291  +    8,
          292  +    ANTICAUSAL,
          293  +    HIGHPASS_ANALYSIS,
          294  +    daub8_highpass_analysis_coeffs,
          295  +};
          296  +
          297  +static filter_t daub8_lowpass_synthesis = {
          298  +    8,
          299  +    CAUSAL,
          300  +    LOWPASS_SYNTHESIS,
          301  +    daub8_lowpass_synthesis_coeffs,
          302  +};
          303  +
          304  +static filter_t daub8_highpass_synthesis = {
          305  +    8,
          306  +    CAUSAL,
          307  +    HIGHPASS_SYNTHESIS,
          308  +    daub8_highpass_synthesis_coeffs,
          309  +};
          310  +
          311  +static filterbank_t daub8 = {
          312  +    "daub8",
          313  +    "Daubechies D8",
          314  +    ORTHOGONAL,
          315  +    &daub8_lowpass_analysis,
          316  +    &daub8_highpass_analysis,
          317  +    &daub8_lowpass_synthesis,
          318  +    &daub8_highpass_synthesis,
          319  +};
          320  +
          321  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          322  + * Communications on Pure and Applied Mathematics, vol. 41,
          323  + * pp. 909-996, 1988. */
          324  +
          325  +static coeff_t daub10_lowpass_analysis_coeffs[] = {
          326  +    0.16010239797419,
          327  +    0.60382926979719,
          328  +    0.72430852843777,
          329  +    0.13842814590132,
          330  +    -0.24229488706638,
          331  +    -0.03224486958464,
          332  +    0.07757149384005,
          333  +    -0.00624149021280,
          334  +    -0.01258075199908,
          335  +    0.00333572528547,
          336  +};
          337  +
          338  +static coeff_t daub10_highpass_analysis_coeffs[] = {
          339  +    0.00333572528547,
          340  +    0.01258075199908,
          341  +    -0.00624149021280,
          342  +    -0.07757149384005,
          343  +    -0.03224486958464,
          344  +    0.24229488706638,
          345  +    0.13842814590132,
          346  +    -0.72430852843777,
          347  +    0.60382926979719,
          348  +    -0.16010239797419,
          349  +};
          350  +
          351  +static coeff_t daub10_lowpass_synthesis_coeffs[] = {
          352  +    0.00333572528547,
          353  +    -0.01258075199908,
          354  +    -0.00624149021280,
          355  +    0.07757149384005,
          356  +    -0.03224486958464,
          357  +    -0.24229488706638,
          358  +    0.13842814590132,
          359  +    0.72430852843777,
          360  +    0.60382926979719,
          361  +    0.16010239797419,
          362  +};
          363  +
          364  +static coeff_t daub10_highpass_synthesis_coeffs[] = {
          365  +    -0.16010239797419,
          366  +    0.60382926979719,
          367  +    -0.72430852843777,
          368  +    0.13842814590132,
          369  +    0.24229488706638,
          370  +    -0.03224486958464,
          371  +    -0.07757149384005,
          372  +    -0.00624149021280,
          373  +    0.01258075199908,
          374  +    0.00333572528547,
          375  +};
          376  +
          377  +static filter_t daub10_lowpass_analysis = {
          378  +    10,
          379  +    ANTICAUSAL,
          380  +    LOWPASS_ANALYSIS,
          381  +    daub10_lowpass_analysis_coeffs,
          382  +};
          383  +
          384  +static filter_t daub10_highpass_analysis = {
          385  +    10,
          386  +    ANTICAUSAL,
          387  +    HIGHPASS_ANALYSIS,
          388  +    daub10_highpass_analysis_coeffs,
          389  +};
          390  +
          391  +static filter_t daub10_lowpass_synthesis = {
          392  +    10,
          393  +    CAUSAL,
          394  +    LOWPASS_SYNTHESIS,
          395  +    daub10_lowpass_synthesis_coeffs,
          396  +};
          397  +
          398  +static filter_t daub10_highpass_synthesis = {
          399  +    10,
          400  +    CAUSAL,
          401  +    HIGHPASS_SYNTHESIS,
          402  +    daub10_highpass_synthesis_coeffs,
          403  +};
          404  +
          405  +static filterbank_t daub10 = {
          406  +    "daub10",
          407  +    "Daubechies D10",
          408  +    ORTHOGONAL,
          409  +    &daub10_lowpass_analysis,
          410  +    &daub10_highpass_analysis,
          411  +    &daub10_lowpass_synthesis,
          412  +    &daub10_highpass_synthesis,
          413  +};
          414  +
          415  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          416  + * Communications on Pure and Applied Mathematics, vol. 41,
          417  + * pp. 909-996, 1988. */
          418  +
          419  +static coeff_t daub12_lowpass_analysis_coeffs[] = {
          420  +    0.111540743350,
          421  +    0.494623890398,
          422  +    0.751133908021,
          423  +    0.315250351709,
          424  +    -0.226264693965,
          425  +    -0.129766867567,
          426  +    0.097501605587,
          427  +    0.027522865530,
          428  +    -0.031582039317,
          429  +    0.000553842201,
          430  +    0.004777257511,
          431  +    -0.001077301085,
          432  +};
          433  +
          434  +static coeff_t daub12_highpass_analysis_coeffs[] = {
          435  +    -0.001077301085,
          436  +    -0.004777257511,
          437  +    0.000553842201,
          438  +    0.031582039317,
          439  +    0.027522865530,
          440  +    -0.097501605587,
          441  +    -0.129766867567,
          442  +    0.226264693965,
          443  +    0.315250351709,
          444  +    -0.751133908021,
          445  +    0.494623890398,
          446  +    -0.111540743350,
          447  +};
          448  +
          449  +static coeff_t daub12_lowpass_synthesis_coeffs[] = {
          450  +    -0.001077301085,
          451  +    0.004777257511,
          452  +    0.000553842201,
          453  +    -0.031582039317,
          454  +    0.027522865530,
          455  +    0.097501605587,
          456  +    -0.129766867567,
          457  +    -0.226264693965,
          458  +    0.315250351709,
          459  +    0.751133908021,
          460  +    0.494623890398,
          461  +    0.111540743350,
          462  +};
          463  +
          464  +static coeff_t daub12_highpass_synthesis_coeffs[] = {
          465  +    -0.111540743350,
          466  +    0.494623890398,
          467  +    -0.751133908021,
          468  +    0.315250351709,
          469  +    0.226264693965,
          470  +    -0.129766867567,
          471  +    -0.097501605587,
          472  +    0.027522865530,
          473  +    0.031582039317,
          474  +    0.000553842201,
          475  +    -0.004777257511,
          476  +    -0.001077301085,
          477  +};
          478  +
          479  +static filter_t daub12_lowpass_analysis = {
          480  +    12,
          481  +    ANTICAUSAL,
          482  +    LOWPASS_ANALYSIS,
          483  +    daub12_lowpass_analysis_coeffs,
          484  +};
          485  +
          486  +static filter_t daub12_highpass_analysis = {
          487  +    12,
          488  +    ANTICAUSAL,
          489  +    HIGHPASS_ANALYSIS,
          490  +    daub12_highpass_analysis_coeffs,
          491  +};
          492  +
          493  +static filter_t daub12_lowpass_synthesis = {
          494  +    12,
          495  +    CAUSAL,
          496  +    LOWPASS_SYNTHESIS,
          497  +    daub12_lowpass_synthesis_coeffs,
          498  +};
          499  +
          500  +static filter_t daub12_highpass_synthesis = {
          501  +    12,
          502  +    CAUSAL,
          503  +    HIGHPASS_SYNTHESIS,
          504  +    daub12_highpass_synthesis_coeffs,
          505  +};
          506  +
          507  +static filterbank_t daub12 = {
          508  +    "daub12",
          509  +    "Daubechies D12",
          510  +    ORTHOGONAL,
          511  +    &daub12_lowpass_analysis,
          512  +    &daub12_highpass_analysis,
          513  +    &daub12_lowpass_synthesis,
          514  +    &daub12_highpass_synthesis,
          515  +};
          516  +
          517  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          518  + * Communications on Pure and Applied Mathematics, vol. 41,
          519  + * pp. 909-996, 1988. */
          520  +
          521  +static coeff_t daub14_lowpass_analysis_coeffs[] = {
          522  +    0.077852054085,
          523  +    0.396539319482,
          524  +    0.729132090846,
          525  +    0.469782287405,
          526  +    -0.143906003929,
          527  +    -0.224036184994,
          528  +    0.071309219267,
          529  +    0.080612609151,
          530  +    -0.038029936935,
          531  +    -0.016574541631,
          532  +    0.012550998556,
          533  +    0.000429577973,
          534  +    -0.001801640704,
          535  +    0.000353713800,
          536  +};
          537  +
          538  +static coeff_t daub14_highpass_analysis_coeffs[] = {
          539  +    0.000353713800,
          540  +    0.001801640704,
          541  +    0.000429577973,
          542  +    -0.012550998556,
          543  +    -0.016574541631,
          544  +    0.038029936935,
          545  +    0.080612609151,
          546  +    -0.071309219267,
          547  +    -0.224036184994,
          548  +    0.143906003929,
          549  +    0.469782287405,
          550  +    -0.729132090846,
          551  +    0.396539319482,
          552  +    -0.077852054085,
          553  +};
          554  +
          555  +static coeff_t daub14_lowpass_synthesis_coeffs[] = {
          556  +    0.000353713800,
          557  +    -0.001801640704,
          558  +    0.000429577973,
          559  +    0.012550998556,
          560  +    -0.016574541631,
          561  +    -0.038029936935,
          562  +    0.080612609151,
          563  +    0.071309219267,
          564  +    -0.224036184994,
          565  +    -0.143906003929,
          566  +    0.469782287405,
          567  +    0.729132090846,
          568  +    0.396539319482,
          569  +    0.077852054085,
          570  +};
          571  +
          572  +static coeff_t daub14_highpass_synthesis_coeffs[] = {
          573  +    -0.077852054085,
          574  +    0.396539319482,
          575  +    -0.729132090846,
          576  +    0.469782287405,
          577  +    0.143906003929,
          578  +    -0.224036184994,
          579  +    -0.071309219267,
          580  +    0.080612609151,
          581  +    0.038029936935,
          582  +    -0.016574541631,
          583  +    -0.012550998556,
          584  +    0.000429577973,
          585  +    0.001801640704,
          586  +    0.000353713800,
          587  +};
          588  +
          589  +static filter_t daub14_lowpass_analysis = {
          590  +    14,
          591  +    ANTICAUSAL,
          592  +    LOWPASS_ANALYSIS,
          593  +    daub14_lowpass_analysis_coeffs,
          594  +};
          595  +
          596  +static filter_t daub14_highpass_analysis = {
          597  +    14,
          598  +    ANTICAUSAL,
          599  +    HIGHPASS_ANALYSIS,
          600  +    daub14_highpass_analysis_coeffs,
          601  +};
          602  +
          603  +static filter_t daub14_lowpass_synthesis = {
          604  +    14,
          605  +    CAUSAL,
          606  +    LOWPASS_SYNTHESIS,
          607  +    daub14_lowpass_synthesis_coeffs,
          608  +};
          609  +
          610  +static filter_t daub14_highpass_synthesis = {
          611  +    14,
          612  +    CAUSAL,
          613  +    HIGHPASS_SYNTHESIS,
          614  +    daub14_highpass_synthesis_coeffs,
          615  +};
          616  +
          617  +static filterbank_t daub14 = {
          618  +    "daub14",
          619  +    "Daubechies D14",
          620  +    ORTHOGONAL,
          621  +    &daub14_lowpass_analysis,
          622  +    &daub14_highpass_analysis,
          623  +    &daub14_lowpass_synthesis,
          624  +    &daub14_highpass_synthesis,
          625  +};
          626  +
          627  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          628  + * Communications on Pure and Applied Mathematics, vol. 41,
          629  + * pp. 909-996, 1988. */
          630  +
          631  +static coeff_t daub16_lowpass_analysis_coeffs[] = {
          632  +    0.054415842243,
          633  +    0.312871590914,
          634  +    0.675630736297,
          635  +    0.585354683654,
          636  +    -0.015829105256,
          637  +    -0.284015542962,
          638  +    0.000472484574,
          639  +    0.128747426620,
          640  +    -0.017369301002,
          641  +    -0.044088253931,
          642  +    0.013981027917,
          643  +    0.008746094047,
          644  +    -0.004870352993,
          645  +    -0.000391740373,
          646  +    0.000675449406,
          647  +    -0.000117476784,
          648  +};
          649  +
          650  +static coeff_t daub16_highpass_analysis_coeffs[] = {
          651  +    -0.000117476784,
          652  +    -0.000675449406,
          653  +    -0.000391740373,
          654  +    0.004870352993,
          655  +    0.008746094047,
          656  +    -0.013981027917,
          657  +    -0.044088253931,
          658  +    0.017369301002,
          659  +    0.128747426620,
          660  +    -0.000472484574,
          661  +    -0.284015542962,
          662  +    0.015829105256,
          663  +    0.585354683654,
          664  +    -0.675630736297,
          665  +    0.312871590914,
          666  +    -0.054415842243,
          667  +};
          668  +
          669  +static coeff_t daub16_lowpass_synthesis_coeffs[] = {
          670  +    -0.000117476784,
          671  +    0.000675449406,
          672  +    -0.000391740373,
          673  +    -0.004870352993,
          674  +    0.008746094047,
          675  +    0.013981027917,
          676  +    -0.044088253931,
          677  +    -0.017369301002,
          678  +    0.128747426620,
          679  +    0.000472484574,
          680  +    -0.284015542962,
          681  +    -0.015829105256,
          682  +    0.585354683654,
          683  +    0.675630736297,
          684  +    0.312871590914,
          685  +    0.054415842243,
          686  +};
          687  +
          688  +static coeff_t daub16_highpass_synthesis_coeffs[] = {
          689  +    -0.054415842243,
          690  +    0.312871590914,
          691  +    -0.675630736297,
          692  +    0.585354683654,
          693  +    0.015829105256,
          694  +    -0.284015542962,
          695  +    -0.000472484574,
          696  +    0.128747426620,
          697  +    0.017369301002,
          698  +    -0.044088253931,
          699  +    -0.013981027917,
          700  +    0.008746094047,
          701  +    0.004870352993,
          702  +    -0.000391740373,
          703  +    -0.000675449406,
          704  +    -0.000117476784,
          705  +};
          706  +
          707  +static filter_t daub16_lowpass_analysis = {
          708  +    16,
          709  +    ANTICAUSAL,
          710  +    LOWPASS_ANALYSIS,
          711  +    daub16_lowpass_analysis_coeffs,
          712  +};
          713  +
          714  +static filter_t daub16_highpass_analysis = {
          715  +    16,
          716  +    ANTICAUSAL,
          717  +    HIGHPASS_ANALYSIS,
          718  +    daub16_highpass_analysis_coeffs,
          719  +};
          720  +
          721  +static filter_t daub16_lowpass_synthesis = {
          722  +    16,
          723  +    CAUSAL,
          724  +    LOWPASS_SYNTHESIS,
          725  +    daub16_lowpass_synthesis_coeffs,
          726  +};
          727  +
          728  +static filter_t daub16_highpass_synthesis = {
          729  +    16,
          730  +    CAUSAL,
          731  +    HIGHPASS_SYNTHESIS,
          732  +    daub16_highpass_synthesis_coeffs,
          733  +};
          734  +
          735  +static filterbank_t daub16 = {
          736  +    "daub16",
          737  +    "Daubechies D16",
          738  +    ORTHOGONAL,
          739  +    &daub16_lowpass_analysis,
          740  +    &daub16_highpass_analysis,
          741  +    &daub16_lowpass_synthesis,
          742  +    &daub16_highpass_synthesis,
          743  +};
          744  +
          745  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          746  + * Communications on Pure and Applied Mathematics, vol. 41,
          747  + * pp. 909-996, 1988. */
          748  +
          749  +static coeff_t daub18_lowpass_analysis_coeffs[] = {
          750  +    0.038077947364,
          751  +    0.243834674613,
          752  +    0.604823123690,
          753  +    0.657288078051,
          754  +    0.133197385825,
          755  +    -0.293273783279,
          756  +    -0.096840783223,
          757  +    0.148540749338,
          758  +    0.030725681479,
          759  +    -0.067632829061,
          760  +    0.000250947115,
          761  +    0.022361662124,
          762  +    -0.004723204758,
          763  +    -0.004281503682,
          764  +    0.001847646883,
          765  +    0.000230385764,
          766  +    -0.000251963189,
          767  +    0.000039347320,
          768  +};
          769  +
          770  +static coeff_t daub18_highpass_analysis_coeffs[] = {
          771  +    0.000039347320,
          772  +    0.000251963189,
          773  +    0.000230385764,
          774  +    -0.001847646883,
          775  +    -0.004281503682,
          776  +    0.004723204758,
          777  +    0.022361662124,
          778  +    -0.000250947115,
          779  +    -0.067632829061,
          780  +    -0.030725681479,
          781  +    0.148540749338,
          782  +    0.096840783223,
          783  +    -0.293273783279,
          784  +    -0.133197385825,
          785  +    0.657288078051,
          786  +    -0.604823123690,
          787  +    0.243834674613,
          788  +    -0.038077947364,
          789  +};
          790  +
          791  +static coeff_t daub18_lowpass_synthesis_coeffs[] = {
          792  +    0.000039347320,
          793  +    -0.000251963189,
          794  +    0.000230385764,
          795  +    0.001847646883,
          796  +    -0.004281503682,
          797  +    -0.004723204758,
          798  +    0.022361662124,
          799  +    0.000250947115,
          800  +    -0.067632829061,
          801  +    0.030725681479,
          802  +    0.148540749338,
          803  +    -0.096840783223,
          804  +    -0.293273783279,
          805  +    0.133197385825,
          806  +    0.657288078051,
          807  +    0.604823123690,
          808  +    0.243834674613,
          809  +    0.038077947364,
          810  +};
          811  +
          812  +static coeff_t daub18_highpass_synthesis_coeffs[] = {
          813  +    -0.038077947364,
          814  +    0.243834674613,
          815  +    -0.604823123690,
          816  +    0.657288078051,
          817  +    -0.133197385825,
          818  +    -0.293273783279,
          819  +    0.096840783223,
          820  +    0.148540749338,
          821  +    -0.030725681479,
          822  +    -0.067632829061,
          823  +    -0.000250947115,
          824  +    0.022361662124,
          825  +    0.004723204758,
          826  +    -0.004281503682,
          827  +    -0.001847646883,
          828  +    0.000230385764,
          829  +    0.000251963189,
          830  +    0.000039347320,
          831  +};
          832  +
          833  +static filter_t daub18_lowpass_analysis = {
          834  +    18,
          835  +    ANTICAUSAL,
          836  +    LOWPASS_ANALYSIS,
          837  +    daub18_lowpass_analysis_coeffs,
          838  +};
          839  +
          840  +static filter_t daub18_highpass_analysis = {
          841  +    18,
          842  +    ANTICAUSAL,
          843  +    HIGHPASS_ANALYSIS,
          844  +    daub18_highpass_analysis_coeffs,
          845  +};
          846  +
          847  +static filter_t daub18_lowpass_synthesis = {
          848  +    18,
          849  +    CAUSAL,
          850  +    LOWPASS_SYNTHESIS,
          851  +    daub18_lowpass_synthesis_coeffs,
          852  +};
          853  +
          854  +static filter_t daub18_highpass_synthesis = {
          855  +    18,
          856  +    CAUSAL,
          857  +    HIGHPASS_SYNTHESIS,
          858  +    daub18_highpass_synthesis_coeffs,
          859  +};
          860  +
          861  +static filterbank_t daub18 = {
          862  +    "daub18",
          863  +    "Daubechies D18",
          864  +    ORTHOGONAL,
          865  +    &daub18_lowpass_analysis,
          866  +    &daub18_highpass_analysis,
          867  +    &daub18_lowpass_synthesis,
          868  +    &daub18_highpass_synthesis,
          869  +};
          870  +
          871  +/* I. Daubechies, "Orthonormal Bases of Compactly Supported Wavelets,"
          872  + * Communications on Pure and Applied Mathematics, vol. 41,
          873  + * pp. 909-996, 1988. */
          874  +
          875  +static coeff_t daub20_lowpass_analysis_coeffs[] = {
          876  +    0.026670057901,
          877  +    0.188176800078,
          878  +    0.527201188932,
          879  +    0.688459039454,
          880  +    0.281172343661,
          881  +    -0.249846424327,
          882  +    -0.195946274377,
          883  +    0.127369340336,
          884  +    0.093057364604,
          885  +    -0.071394147166,
          886  +    -0.029457536822,
          887  +    0.033212674059,
          888  +    0.003606553567,
          889  +    -0.010733175483,
          890  +    0.001395351747,
          891  +    0.001992405295,
          892  +    -0.000685856695,
          893  +    -0.000116466855,
          894  +    0.000093588670,
          895  +    -0.000013264203,
          896  +};
          897  +
          898  +static coeff_t daub20_highpass_analysis_coeffs[] = {
          899  +    -0.000013264203,
          900  +    -0.000093588670,
          901  +    -0.000116466855,
          902  +    0.000685856695,
          903  +    0.001992405295,
          904  +    -0.001395351747,
          905  +    -0.010733175483,
          906  +    -0.003606553567,
          907  +    0.033212674059,
          908  +    0.029457536822,
          909  +    -0.071394147166,
          910  +    -0.093057364604,
          911  +    0.127369340336,
          912  +    0.195946274377,
          913  +    -0.249846424327,
          914  +    -0.281172343661,
          915  +    0.688459039454,
          916  +    -0.527201188932,
          917  +    0.188176800078,
          918  +    -0.026670057901,
          919  +};
          920  +
          921  +static coeff_t daub20_lowpass_synthesis_coeffs[] = {
          922  +    -0.000013264203,
          923  +    0.000093588670,
          924  +    -0.000116466855,
          925  +    -0.000685856695,
          926  +    0.001992405295,
          927  +    0.001395351747,
          928  +    -0.010733175483,
          929  +    0.003606553567,
          930  +    0.033212674059,
          931  +    -0.029457536822,
          932  +    -0.071394147166,
          933  +    0.093057364604,
          934  +    0.127369340336,
          935  +    -0.195946274377,
          936  +    -0.249846424327,
          937  +    0.281172343661,
          938  +    0.688459039454,
          939  +    0.527201188932,
          940  +    0.188176800078,
          941  +    0.026670057901,
          942  +};
          943  +
          944  +static coeff_t daub20_highpass_synthesis_coeffs[] = {
          945  +    -0.026670057901,
          946  +    0.188176800078,
          947  +    -0.527201188932,
          948  +    0.688459039454,
          949  +    -0.281172343661,
          950  +    -0.249846424327,
          951  +    0.195946274377,
          952  +    0.127369340336,
          953  +    -0.093057364604,
          954  +    -0.071394147166,
          955  +    0.029457536822,
          956  +    0.033212674059,
          957  +    -0.003606553567,
          958  +    -0.010733175483,
          959  +    -0.001395351747,
          960  +    0.001992405295,
          961  +    0.000685856695,
          962  +    -0.000116466855,
          963  +    -0.000093588670,
          964  +    -0.000013264203,
          965  +};
          966  +
          967  +static filter_t daub20_lowpass_analysis = {
          968  +    20,
          969  +    ANTICAUSAL,
          970  +    LOWPASS_ANALYSIS,
          971  +    daub20_lowpass_analysis_coeffs,
          972  +};
          973  +
          974  +static filter_t daub20_highpass_analysis = {
          975  +    20,
          976  +    ANTICAUSAL,
          977  +    HIGHPASS_ANALYSIS,
          978  +    daub20_highpass_analysis_coeffs,
          979  +};
          980  +
          981  +static filter_t daub20_lowpass_synthesis = {
          982  +    20,
          983  +    CAUSAL,
          984  +    LOWPASS_SYNTHESIS,
          985  +    daub20_lowpass_synthesis_coeffs,
          986  +};
          987  +
          988  +static filter_t daub20_highpass_synthesis = {
          989  +    20,
          990  +    CAUSAL,
          991  +    HIGHPASS_SYNTHESIS,
          992  +    daub20_highpass_synthesis_coeffs,
          993  +};
          994  +
          995  +static filterbank_t daub20 = {
          996  +    "daub20",
          997  +    "Daubechies D20",
          998  +    ORTHOGONAL,
          999  +    &daub20_lowpass_analysis,
         1000  +    &daub20_highpass_analysis,
         1001  +    &daub20_lowpass_synthesis,
         1002  +    &daub20_highpass_synthesis,
         1003  +};
         1004  +
         1005  +/* The Beylkin filter places roots for the frequency response function
         1006  + * close to the Nyquist frequency on the real axis. */
         1007  +
         1008  +static coeff_t beylkin_lowpass_analysis_coeffs[] = {
         1009  +    0.099305765374,
         1010  +    0.424215360813,
         1011  +    0.699825214057,
         1012  +    0.449718251149,
         1013  +    -0.110927598348,
         1014  +    -0.264497231446,
         1015  +    0.026900308804,
         1016  +    0.155538731877,
         1017  +    -0.017520746267,
         1018  +    -0.088543630623,
         1019  +    0.019679866044,
         1020  +    0.042916387274,
         1021  +    -0.017460408696,
         1022  +    -0.014365807969,
         1023  +    0.010040411845,
         1024  +    0.001484234782,
         1025  +    -0.002736031626,
         1026  +    0.000640485329,
         1027  +};
         1028  +
         1029  +static coeff_t beylkin_highpass_analysis_coeffs[] = {
         1030  +    0.000640485329,
         1031  +    0.002736031626,
         1032  +    0.001484234782,
         1033  +    -0.010040411845,
         1034  +    -0.014365807969,
         1035  +    0.017460408696,
         1036  +    0.042916387274,
         1037  +    -0.019679866044,
         1038  +    -0.088543630623,
         1039  +    0.017520746267,
         1040  +    0.155538731877,
         1041  +    -0.026900308804,
         1042  +    -0.264497231446,
         1043  +    0.110927598348,
         1044  +    0.449718251149,
         1045  +    -0.699825214057,
         1046  +    0.424215360813,
         1047  +    -0.099305765374,
         1048  +};
         1049  +
         1050  +static coeff_t beylkin_lowpass_synthesis_coeffs[] = {
         1051  +    0.000640485329,
         1052  +    -0.002736031626,
         1053  +    0.001484234782,
         1054  +    0.010040411845,
         1055  +    -0.014365807969,
         1056  +    -0.017460408696,
         1057  +    0.042916387274,
         1058  +    0.019679866044,
         1059  +    -0.088543630623,
         1060  +    -0.017520746267,
         1061  +    0.155538731877,
         1062  +    0.026900308804,
         1063  +    -0.264497231446,
         1064  +    -0.110927598348,
         1065  +    0.449718251149,
         1066  +    0.699825214057,
         1067  +    0.424215360813,
         1068  +    0.099305765374,
         1069  +};
         1070  +
         1071  +static coeff_t beylkin_highpass_synthesis_coeffs[] = {
         1072  +    -0.099305765374,
         1073  +    0.424215360813,
         1074  +    -0.699825214057,
         1075  +    0.449718251149,
         1076  +    0.110927598348,
         1077  +    -0.264497231446,
         1078  +    -0.026900308804,
         1079  +    0.155538731877,
         1080  +    0.017520746267,
         1081  +    -0.088543630623,
         1082  +    -0.019679866044,
         1083  +    0.042916387274,
         1084  +    0.017460408696,
         1085  +    -0.014365807969,
         1086  +    -0.010040411845,
         1087  +    0.001484234782,
         1088  +    0.002736031626,
         1089  +    0.000640485329,
         1090  +};
         1091  +
         1092  +static filter_t beylkin_lowpass_analysis = {
         1093  +    18,
         1094  +    ANTICAUSAL,
         1095  +    LOWPASS_ANALYSIS,
         1096  +    beylkin_lowpass_analysis_coeffs,
         1097  +};
         1098  +
         1099  +static filter_t beylkin_highpass_analysis = {
         1100  +    18,
         1101  +    ANTICAUSAL,
         1102  +    HIGHPASS_ANALYSIS,
         1103  +    beylkin_highpass_analysis_coeffs,
         1104  +};
         1105  +
         1106  +static filter_t beylkin_lowpass_synthesis = {
         1107  +    18,
         1108  +    CAUSAL,
         1109  +    LOWPASS_SYNTHESIS,
         1110  +    beylkin_lowpass_synthesis_coeffs,
         1111  +};
         1112  +
         1113  +static filter_t beylkin_highpass_synthesis = {
         1114  +    18,
         1115  +    CAUSAL,
         1116  +    HIGHPASS_SYNTHESIS,
         1117  +    beylkin_highpass_synthesis_coeffs,
         1118  +};
         1119  +
         1120  +static filterbank_t beylkin = {
         1121  +    "beylkin",
         1122  +    "Beylkin",
         1123  +    ORTHOGONAL,
         1124  +    &beylkin_lowpass_analysis,
         1125  +    &beylkin_highpass_analysis,
         1126  +    &beylkin_lowpass_synthesis,
         1127  +    &beylkin_highpass_synthesis,
         1128  +};
         1129  +
         1130  +/* The Vaidyanathan filter gives an exact reconstruction, but does not
         1131  + * satisfy any moment condition.  The filter has been optimized for
         1132  + * speech coding. */
         1133  +
         1134  +static coeff_t vaidyanathan_lowpass_analysis_coeffs[] = {
         1135  +    -0.000062906118,
         1136  +    0.000343631905,
         1137  +    -0.000453956620,
         1138  +    -0.000944897136,
         1139  +    0.002843834547,
         1140  +    0.000708137504,
         1141  +    -0.008839103409,
         1142  +    0.003153847056,
         1143  +    0.019687215010,
         1144  +    -0.014853448005,
         1145  +    -0.035470398607,
         1146  +    0.038742619293,
         1147  +    0.055892523691,
         1148  +    -0.077709750902,
         1149  +    -0.083928884366,
         1150  +    0.131971661417,
         1151  +    0.135084227129,
         1152  +    -0.194450471766,
         1153  +    -0.263494802488,
         1154  +    0.201612161775,
         1155  +    0.635601059872,
         1156  +    0.572797793211,
         1157  +    0.250184129505,
         1158  +    0.045799334111,
         1159  +};
         1160  +
         1161  +static coeff_t vaidyanathan_highpass_analysis_coeffs[] = {
         1162  +    0.045799334111,
         1163  +    -0.250184129505,
         1164  +    0.572797793211,
         1165  +    -0.635601059872,
         1166  +    0.201612161775,
         1167  +    0.263494802488,
         1168  +    -0.194450471766,
         1169  +    -0.135084227129,
         1170  +    0.131971661417,
         1171  +    0.083928884366,
         1172  +    -0.077709750902,
         1173  +    -0.055892523691,
         1174  +    0.038742619293,
         1175  +    0.035470398607,
         1176  +    -0.014853448005,
         1177  +    -0.019687215010,
         1178  +    0.003153847056,
         1179  +    0.008839103409,
         1180  +    0.000708137504,
         1181  +    -0.002843834547,
         1182  +    -0.000944897136,
         1183  +    0.000453956620,
         1184  +    0.000343631905,
         1185  +    0.000062906118,
         1186  +};
         1187  +
         1188  +static coeff_t vaidyanathan_lowpass_synthesis_coeffs[] = {
         1189  +    0.045799334111,
         1190  +    0.250184129505,
         1191  +    0.572797793211,
         1192  +    0.635601059872,
         1193  +    0.201612161775,
         1194  +    -0.263494802488,
         1195  +    -0.194450471766,
         1196  +    0.135084227129,
         1197  +    0.131971661417,
         1198  +    -0.083928884366,
         1199  +    -0.077709750902,
         1200  +    0.055892523691,
         1201  +    0.038742619293,
         1202  +    -0.035470398607,
         1203  +    -0.014853448005,
         1204  +    0.019687215010,
         1205  +    0.003153847056,
         1206  +    -0.008839103409,
         1207  +    0.000708137504,
         1208  +    0.002843834547,
         1209  +    -0.000944897136,
         1210  +    -0.000453956620,
         1211  +    0.000343631905,
         1212  +    -0.000062906118,
         1213  +};
         1214  +
         1215  +static coeff_t vaidyanathan_highpass_synthesis_coeffs[] = {
         1216  +    0.000062906118,
         1217  +    0.000343631905,
         1218  +    0.000453956620,
         1219  +    -0.000944897136,
         1220  +    -0.002843834547,
         1221  +    0.000708137504,
         1222  +    0.008839103409,
         1223  +    0.003153847056,
         1224  +    -0.019687215010,
         1225  +    -0.014853448005,
         1226  +    0.035470398607,
         1227  +    0.038742619293,
         1228  +    -0.055892523691,
         1229  +    -0.077709750902,
         1230  +    0.083928884366,
         1231  +    0.131971661417,
         1232  +    -0.135084227129,
         1233  +    -0.194450471766,
         1234  +    0.263494802488,
         1235  +    0.201612161775,
         1236  +    -0.635601059872,
         1237  +    0.572797793211,
         1238  +    -0.250184129505,
         1239  +    0.045799334111,
         1240  +};
         1241  +
         1242  +static filter_t vaidyanathan_lowpass_analysis = {
         1243  +    24,
         1244  +    ANTICAUSAL,
         1245  +    LOWPASS_ANALYSIS,
         1246  +    vaidyanathan_lowpass_analysis_coeffs,
         1247  +};
         1248  +
         1249  +static filter_t vaidyanathan_highpass_analysis = {
         1250  +    24,
         1251  +    ANTICAUSAL,
         1252  +    HIGHPASS_ANALYSIS,
         1253  +    vaidyanathan_highpass_analysis_coeffs,
         1254  +};
         1255  +
         1256  +static filter_t vaidyanathan_lowpass_synthesis = {
         1257  +    24,
         1258  +    CAUSAL,
         1259  +    LOWPASS_SYNTHESIS,
         1260  +    vaidyanathan_lowpass_synthesis_coeffs,
         1261  +};
         1262  +
         1263  +static filter_t vaidyanathan_highpass_synthesis = {
         1264  +    24,
         1265  +    CAUSAL,
         1266  +    HIGHPASS_SYNTHESIS,
         1267  +    vaidyanathan_highpass_synthesis_coeffs,
         1268  +};
         1269  +
         1270  +static filterbank_t vaidyanathan = {
         1271  +    "vaidyanathan",
         1272  +    "Vaidyanathan",
         1273  +    ORTHOGONAL,
         1274  +    &vaidyanathan_lowpass_analysis,
         1275  +    &vaidyanathan_highpass_analysis,
         1276  +    &vaidyanathan_lowpass_synthesis,
         1277  +    &vaidyanathan_highpass_synthesis,
         1278  +};
         1279  +
         1280  +/* Coeflet �6 filter. */
         1281  +
         1282  +static coeff_t coiflet6_lowpass_analysis_coeffs[] = {
         1283  +    0.038580777748,
         1284  +    -0.126969125396,
         1285  +    -0.077161555496,
         1286  +    0.607491641386,
         1287  +    0.745687558934,
         1288  +    0.226584265197,
         1289  +};
         1290  +
         1291  +static coeff_t coiflet6_highpass_analysis_coeffs[] = {
         1292  +    0.226584265197,
         1293  +    -0.745687558934,
         1294  +    0.607491641386,
         1295  +    0.077161555496,
         1296  +    -0.126969125396,
         1297  +    -0.038580777748,
         1298  +};
         1299  +
         1300  +static coeff_t coiflet6_lowpass_synthesis_coeffs[] = {
         1301  +    0.226584265197,
         1302  +    0.745687558934,
         1303  +    0.607491641386,
         1304  +    -0.077161555496,
         1305  +    -0.126969125396,
         1306  +    0.038580777748,
         1307  +};
         1308  +
         1309  +static coeff_t coiflet6_highpass_synthesis_coeffs[] = {
         1310  +    -0.038580777748,
         1311  +    -0.126969125396,
         1312  +    0.077161555496,
         1313  +    0.607491641386,
         1314  +    -0.745687558934,
         1315  +    0.226584265197,
         1316  +};
         1317  +
         1318  +static filter_t coiflet6_lowpass_analysis = {
         1319  +    6,
         1320  +    ANTICAUSAL,
         1321  +    LOWPASS_ANALYSIS,
         1322  +    coiflet6_lowpass_analysis_coeffs,
         1323  +};
         1324  +
         1325  +static filter_t coiflet6_highpass_analysis = {
         1326  +    6,
         1327  +    ANTICAUSAL,
         1328  +    HIGHPASS_ANALYSIS,
         1329  +    coiflet6_highpass_analysis_coeffs,
         1330  +};
         1331  +
         1332  +static filter_t coiflet6_lowpass_synthesis = {
         1333  +    6,
         1334  +    CAUSAL,
         1335  +    LOWPASS_SYNTHESIS,
         1336  +    coiflet6_lowpass_synthesis_coeffs,
         1337  +};
         1338  +
         1339  +static filter_t coiflet6_highpass_synthesis = {
         1340  +    6,
         1341  +    CAUSAL,
         1342  +    HIGHPASS_SYNTHESIS,
         1343  +    coiflet6_highpass_synthesis_coeffs,
         1344  +};
         1345  +
         1346  +static filterbank_t coiflet6 = {
         1347  +    "coiflet6",
         1348  +    "Coeflet C6",
         1349  +    ORTHOGONAL,
         1350  +    &coiflet6_lowpass_analysis,
         1351  +    &coiflet6_highpass_analysis,
         1352  +    &coiflet6_lowpass_synthesis,
         1353  +    &coiflet6_highpass_synthesis,
         1354  +};
         1355  +
         1356  +/* Coeflet C12 filter. */
         1357  +
         1358  +static coeff_t coiflet12_lowpass_analysis_coeffs[] = {
         1359  +    0.016387336463,
         1360  +    -0.041464936782,
         1361  +    -0.067372554722,
         1362  +    0.386110066823,
         1363  +    0.812723635450,
         1364  +    0.417005184424,
         1365  +    -0.076488599078,
         1366  +    -0.059434418646,
         1367  +    0.023680171947,
         1368  +    0.005611434819,
         1369  +    -0.001823208871,
         1370  +    -0.000720549445,
         1371  +};
         1372  +
         1373  +static coeff_t coiflet12_highpass_analysis_coeffs[] = {
         1374  +    -0.000720549445,
         1375  +    0.001823208871,
         1376  +    0.005611434819,
         1377  +    -0.023680171947,
         1378  +    -0.059434418646,
         1379  +    0.076488599078,
         1380  +    0.417005184424,
         1381  +    -0.812723635450,
         1382  +    0.386110066823,
         1383  +    0.067372554722,
         1384  +    -0.041464936782,
         1385  +    -0.016387336463,
         1386  +};
         1387  +
         1388  +static coeff_t coiflet12_lowpass_synthesis_coeffs[] = {
         1389  +    -0.000720549445,
         1390  +    -0.001823208871,
         1391  +    0.005611434819,
         1392  +    0.023680171947,
         1393  +    -0.059434418646,
         1394  +    -0.076488599078,
         1395  +    0.417005184424,
         1396  +    0.812723635450,
         1397  +    0.386110066823,
         1398  +    -0.067372554722,
         1399  +    -0.041464936782,
         1400  +    0.016387336463,
         1401  +};
         1402  +
         1403  +static coeff_t coiflet12_highpass_synthesis_coeffs[] = {
         1404  +    -0.016387336463,
         1405  +    -0.041464936782,
         1406  +    0.067372554722,
         1407  +    0.386110066823,
         1408  +    -0.812723635450,
         1409  +    0.417005184424,
         1410  +    0.076488599078,
         1411  +    -0.059434418646,
         1412  +    -0.023680171947,
         1413  +    0.005611434819,
         1414  +    0.001823208871,
         1415  +    -0.000720549445,
         1416  +};
         1417  +
         1418  +static filter_t coiflet12_lowpass_analysis = {
         1419  +    12,
         1420  +    ANTICAUSAL,
         1421  +    LOWPASS_ANALYSIS,
         1422  +    coiflet12_lowpass_analysis_coeffs,
         1423  +};
         1424  +
         1425  +static filter_t coiflet12_highpass_analysis = {
         1426  +    12,
         1427  +    ANTICAUSAL,
         1428  +    HIGHPASS_ANALYSIS,
         1429  +    coiflet12_highpass_analysis_coeffs,
         1430  +};
         1431  +
         1432  +static filter_t coiflet12_lowpass_synthesis = {
         1433  +    12,
         1434  +    CAUSAL,
         1435  +    LOWPASS_SYNTHESIS,
         1436  +    coiflet12_lowpass_synthesis_coeffs,
         1437  +};
         1438  +
         1439  +static filter_t coiflet12_highpass_synthesis = {
         1440  +    12,
         1441  +    CAUSAL,
         1442  +    HIGHPASS_SYNTHESIS,
         1443  +    coiflet12_highpass_synthesis_coeffs,
         1444  +};
         1445  +
         1446  +static filterbank_t coiflet12 = {
         1447  +    "coiflet12",
         1448  +    "Coeflet C12",
         1449  +    ORTHOGONAL,
         1450  +    &coiflet12_lowpass_analysis,
         1451  +    &coiflet12_highpass_analysis,
         1452  +    &coiflet12_lowpass_synthesis,
         1453  +    &coiflet12_highpass_synthesis,
         1454  +};
         1455  +
         1456  +/* Coeflet C18 filter. */
         1457  +
         1458  +static coeff_t coiflet18_lowpass_analysis_coeffs[] = {
         1459  +    -0.003793512864,
         1460  +    0.007782596426,
         1461  +    0.023452696142,
         1462  +    -0.065771911281,
         1463  +    -0.061123390003,
         1464  +    0.405176902410,
         1465  +    0.793777222626,
         1466  +    0.428483476378,
         1467  +    -0.071799821619,
         1468  +    -0.082301927106,
         1469  +    0.034555027573,
         1470  +    0.015880544864,
         1471  +    -0.009007976137,
         1472  +    -0.002574517688,
         1473  +    0.001117518771,
         1474  +    0.000466216960,
         1475  +    -0.000070983303,
         1476  +    -0.000034599773,
         1477  +};
         1478  +
         1479  +static coeff_t coiflet18_highpass_analysis_coeffs[] = {
         1480  +    -0.000034599773,
         1481  +    0.000070983303,
         1482  +    0.000466216960,
         1483  +    -0.001117518771,
         1484  +    -0.002574517688,
         1485  +    0.009007976137,
         1486  +    0.015880544864,
         1487  +    -0.034555027573,
         1488  +    -0.082301927106,
         1489  +    0.071799821619,
         1490  +    0.428483476378,
         1491  +    -0.793777222626,
         1492  +    0.405176902410,
         1493  +    0.061123390003,
         1494  +    -0.065771911281,
         1495  +    -0.023452696142,
         1496  +    0.007782596426,
         1497  +    0.003793512864,
         1498  +};
         1499  +
         1500  +static coeff_t coiflet18_lowpass_synthesis_coeffs[] = {
         1501  +    -0.000034599773,
         1502  +    -0.000070983303,
         1503  +    0.000466216960,
         1504  +    0.001117518771,
         1505  +    -0.002574517688,
         1506  +    -0.009007976137,
         1507  +    0.015880544864,
         1508  +    0.034555027573,
         1509  +    -0.082301927106,
         1510  +    -0.071799821619,
         1511  +    0.428483476378,
         1512  +    0.793777222626,
         1513  +    0.405176902410,
         1514  +    -0.061123390003,
         1515  +    -0.065771911281,
         1516  +    0.023452696142,
         1517  +    0.007782596426,
         1518  +    -0.003793512864,
         1519  +};
         1520  +
         1521  +static coeff_t coiflet18_highpass_synthesis_coeffs[] = {
         1522  +    0.003793512864,
         1523  +    0.007782596426,
         1524  +    -0.023452696142,
         1525  +    -0.065771911281,
         1526  +    0.061123390003,
         1527  +    0.405176902410,
         1528  +    -0.793777222626,
         1529  +    0.428483476378,
         1530  +    0.071799821619,
         1531  +    -0.082301927106,
         1532  +    -0.034555027573,
         1533  +    0.015880544864,
         1534  +    0.009007976137,
         1535  +    -0.002574517688,
         1536  +    -0.001117518771,
         1537  +    0.000466216960,
         1538  +    0.000070983303,
         1539  +    -0.000034599773,
         1540  +};
         1541  +
         1542  +static filter_t coiflet18_lowpass_analysis = {
         1543  +    18,
         1544  +    ANTICAUSAL,
         1545  +    LOWPASS_ANALYSIS,
         1546  +    coiflet18_lowpass_analysis_coeffs,
         1547  +};
         1548  +
         1549  +static filter_t coiflet18_highpass_analysis = {
         1550  +    18,
         1551  +    ANTICAUSAL,
         1552  +    HIGHPASS_ANALYSIS,
         1553  +    coiflet18_highpass_analysis_coeffs,
         1554  +};
         1555  +
         1556  +static filter_t coiflet18_lowpass_synthesis = {
         1557  +    18,
         1558  +    CAUSAL,
         1559  +    LOWPASS_SYNTHESIS,
         1560  +    coiflet18_lowpass_synthesis_coeffs,
         1561  +};
         1562  +
         1563  +static filter_t coiflet18_highpass_synthesis = {
         1564  +    18,
         1565  +    CAUSAL,
         1566  +    HIGHPASS_SYNTHESIS,
         1567  +    coiflet18_highpass_synthesis_coeffs,
         1568  +};
         1569  +
         1570  +static filterbank_t coiflet18 = {
         1571  +    "coiflet18",
         1572  +    "Coeflet C18",
         1573  +    ORTHOGONAL,
         1574  +    &coiflet18_lowpass_analysis,
         1575  +    &coiflet18_highpass_analysis,
         1576  +    &coiflet18_lowpass_synthesis,
         1577  +    &coiflet18_highpass_synthesis,
         1578  +};
         1579  +
         1580  +/* Coeflet C24 filter. */
         1581  +
         1582  +static coeff_t coiflet24_lowpass_analysis_coeffs[] = {
         1583  +    0.000892313668,
         1584  +    -0.001629492013,
         1585  +    -0.007346166328,
         1586  +    0.016068943964,
         1587  +    0.026682300156,
         1588  +    -0.081266699680,
         1589  +    -0.056077313316,
         1590  +    0.415308407030,
         1591  +    0.782238930920,
         1592  +    0.434386056491,
         1593  +    -0.066627474263,
         1594  +    -0.096220442034,
         1595  +    0.039334427123,
         1596  +    0.025082261845,
         1597  +    -0.015211731527,
         1598  +    -0.005658286686,
         1599  +    0.003751436157,
         1600  +    0.001266561929,
         1601  +    -0.000589020757,
         1602  +    -0.000259974552,
         1603  +    0.000062339034,
         1604  +    0.000031229876,
         1605  +    -0.000003259680,
         1606  +    -0.000001784985,
         1607  +};
         1608  +
         1609  +static coeff_t coiflet24_highpass_analysis_coeffs[] = {
         1610  +    -0.000001784985,
         1611  +    0.000003259680,
         1612  +    0.000031229876,
         1613  +    -0.000062339034,
         1614  +    -0.000259974552,
         1615  +    0.000589020757,
         1616  +    0.001266561929,
         1617  +    -0.003751436157,
         1618  +    -0.005658286686,
         1619  +    0.015211731527,
         1620  +    0.025082261845,
         1621  +    -0.039334427123,
         1622  +    -0.096220442034,
         1623  +    0.066627474263,
         1624  +    0.434386056491,
         1625  +    -0.782238930920,
         1626  +    0.415308407030,
         1627  +    0.056077313316,
         1628  +    -0.081266699680,
         1629  +    -0.026682300156,
         1630  +    0.016068943964,
         1631  +    0.007346166328,
         1632  +    -0.001629492013,
         1633  +    -0.000892313668,
         1634  +};
         1635  +
         1636  +static coeff_t coiflet24_lowpass_synthesis_coeffs[] = {
         1637  +    -0.000001784985,
         1638  +    -0.000003259680,
         1639  +    0.000031229876,
         1640  +    0.000062339034,
         1641  +    -0.000259974552,
         1642  +    -0.000589020757,
         1643  +    0.001266561929,
         1644  +    0.003751436157,
         1645  +    -0.005658286686,
         1646  +    -0.015211731527,
         1647  +    0.025082261845,
         1648  +    0.039334427123,
         1649  +    -0.096220442034,
         1650  +    -0.066627474263,
         1651  +    0.434386056491,
         1652  +    0.782238930920,
         1653  +    0.415308407030,
         1654  +    -0.056077313316,
         1655  +    -0.081266699680,
         1656  +    0.026682300156,
         1657  +    0.016068943964,
         1658  +    -0.007346166328,
         1659  +    -0.001629492013,
         1660  +    0.000892313668,
         1661  +};
         1662  +
         1663  +static coeff_t coiflet24_highpass_synthesis_coeffs[] = {
         1664  +    -0.000892313668,
         1665  +    -0.001629492013,
         1666  +    0.007346166328,
         1667  +    0.016068943964,
         1668  +    -0.026682300156,
         1669  +    -0.081266699680,
         1670  +    0.056077313316,
         1671  +    0.415308407030,
         1672  +    -0.782238930920,
         1673  +    0.434386056491,
         1674  +    0.066627474263,
         1675  +    -0.096220442034,
         1676  +    -0.039334427123,
         1677  +    0.025082261845,
         1678  +    0.015211731527,
         1679  +    -0.005658286686,
         1680  +    -0.003751436157,
         1681  +    0.001266561929,
         1682  +    0.000589020757,
         1683  +    -0.000259974552,
         1684  +    -0.000062339034,
         1685  +    0.000031229876,
         1686  +    0.000003259680,
         1687  +    -0.000001784985,
         1688  +};
         1689  +
         1690  +static filter_t coiflet24_lowpass_analysis = {
         1691  +    24,
         1692  +    ANTICAUSAL,
         1693  +    LOWPASS_ANALYSIS,
         1694  +    coiflet24_lowpass_analysis_coeffs,
         1695  +};
         1696  +
         1697  +static filter_t coiflet24_highpass_analysis = {
         1698  +    24,
         1699  +    ANTICAUSAL,
         1700  +    HIGHPASS_ANALYSIS,
         1701  +    coiflet24_highpass_analysis_coeffs,
         1702  +};
         1703  +
         1704  +static filter_t coiflet24_lowpass_synthesis = {
         1705  +    24,
         1706  +    CAUSAL,
         1707  +    LOWPASS_SYNTHESIS,
         1708  +    coiflet24_lowpass_synthesis_coeffs,
         1709  +};
         1710  +
         1711  +static filter_t coiflet24_highpass_synthesis = {
         1712  +    24,
         1713  +    CAUSAL,
         1714  +    HIGHPASS_SYNTHESIS,
         1715  +    coiflet24_highpass_synthesis_coeffs,
         1716  +};
         1717  +
         1718  +static filterbank_t coiflet24 = {
         1719  +    "coiflet24",
         1720  +    "Coeflet C24",
         1721  +    ORTHOGONAL,
         1722  +    &coiflet24_lowpass_analysis,
         1723  +    &coiflet24_highpass_analysis,
         1724  +    &coiflet24_lowpass_synthesis,
         1725  +    &coiflet24_highpass_synthesis,
         1726  +};
         1727  +
         1728  +/* Coiflet C30 filter. */
         1729  +
         1730  +static coeff_t coiflet30_lowpass_analysis_coeffs[] = {
         1731  +    -0.000212080863,
         1732  +    0.000358589677,
         1733  +    0.002178236305,
         1734  +    -0.004159358782,
         1735  +    -0.010131117538,
         1736  +    0.023408156762,
         1737  +    0.028168029062,
         1738  +    -0.091920010549,
         1739  +    -0.052043163216,
         1740  +    0.421566206729,
         1741  +    0.774289603740,
         1742  +    0.437991626228,
         1743  +    -0.062035963906,
         1744  +    -0.105574208706,
         1745  +    0.041289208741,
         1746  +    0.032683574283,
         1747  +    -0.019761779012,
         1748  +    -0.009164231153,
         1749  +    0.006764185419,
         1750  +    0.002433373209,
         1751  +    -0.001662863769,
         1752  +    -0.000638131296,
         1753  +    0.000302259520,
         1754  +    0.000140541149,
         1755  +    -0.000041340484,
         1756  +    -0.000021315014,
         1757  +    0.000003734597,
         1758  +    0.000002063806,
         1759  +    -0.000000167408,
         1760  +    -0.000000095158,
         1761  +};
         1762  +
         1763  +static coeff_t coiflet30_highpass_analysis_coeffs[] = {
         1764  +    -0.000000095158,
         1765  +    0.000000167408,
         1766  +    0.000002063806,
         1767  +    -0.000003734597,
         1768  +    -0.000021315014,
         1769  +    0.000041340484,
         1770  +    0.000140541149,
         1771  +    -0.000302259520,
         1772  +    -0.000638131296,
         1773  +    0.001662863769,
         1774  +    0.002433373209,
         1775  +    -0.006764185419,
         1776  +    -0.009164231153,
         1777  +    0.019761779012,
         1778  +    0.032683574283,
         1779  +    -0.041289208741,
         1780  +    -0.105574208706,
         1781  +    0.062035963906,
         1782  +    0.437991626228,
         1783  +    -0.774289603740,
         1784  +    0.421566206729,
         1785  +    0.052043163216,
         1786  +    -0.091920010549,
         1787  +    -0.028168029062,
         1788  +    0.023408156762,
         1789  +    0.010131117538,
         1790  +    -0.004159358782,
         1791  +    -0.002178236305,
         1792  +    0.000358589677,
         1793  +    0.000212080863,
         1794  +};
         1795  +
         1796  +static coeff_t coiflet30_lowpass_synthesis_coeffs[] = {
         1797  +    -0.000000095158,
         1798  +    -0.000000167408,
         1799  +    0.000002063806,
         1800  +    0.000003734597,
         1801  +    -0.000021315014,
         1802  +    -0.000041340484,
         1803  +    0.000140541149,
         1804  +    0.000302259520,
         1805  +    -0.000638131296,
         1806  +    -0.001662863769,
         1807  +    0.002433373209,
         1808  +    0.006764185419,
         1809  +    -0.009164231153,
         1810  +    -0.019761779012,
         1811  +    0.032683574283,
         1812  +    0.041289208741,
         1813  +    -0.105574208706,
         1814  +    -0.062035963906,
         1815  +    0.437991626228,
         1816  +    0.774289603740,
         1817  +    0.421566206729,
         1818  +    -0.052043163216,
         1819  +    -0.091920010549,
         1820  +    0.028168029062,
         1821  +    0.023408156762,
         1822  +    -0.010131117538,
         1823  +    -0.004159358782,
         1824  +    0.002178236305,
         1825  +    0.000358589677,
         1826  +    -0.000212080863,
         1827  +};
         1828  +
         1829  +static coeff_t coiflet30_highpass_synthesis_coeffs[] = {
         1830  +    0.000212080863,
         1831  +    0.000358589677,
         1832  +    -0.002178236305,
         1833  +    -0.004159358782,
         1834  +    0.010131117538,
         1835  +    0.023408156762,
         1836  +    -0.028168029062,
         1837  +    -0.091920010549,
         1838  +    0.052043163216,
         1839  +    0.421566206729,
         1840  +    -0.774289603740,
         1841  +    0.437991626228,
         1842  +    0.062035963906,
         1843  +    -0.105574208706,
         1844  +    -0.041289208741,
         1845  +    0.032683574283,
         1846  +    0.019761779012,
         1847  +    -0.009164231153,
         1848  +    -0.006764185419,
         1849  +    0.002433373209,
         1850  +    0.001662863769,
         1851  +    -0.000638131296,
         1852  +    -0.000302259520,
         1853  +    0.000140541149,
         1854  +    0.000041340484,
         1855  +    -0.000021315014,
         1856  +    -0.000003734597,
         1857  +    0.000002063806,
         1858  +    0.000000167408,
         1859  +    -0.000000095158,
         1860  +};
         1861  +
         1862  +static filter_t coiflet30_lowpass_analysis = {
         1863  +    30,
         1864  +    ANTICAUSAL,
         1865  +    LOWPASS_ANALYSIS,
         1866  +    coiflet30_lowpass_analysis_coeffs,
         1867  +};
         1868  +
         1869  +static filter_t coiflet30_highpass_analysis = {
         1870  +    30,
         1871  +    ANTICAUSAL,
         1872  +    HIGHPASS_ANALYSIS,
         1873  +    coiflet30_highpass_analysis_coeffs,
         1874  +};
         1875  +
         1876  +static filter_t coiflet30_lowpass_synthesis = {
         1877  +    30,
         1878  +    CAUSAL,
         1879  +    LOWPASS_SYNTHESIS,
         1880  +    coiflet30_lowpass_synthesis_coeffs,
         1881  +};
         1882  +
         1883  +static filter_t coiflet30_highpass_synthesis = {
         1884  +    30,
         1885  +    CAUSAL,
         1886  +    HIGHPASS_SYNTHESIS,
         1887  +    coiflet30_highpass_synthesis_coeffs,
         1888  +};
         1889  +
         1890  +static filterbank_t coiflet30 = {
         1891  +    "coiflet30",
         1892  +    "Coiflet C30",
         1893  +    ORTHOGONAL,
         1894  +    &coiflet30_lowpass_analysis,
         1895  +    &coiflet30_highpass_analysis,
         1896  +    &coiflet30_lowpass_synthesis,
         1897  +    &coiflet30_highpass_synthesis,
         1898  +};
         1899  +
         1900  +/* Symmlets are wavelets within a minimum size support for a given
         1901  + * number of vanishing moments, but they are as symmetrical as possible,
         1902  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         1903  +
         1904  +static coeff_t symmlet8_lowpass_analysis_coeffs[] = {
         1905  +    -0.075765714789357,
         1906  +    -0.029635527645960,
         1907  +    0.497618667632563,
         1908  +    0.803738751805386,
         1909  +    0.297857795605605,
         1910  +    -0.099219543576956,
         1911  +    -0.012603967262264,
         1912  +    0.032223100604078,
         1913  +};
         1914  +
         1915  +static coeff_t symmlet8_highpass_analysis_coeffs[] = {
         1916  +    0.032223100604078,
         1917  +    0.012603967262264,
         1918  +    -0.099219543576956,
         1919  +    -0.297857795605605,
         1920  +    0.803738751805386,
         1921  +    -0.497618667632563,
         1922  +    -0.029635527645960,
         1923  +    0.075765714789357,
         1924  +};
         1925  +
         1926  +static coeff_t symmlet8_lowpass_synthesis_coeffs[] = {
         1927  +    0.032223100604078,
         1928  +    -0.012603967262264,
         1929  +    -0.099219543576956,
         1930  +    0.297857795605605,
         1931  +    0.803738751805386,
         1932  +    0.497618667632563,
         1933  +    -0.029635527645960,
         1934  +    -0.075765714789357,
         1935  +};
         1936  +
         1937  +static coeff_t symmlet8_highpass_synthesis_coeffs[] = {
         1938  +    0.075765714789357,
         1939  +    -0.029635527645960,
         1940  +    -0.497618667632563,
         1941  +    0.803738751805386,
         1942  +    -0.297857795605605,
         1943  +    -0.099219543576956,
         1944  +    0.012603967262264,
         1945  +    0.032223100604078,
         1946  +};
         1947  +
         1948  +static filter_t symmlet8_lowpass_analysis = {
         1949  +    8,
         1950  +    ANTICAUSAL,
         1951  +    LOWPASS_ANALYSIS,
         1952  +    symmlet8_lowpass_analysis_coeffs,
         1953  +};
         1954  +
         1955  +static filter_t symmlet8_highpass_analysis = {
         1956  +    8,
         1957  +    ANTICAUSAL,
         1958  +    HIGHPASS_ANALYSIS,
         1959  +    symmlet8_highpass_analysis_coeffs,
         1960  +};
         1961  +
         1962  +static filter_t symmlet8_lowpass_synthesis = {
         1963  +    8,
         1964  +    CAUSAL,
         1965  +    LOWPASS_SYNTHESIS,
         1966  +    symmlet8_lowpass_synthesis_coeffs,
         1967  +};
         1968  +
         1969  +static filter_t symmlet8_highpass_synthesis = {
         1970  +    8,
         1971  +    CAUSAL,
         1972  +    HIGHPASS_SYNTHESIS,
         1973  +    symmlet8_highpass_synthesis_coeffs,
         1974  +};
         1975  +
         1976  +static filterbank_t symmlet8 = {
         1977  +    "symmlet8",
         1978  +    "Symmlet S8",
         1979  +    ORTHOGONAL,
         1980  +    &symmlet8_lowpass_analysis,
         1981  +    &symmlet8_highpass_analysis,
         1982  +    &symmlet8_lowpass_synthesis,
         1983  +    &symmlet8_highpass_synthesis,
         1984  +};
         1985  +
         1986  +/* Symmlets are wavelets within a minimum size support for a given
         1987  + * number of vanishing moments, but they are as symmetrical as possible,
         1988  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         1989  +
         1990  +static coeff_t symmlet10_lowpass_analysis_coeffs[] = {
         1991  +    0.027333068345163,
         1992  +    0.029519490926072,
         1993  +    -0.039134249302581,
         1994  +    0.199397533976983,
         1995  +    0.723407690403764,
         1996  +    0.633978963456911,
         1997  +    0.016602105764423,
         1998  +    -0.175328089908097,
         1999  +    -0.021101834024929,
         2000  +    0.019538882735386,
         2001  +};
         2002  +
         2003  +static coeff_t symmlet10_highpass_analysis_coeffs[] = {
         2004  +    0.019538882735386,
         2005  +    0.021101834024929,
         2006  +    -0.175328089908097,
         2007  +    -0.016602105764423,
         2008  +    0.633978963456911,
         2009  +    -0.723407690403764,
         2010  +    0.199397533976983,
         2011  +    0.039134249302581,
         2012  +    0.029519490926072,
         2013  +    -0.027333068345163,
         2014  +};
         2015  +
         2016  +static coeff_t symmlet10_lowpass_synthesis_coeffs[] = {
         2017  +    0.019538882735386,
         2018  +    -0.021101834024929,
         2019  +    -0.175328089908097,
         2020  +    0.016602105764423,
         2021  +    0.633978963456911,
         2022  +    0.723407690403764,
         2023  +    0.199397533976983,
         2024  +    -0.039134249302581,
         2025  +    0.029519490926072,
         2026  +    0.027333068345163,
         2027  +};
         2028  +
         2029  +static coeff_t symmlet10_highpass_synthesis_coeffs[] = {
         2030  +    -0.027333068345163,
         2031  +    0.029519490926072,
         2032  +    0.039134249302581,
         2033  +    0.199397533976983,
         2034  +    -0.723407690403764,
         2035  +    0.633978963456911,
         2036  +    -0.016602105764423,
         2037  +    -0.175328089908097,
         2038  +    0.021101834024929,
         2039  +    0.019538882735386,
         2040  +};
         2041  +
         2042  +static filter_t symmlet10_lowpass_analysis = {
         2043  +    10,
         2044  +    ANTICAUSAL,
         2045  +    LOWPASS_ANALYSIS,
         2046  +    symmlet10_lowpass_analysis_coeffs,
         2047  +};
         2048  +
         2049  +static filter_t symmlet10_highpass_analysis = {
         2050  +    10,
         2051  +    ANTICAUSAL,
         2052  +    HIGHPASS_ANALYSIS,
         2053  +    symmlet10_highpass_analysis_coeffs,
         2054  +};
         2055  +
         2056  +static filter_t symmlet10_lowpass_synthesis = {
         2057  +    10,
         2058  +    CAUSAL,
         2059  +    LOWPASS_SYNTHESIS,
         2060  +    symmlet10_lowpass_synthesis_coeffs,
         2061  +};
         2062  +
         2063  +static filter_t symmlet10_highpass_synthesis = {
         2064  +    10,
         2065  +    CAUSAL,
         2066  +    HIGHPASS_SYNTHESIS,
         2067  +    symmlet10_highpass_synthesis_coeffs,
         2068  +};
         2069  +
         2070  +static filterbank_t symmlet10 = {
         2071  +    "symmlet10",
         2072  +    "Symmlet S10",
         2073  +    ORTHOGONAL,
         2074  +    &symmlet10_lowpass_analysis,
         2075  +    &symmlet10_highpass_analysis,
         2076  +    &symmlet10_lowpass_synthesis,
         2077  +    &symmlet10_highpass_synthesis,
         2078  +};
         2079  +
         2080  +/* Symmlets are wavelets within a minimum size support for a given
         2081  + * number of vanishing moments, but they are as symmetrical as possible,
         2082  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2083  +
         2084  +static coeff_t symmlet12_lowpass_analysis_coeffs[] = {
         2085  +    0.015404109327339,
         2086  +    0.003490712084331,
         2087  +    -0.117990111148417,
         2088  +    -0.048311742586001,
         2089  +    0.491055941927666,
         2090  +    0.787641141028836,
         2091  +    0.337929421728258,
         2092  +    -0.072637522786604,
         2093  +    -0.021060292512697,
         2094  +    0.044724901770751,
         2095  +    0.001767711864398,
         2096  +    -0.007800708324765,
         2097  +};
         2098  +
         2099  +static coeff_t symmlet12_highpass_analysis_coeffs[] = {
         2100  +    -0.007800708324765,
         2101  +    -0.001767711864398,
         2102  +    0.044724901770751,
         2103  +    0.021060292512697,
         2104  +    -0.072637522786604,
         2105  +    -0.337929421728258,
         2106  +    0.787641141028836,
         2107  +    -0.491055941927666,
         2108  +    -0.048311742586001,
         2109  +    0.117990111148417,
         2110  +    0.003490712084331,
         2111  +    -0.015404109327339,
         2112  +};
         2113  +
         2114  +static coeff_t symmlet12_lowpass_synthesis_coeffs[] = {
         2115  +    -0.007800708324765,
         2116  +    0.001767711864398,
         2117  +    0.044724901770751,
         2118  +    -0.021060292512697,
         2119  +    -0.072637522786604,
         2120  +    0.337929421728258,
         2121  +    0.787641141028836,
         2122  +    0.491055941927666,
         2123  +    -0.048311742586001,
         2124  +    -0.117990111148417,
         2125  +    0.003490712084331,
         2126  +    0.015404109327339,
         2127  +};
         2128  +
         2129  +static coeff_t symmlet12_highpass_synthesis_coeffs[] = {
         2130  +    -0.015404109327339,
         2131  +    0.003490712084331,
         2132  +    0.117990111148417,
         2133  +    -0.048311742586001,
         2134  +    -0.491055941927666,
         2135  +    0.787641141028836,
         2136  +    -0.337929421728258,
         2137  +    -0.072637522786604,
         2138  +    0.021060292512697,
         2139  +    0.044724901770751,
         2140  +    -0.001767711864398,
         2141  +    -0.007800708324765,
         2142  +};
         2143  +
         2144  +static filter_t symmlet12_lowpass_analysis = {
         2145  +    12,
         2146  +    ANTICAUSAL,
         2147  +    LOWPASS_ANALYSIS,
         2148  +    symmlet12_lowpass_analysis_coeffs,
         2149  +};
         2150  +
         2151  +static filter_t symmlet12_highpass_analysis = {
         2152  +    12,
         2153  +    ANTICAUSAL,
         2154  +    HIGHPASS_ANALYSIS,
         2155  +    symmlet12_highpass_analysis_coeffs,
         2156  +};
         2157  +
         2158  +static filter_t symmlet12_lowpass_synthesis = {
         2159  +    12,
         2160  +    CAUSAL,
         2161  +    LOWPASS_SYNTHESIS,
         2162  +    symmlet12_lowpass_synthesis_coeffs,
         2163  +};
         2164  +
         2165  +static filter_t symmlet12_highpass_synthesis = {
         2166  +    12,
         2167  +    CAUSAL,
         2168  +    HIGHPASS_SYNTHESIS,
         2169  +    symmlet12_highpass_synthesis_coeffs,
         2170  +};
         2171  +
         2172  +static filterbank_t symmlet12 = {
         2173  +    "symmlet12",
         2174  +    "Symmlet S12",
         2175  +    ORTHOGONAL,
         2176  +    &symmlet12_lowpass_analysis,
         2177  +    &symmlet12_highpass_analysis,
         2178  +    &symmlet12_lowpass_synthesis,
         2179  +    &symmlet12_highpass_synthesis,
         2180  +};
         2181  +
         2182  +/* Symmlets are wavelets within a minimum size support for a given
         2183  + * number of vanishing moments, but they are as symmetrical as possible,
         2184  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2185  +
         2186  +static coeff_t symmlet14_lowpass_analysis_coeffs[] = {
         2187  +    0.002681814568116,
         2188  +    -0.001047384888965,
         2189  +    -0.012636303403152,
         2190  +    0.030515513165906,
         2191  +    0.067892693501598,
         2192  +    -0.049552834937041,
         2193  +    0.017441255087110,
         2194  +    0.536101917090782,
         2195  +    0.767764317004585,
         2196  +    0.288629631750988,
         2197  +    -0.140047240442706,
         2198  +    -0.107808237703619,
         2199  +    0.004010244871703,
         2200  +    0.010268176708497,
         2201  +};
         2202  +
         2203  +static coeff_t symmlet14_highpass_analysis_coeffs[] = {
         2204  +    0.010268176708497,
         2205  +    -0.004010244871703,
         2206  +    -0.107808237703619,
         2207  +    0.140047240442706,
         2208  +    0.288629631750988,
         2209  +    -0.767764317004585,
         2210  +    0.536101917090782,
         2211  +    -0.017441255087110,
         2212  +    -0.049552834937041,
         2213  +    -0.067892693501598,
         2214  +    0.030515513165906,
         2215  +    0.012636303403152,
         2216  +    -0.001047384888965,
         2217  +    -0.002681814568116,
         2218  +};
         2219  +
         2220  +static coeff_t symmlet14_lowpass_synthesis_coeffs[] = {
         2221  +    0.010268176708497,
         2222  +    0.004010244871703,
         2223  +    -0.107808237703619,
         2224  +    -0.140047240442706,
         2225  +    0.288629631750988,
         2226  +    0.767764317004585,
         2227  +    0.536101917090782,
         2228  +    0.017441255087110,
         2229  +    -0.049552834937041,
         2230  +    0.067892693501598,
         2231  +    0.030515513165906,
         2232  +    -0.012636303403152,
         2233  +    -0.001047384888965,
         2234  +    0.002681814568116,
         2235  +};
         2236  +
         2237  +static coeff_t symmlet14_highpass_synthesis_coeffs[] = {
         2238  +    -0.002681814568116,
         2239  +    -0.001047384888965,
         2240  +    0.012636303403152,
         2241  +    0.030515513165906,
         2242  +    -0.067892693501598,
         2243  +    -0.049552834937041,
         2244  +    -0.017441255087110,
         2245  +    0.536101917090782,
         2246  +    -0.767764317004585,
         2247  +    0.288629631750988,
         2248  +    0.140047240442706,
         2249  +    -0.107808237703619,
         2250  +    -0.004010244871703,
         2251  +    0.010268176708497,
         2252  +};
         2253  +
         2254  +static filter_t symmlet14_lowpass_analysis = {
         2255  +    14,
         2256  +    ANTICAUSAL,
         2257  +    LOWPASS_ANALYSIS,
         2258  +    symmlet14_lowpass_analysis_coeffs,
         2259  +};
         2260  +
         2261  +static filter_t symmlet14_highpass_analysis = {
         2262  +    14,
         2263  +    ANTICAUSAL,
         2264  +    HIGHPASS_ANALYSIS,
         2265  +    symmlet14_highpass_analysis_coeffs,
         2266  +};
         2267  +
         2268  +static filter_t symmlet14_lowpass_synthesis = {
         2269  +    14,
         2270  +    CAUSAL,
         2271  +    LOWPASS_SYNTHESIS,
         2272  +    symmlet14_lowpass_synthesis_coeffs,
         2273  +};
         2274  +
         2275  +static filter_t symmlet14_highpass_synthesis = {
         2276  +    14,
         2277  +    CAUSAL,
         2278  +    HIGHPASS_SYNTHESIS,
         2279  +    symmlet14_highpass_synthesis_coeffs,
         2280  +};
         2281  +
         2282  +static filterbank_t symmlet14 = {
         2283  +    "symmlet14",
         2284  +    "Symmlet S14",
         2285  +    ORTHOGONAL,
         2286  +    &symmlet14_lowpass_analysis,
         2287  +    &symmlet14_highpass_analysis,
         2288  +    &symmlet14_lowpass_synthesis,
         2289  +    &symmlet14_highpass_synthesis,
         2290  +};
         2291  +
         2292  +/* Symmlets are wavelets within a minimum size support for a given
         2293  + * number of vanishing moments, but they are as symmetrical as possible,
         2294  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2295  +
         2296  +static coeff_t symmlet16_lowpass_analysis_coeffs[] = {
         2297  +    0.00188995033291,
         2298  +    -0.00030292051455,
         2299  +    -0.01495225833679,
         2300  +    0.00380875201406,
         2301  +    0.04913717967348,
         2302  +    -0.02721902991682,
         2303  +    -0.05194583810788,
         2304  +    0.36444189483599,
         2305  +    0.77718575169981,
         2306  +    0.48135965125924,
         2307  +    -0.06127335906791,
         2308  +    -0.14329423835107,
         2309  +    0.00760748732529,
         2310  +    0.03169508781035,
         2311  +    -0.00054213233164,
         2312  +    -0.00338241595136,
         2313  +};
         2314  +
         2315  +static coeff_t symmlet16_highpass_analysis_coeffs[] = {
         2316  +    -0.00338241595136,
         2317  +    0.00054213233164,
         2318  +    0.03169508781035,
         2319  +    -0.00760748732529,
         2320  +    -0.14329423835107,
         2321  +    0.06127335906791,
         2322  +    0.48135965125924,
         2323  +    -0.77718575169981,
         2324  +    0.36444189483599,
         2325  +    0.05194583810788,
         2326  +    -0.02721902991682,
         2327  +    -0.04913717967348,
         2328  +    0.00380875201406,
         2329  +    0.01495225833679,
         2330  +    -0.00030292051455,
         2331  +    -0.00188995033291,
         2332  +};
         2333  +
         2334  +static coeff_t symmlet16_lowpass_synthesis_coeffs[] = {
         2335  +    -0.00338241595136,
         2336  +    -0.00054213233164,
         2337  +    0.03169508781035,
         2338  +    0.00760748732529,
         2339  +    -0.14329423835107,
         2340  +    -0.06127335906791,
         2341  +    0.48135965125924,
         2342  +    0.77718575169981,
         2343  +    0.36444189483599,
         2344  +    -0.05194583810788,
         2345  +    -0.02721902991682,
         2346  +    0.04913717967348,
         2347  +    0.00380875201406,
         2348  +    -0.01495225833679,
         2349  +    -0.00030292051455,
         2350  +    0.00188995033291,
         2351  +};
         2352  +
         2353  +static coeff_t symmlet16_highpass_synthesis_coeffs[] = {
         2354  +    -0.00188995033291,
         2355  +    -0.00030292051455,
         2356  +    0.01495225833679,
         2357  +    0.00380875201406,
         2358  +    -0.04913717967348,
         2359  +    -0.02721902991682,
         2360  +    0.05194583810788,
         2361  +    0.36444189483599,
         2362  +    -0.77718575169981,
         2363  +    0.48135965125924,
         2364  +    0.06127335906791,
         2365  +    -0.14329423835107,
         2366  +    -0.00760748732529,
         2367  +    0.03169508781035,
         2368  +    0.00054213233164,
         2369  +    -0.00338241595136,
         2370  +};
         2371  +
         2372  +static filter_t symmlet16_lowpass_analysis = {
         2373  +    16,
         2374  +    ANTICAUSAL,
         2375  +    LOWPASS_ANALYSIS,
         2376  +    symmlet16_lowpass_analysis_coeffs,
         2377  +};
         2378  +
         2379  +static filter_t symmlet16_highpass_analysis = {
         2380  +    16,
         2381  +    ANTICAUSAL,
         2382  +    HIGHPASS_ANALYSIS,
         2383  +    symmlet16_highpass_analysis_coeffs,
         2384  +};
         2385  +
         2386  +static filter_t symmlet16_lowpass_synthesis = {
         2387  +    16,
         2388  +    CAUSAL,
         2389  +    LOWPASS_SYNTHESIS,
         2390  +    symmlet16_lowpass_synthesis_coeffs,
         2391  +};
         2392  +
         2393  +static filter_t symmlet16_highpass_synthesis = {
         2394  +    16,
         2395  +    CAUSAL,
         2396  +    HIGHPASS_SYNTHESIS,
         2397  +    symmlet16_highpass_synthesis_coeffs,
         2398  +};
         2399  +
         2400  +static filterbank_t symmlet16 = {
         2401  +    "symmlet16",
         2402  +    "Symmlet S16",
         2403  +    ORTHOGONAL,
         2404  +    &symmlet16_lowpass_analysis,
         2405  +    &symmlet16_highpass_analysis,
         2406  +    &symmlet16_lowpass_synthesis,
         2407  +    &symmlet16_highpass_synthesis,
         2408  +};
         2409  +
         2410  +/* Symmlets are wavelets within a minimum size support for a given
         2411  + * number of vanishing moments, but they are as symmetrical as possible,
         2412  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2413  +
         2414  +static coeff_t symmlet18_lowpass_analysis_coeffs[] = {
         2415  +    0.001069490032652,
         2416  +    -0.000473154498587,
         2417  +    -0.010264064027672,
         2418  +    0.008859267493501,
         2419  +    0.062077789302687,
         2420  +    -0.018233770779803,
         2421  +    -0.191550831296252,
         2422  +    0.035272488035891,
         2423  +    0.617338449140593,
         2424  +    0.717897082763343,
         2425  +    0.238760914607125,
         2426  +    -0.054568958430509,
         2427  +    0.000583462746330,
         2428  +    0.030224878857952,
         2429  +    -0.011528210207971,
         2430  +    -0.013271967781517,
         2431  +    0.000619780889054,
         2432  +    0.001400915525570,
         2433  +};
         2434  +
         2435  +static coeff_t symmlet18_highpass_analysis_coeffs[] = {
         2436  +    0.001400915525570,
         2437  +    -0.000619780889054,
         2438  +    -0.013271967781517,
         2439  +    0.011528210207971,
         2440  +    0.030224878857952,
         2441  +    -0.000583462746330,
         2442  +    -0.054568958430509,
         2443  +    -0.238760914607125,
         2444  +    0.717897082763343,
         2445  +    -0.617338449140593,
         2446  +    0.035272488035891,
         2447  +    0.191550831296252,
         2448  +    -0.018233770779803,
         2449  +    -0.062077789302687,
         2450  +    0.008859267493501,
         2451  +    0.010264064027672,
         2452  +    -0.000473154498587,
         2453  +    -0.001069490032652,
         2454  +};
         2455  +
         2456  +static coeff_t symmlet18_lowpass_synthesis_coeffs[] = {
         2457  +    0.001400915525570,
         2458  +    0.000619780889054,
         2459  +    -0.013271967781517,
         2460  +    -0.011528210207971,
         2461  +    0.030224878857952,
         2462  +    0.000583462746330,
         2463  +    -0.054568958430509,
         2464  +    0.238760914607125,
         2465  +    0.717897082763343,
         2466  +    0.617338449140593,
         2467  +    0.035272488035891,
         2468  +    -0.191550831296252,
         2469  +    -0.018233770779803,
         2470  +    0.062077789302687,
         2471  +    0.008859267493501,
         2472  +    -0.010264064027672,
         2473  +    -0.000473154498587,
         2474  +    0.001069490032652,
         2475  +};
         2476  +
         2477  +static coeff_t symmlet18_highpass_synthesis_coeffs[] = {
         2478  +    -0.001069490032652,
         2479  +    -0.000473154498587,
         2480  +    0.010264064027672,
         2481  +    0.008859267493501,
         2482  +    -0.062077789302687,
         2483  +    -0.018233770779803,
         2484  +    0.191550831296252,
         2485  +    0.035272488035891,
         2486  +    -0.617338449140593,
         2487  +    0.717897082763343,
         2488  +    -0.238760914607125,
         2489  +    -0.054568958430509,
         2490  +    -0.000583462746330,
         2491  +    0.030224878857952,
         2492  +    0.011528210207971,
         2493  +    -0.013271967781517,
         2494  +    -0.000619780889054,
         2495  +    0.001400915525570,
         2496  +};
         2497  +
         2498  +static filter_t symmlet18_lowpass_analysis = {
         2499  +    18,
         2500  +    ANTICAUSAL,
         2501  +    LOWPASS_ANALYSIS,
         2502  +    symmlet18_lowpass_analysis_coeffs,
         2503  +};
         2504  +
         2505  +static filter_t symmlet18_highpass_analysis = {
         2506  +    18,
         2507  +    ANTICAUSAL,
         2508  +    HIGHPASS_ANALYSIS,
         2509  +    symmlet18_highpass_analysis_coeffs,
         2510  +};
         2511  +
         2512  +static filter_t symmlet18_lowpass_synthesis = {
         2513  +    18,
         2514  +    CAUSAL,
         2515  +    LOWPASS_SYNTHESIS,
         2516  +    symmlet18_lowpass_synthesis_coeffs,
         2517  +};
         2518  +
         2519  +static filter_t symmlet18_highpass_synthesis = {
         2520  +    18,
         2521  +    CAUSAL,
         2522  +    HIGHPASS_SYNTHESIS,
         2523  +    symmlet18_highpass_synthesis_coeffs,
         2524  +};
         2525  +
         2526  +static filterbank_t symmlet18 = {
         2527  +    "symmlet18",
         2528  +    "Symmlet S18",
         2529  +    ORTHOGONAL,
         2530  +    &symmlet18_lowpass_analysis,
         2531  +    &symmlet18_highpass_analysis,
         2532  +    &symmlet18_lowpass_synthesis,
         2533  +    &symmlet18_highpass_synthesis,
         2534  +};
         2535  +
         2536  +/* Symmlets are wavelets within a minimum size support for a given
         2537  + * number of vanishing moments, but they are as symmetrical as possible,
         2538  + * as opposed to the Daubechies filters which are highly asymmetrical. */
         2539  +
         2540  +static coeff_t symmlet20_lowpass_analysis_coeffs[] = {
         2541  +    0.0007701598089417,
         2542  +    9.56326707637102e-05,
         2543  +    -0.0086412992741304,
         2544  +    -0.0014653825830397,
         2545  +    0.0459272392141469,
         2546  +    0.0116098939105411,
         2547  +    -0.1594942788241300,
         2548  +    -0.0708805357960178,
         2549  +    0.4716906667438780,
         2550  +    0.7695100368531890,
         2551  +    0.3838267611450020,
         2552  +    -0.0355367402980268,
         2553  +    -0.0319900568214638,
         2554  +    0.0499949720686861,
         2555  +    0.0057649120443445,
         2556  +    -0.0203549397996833,
         2557  +    -0.0008043589343686,
         2558  +    0.0045931735827084,
         2559  +    5.70360843270715e-05,
         2560  +    -0.0004593294204519,
         2561  +};
         2562  +
         2563  +static coeff_t symmlet20_highpass_analysis_coeffs[] = {
         2564  +    -0.0004593294204519,
         2565  +    -5.70360843270715e-05,
         2566  +    0.0045931735827084,
         2567  +    0.0008043589343686,
         2568  +    -0.0203549397996833,
         2569  +    -0.0057649120443445,
         2570  +    0.0499949720686861,
         2571  +    0.0319900568214638,
         2572  +    -0.0355367402980268,
         2573  +    -0.3838267611450020,
         2574  +    0.7695100368531890,
         2575  +    -0.4716906667438780,
         2576  +    -0.0708805357960178,
         2577  +    0.1594942788241300,
         2578  +    0.0116098939105411,
         2579  +    -0.0459272392141469,
         2580  +    -0.0014653825830397,
         2581  +    0.0086412992741304,
         2582  +    9.56326707637102e-05,
         2583  +    -0.0007701598089417,
         2584  +};
         2585  +
         2586  +static coeff_t symmlet20_lowpass_synthesis_coeffs[] = {
         2587  +    -0.0004593294204519,
         2588  +    5.70360843270715e-05,
         2589  +    0.0045931735827084,
         2590  +    -0.0008043589343686,
         2591  +    -0.0203549397996833,
         2592  +    0.0057649120443445,
         2593  +    0.0499949720686861,
         2594  +    -0.0319900568214638,
         2595  +    -0.0355367402980268,
         2596  +    0.3838267611450020,
         2597  +    0.7695100368531890,
         2598  +    0.4716906667438780,
         2599  +    -0.0708805357960178,
         2600  +    -0.1594942788241300,
         2601  +    0.0116098939105411,
         2602  +    0.0459272392141469,
         2603  +    -0.0014653825830397,
         2604  +    -0.0086412992741304,
         2605  +    9.56326707637102e-05,
         2606  +    0.0007701598089417,
         2607  +};
         2608  +
         2609  +static coeff_t symmlet20_highpass_synthesis_coeffs[] = {
         2610  +    -0.0007701598089417,
         2611  +    9.56326707637102e-05,
         2612  +    0.0086412992741304,
         2613  +    -0.0014653825830397,
         2614  +    -0.0459272392141469,
         2615  +    0.0116098939105411,
         2616  +    0.1594942788241300,
         2617  +    -0.0708805357960178,
         2618  +    -0.4716906667438780,
         2619  +    0.7695100368531890,
         2620  +    -0.3838267611450020,
         2621  +    -0.0355367402980268,
         2622  +    0.0319900568214638,
         2623  +    0.0499949720686861,
         2624  +    -0.0057649120443445,
         2625  +    -0.0203549397996833,
         2626  +    0.0008043589343686,
         2627  +    0.0045931735827084,
         2628  +    -5.70360843270715e-05,
         2629  +    -0.0004593294204519,
         2630  +};
         2631  +
         2632  +static filter_t symmlet20_lowpass_analysis = {
         2633  +    20,
         2634  +    ANTICAUSAL,
         2635  +    LOWPASS_ANALYSIS,
         2636  +    symmlet20_lowpass_analysis_coeffs,
         2637  +};
         2638  +
         2639  +static filter_t symmlet20_highpass_analysis = {
         2640  +    20,
         2641  +    ANTICAUSAL,
         2642  +    HIGHPASS_ANALYSIS,
         2643  +    symmlet20_highpass_analysis_coeffs,
         2644  +};
         2645  +
         2646  +static filter_t symmlet20_lowpass_synthesis = {
         2647  +    20,
         2648  +    CAUSAL,
         2649  +    LOWPASS_SYNTHESIS,
         2650  +    symmlet20_lowpass_synthesis_coeffs,
         2651  +};
         2652  +
         2653  +static filter_t symmlet20_highpass_synthesis = {
         2654  +    20,
         2655  +    CAUSAL,
         2656  +    HIGHPASS_SYNTHESIS,
         2657  +    symmlet20_highpass_synthesis_coeffs,
         2658  +};
         2659  +
         2660  +static filterbank_t symmlet20 = {
         2661  +    "symmlet20",
         2662  +    "Symmlet S20",
         2663  +    ORTHOGONAL,
         2664  +    &symmlet20_lowpass_analysis,
         2665  +    &symmlet20_highpass_analysis,
         2666  +    &symmlet20_lowpass_synthesis,
         2667  +    &symmlet20_highpass_synthesis,
         2668  +};
         2669  +
         2670  +/* Odegard's 9/7 filter. */
         2671  +
         2672  +static coeff_t odegard97_lowpass_analysis_coeffs[] = {
         2673  +    0.7875137715277921,
         2674  +    0.3869718638726204,
         2675  +    -0.0930692637035827,
         2676  +    -0.0334184732793468,
         2677  +    0.0528657685329605,
         2678  +};
         2679  +
         2680  +static coeff_t odegard97_highpass_analysis_coeffs[] = {
         2681  +    -0.8167806349921064,
         2682  +    0.4403017067249854,
         2683  +    0.0548369269027794,
         2684  +    -0.0867483161317116,
         2685  +};
         2686  +
         2687  +static coeff_t odegard97_lowpass_synthesis_coeffs[] = {
         2688  +    0.8167806349921064,
         2689  +    0.4403017067249854,
         2690  +    -0.0548369269027794,
         2691  +    -0.0867483161317116,
         2692  +};
         2693  +
         2694  +static coeff_t odegard97_highpass_synthesis_coeffs[] = {
         2695  +    -0.7875137715277921,
         2696  +    0.3869718638726204,
         2697  +    0.0930692637035827,
         2698  +    -0.0334184732793468,
         2699  +    -0.0528657685329605,
         2700  +};
         2701  +
         2702  +static filter_t odegard97_lowpass_analysis = {
         2703  +    5,
         2704  +    SYMMETRIC_WHOLE,
         2705  +    LOWPASS_ANALYSIS,
         2706  +    odegard97_lowpass_analysis_coeffs,
         2707  +};
         2708  +
         2709  +static filter_t odegard97_highpass_analysis = {
         2710  +    4,
         2711  +    SYMMETRIC_WHOLE,
         2712  +    HIGHPASS_ANALYSIS,
         2713  +    odegard97_highpass_analysis_coeffs,
         2714  +};
         2715  +
         2716  +static filter_t odegard97_lowpass_synthesis = {
         2717  +    4,
         2718  +    SYMMETRIC_WHOLE,
         2719  +    LOWPASS_SYNTHESIS,
         2720  +    odegard97_lowpass_synthesis_coeffs,
         2721  +};
         2722  +
         2723  +static filter_t odegard97_highpass_synthesis = {
         2724  +    5,
         2725  +    SYMMETRIC_WHOLE,
         2726  +    HIGHPASS_SYNTHESIS,
         2727  +    odegard97_highpass_synthesis_coeffs,
         2728  +};
         2729  +
         2730  +static filterbank_t odegard97 = {
         2731  +    "odegard97",
         2732  +    "Odegard 9/7",
         2733  +    BIORTHOGONAL,
         2734  +    &odegard97_lowpass_analysis,
         2735  +    &odegard97_highpass_analysis,
         2736  +    &odegard97_lowpass_synthesis,
         2737  +    &odegard97_highpass_synthesis,
         2738  +};
         2739  +
         2740  +/* 9/7 filter from M. Antonini, M. Barlaud, P. Mathieu, and
         2741  + * I. Daubechies, "Image coding using wavelet transform", IEEE
         2742  + * Transactions on Image Processing, Vol. pp. 205-220, 1992. */
         2743  +
         2744  +static coeff_t daub97_lowpass_analysis_coeffs[] = {
         2745  +    0.8526986790088938,
         2746  +    0.3774028556128306,
         2747  +    -0.1106244044184372,
         2748  +    -0.0238494650195568,
         2749  +    0.0378284555072640,
         2750  +};
         2751  +
         2752  +static coeff_t daub97_highpass_analysis_coeffs[] = {
         2753  +    -0.7884856164063712,
         2754  +    0.4180922732220353,
         2755  +    0.0406894176092047,
         2756  +    -0.0645388826287616,
         2757  +};
         2758  +
         2759  +static coeff_t daub97_lowpass_synthesis_coeffs[] = {
         2760  +    0.7884856164063712,
         2761  +    0.4180922732220353,
         2762  +    -0.0406894176092047,
         2763  +    -0.0645388826287616,
         2764  +};
         2765  +
         2766  +static coeff_t daub97_highpass_synthesis_coeffs[] = {
         2767  +    -0.8526986790088938,
         2768  +    0.3774028556128306,
         2769  +    0.1106244044184372,
         2770  +    -0.0238494650195568,
         2771  +    -0.0378284555072640,
         2772  +};
         2773  +
         2774  +static filter_t daub97_lowpass_analysis = {
         2775  +    5,
         2776  +    SYMMETRIC_WHOLE,
         2777  +    LOWPASS_ANALYSIS,
         2778  +    daub97_lowpass_analysis_coeffs,
         2779  +};
         2780  +
         2781  +static filter_t daub97_highpass_analysis = {
         2782  +    4,
         2783  +    SYMMETRIC_WHOLE,
         2784  +    HIGHPASS_ANALYSIS,
         2785  +    daub97_highpass_analysis_coeffs,
         2786  +};
         2787  +
         2788  +static filter_t daub97_lowpass_synthesis = {
         2789  +    4,
         2790  +    SYMMETRIC_WHOLE,
         2791  +    LOWPASS_SYNTHESIS,
         2792  +    daub97_lowpass_synthesis_coeffs,
         2793  +};
         2794  +
         2795  +static filter_t daub97_highpass_synthesis = {
         2796  +    5,
         2797  +    SYMMETRIC_WHOLE,
         2798  +    HIGHPASS_SYNTHESIS,
         2799  +    daub97_highpass_synthesis_coeffs,
         2800  +};
         2801  +
         2802  +static filterbank_t daub97 = {
         2803  +    "daub97",
         2804  +    "Daubechies 9/7",
         2805  +    BIORTHOGONAL,
         2806  +    &daub97_lowpass_analysis,
         2807  +    &daub97_highpass_analysis,
         2808  +    &daub97_lowpass_synthesis,
         2809  +    &daub97_highpass_synthesis,
         2810  +};
         2811  +
         2812  +static filterbank_t daub97lift = {
         2813  +    "daub97lift",
         2814  +    "Daubechies 9/7 (Lifting)",
         2815  +    BIORTHOGONAL,
         2816  +    NULL,
         2817  +    NULL,
         2818  +    NULL,
         2819  +    NULL,
         2820  +};
         2821  +
         2822  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         2823  + * Compactly Supported Wavelets," Communications on Pure and
         2824  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         2825  +
         2826  +static coeff_t cdf53_lowpass_analysis_coeffs[] = {
         2827  +    1.06066017177982,
         2828  +    0.35355339059327,
         2829  +    -0.17677669529664,
         2830  +};
         2831  +
         2832  +static coeff_t cdf53_highpass_analysis_coeffs[] = {
         2833  +    -0.70710678118655,
         2834  +    0.35355339059327,
         2835  +};
         2836  +
         2837  +static coeff_t cdf53_lowpass_synthesis_coeffs[] = {
         2838  +    0.70710678118655,
         2839  +    0.35355339059327,
         2840  +};
         2841  +
         2842  +static coeff_t cdf53_highpass_synthesis_coeffs[] = {
         2843  +    -1.06066017177982,
         2844  +    0.35355339059327,
         2845  +    0.17677669529664,
         2846  +};
         2847  +
         2848  +static filter_t cdf53_lowpass_analysis = {
         2849  +    3,
         2850  +    SYMMETRIC_WHOLE,
         2851  +    LOWPASS_ANALYSIS,
         2852  +    cdf53_lowpass_analysis_coeffs,
         2853  +};
         2854  +
         2855  +static filter_t cdf53_highpass_analysis = {
         2856  +    2,
         2857  +    SYMMETRIC_WHOLE,
         2858  +    HIGHPASS_ANALYSIS,
         2859  +    cdf53_highpass_analysis_coeffs,
         2860  +};
         2861  +
         2862  +static filter_t cdf53_lowpass_synthesis = {
         2863  +    2,
         2864  +    SYMMETRIC_WHOLE,
         2865  +    LOWPASS_SYNTHESIS,
         2866  +    cdf53_lowpass_synthesis_coeffs,
         2867  +};
         2868  +
         2869  +static filter_t cdf53_highpass_synthesis = {
         2870  +    3,
         2871  +    SYMMETRIC_WHOLE,
         2872  +    HIGHPASS_SYNTHESIS,
         2873  +    cdf53_highpass_synthesis_coeffs,
         2874  +};
         2875  +
         2876  +static filterbank_t cdf53 = {
         2877  +    "cdf53",
         2878  +    "Cohen Daubechies Feauveau 5/3",
         2879  +    BIORTHOGONAL,
         2880  +    &cdf53_lowpass_analysis,
         2881  +    &cdf53_highpass_analysis,
         2882  +    &cdf53_lowpass_synthesis,
         2883  +    &cdf53_highpass_synthesis,
         2884  +};
         2885  +
         2886  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         2887  + * Compactly Supported Wavelets," Communications on Pure and
         2888  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         2889  +
         2890  +static coeff_t cdf93_lowpass_analysis_coeffs[] = {
         2891  +    0.99436891104360,
         2892  +    0.41984465132952,
         2893  +    -0.17677669529665,
         2894  +    -0.06629126073624,
         2895  +    0.03314563036812,
         2896  +};
         2897  +
         2898  +static coeff_t cdf93_highpass_analysis_coeffs[] = {
         2899  +    -0.70710678118655,
         2900  +    0.35355339059327,
         2901  +};
         2902  +
         2903  +static coeff_t cdf93_lowpass_synthesis_coeffs[] = {
         2904  +    0.70710678118655,
         2905  +    0.35355339059327,
         2906  +};
         2907  +
         2908  +static coeff_t cdf93_highpass_synthesis_coeffs[] = {
         2909  +    -0.99436891104360,
         2910  +    0.41984465132952,
         2911  +    0.17677669529665,
         2912  +    -0.06629126073624,
         2913  +    -0.03314563036812,
         2914  +};
         2915  +
         2916  +static filter_t cdf93_lowpass_analysis = {
         2917  +    5,
         2918  +    SYMMETRIC_WHOLE,
         2919  +    LOWPASS_ANALYSIS,
         2920  +    cdf93_lowpass_analysis_coeffs,
         2921  +};
         2922  +
         2923  +static filter_t cdf93_highpass_analysis = {
         2924  +    2,
         2925  +    SYMMETRIC_WHOLE,
         2926  +    HIGHPASS_ANALYSIS,
         2927  +    cdf93_highpass_analysis_coeffs,
         2928  +};
         2929  +
         2930  +static filter_t cdf93_lowpass_synthesis = {
         2931  +    2,
         2932  +    SYMMETRIC_WHOLE,
         2933  +    LOWPASS_SYNTHESIS,
         2934  +    cdf93_lowpass_synthesis_coeffs,
         2935  +};
         2936  +
         2937  +static filter_t cdf93_highpass_synthesis = {
         2938  +    5,
         2939  +    SYMMETRIC_WHOLE,
         2940  +    HIGHPASS_SYNTHESIS,
         2941  +    cdf93_highpass_synthesis_coeffs,
         2942  +};
         2943  +
         2944  +static filterbank_t cdf93 = {
         2945  +    "cdf93",
         2946  +    "Cohen Daubechies Feauveau 9/3",
         2947  +    BIORTHOGONAL,
         2948  +    &cdf93_lowpass_analysis,
         2949  +    &cdf93_highpass_analysis,
         2950  +    &cdf93_lowpass_synthesis,
         2951  +    &cdf93_highpass_synthesis,
         2952  +};
         2953  +
         2954  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         2955  + * Compactly Supported Wavelets," Communications on Pure and
         2956  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         2957  +
         2958  +static coeff_t cdf133_lowpass_analysis_coeffs[] = {
         2959  +    0.96674755240348,
         2960  +    0.44746600996961,
         2961  +    -0.16987135563661,
         2962  +    -0.10772329869638,
         2963  +    0.04695630968816,
         2964  +    0.01381067932004,
         2965  +    -0.00690533966002,
         2966  +};
         2967  +
         2968  +static coeff_t cdf133_highpass_analysis_coeffs[] = {
         2969  +    -0.70710678118655,
         2970  +    0.35355339059327,
         2971  +};
         2972  +
         2973  +static coeff_t cdf133_lowpass_synthesis_coeffs[] = {
         2974  +    0.70710678118655,
         2975  +    0.35355339059327,
         2976  +};
         2977  +
         2978  +static coeff_t cdf133_highpass_synthesis_coeffs[] = {
         2979  +    -0.96674755240348,
         2980  +    0.44746600996961,
         2981  +    0.16987135563661,
         2982  +    -0.10772329869638,
         2983  +    -0.04695630968816,
         2984  +    0.01381067932004,
         2985  +    0.00690533966002,
         2986  +};
         2987  +
         2988  +static filter_t cdf133_lowpass_analysis = {
         2989  +    7,
         2990  +    SYMMETRIC_WHOLE,
         2991  +    LOWPASS_ANALYSIS,
         2992  +    cdf133_lowpass_analysis_coeffs,
         2993  +};
         2994  +
         2995  +static filter_t cdf133_highpass_analysis = {
         2996  +    2,
         2997  +    SYMMETRIC_WHOLE,
         2998  +    HIGHPASS_ANALYSIS,
         2999  +    cdf133_highpass_analysis_coeffs,
         3000  +};
         3001  +
         3002  +static filter_t cdf133_lowpass_synthesis = {
         3003  +    2,
         3004  +    SYMMETRIC_WHOLE,
         3005  +    LOWPASS_SYNTHESIS,
         3006  +    cdf133_lowpass_synthesis_coeffs,
         3007  +};
         3008  +
         3009  +static filter_t cdf133_highpass_synthesis = {
         3010  +    7,
         3011  +    SYMMETRIC_WHOLE,
         3012  +    HIGHPASS_SYNTHESIS,
         3013  +    cdf133_highpass_synthesis_coeffs,
         3014  +};
         3015  +
         3016  +static filterbank_t cdf133 = {
         3017  +    "cdf133",
         3018  +    "Cohen Daubechies Feauveau 13/3",
         3019  +    BIORTHOGONAL,
         3020  +    &cdf133_lowpass_analysis,
         3021  +    &cdf133_highpass_analysis,
         3022  +    &cdf133_lowpass_synthesis,
         3023  +    &cdf133_highpass_synthesis,
         3024  +};
         3025  +
         3026  +/* A. Cohen, I. Daubechies, J. C. Feauveau, "Biorthogonal Bases of
         3027  + * Compactly Supported Wavelets," Communications on Pure and
         3028  + * Applied Mathematics, vol. 45, no. 5, pp. 485-560, May 1992. */
         3029  +
         3030  +static coeff_t cdf173_lowpass_analysis_coeffs[] = {
         3031  +    0.95164212189717,
         3032  +    0.46257144047591,
         3033  +    -0.16382918343409,
         3034  +    -0.13491307360773,
         3035  +    0.05299848189069,
         3036  +    0.02891610982635,
         3037  +    -0.01294751186254,
         3038  +    -0.00302108610126,
         3039  +    0.00151054305063,
         3040  +};
         3041  +
         3042  +static coeff_t cdf173_highpass_analysis_coeffs[] = {
         3043  +    -0.70710678118655,
         3044  +    0.35355339059327,
         3045  +};
         3046  +
         3047  +static coeff_t cdf173_lowpass_synthesis_coeffs[] = {
         3048  +    0.70710678118655,
         3049  +    0.35355339059327,
         3050  +};
         3051  +
         3052  +static coeff_t cdf173_highpass_synthesis_coeffs[] = {
         3053  +    -0.95164212189717,
         3054  +    0.46257144047591,
         3055  +    0.16382918343409,
         3056  +    -0.13491307360773,
         3057  +    -0.05299848189069,
         3058  +    0.02891610982635,
         3059  +    0.01294751186254,
         3060  +    -0.00302108610126,
         3061  +    -0.00151054305063,
         3062  +};
         3063  +
         3064  +static filter_t cdf173_lowpass_analysis = {
         3065  +    9,
         3066  +    SYMMETRIC_WHOLE,
         3067  +    LOWPASS_ANALYSIS,
         3068  +    cdf173_lowpass_analysis_coeffs,
         3069  +};
         3070  +
         3071  +static filter_t cdf173_highpass_analysis = {
         3072  +    2,
         3073  +    SYMMETRIC_WHOLE,
         3074  +    HIGHPASS_ANALYSIS,
         3075  +    cdf173_highpass_analysis_coeffs,
         3076  +};
         3077  +
         3078  +static filter_t cdf173_lowpass_synthesis = {
         3079  +    2,
         3080  +    SYMMETRIC_WHOLE,
         3081  +    LOWPASS_SYNTHESIS,
         3082  +    cdf173_lowpass_synthesis_coeffs,
         3083  +};
         3084  +
         3085  +static filter_t cdf173_highpass_synthesis = {
         3086  +    9,
         3087  +    SYMMETRIC_WHOLE,
         3088  +    HIGHPASS_SYNTHESIS,
         3089  +    cdf173_highpass_synthesis_coeffs,
         3090  +};
         3091  +
         3092  +static filterbank_t cdf173 = {
         3093  +    "cdf173",
         3094  +    "Cohen Daubechies Feauveau 17/3",
         3095  +    BIORTHOGONAL,
         3096  +    &cdf173_lowpass_analysis,
         3097  +    &cdf173_highpass_analysis,
         3098  +    &cdf173_lowpass_synthesis,
         3099  +    &cdf173_highpass_synthesis,
         3100  +};
         3101  +
         3102  +/* Filter from J. Villasenor, B. Belzer, J. Liao, "Wavelet Filter
         3103  + * Evaluation for Image Compression." IEEE Transactions on Image
         3104  + * Processing, Vol. 2, pp. 1053-1060, August 1995. */
         3105  +
         3106  +static coeff_t villa1311_lowpass_analysis_coeffs[] = {
         3107  +    0.7672451593927493,
         3108  +    0.3832692613243884,
         3109  +    -0.0688781141906103,
         3110  +    -0.0334750810478015,
         3111  +    0.0472817528288275,
         3112  +    0.0037592103166868,
         3113  +    -0.0084728277413181,
         3114  +};
         3115  +
         3116  +static coeff_t villa1311_highpass_analysis_coeffs[] = {
         3117  +    -0.8328475700934288,
         3118  +    0.4481085999263908,
         3119  +    0.0691627101203004,
         3120  +    -0.1087373652243805,
         3121  +    -0.0062923156668598,
         3122  +    0.0141821558912635,
         3123  +};
         3124  +
         3125  +static coeff_t villa1311_lowpass_synthesis_coeffs[] = {
         3126  +    0.8328475700934288,
         3127  +    0.4481085999263908,
         3128  +    -0.0691627101203004,
         3129  +    -0.1087373652243805,
         3130  +    0.0062923156668598,
         3131  +    0.0141821558912635,
         3132  +};
         3133  +
         3134  +static coeff_t villa1311_highpass_synthesis_coeffs[] = {
         3135  +    -0.7672451593927493,
         3136  +    0.3832692613243884,
         3137  +    0.0688781141906103,
         3138  +    -0.0334750810478015,
         3139  +    -0.0472817528288275,
         3140  +    0.0037592103166868,
         3141  +    0.0084728277413181,
         3142  +};
         3143  +
         3144  +static filter_t villa1311_lowpass_analysis = {
         3145  +    7,
         3146  +    SYMMETRIC_WHOLE,
         3147  +    LOWPASS_ANALYSIS,
         3148  +    villa1311_lowpass_analysis_coeffs,
         3149  +};
         3150  +
         3151  +static filter_t villa1311_highpass_analysis = {
         3152  +    6,
         3153  +    SYMMETRIC_WHOLE,
         3154  +    HIGHPASS_ANALYSIS,
         3155  +    villa1311_highpass_analysis_coeffs,
         3156  +};
         3157  +
         3158  +static filter_t villa1311_lowpass_synthesis = {
         3159  +    6,
         3160  +    SYMMETRIC_WHOLE,
         3161  +    LOWPASS_SYNTHESIS,
         3162  +    villa1311_lowpass_synthesis_coeffs,
         3163  +};
         3164  +
         3165  +static filter_t villa1311_highpass_synthesis = {
         3166  +    7,
         3167  +    SYMMETRIC_WHOLE,
         3168  +    HIGHPASS_SYNTHESIS,
         3169  +    villa1311_highpass_synthesis_coeffs,
         3170  +};
         3171  +
         3172  +static filterbank_t villa1311 = {
         3173  +    "villa1311",
         3174  +    "Villasenor 13/11",
         3175  +    BIORTHOGONAL,
         3176  +    &villa1311_lowpass_analysis,
         3177  +    &villa1311_highpass_analysis,
         3178  +    &villa1311_lowpass_synthesis,
         3179  +    &villa1311_highpass_synthesis,
         3180  +};
         3181  +
         3182  +/* Append filterbank reference to this array: this is the only
         3183  + * thing you need to do by hand. The rest of the work will be done
         3184  + * by the make_filterbank.pl utility: just cut-and-paste its output. */
         3185  +
         3186  +filterbank_t *filterbanks[] = {
         3187  +    &haar,
         3188  +    &daub4,
         3189  +    &daub6,
         3190  +    &daub8,
         3191  +    &daub10,
         3192  +    &daub12,
         3193  +    &daub14,
         3194  +    &daub16,
         3195  +    &daub18,
         3196  +    &daub20,
         3197  +    &beylkin,
         3198  +    &vaidyanathan,
         3199  +    &coiflet6,
         3200  +    &coiflet12,
         3201  +    &coiflet18,
         3202  +    &coiflet24,
         3203  +    &coiflet30,
         3204  +    &symmlet8,
         3205  +    &symmlet10,
         3206  +    &symmlet12,
         3207  +    &symmlet14,
         3208  +    &symmlet16,
         3209  +    &symmlet18,
         3210  +    &symmlet20,
         3211  +    &odegard97,
         3212  +    &daub97,
         3213  +    &daub97lift,
         3214  +    &cdf53,
         3215  +    &cdf93,
         3216  +    &cdf133,
         3217  +    &cdf173,
         3218  +    &villa1311,
         3219  +    NULL
         3220  +};

Added epsilon/filterbank.h.

            1  +/*
            2  + * $Id: filterbank.h,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Filter banks
           27  + *
           28  + *  This file holds defines for filter and filterbank
           29  + *  data structures.
           30  + *
           31  + *  \section References
           32  + *
           33  + *  Gilbert Strang, Truong Nguyen "Wavelets and Filter Banks". */
           34  +
           35  +#ifndef __FILTERBANK_H__
           36  +#define __FILTERBANK_H__
           37  +
           38  +#ifdef __cplusplus
           39  +extern "C"
           40  +{
           41  +#endif
           42  +
           43  +/** \addtogroup wavelet Wavelet transform */
           44  +/*@{*/
           45  +
           46  +#include <common.h>
           47  +
           48  +/** Causal filter: h[i] = 0, i < 0 */
           49  +#define CAUSAL                  0
           50  +/** Anticausal filter: h[i] = 0, i > 0 */
           51  +#define ANTICAUSAL              1
           52  +/** Symmetric-whole filter: h[-i] = h[i] */
           53  +#define SYMMETRIC_WHOLE         2
           54  +/** Symmetric-half filter: h[-i] = h[i - 1] */
           55  +#define SYMMETRIC_HALF          3
           56  +
           57  +/** Lowpass analysis filter */
           58  +#define LOWPASS_ANALYSIS        0
           59  +/** Highpass analysis filter */
           60  +#define HIGHPASS_ANALYSIS       1
           61  +/** Lowpass synthesis filter */
           62  +#define LOWPASS_SYNTHESIS       2
           63  +/** Highpass synthesis filter */
           64  +#define HIGHPASS_SYNTHESIS      3
           65  +
           66  +/** Orthogonal filterbank */
           67  +#define ORTHOGONAL              0
           68  +/** Biothogonal filterbank */
           69  +#define BIORTHOGONAL            1
           70  +
           71  +/** Even subsampling phase */
           72  +#define PHASE_EVEN              0
           73  +/** Odd subsampling phase */
           74  +#define PHASE_ODD               1
           75  +
           76  +/** Filter structure
           77  + *
           78  + *  This structure represents a standalone filter.
           79  + *
           80  + *  \note There is no need to keep all coefficients for symmetric
           81  + *  filters. Only half (h[i], i >= 0) of them is kept. */
           82  +    typedef struct filter_t_tag
           83  +    {
           84  +    /** Filter length */
           85  +	int length;
           86  +    /** Filter causality */
           87  +	int causality;
           88  +    /** Filter type */
           89  +	int type;
           90  +    /** Filter coefficients */
           91  +	coeff_t *coeffs;
           92  +    } filter_t;
           93  +
           94  +/** Filterbank structure
           95  + *
           96  + *  Filter bank consists of two filter pairs. */
           97  +    typedef struct filterbank_t_tag
           98  +    {
           99  +    /** Short filter name (for a program) */
          100  +	char *id;
          101  +    /** Long filter name (for a user) */
          102  +	char *name;
          103  +    /** Filterbank type */
          104  +	int type;
          105  +    /** Lowpass analysis filter */
          106  +	filter_t *lowpass_analysis;
          107  +    /** Highpass analysis filter */
          108  +	filter_t *highpass_analysis;
          109  +    /** Lowpass synthesis filter */
          110  +	filter_t *lowpass_synthesis;
          111  +    /** Highpass synthesis filter */
          112  +	filter_t *highpass_synthesis;
          113  +    } filterbank_t;
          114  +
          115  +/** External array of all available filter banks
          116  + *
          117  + *  This array hold pointers to all available filter banks.
          118  + *  Last element is always \c NULL. */
          119  +    extern filterbank_t *filterbanks[];
          120  +
          121  +/*@}*/
          122  +
          123  +#ifdef __cplusplus
          124  +}
          125  +#endif
          126  +
          127  +#endif				/* __FILTERBANK_H__ */

Added epsilon/libmain.c.

            1  +/*
            2  + * $Id: libmain.c,v 1.59 2008/03/25 19:31:45 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <epsilon.h>
           25  +#include <libmain.h>
           26  +#include <common.h>
           27  +#include <filter.h>
           28  +#include <filterbank.h>
           29  +#include <cobs.h>
           30  +#include <color.h>
           31  +#include <mem_alloc.h>
           32  +#include <dc_level.h>
           33  +#include <resample.h>
           34  +#include <checksum.h>
           35  +#include <pad.h>
           36  +#include <merge_split.h>
           37  +#include <speck.h>
           38  +#include <string.h>
           39  +
           40  +#if defined(_WIN32) && !defined(__MINGW32__)
           41  +#define snprintf	_snprintf
           42  +#endif /* not using the MSVC compiler */
           43  +
           44  +local void
           45  +round_channel (coeff_t ** in_channel, int **out_channel, int channel_size)
           46  +{
           47  +    int i, j;
           48  +
           49  +    for (i = 0; i < channel_size; i++)
           50  +      {
           51  +	  for (j = 0; j < channel_size; j++)
           52  +	    {
           53  +		out_channel[i][j] = (int) ROUND (in_channel[i][j]);
           54  +	    }
           55  +      }
           56  +}
           57  +
           58  +local void
           59  +copy_channel (int **in_channel, coeff_t ** out_channel, int channel_size)
           60  +{
           61  +    int i, j;
           62  +
           63  +    /* Expand data from int to coeff_t */
           64  +    for (i = 0; i < channel_size; i++)
           65  +      {
           66  +	  for (j = 0; j < channel_size; j++)
           67  +	    {
           68  +		out_channel[i][j] = in_channel[i][j];
           69  +	    }
           70  +      }
           71  +}
           72  +
           73  +local void
           74  +reset_RGB (unsigned char **block_R, unsigned char **block_G,
           75  +	   unsigned char **block_B, int width, int height)
           76  +{
           77  +    int i, j;
           78  +
           79  +    /* Reset everything to zero */
           80  +    for (i = 0; i < height; i++)
           81  +      {
           82  +	  for (j = 0; j < width; j++)
           83  +	    {
           84  +		block_R[i][j] = block_G[i][j] = block_B[i][j] = 0;
           85  +	    }
           86  +      }
           87  +}
           88  +
           89  +local void
           90  +reset_Y (unsigned char **block_Y, int width, int height)
           91  +{
           92  +    int i, j;
           93  +
           94  +    /* Reset everything to zero */
           95  +    for (i = 0; i < height; i++)
           96  +      {
           97  +	  for (j = 0; j < width; j++)
           98  +	    {
           99  +		block_Y[i][j] = 0;
          100  +	    }
          101  +      }
          102  +}
          103  +
          104  +local filterbank_t *
          105  +get_fb (char *id)
          106  +{
          107  +    int i, n;
          108  +
          109  +    /* Get the number of all available filterbanks */
          110  +    for (n = 0; filterbanks[n]; n++);
          111  +
          112  +    /* Find id in the list */
          113  +    for (i = 0; i < n; i++)
          114  +      {
          115  +	  if (strcmp (id, filterbanks[i]->id) == 0)
          116  +	    {
          117  +		return filterbanks[i];
          118  +	    }
          119  +      }
          120  +
          121  +    return NULL;
          122  +}
          123  +
          124  +local int
          125  +get_block_size (int w, int h, int mode, int min)
          126  +{
          127  +    int max = MAX (MAX (w, h), min);
          128  +    int bits = number_of_bits (max);
          129  +
          130  +    if (mode == EPS_MODE_NORMAL)
          131  +      {
          132  +	  /* W = H = 2 ^ N */
          133  +	  if (max == (1 << (bits - 1)))
          134  +	    {
          135  +		return max;
          136  +	    }
          137  +	  else
          138  +	    {
          139  +		return (1 << bits);
          140  +	    }
          141  +      }
          142  +    else
          143  +      {
          144  +	  /* W = H = 2 ^ N + 1 */
          145  +	  if (max == (1 << (bits - 1)) + 1)
          146  +	    {
          147  +		return max;
          148  +	    }
          149  +	  else if (max == (1 << (bits - 1)))
          150  +	    {
          151  +		return max + 1;
          152  +	    }
          153  +	  else
          154  +	    {
          155  +		return (1 << bits) + 1;
          156  +	    }
          157  +      }
          158  +}
          159  +
          160  +local int
          161  +terminate_header (unsigned char *buf, int buf_size, int n_fields)
          162  +{
          163  +    int field, i;
          164  +
          165  +    /* Report an error if data contains at least one zero byte */
          166  +    for (i = 0; i < buf_size; i++)
          167  +      {
          168  +	  if (!buf[i])
          169  +	    {
          170  +		return EPS_FORMAT_ERROR;
          171  +	    }
          172  +      }
          173  +
          174  +    /* Find n-th occurence of ';' symbol and replace it with zero */
          175  +    for (i = 0, field = 1; i < buf_size; i++)
          176  +      {
          177  +	  if (buf[i] == ';')
          178  +	    {
          179  +		if (field == n_fields)
          180  +		  {
          181  +		      buf[i] = 0;
          182  +		      return EPS_OK;
          183  +		  }
          184  +
          185  +		field++;
          186  +	    }
          187  +      }
          188  +
          189  +    return EPS_FORMAT_ERROR;
          190  +}
          191  +
          192  +local void
          193  +unterminate_header (unsigned char *buf)
          194  +{
          195  +    buf[strlen ((char *) buf)] = ';';
          196  +}
          197  +
          198  +local int
          199  +header_sanity_check (unsigned char *buf)
          200  +{
          201  +    int i, len;
          202  +
          203  +    len = strlen ((char *) buf);
          204  +
          205  +    /* Check header for malicious symbols */
          206  +    for (i = 0; i < len; i++)
          207  +      {
          208  +	  if ((buf[i] >= 'A') && (buf[i] <= 'Z'))
          209  +	    {
          210  +		continue;
          211  +	    }
          212  +
          213  +	  if ((buf[i] >= 'a') && (buf[i] <= 'z'))
          214  +	    {
          215  +		continue;
          216  +	    }
          217  +
          218  +	  if ((buf[i] >= '0') && (buf[i] <= '9'))
          219  +	    {
          220  +		continue;
          221  +	    }
          222  +
          223  +	  if ((buf[i] == ';') || (buf[i] == '=') ||
          224  +	      (buf[i] == '-') || (buf[i] == ':'))
          225  +	    {
          226  +		continue;
          227  +	    }
          228  +
          229  +	  return EPS_FORMAT_ERROR;
          230  +      }
          231  +
          232  +    return EPS_OK;
          233  +}
          234  +
          235  +local int
          236  +read_gs_header (unsigned char *buf, int buf_size, eps_block_header * hdr)
          237  +{
          238  +    filterbank_t *fb;
          239  +
          240  +    char fb_id[32];
          241  +
          242  +    crc32_t hdr_crc;
          243  +    crc32_t data_crc;
          244  +
          245  +    int result;
          246  +    int len;
          247  +    int n;
          248  +
          249  +    char *chk_pos;
          250  +    char *str;
          251  +
          252  +    /* Sanity checks */
          253  +    if (!buf || !hdr)
          254  +      {
          255  +	  return EPS_PARAM_ERROR;
          256  +      }
          257  +
          258  +    if (buf_size < 1)
          259  +      {
          260  +	  return EPS_PARAM_ERROR;
          261  +      }
          262  +
          263  +    /* Terminate header for ease of processing */
          264  +    if (terminate_header (buf, buf_size, 12) != EPS_OK)
          265  +      {
          266  +	  return EPS_FORMAT_ERROR;
          267  +      }
          268  +
          269  +    /* Check for maliciuos symbols */
          270  +    if (header_sanity_check (buf) != EPS_OK)
          271  +      {
          272  +	  unterminate_header (buf);
          273  +	  return EPS_FORMAT_ERROR;
          274  +      }
          275  +
          276  +    /* Handle header as a regular null-terminated string */
          277  +    str = (char *) buf;
          278  +    len = strlen (str);
          279  +
          280  +    /* Mark the position of header CRC field */
          281  +    chk_pos = strstr (str, "chk=");
          282  +
          283  +    /* Parse header fields */
          284  +    result = sscanf (str,
          285  +		     "type=gs;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;"
          286  +		     "m=%d;dc=%d;fb=%31[a-z0-9];chk=%x;crc=%x%n",
          287  +		     &hdr->uhdr.gs.W, &hdr->uhdr.gs.H, &hdr->uhdr.gs.w,
          288  +		     &hdr->uhdr.gs.h, &hdr->uhdr.gs.x, &hdr->uhdr.gs.y,
          289  +		     &hdr->uhdr.gs.mode, &hdr->uhdr.gs.dc, fb_id, &hdr->chk,
          290  +		     &hdr->crc, &n);
          291  +
          292  +    unterminate_header (buf);
          293  +
          294  +    /* Check for parsing errors (see also sscanf(3)) */
          295  +    if ((result < 11) || (n != len))
          296  +      {
          297  +	  return EPS_FORMAT_ERROR;
          298  +      }
          299  +
          300  +    /* Compute header & data size */
          301  +    hdr->hdr_size = len + 1;
          302  +    hdr->data_size = buf_size - hdr->hdr_size;
          303  +
          304  +    /* Sanity checks */
          305  +    assert (hdr->data_size >= 0);
          306  +    assert (hdr->hdr_size + hdr->data_size == buf_size);
          307  +
          308  +    /* Check transform mode */
          309  +    if ((hdr->uhdr.gs.mode != EPS_MODE_NORMAL)
          310  +	&& (hdr->uhdr.gs.mode != EPS_MODE_OTLPF))
          311  +      {
          312  +	  return EPS_FORMAT_ERROR;
          313  +      }
          314  +
          315  +    /* Check image (W, H) and block (w, y, w, h) parameters for consistency */
          316  +    if ((hdr->uhdr.gs.W <= 0) || (hdr->uhdr.gs.H <= 0))
          317  +      {
          318  +	  return EPS_FORMAT_ERROR;
          319  +      }
          320  +
          321  +    if ((hdr->uhdr.gs.w < 1) || (hdr->uhdr.gs.h < 1))
          322  +      {
          323  +	  return EPS_FORMAT_ERROR;
          324  +      }
          325  +
          326  +    if (hdr->uhdr.gs.w > EPS_MAX_BLOCK_SIZE + hdr->uhdr.gs.mode ==
          327  +	EPS_MODE_OTLPF)
          328  +      {
          329  +	  return EPS_FORMAT_ERROR;
          330  +      }
          331  +
          332  +    if (hdr->uhdr.gs.h > EPS_MAX_BLOCK_SIZE + hdr->uhdr.gs.mode ==
          333  +	EPS_MODE_OTLPF)
          334  +      {
          335  +	  return EPS_FORMAT_ERROR;
          336  +      }
          337  +
          338  +    if ((hdr->uhdr.gs.x < 0) || (hdr->uhdr.gs.y < 0))
          339  +      {
          340  +	  return EPS_FORMAT_ERROR;
          341  +      }
          342  +
          343  +    if (hdr->uhdr.gs.x + hdr->uhdr.gs.w > hdr->uhdr.gs.W)
          344  +      {
          345  +	  return EPS_FORMAT_ERROR;
          346  +      }
          347  +
          348  +    if (hdr->uhdr.gs.y + hdr->uhdr.gs.h > hdr->uhdr.gs.H)
          349  +      {
          350  +	  return EPS_FORMAT_ERROR;
          351  +      }
          352  +
          353  +    /* Check DC level */
          354  +    if ((hdr->uhdr.gs.dc < 0) || (hdr->uhdr.gs.dc > 255))
          355  +      {
          356  +	  return EPS_FORMAT_ERROR;
          357  +      }
          358  +
          359  +    /* Find filterbank by id */
          360  +    if (fb = get_fb (fb_id))
          361  +      {
          362  +	  hdr->uhdr.gs.fb_id = fb->id;
          363  +      }
          364  +    else
          365  +      {
          366  +	  hdr->uhdr.gs.fb_id = NULL;
          367  +      }
          368  +
          369  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
          370  +    if ((fb->type == ORTHOGONAL) && (hdr->uhdr.gs.mode != EPS_MODE_NORMAL))
          371  +      {
          372  +	  return EPS_FORMAT_ERROR;
          373  +      }
          374  +
          375  +    assert (chk_pos);
          376  +
          377  +    /* Compute header CRC and compare it against stored one */
          378  +    hdr_crc = epsilon_crc32 (buf, chk_pos - (char *) buf);
          379  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
          380  +
          381  +    if (hdr_crc == hdr->chk)
          382  +      {
          383  +	  hdr->chk_flag = EPS_GOOD_CRC;
          384  +      }
          385  +    else
          386  +      {
          387  +	  hdr->chk_flag = EPS_BAD_CRC;
          388  +      }
          389  +
          390  +    /* Compute data CRC and compare it against stored one */
          391  +    data_crc = epsilon_crc32 (buf + hdr->hdr_size, hdr->data_size);
          392  +
          393  +    if (data_crc == hdr->crc)
          394  +      {
          395  +	  hdr->crc_flag = EPS_GOOD_CRC;
          396  +      }
          397  +    else
          398  +      {
          399  +	  hdr->crc_flag = EPS_BAD_CRC;
          400  +      }
          401  +
          402  +    return EPS_OK;
          403  +}
          404  +
          405  +local int
          406  +read_tc_header (unsigned char *buf, int buf_size, eps_block_header * hdr)
          407  +{
          408  +    filterbank_t *fb;
          409  +
          410  +    char fb_id[32];
          411  +
          412  +    crc32_t hdr_crc;
          413  +    crc32_t data_crc;
          414  +
          415  +    int result;
          416  +    int len;
          417  +    int n;
          418  +
          419  +    char *chk_pos;
          420  +    char *str;
          421  +    /* Sanity checks */
          422  +    if (!buf || !hdr)
          423  +      {
          424  +	  return EPS_PARAM_ERROR;
          425  +      }
          426  +
          427  +    if (buf_size < 1)
          428  +      {
          429  +	  return EPS_PARAM_ERROR;
          430  +      }
          431  +
          432  +    /* Terminate header for ease of processing */
          433  +    if (terminate_header (buf, buf_size, 14) != EPS_OK)
          434  +      {
          435  +	  return EPS_FORMAT_ERROR;
          436  +      }
          437  +
          438  +    /* Check for maliciuos symbols */
          439  +    if (header_sanity_check (buf) != EPS_OK)
          440  +      {
          441  +	  unterminate_header (buf);
          442  +	  return EPS_FORMAT_ERROR;
          443  +      }
          444  +
          445  +    /* Handle header as a regular null-terminated string */
          446  +    str = (char *) buf;
          447  +    len = strlen (str);
          448  +
          449  +    /* Mark the position of header CRC field */
          450  +    chk_pos = strstr (str, "chk=");
          451  +    /* Parse header fields */
          452  +    result = sscanf (str,
          453  +		     "type=tc;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;m=%d;"
          454  +		     "r=%d;dc=%d:%d:%d;rt=%d:%d:%d;fb=%31[a-z0-9];"
          455  +		     "chk=%x;crc=%x%n",
          456  +		     &hdr->uhdr.tc.W, &hdr->uhdr.tc.H, &hdr->uhdr.tc.w,
          457  +		     &hdr->uhdr.tc.h, &hdr->uhdr.tc.x, &hdr->uhdr.tc.y,
          458  +		     &hdr->uhdr.tc.mode, &hdr->uhdr.tc.resample,
          459  +		     &hdr->uhdr.tc.dc_Y, &hdr->uhdr.tc.dc_Cb,
          460  +		     &hdr->uhdr.tc.dc_Cr, &hdr->uhdr.tc.Y_rt,
          461  +		     &hdr->uhdr.tc.Cb_rt, &hdr->uhdr.tc.Cr_rt, fb_id, &hdr->chk,
          462  +		     &hdr->crc, &n);
          463  +    unterminate_header (buf);
          464  +
          465  +    /* Check for parsing errors (see also sscanf(3)) */
          466  +    if ((result < 17) || (n != len))
          467  +      {
          468  +	  return EPS_FORMAT_ERROR;
          469  +      }
          470  +
          471  +    /* Compute header & data size */
          472  +    hdr->hdr_size = len + 1;
          473  +    hdr->data_size = buf_size - hdr->hdr_size;
          474  +
          475  +    /* Sanity checks */
          476  +    assert (hdr->data_size >= 0);
          477  +    assert (hdr->hdr_size + hdr->data_size == buf_size);
          478  +
          479  +    /* Check transform mode */
          480  +    if ((hdr->uhdr.tc.mode != EPS_MODE_NORMAL)
          481  +	&& (hdr->uhdr.tc.mode != EPS_MODE_OTLPF))
          482  +      {
          483  +	  return EPS_FORMAT_ERROR;
          484  +      }
          485  +
          486  +    /* Check image (W, H) and block (w, y, w, h) parameters for consistency */
          487  +    if ((hdr->uhdr.tc.W <= 0) || (hdr->uhdr.tc.H <= 0))
          488  +      {
          489  +	  return EPS_FORMAT_ERROR;
          490  +      }
          491  +
          492  +    if ((hdr->uhdr.tc.w < 1) || (hdr->uhdr.tc.h < 1))
          493  +      {
          494  +	  return EPS_FORMAT_ERROR;
          495  +      }
          496  +
          497  +    if (hdr->uhdr.tc.w > EPS_MAX_BLOCK_SIZE + hdr->uhdr.tc.mode ==
          498  +	EPS_MODE_OTLPF)
          499  +      {
          500  +	  return EPS_FORMAT_ERROR;
          501  +      }
          502  +
          503  +    if (hdr->uhdr.tc.h > EPS_MAX_BLOCK_SIZE + hdr->uhdr.tc.mode ==
          504  +	EPS_MODE_OTLPF)
          505  +      {
          506  +	  return EPS_FORMAT_ERROR;
          507  +      }
          508  +
          509  +    if ((hdr->uhdr.tc.x < 0) || (hdr->uhdr.tc.y < 0))
          510  +      {
          511  +	  return EPS_FORMAT_ERROR;
          512  +      }
          513  +
          514  +    if (hdr->uhdr.tc.x + hdr->uhdr.tc.w > hdr->uhdr.tc.W)
          515  +      {
          516  +	  return EPS_FORMAT_ERROR;
          517  +      }
          518  +
          519  +    if (hdr->uhdr.tc.y + hdr->uhdr.tc.h > hdr->uhdr.tc.H)
          520  +      {
          521  +	  return EPS_FORMAT_ERROR;
          522  +      }
          523  +
          524  +    /* Check resampling mode */
          525  +    if ((hdr->uhdr.tc.resample != EPS_RESAMPLE_444) &&
          526  +	(hdr->uhdr.tc.resample != EPS_RESAMPLE_420))
          527  +      {
          528  +	  return EPS_FORMAT_ERROR;
          529  +      }
          530  +
          531  +    /* Check DC level for Y, Cb and Cr channels */
          532  +    if ((hdr->uhdr.tc.dc_Y < 0) || (hdr->uhdr.tc.dc_Y > 255))
          533  +      {
          534  +	  return EPS_FORMAT_ERROR;
          535  +      }
          536  +
          537  +    if ((hdr->uhdr.tc.dc_Cb < 0) || (hdr->uhdr.tc.dc_Cb > 255))
          538  +      {
          539  +	  return EPS_FORMAT_ERROR;
          540  +      }
          541  +
          542  +    if ((hdr->uhdr.tc.dc_Cr < 0) || (hdr->uhdr.tc.dc_Cr > 255))
          543  +      {
          544  +	  return EPS_FORMAT_ERROR;
          545  +      }
          546  +
          547  +    if ((hdr->uhdr.tc.Y_rt <= 0) || (hdr->uhdr.tc.Cb_rt <= 0)
          548  +	|| (hdr->uhdr.tc.Cr_rt <= 0))
          549  +      {
          550  +	  return EPS_FORMAT_ERROR;
          551  +      }
          552  +
          553  +    /* Find filterbank by id */
          554  +    if (fb = get_fb (fb_id))
          555  +      {
          556  +	  hdr->uhdr.tc.fb_id = fb->id;
          557  +      }
          558  +    else
          559  +      {
          560  +	  hdr->uhdr.tc.fb_id = NULL;
          561  +      }
          562  +
          563  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
          564  +    if ((fb->type == ORTHOGONAL) && (hdr->uhdr.tc.mode != EPS_MODE_NORMAL))
          565  +      {
          566  +	  return EPS_FORMAT_ERROR;
          567  +      }
          568  +
          569  +    assert (chk_pos);
          570  +    /* Compute header CRC and compare it against stored one */
          571  +    hdr_crc = epsilon_crc32 (buf, chk_pos - (char *) buf);
          572  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
          573  +
          574  +    if (hdr_crc == hdr->chk)
          575  +      {
          576  +	  hdr->chk_flag = EPS_GOOD_CRC;
          577  +      }
          578  +    else
          579  +      {
          580  +	  hdr->chk_flag = EPS_BAD_CRC;
          581  +      }
          582  +    /* Compute data CRC and compare it against stored one */
          583  +    data_crc = epsilon_crc32 (buf + hdr->hdr_size, hdr->data_size);
          584  +
          585  +    if (data_crc == hdr->crc)
          586  +      {
          587  +	  hdr->crc_flag = EPS_GOOD_CRC;
          588  +      }
          589  +    else
          590  +      {
          591  +	  hdr->crc_flag = EPS_BAD_CRC;
          592  +      }
          593  +    return EPS_OK;
          594  +}
          595  +
          596  +int
          597  +eps_read_block_header (unsigned char *buf, int buf_size, eps_block_header * hdr)
          598  +{
          599  +    char *str;
          600  +    /* Sanity checks */
          601  +    if (!buf || !hdr)
          602  +      {
          603  +	  return EPS_PARAM_ERROR;
          604  +      }
          605  +
          606  +    if (buf_size < 1)
          607  +      {
          608  +	  return EPS_PARAM_ERROR;
          609  +      }
          610  +
          611  +    /* Extract first header field: block type */
          612  +    if (terminate_header (buf, buf_size, 1) != EPS_OK)
          613  +      {
          614  +	  return EPS_FORMAT_ERROR;
          615  +      }
          616  +
          617  +    str = (char *) buf;
          618  +
          619  +    /* Set block type */
          620  +    if ((strlen (str) == 7) && (strcmp (str, "type=gs") == 0))
          621  +      {
          622  +	  hdr->block_type = EPS_GRAYSCALE_BLOCK;
          623  +      }
          624  +    else if ((strlen (str) == 7) && (strcmp (str, "type=tc") == 0))
          625  +      {
          626  +	  hdr->block_type = EPS_TRUECOLOR_BLOCK;
          627  +      }
          628  +    else
          629  +      {
          630  +	  unterminate_header (buf);
          631  +	  return EPS_FORMAT_ERROR;
          632  +      }
          633  +
          634  +    unterminate_header (buf);
          635  +
          636  +    /* Process the block using appropriative function */
          637  +    switch (hdr->block_type)
          638  +      {
          639  +      case EPS_GRAYSCALE_BLOCK:
          640  +	  {
          641  +	      return read_gs_header (buf, buf_size, hdr);
          642  +	      break;
          643  +	  }
          644  +
          645  +      case EPS_TRUECOLOR_BLOCK:
          646  +	  {
          647  +	      return read_tc_header (buf, buf_size, hdr);
          648  +	      break;
          649  +	  }
          650  +
          651  +      default:
          652  +	  {
          653  +	      assert (0);
          654  +	      break;
          655  +	  }
          656  +      }
          657  +    return EPS_OK;
          658  +}
          659  +
          660  +char **
          661  +eps_get_fb_info (int type)
          662  +{
          663  +    char **info;
          664  +    int i, n;
          665  +
          666  +    /* Get the number of all available filterbanks */
          667  +    for (n = 0; filterbanks[n]; n++);
          668  +    info = (char **) xmalloc ((n + 1) * sizeof (char *));
          669  +
          670  +    /* Travels the list and populate `info' with requested information */
          671  +    for (i = 0; i < n; i++)
          672  +      {
          673  +	  if (type == EPS_FB_ID)
          674  +	    {
          675  +		info[i] = filterbanks[i]->id;
          676  +	    }
          677  +	  else if (type == EPS_FB_NAME)
          678  +	    {
          679  +		info[i] = filterbanks[i]->name;
          680  +	    }
          681  +	  else if (type == EPS_FB_TYPE)
          682  +	    {
          683  +		if (filterbanks[i]->type == BIORTHOGONAL)
          684  +		  {
          685  +		      info[i] = "biorthogonal";
          686  +		  }
          687  +		else
          688  +		  {
          689  +		      info[i] = "orthogonal";
          690  +		  }
          691  +	    }
          692  +	  else
          693  +	    {
          694  +		info[i] = NULL;
          695  +	    }
          696  +      }
          697  +
          698  +    /* Terminate list with NULL pointer */
          699  +    info[n] = NULL;
          700  +
          701  +    return info;
          702  +}
          703  +
          704  +void
          705  +eps_free_fb_info (char **info)
          706  +{
          707  +    free (info);
          708  +}
          709  +
          710  +void **
          711  +eps_xmalloc (int size)
          712  +{
          713  +    return xmalloc (size);
          714  +}
          715  +
          716  +void **
          717  +eps_malloc_2D (int width, int height, int size)
          718  +{
          719  +    return malloc_2D (width, height, size);
          720  +}
          721  +
          722  +void
          723  +eps_free_2D (void **ptr, int width, int height)
          724  +{
          725  +    free_2D (ptr, width, height);
          726  +}
          727  +
          728  +int
          729  +eps_encode_grayscale_block (unsigned char **block, int W, int H, int w, int h,
          730  +			    int x, int y, unsigned char *buf, int *buf_size,
          731  +			    char *fb_id, int mode)
          732  +{
          733  +    filterbank_t *fb;
          734  +
          735  +    unsigned char *buf_next;
          736  +    int bytes_left;
          737  +
          738  +    unsigned char *stuff_buf;
          739  +    int stuff_bytes;
          740  +    int stuff_max;
          741  +    int stuff_cut;
          742  +
          743  +    coeff_t **pad_block;
          744  +    coeff_t **dwt_block;
          745  +    int **int_block;
          746  +
          747  +    int speck_bytes;
          748  +    int block_size;
          749  +    int str_len;
          750  +
          751  +    unsigned char dc_int;
          752  +    coeff_t dc;
          753  +
          754  +    crc32_t hdr_crc;
          755  +    crc32_t data_crc;
          756  +
          757  +    unsigned char *crc_pos;
          758  +
          759  +    /* Sanity checks */
          760  +    if (!block || !buf || !buf_size || !fb_id)
          761  +      {
          762  +	  return EPS_PARAM_ERROR;
          763  +      }
          764  +
          765  +    /* Check input parameters for consistency */
          766  +    if ((mode != EPS_MODE_NORMAL) && (mode != EPS_MODE_OTLPF))
          767  +      {
          768  +	  return EPS_PARAM_ERROR;
          769  +      }
          770  +
          771  +    if ((W <= 0) || (H <= 0))
          772  +      {
          773  +	  return EPS_PARAM_ERROR;
          774  +      }
          775  +
          776  +    if ((w < 1) || (h < 1))
          777  +      {
          778  +	  return EPS_PARAM_ERROR;
          779  +      }
          780  +
          781  +    if (w > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
          782  +      {
          783  +	  return EPS_PARAM_ERROR;
          784  +      }
          785  +
          786  +    if (h > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
          787  +      {
          788  +	  return EPS_PARAM_ERROR;
          789  +      }
          790  +
          791  +    if ((x < 0) || (y < 0))
          792  +      {
          793  +	  return EPS_PARAM_ERROR;
          794  +      }
          795  +
          796  +    if ((x + w > W) || (y + h > H))
          797  +      {
          798  +	  return EPS_PARAM_ERROR;
          799  +      }
          800  +
          801  +    if (*buf_size < EPS_MIN_GRAYSCALE_BUF)
          802  +      {
          803  +	  return EPS_PARAM_ERROR;
          804  +      }
          805  +
          806  +    /* Find filterbank from id */
          807  +    if (!(fb = get_fb (fb_id)))
          808  +      {
          809  +	  return EPS_UNSUPPORTED_FB;
          810  +      }
          811  +
          812  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
          813  +    if ((fb->type == ORTHOGONAL) && (mode != EPS_MODE_NORMAL))
          814  +      {
          815  +	  return EPS_PARAM_ERROR;
          816  +      }
          817  +
          818  +    buf_next = buf;
          819  +    bytes_left = *buf_size;
          820  +
          821  +    /* Compute block size */
          822  +    block_size = get_block_size (w, h, mode, 2);
          823  +
          824  +    /* Extend block */
          825  +    pad_block =
          826  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          827  +    extend_channel (block, pad_block, w, h, block_size, block_size);
          828  +
          829  +    /* DC level shift */
          830  +    dc = dc_level_shift (pad_block, block_size, block_size);
          831  +    dc_int = (unsigned char) CLIP (dc);
          832  +
          833  +    /* Wavelet transform */
          834  +    dwt_block =
          835  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          836  +    analysis_2D (pad_block, dwt_block, block_size, mode, fb);
          837  +    free_2D ((void *) pad_block, block_size, block_size);
          838  +
          839  +    /* Round coefficients */
          840  +    int_block = (int **) malloc_2D (block_size, block_size, sizeof (int));
          841  +    round_channel (dwt_block, int_block, block_size);
          842  +    free_2D ((void *) dwt_block, block_size, block_size);
          843  +
          844  +    /* Write block header */
          845  +    str_len = snprintf ((char *) buf_next, bytes_left,
          846  +			"type=gs;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;"
          847  +			"m=%d;dc=%d;fb=%s;",
          848  +			W, H, w, h, x, y, mode, dc_int, fb_id);
          849  +
          850  +    assert (str_len < bytes_left);
          851  +
          852  +    buf_next += str_len;
          853  +    bytes_left -= str_len;
          854  +
          855  +    /* Compute and save block CRC */
          856  +    hdr_crc = epsilon_crc32 (buf, str_len);
          857  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
          858  +
          859  +    str_len = snprintf ((char *) buf_next, bytes_left,
          860  +			"chk=%04x;crc=????????;", hdr_crc);
          861  +
          862  +    assert (str_len < bytes_left);
          863  +
          864  +    buf_next += str_len;
          865  +    bytes_left -= str_len;
          866  +
          867  +    crc_pos = buf_next - 9;
          868  +
          869  +    /* Encode coefficients */
          870  +    speck_bytes = speck_encode (int_block, block_size, buf_next, bytes_left);
          871  +
          872  +    free_2D ((void *) int_block, block_size, block_size);
          873  +
          874  +    /* Byte stuffing */
          875  +    stuff_max = speck_bytes + speck_bytes / 254 + 1;
          876  +    stuff_buf = (unsigned char *) xmalloc (stuff_max);
          877  +    stuff_bytes = stuff_data (buf_next, stuff_buf, speck_bytes, stuff_max);
          878  +
          879  +    assert (stuff_bytes >= speck_bytes);
          880  +
          881  +    /* Cut encoded stream to fit it within available space */
          882  +    stuff_cut = MIN (bytes_left, stuff_bytes);
          883  +    memcpy (buf_next, stuff_buf, stuff_cut);
          884  +
          885  +    free (stuff_buf);
          886  +
          887  +    /* Compute and save data CRC */
          888  +    data_crc = epsilon_crc32 (buf_next, stuff_cut);
          889  +    snprintf ((char *) crc_pos, 9, "%08x", data_crc);
          890  +    crc_pos[8] = ';';
          891  +
          892  +    buf_next += stuff_cut;
          893  +    bytes_left -= stuff_cut;
          894  +
          895  +    /* Compute real amount of available bytes */
          896  +    *buf_size = buf_next - buf;
          897  +
          898  +    return EPS_OK;
          899  +}
          900  +
          901  +int
          902  +eps_decode_grayscale_block (unsigned char **block, unsigned char *buf,
          903  +			    eps_block_header * hdr)
          904  +{
          905  +    filterbank_t *fb;
          906  +
          907  +    unsigned char *unstuff_buf;
          908  +    int unstuff_bytes;
          909  +
          910  +    int **int_block;
          911  +    coeff_t **dwt_block;
          912  +    coeff_t **pad_block;
          913  +
          914  +    unsigned char dc_int;
          915  +    int block_size;
          916  +
          917  +    /* Sanity checks */
          918  +    if (!block || !buf || !hdr)
          919  +      {
          920  +	  return EPS_PARAM_ERROR;
          921  +      }
          922  +
          923  +    if (hdr->data_size < 1)
          924  +      {
          925  +	  return EPS_PARAM_ERROR;
          926  +      }
          927  +
          928  +    if (!hdr->uhdr.gs.fb_id)
          929  +      {
          930  +	  return EPS_UNSUPPORTED_FB;
          931  +      }
          932  +
          933  +    /* Reset Y channel */
          934  +    reset_Y (block, hdr->uhdr.gs.w, hdr->uhdr.gs.h);
          935  +
          936  +    /* Find filterbank from id */
          937  +    fb = get_fb (hdr->uhdr.gs.fb_id);
          938  +    assert (fb);
          939  +
          940  +    /* Unstuff data */
          941  +    unstuff_buf = (unsigned char *) xmalloc (hdr->data_size *
          942  +					     sizeof (unsigned char));
          943  +
          944  +    unstuff_bytes = unstuff_data (buf + hdr->hdr_size, unstuff_buf,
          945  +				  hdr->data_size, hdr->data_size);
          946  +
          947  +    if (unstuff_bytes == 0)
          948  +      {
          949  +	  unstuff_buf[0] = 0;
          950  +	  unstuff_bytes = 1;
          951  +      }
          952  +
          953  +    /* Compute block size */
          954  +    block_size =
          955  +	get_block_size (hdr->uhdr.gs.w, hdr->uhdr.gs.h, hdr->uhdr.gs.mode, 2);
          956  +
          957  +    /* Decode coefficients */
          958  +    int_block = (int **) malloc_2D (block_size, block_size, sizeof (int));
          959  +    speck_decode (unstuff_buf, unstuff_bytes, int_block, block_size);
          960  +    free (unstuff_buf);
          961  +
          962  +    /* Extend values from int to coeff_t */
          963  +    dwt_block =
          964  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          965  +    copy_channel (int_block, dwt_block, block_size);
          966  +    free_2D ((void *) int_block, block_size, block_size);
          967  +
          968  +    /* Inverse wavelet transform */
          969  +    pad_block =
          970  +	(coeff_t **) malloc_2D (block_size, block_size, sizeof (coeff_t));
          971  +    synthesis_2D (dwt_block, pad_block, block_size, hdr->uhdr.gs.mode, fb);
          972  +    free_2D ((void *) dwt_block, block_size, block_size);
          973  +
          974  +    dc_int = (unsigned char) hdr->uhdr.gs.dc;
          975  +
          976  +    /* DC level unshift */
          977  +    dc_level_unshift (pad_block, (coeff_t) dc_int, block_size, block_size);
          978  +
          979  +    /* Extract original data */
          980  +    extract_channel (pad_block, block, block_size, block_size,
          981  +		     hdr->uhdr.gs.w, hdr->uhdr.gs.h);
          982  +
          983  +    free_2D ((void *) pad_block, block_size, block_size);
          984  +
          985  +    return EPS_OK;
          986  +}
          987  +
          988  +int
          989  +eps_encode_truecolor_block (unsigned char **block_R,
          990  +			    unsigned char **block_G,
          991  +			    unsigned char **block_B,
          992  +			    int W, int H, int w, int h,
          993  +			    int x, int y, int resample,
          994  +			    unsigned char *buf, int *buf_size,
          995  +			    int Y_rt, int Cb_rt, int Cr_rt,
          996  +			    char *fb_id, int mode)
          997  +{
          998  +    filterbank_t *fb;
          999  +
         1000  +    unsigned char *buf_next;
         1001  +    int bytes_left;
         1002  +
         1003  +    unsigned char *buf_Y;
         1004  +    unsigned char *buf_Cb;
         1005  +    unsigned char *buf_Cr;
         1006  +
         1007  +    int buf_Y_size;
         1008  +    int buf_Cb_size;
         1009  +    int buf_Cr_size;
         1010  +
         1011  +    unsigned char *buf_Cb_Cr;
         1012  +    unsigned char *buf_Y_Cb_Cr;
         1013  +
         1014  +    unsigned char *stuff_buf;
         1015  +
         1016  +    int stuff_bytes;
         1017  +    int stuff_max;
         1018  +    int stuff_cut;
         1019  +
         1020  +    coeff_t **pad_block_R;
         1021  +    coeff_t **pad_block_G;
         1022  +    coeff_t **pad_block_B;
         1023  +
         1024  +    coeff_t **pad_block_Y;
         1025  +    coeff_t **pad_block_Cb;
         1026  +    coeff_t **pad_block_Cr;
         1027  +
         1028  +    coeff_t **block_Y;
         1029  +    coeff_t **block_Cb;
         1030  +    coeff_t **block_Cr;
         1031  +
         1032  +    coeff_t **dwt_block_Y;
         1033  +    coeff_t **dwt_block_Cb;
         1034  +    coeff_t **dwt_block_Cr;
         1035  +
         1036  +    int **int_block_Y;
         1037  +    int **int_block_Cb;
         1038  +    int **int_block_Cr;
         1039  +
         1040  +    int block_Y_size;
         1041  +    int block_Cb_size;
         1042  +    int block_Cr_size;
         1043  +
         1044  +    int speck_bytes_Y;
         1045  +    int speck_bytes_Cb;
         1046  +    int speck_bytes_Cr;
         1047  +
         1048  +    int speck_bytes;
         1049  +
         1050  +    int full_size;
         1051  +    int half_size;
         1052  +
         1053  +    coeff_t dc_Y;
         1054  +    coeff_t dc_Cb;
         1055  +    coeff_t dc_Cr;
         1056  +
         1057  +    unsigned char dc_Y_int;
         1058  +    unsigned char dc_Cb_int;
         1059  +    unsigned char dc_Cr_int;
         1060  +
         1061  +    crc32_t hdr_crc;
         1062  +    crc32_t data_crc;
         1063  +
         1064  +    unsigned char *crc_pos;
         1065  +    int str_len;
         1066  +
         1067  +    /* Sanity checks */
         1068  +    if (!block_R || !block_G || !block_B)
         1069  +      {
         1070  +	  return EPS_PARAM_ERROR;
         1071  +      }
         1072  +
         1073  +    if (!buf || !buf_size || !fb_id)
         1074  +      {
         1075  +	  return EPS_PARAM_ERROR;
         1076  +      }
         1077  +
         1078  +    /* Check input parameters for consistency */
         1079  +    if ((mode != EPS_MODE_NORMAL) && (mode != EPS_MODE_OTLPF))
         1080  +      {
         1081  +	  return EPS_PARAM_ERROR;
         1082  +      }
         1083  +
         1084  +    if ((W <= 0) || (H <= 0))
         1085  +      {
         1086  +	  return EPS_PARAM_ERROR;
         1087  +      }
         1088  +
         1089  +    if ((w < 1) || (h < 1))
         1090  +      {
         1091  +	  return EPS_PARAM_ERROR;
         1092  +      }
         1093  +
         1094  +    if (w > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
         1095  +      {
         1096  +	  return EPS_PARAM_ERROR;
         1097  +      }
         1098  +
         1099  +    if (h > EPS_MAX_BLOCK_SIZE + mode == EPS_MODE_OTLPF)
         1100  +      {
         1101  +	  return EPS_PARAM_ERROR;
         1102  +      }
         1103  +
         1104  +    if ((x < 0) || (y < 0))
         1105  +      {
         1106  +	  return EPS_PARAM_ERROR;
         1107  +      }
         1108  +
         1109  +    if ((x + w > W) || (y + h > H))
         1110  +      {
         1111  +	  return EPS_PARAM_ERROR;
         1112  +      }
         1113  +
         1114  +    if ((resample != EPS_RESAMPLE_444) && (resample != EPS_RESAMPLE_420))
         1115  +      {
         1116  +	  return EPS_PARAM_ERROR;
         1117  +      }
         1118  +
         1119  +    if (*buf_size < EPS_MIN_TRUECOLOR_BUF)
         1120  +      {
         1121  +	  return EPS_PARAM_ERROR;
         1122  +      }
         1123  +
         1124  +    if ((Y_rt < EPS_MIN_RT) || (Cb_rt < EPS_MIN_RT) || (Cr_rt < EPS_MIN_RT))
         1125  +      {
         1126  +	  return EPS_PARAM_ERROR;
         1127  +      }
         1128  +
         1129  +    if (Y_rt + Cb_rt + Cr_rt != 100)
         1130  +      {
         1131  +	  return EPS_PARAM_ERROR;
         1132  +      }
         1133  +
         1134  +    /* Find filterbank from id */
         1135  +    if (!(fb = get_fb (fb_id)))
         1136  +      {
         1137  +	  return EPS_UNSUPPORTED_FB;
         1138  +      }
         1139  +
         1140  +    /* EPS_MODE_NORMAL is the only valid choise for orthogonal filters */
         1141  +    if ((fb->type == ORTHOGONAL) && (mode != EPS_MODE_NORMAL))
         1142  +      {
         1143  +	  return EPS_PARAM_ERROR;
         1144  +      }
         1145  +
         1146  +    buf_next = buf;
         1147  +    bytes_left = *buf_size;
         1148  +
         1149  +    /* Compute bid-budget for each channel */
         1150  +    buf_Cr_size = MAX ((bytes_left / 100) * Cr_rt, 1);
         1151  +    buf_Cb_size = MAX ((bytes_left / 100) * Cb_rt, 1);
         1152  +    buf_Y_size = bytes_left - buf_Cb_size - buf_Cr_size;
         1153  +
         1154  +    /* Ensure that everything is ok */
         1155  +    assert ((buf_Y_size > 0) && (buf_Cb_size > 0) && (buf_Cr_size > 0));
         1156  +    assert (buf_Y_size + buf_Cb_size + buf_Cr_size == bytes_left);
         1157  +
         1158  +    /* Compute block sizes for full and resampled channels */
         1159  +    full_size = get_block_size (w, h, mode, 4);
         1160  +    half_size = full_size / 2 + (mode == EPS_MODE_OTLPF);
         1161  +
         1162  +    /* Allocate memory for extended R,G,B channels */
         1163  +    pad_block_R = (coeff_t **) malloc_2D (full_size, full_size,
         1164  +					  sizeof (coeff_t));
         1165  +    pad_block_G = (coeff_t **) malloc_2D (full_size, full_size,
         1166  +					  sizeof (coeff_t));
         1167  +    pad_block_B = (coeff_t **) malloc_2D (full_size, full_size,
         1168  +					  sizeof (coeff_t));
         1169  +
         1170  +    /* Extend R,G,B channels */
         1171  +    extend_channel (block_R, pad_block_R, w, h, full_size, full_size);
         1172  +    extend_channel (block_G, pad_block_G, w, h, full_size, full_size);
         1173  +    extend_channel (block_B, pad_block_B, w, h, full_size, full_size);
         1174  +
         1175  +    /* Allocate memory for extended Y,Cb,Cr channels */
         1176  +    pad_block_Y = (coeff_t **) malloc_2D (full_size, full_size,
         1177  +					  sizeof (coeff_t));
         1178  +    pad_block_Cb = (coeff_t **) malloc_2D (full_size, full_size,
         1179  +					   sizeof (coeff_t));
         1180  +    pad_block_Cr = (coeff_t **) malloc_2D (full_size, full_size,
         1181  +					   sizeof (coeff_t));
         1182  +
         1183  +    /* Convert from R,G,B to Y,Cb,Cr color space */
         1184  +    convert_RGB_to_YCbCr (pad_block_R, pad_block_G, pad_block_B,
         1185  +			  pad_block_Y, pad_block_Cb, pad_block_Cr,
         1186  +			  full_size, full_size);
         1187  +
         1188  +    /* No longer needed */
         1189  +    free_2D ((void *) pad_block_R, full_size, full_size);
         1190  +    free_2D ((void *) pad_block_G, full_size, full_size);
         1191  +    free_2D ((void *) pad_block_B, full_size, full_size);
         1192  +
         1193  +    if (resample == EPS_RESAMPLE_444)
         1194  +      {
         1195  +	  /* No resampling: all channels are full sized */
         1196  +	  block_Y_size = full_size;
         1197  +	  block_Cb_size = full_size;
         1198  +	  block_Cr_size = full_size;
         1199  +
         1200  +	  /* No changes */
         1201  +	  block_Y = pad_block_Y;
         1202  +	  block_Cb = pad_block_Cb;
         1203  +	  block_Cr = pad_block_Cr;
         1204  +      }
         1205  +    else
         1206  +      {
         1207  +	  /* Resample image using 4:2:0 scheme */
         1208  +	  block_Y_size = full_size;
         1209  +	  block_Cb_size = half_size;
         1210  +	  block_Cr_size = half_size;
         1211  +
         1212  +	  /* No changes in Y channel */
         1213  +	  block_Y = pad_block_Y;
         1214  +
         1215  +	  /* Allocate memory for resampled Cb and Cr channels */
         1216  +	  block_Cb = (coeff_t **) malloc_2D (half_size, half_size,
         1217  +					     sizeof (coeff_t));
         1218  +	  block_Cr = (coeff_t **) malloc_2D (half_size, half_size,
         1219  +					     sizeof (coeff_t));
         1220  +
         1221  +	  /* Resample Cb channel */
         1222  +	  bilinear_resample_channel (pad_block_Cb, block_Cb,
         1223  +				     full_size, full_size,
         1224  +				     half_size, half_size);
         1225  +
         1226  +	  /* Resample Cr channel */
         1227  +	  bilinear_resample_channel (pad_block_Cr, block_Cr,
         1228  +				     full_size, full_size,
         1229  +				     half_size, half_size);
         1230  +
         1231  +	  /* No longer needed */
         1232  +	  free_2D ((void *) pad_block_Cb, full_size, full_size);
         1233  +	  free_2D ((void *) pad_block_Cr, full_size, full_size);
         1234  +      }
         1235  +
         1236  +    /* DC level shift */
         1237  +    dc_Y = dc_level_shift (block_Y, block_Y_size, block_Y_size);
         1238  +    dc_Cb = dc_level_shift (block_Cb, block_Cb_size, block_Cb_size);
         1239  +    dc_Cr = dc_level_shift (block_Cr, block_Cr_size, block_Cr_size);
         1240  +
         1241  +    /* Clip DC values */
         1242  +    dc_Y_int = (unsigned char) CLIP (dc_Y);
         1243  +    dc_Cb_int = (unsigned char) CLIP (dc_Cb);
         1244  +    dc_Cr_int = (unsigned char) CLIP (dc_Cr);
         1245  +
         1246  +    /* Allocate memory for wavelet coefficients */
         1247  +    dwt_block_Y = (coeff_t **) malloc_2D (block_Y_size, block_Y_size,
         1248  +					  sizeof (coeff_t));
         1249  +    dwt_block_Cb = (coeff_t **) malloc_2D (block_Cb_size, block_Cb_size,
         1250  +					   sizeof (coeff_t));
         1251  +    dwt_block_Cr = (coeff_t **) malloc_2D (block_Cr_size, block_Cr_size,
         1252  +					   sizeof (coeff_t));
         1253  +
         1254  +    /* Wavelet transform */
         1255  +    analysis_2D (block_Y, dwt_block_Y, block_Y_size, mode, fb);
         1256  +    analysis_2D (block_Cb, dwt_block_Cb, block_Cb_size, mode, fb);
         1257  +    analysis_2D (block_Cr, dwt_block_Cr, block_Cr_size, mode, fb);
         1258  +
         1259  +    /* No longer needed */
         1260  +    free_2D ((void *) block_Y, block_Y_size, block_Y_size);
         1261  +    free_2D ((void *) block_Cb, block_Cb_size, block_Cb_size);
         1262  +    free_2D ((void *) block_Cr, block_Cr_size, block_Cr_size);
         1263  +
         1264  +    /* Allocate memory for rounded wavelet coefficients */
         1265  +    int_block_Y = (int **) malloc_2D (block_Y_size, block_Y_size, sizeof (int));
         1266  +    int_block_Cb = (int **) malloc_2D (block_Cb_size, block_Cb_size,
         1267  +				       sizeof (int));
         1268  +    int_block_Cr = (int **) malloc_2D (block_Cr_size, block_Cr_size,
         1269  +				       sizeof (int));
         1270  +
         1271  +    /* Round wavelet coefficients */
         1272  +    round_channel (dwt_block_Y, int_block_Y, block_Y_size);
         1273  +    round_channel (dwt_block_Cb, int_block_Cb, block_Cb_size);
         1274  +    round_channel (dwt_block_Cr, int_block_Cr, block_Cr_size);
         1275  +
         1276  +    /* No longer needed */
         1277  +    free_2D ((void *) dwt_block_Y, block_Y_size, block_Y_size);
         1278  +    free_2D ((void *) dwt_block_Cb, block_Cb_size, block_Cb_size);
         1279  +    free_2D ((void *) dwt_block_Cr, block_Cr_size, block_Cr_size);
         1280  +
         1281  +    /* Allocate memory for encoded data */
         1282  +    buf_Y = (unsigned char *) xmalloc (buf_Y_size * sizeof (unsigned char));
         1283  +    buf_Cb = (unsigned char *) xmalloc (buf_Cb_size * sizeof (unsigned char));
         1284  +    buf_Cr = (unsigned char *) xmalloc (buf_Cr_size * sizeof (unsigned char));
         1285  +
         1286  +    /* Encode Y,Cb,Cr channels */
         1287  +    speck_bytes_Y = speck_encode (int_block_Y, block_Y_size, buf_Y, buf_Y_size);
         1288  +
         1289  +    speck_bytes_Cb = speck_encode (int_block_Cb, block_Cb_size,
         1290  +				   buf_Cb, buf_Cb_size);
         1291  +
         1292  +
         1293  +    speck_bytes_Cr = speck_encode (int_block_Cr, block_Cr_size,
         1294  +				   buf_Cr, buf_Cr_size);
         1295  +
         1296  +    /* No longer needed */
         1297  +    free_2D ((void *) int_block_Y, block_Y_size, block_Y_size);
         1298  +    free_2D ((void *) int_block_Cb, block_Cb_size, block_Cb_size);
         1299  +    free_2D ((void *) int_block_Cr, block_Cr_size, block_Cr_size);
         1300  +
         1301  +    /* Total number of encoded bytes */
         1302  +    speck_bytes = speck_bytes_Y + speck_bytes_Cb + speck_bytes_Cr;
         1303  +
         1304  +    /* Allocate memory for mixed Cb + Cr channel */
         1305  +    buf_Cb_Cr = (unsigned char *) xmalloc ((speck_bytes_Cb + speck_bytes_Cr) *
         1306  +					   sizeof (unsigned char));
         1307  +
         1308  +    /* Merge Cb and Cr channels */
         1309  +    merge_channels (buf_Cb, buf_Cr, buf_Cb_Cr, speck_bytes_Cb, speck_bytes_Cr);
         1310  +
         1311  +    /* No longer needed */
         1312  +    free (buf_Cb);
         1313  +    free (buf_Cr);
         1314  +
         1315  +    /* Allocate memory for mixed Y + (Cb + Cr) channel */
         1316  +    buf_Y_Cb_Cr = (unsigned char *) xmalloc (speck_bytes *
         1317  +					     sizeof (unsigned char));
         1318  +
         1319  +    /* Merge Y and (Cb + Cr) channels */
         1320  +    merge_channels (buf_Y, buf_Cb_Cr, buf_Y_Cb_Cr, speck_bytes_Y,
         1321  +		    speck_bytes_Cb + speck_bytes_Cr);
         1322  +
         1323  +    /* No longer needed */
         1324  +    free (buf_Y);
         1325  +    free (buf_Cb_Cr);
         1326  +
         1327  +    /* Byte stuffing */
         1328  +    stuff_max = speck_bytes + speck_bytes / 254 + 1;
         1329  +    stuff_buf = (unsigned char *) xmalloc (stuff_max * sizeof (unsigned char));
         1330  +    stuff_bytes = stuff_data (buf_Y_Cb_Cr, stuff_buf, speck_bytes, stuff_max);
         1331  +
         1332  +    assert (stuff_bytes >= speck_bytes);
         1333  +
         1334  +    free (buf_Y_Cb_Cr);
         1335  +
         1336  +    /* Write block header */
         1337  +    str_len = snprintf ((char *) buf_next, bytes_left,
         1338  +			"type=tc;W=%d;H=%d;w=%d;h=%d;x=%d;y=%d;m=%d;r=%d;"
         1339  +			"dc=%d:%d:%d;rt=%d:%d:%d;fb=%s;",
         1340  +			W, H, w, h, x, y, mode, resample,
         1341  +			dc_Y_int, dc_Cb_int, dc_Cr_int,
         1342  +			speck_bytes_Y, speck_bytes_Cb, speck_bytes_Cr, fb_id);
         1343  +
         1344  +    assert (str_len < bytes_left);
         1345  +
         1346  +    buf_next += str_len;
         1347  +    bytes_left -= str_len;
         1348  +
         1349  +    /* Compute and save header CRC */
         1350  +    hdr_crc = epsilon_crc32 (buf, str_len);
         1351  +    hdr_crc = (hdr_crc ^ (hdr_crc >> 16)) & 0xffff;
         1352  +
         1353  +    str_len = snprintf ((char *) buf_next, bytes_left,
         1354  +			"chk=%04x;crc=????????;", hdr_crc);
         1355  +
         1356  +    assert (str_len < bytes_left);
         1357  +
         1358  +    buf_next += str_len;
         1359  +    bytes_left -= str_len;
         1360  +
         1361  +    crc_pos = buf_next - 9;
         1362  +
         1363  +    /* Cut encoded stream to fit it within available space */
         1364  +    stuff_cut = MIN (bytes_left, stuff_bytes);
         1365  +    memcpy (buf_next, stuff_buf, stuff_cut);
         1366  +
         1367  +    free (stuff_buf);
         1368  +
         1369  +    /* Compute and save data CRC */
         1370  +    data_crc = epsilon_crc32 (buf_next, stuff_cut);
         1371  +    snprintf ((char *) crc_pos, 9, "%08x", data_crc);
         1372  +    crc_pos[8] = ';';
         1373  +
         1374  +    buf_next += stuff_cut;
         1375  +    bytes_left -= stuff_cut;
         1376  +
         1377  +    /* Compute real amount of used bytes */
         1378  +    *buf_size = buf_next - buf;
         1379  +
         1380  +    return EPS_OK;
         1381  +}
         1382  +
         1383  +int
         1384  +eps_decode_truecolor_block (unsigned char **block_R,
         1385  +			    unsigned char **block_G,
         1386  +			    unsigned char **block_B,
         1387  +			    unsigned char *buf, eps_block_header * hdr)
         1388  +{
         1389  +    filterbank_t *fb;
         1390  +
         1391  +    unsigned char *unstuff_buf;
         1392  +    int unstuff_bytes;
         1393  +
         1394  +    unsigned char *buf_Y;
         1395  +    unsigned char *buf_Cb;
         1396  +    unsigned char *buf_Cr;
         1397  +    unsigned char *buf_Cb_Cr;
         1398  +
         1399  +    int speck_bytes_Y;
         1400  +    int speck_bytes_Cb;
         1401  +    int speck_bytes_Cr;
         1402  +    int speck_bytes_Cb_Cr;
         1403  +
         1404  +    int full_size;
         1405  +    int half_size;
         1406  +
         1407  +    int **int_block_Y;
         1408  +    int **int_block_Cb;
         1409  +    int **int_block_Cr;
         1410  +
         1411  +    coeff_t **dwt_block_Y;
         1412  +    coeff_t **dwt_block_Cb;
         1413  +    coeff_t **dwt_block_Cr;
         1414  +
         1415  +    coeff_t **pad_block_Y;
         1416  +    coeff_t **pad_block_Cb;
         1417  +    coeff_t **pad_block_Cr;
         1418  +
         1419  +    coeff_t **pad_block_R;
         1420  +    coeff_t **pad_block_G;
         1421  +    coeff_t **pad_block_B;
         1422  +
         1423  +    coeff_t **block_Y;
         1424  +    coeff_t **block_Cb;
         1425  +    coeff_t **block_Cr;
         1426  +
         1427  +    int block_Y_size;
         1428  +    int block_Cb_size;
         1429  +    int block_Cr_size;
         1430  +
         1431  +    unsigned char dc_Y_int;
         1432  +    unsigned char dc_Cb_int;
         1433  +    unsigned char dc_Cr_int;
         1434  +
         1435  +    /* Sanity checks */
         1436  +    if (!block_R || !block_G || !block_B)
         1437  +      {
         1438  +	  return EPS_PARAM_ERROR;
         1439  +      }
         1440  +
         1441  +    if (!buf || !hdr)
         1442  +      {
         1443  +	  return EPS_PARAM_ERROR;
         1444  +      }
         1445  +
         1446  +    if (hdr->data_size < 1)
         1447  +      {
         1448  +	  return EPS_PARAM_ERROR;
         1449  +      }
         1450  +
         1451  +    /* Reset RGB channels */
         1452  +    reset_RGB (block_R, block_G, block_B, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1453  +
         1454  +    /* Find filterbank by id */
         1455  +    if (!hdr->uhdr.tc.fb_id)
         1456  +      {
         1457  +	  return EPS_UNSUPPORTED_FB;
         1458  +      }
         1459  +
         1460  +    fb = get_fb (hdr->uhdr.tc.fb_id);
         1461  +    assert (fb);
         1462  +
         1463  +    /* Unstaff data */
         1464  +    unstuff_buf = (unsigned char *) xmalloc (hdr->data_size *
         1465  +					     sizeof (unsigned char));
         1466  +
         1467  +    unstuff_bytes = unstuff_data (buf + hdr->hdr_size, unstuff_buf,
         1468  +				  hdr->data_size, hdr->data_size);
         1469  +
         1470  +    /* Consistency check */
         1471  +    if (unstuff_bytes >
         1472  +	hdr->uhdr.tc.Y_rt + hdr->uhdr.tc.Cb_rt + hdr->uhdr.tc.Cr_rt)
         1473  +      {
         1474  +	  free (unstuff_buf);
         1475  +	  return EPS_FORMAT_ERROR;
         1476  +      }
         1477  +
         1478  +    /* Dummy data */
         1479  +    if (unstuff_bytes == 0)
         1480  +      {
         1481  +	  unstuff_buf[0] = 0;
         1482  +	  unstuff_bytes = 1;
         1483  +      }
         1484  +
         1485  +    /* Allocate memory for Y and (Cb + Cr) channels */
         1486  +    buf_Y = (unsigned char *) xmalloc (unstuff_bytes * sizeof (unsigned char));
         1487  +
         1488  +    buf_Cb_Cr = (unsigned char *) xmalloc (unstuff_bytes *
         1489  +					   sizeof (unsigned char));
         1490  +
         1491  +    /* Split stream into Y and (Cb + Cr) channels */
         1492  +    split_channels (unstuff_buf, buf_Y, buf_Cb_Cr, unstuff_bytes,
         1493  +		    hdr->uhdr.tc.Y_rt, hdr->uhdr.tc.Cb_rt + hdr->uhdr.tc.Cr_rt,
         1494  +		    &speck_bytes_Y, &speck_bytes_Cb_Cr);
         1495  +
         1496  +    /* No longer needed */
         1497  +    free (unstuff_buf);
         1498  +
         1499  +    /* Consistency check */
         1500  +    if (speck_bytes_Cb_Cr > hdr->uhdr.tc.Cb_rt + hdr->uhdr.tc.Cr_rt)
         1501  +      {
         1502  +	  free (buf_Y);
         1503  +	  free (buf_Cb_Cr);
         1504  +	  return EPS_FORMAT_ERROR;
         1505  +      }
         1506  +
         1507  +    /* Dummy data */
         1508  +    if (speck_bytes_Y == 0)
         1509  +      {
         1510  +	  buf_Y[0] = 0;
         1511  +	  speck_bytes_Y = 1;
         1512  +      }
         1513  +
         1514  +    /* Dummy data */
         1515  +    if (speck_bytes_Cb_Cr == 0)
         1516  +      {
         1517  +	  buf_Cb_Cr[0] = 0;
         1518  +	  speck_bytes_Cb_Cr = 1;
         1519  +      }
         1520  +
         1521  +    /* Allocate memory for Cb and Cr channels */
         1522  +    buf_Cb = (unsigned char *) xmalloc (speck_bytes_Cb_Cr *
         1523  +					sizeof (unsigned char));
         1524  +
         1525  +    buf_Cr = (unsigned char *) xmalloc (speck_bytes_Cb_Cr *
         1526  +					sizeof (unsigned char));
         1527  +
         1528  +    /* Split merged (Cb + Cr) channel into Cb and Cr channels */
         1529  +    split_channels (buf_Cb_Cr, buf_Cb, buf_Cr, speck_bytes_Cb_Cr,
         1530  +		    hdr->uhdr.tc.Cb_rt, hdr->uhdr.tc.Cr_rt,
         1531  +		    &speck_bytes_Cb, &speck_bytes_Cr);
         1532  +
         1533  +    /* No longer needed */
         1534  +    free (buf_Cb_Cr);
         1535  +
         1536  +    /* Dummy data */
         1537  +    if (speck_bytes_Cb == 0)
         1538  +      {
         1539  +	  buf_Cb[0] = 0;
         1540  +	  speck_bytes_Cb = 1;
         1541  +      }
         1542  +
         1543  +    /* Dummy data */
         1544  +    if (speck_bytes_Cr == 0)
         1545  +      {
         1546  +	  buf_Cr[0] = 0;
         1547  +	  speck_bytes_Cr = 1;
         1548  +      }
         1549  +
         1550  +    /* Compute block sizes for full and resampled channels */
         1551  +    full_size =
         1552  +	get_block_size (hdr->uhdr.tc.w, hdr->uhdr.tc.h, hdr->uhdr.tc.mode, 4);
         1553  +    half_size = full_size / 2 + (hdr->uhdr.tc.mode == EPS_MODE_OTLPF);
         1554  +
         1555  +    if (hdr->uhdr.tc.resample == EPS_RESAMPLE_444)
         1556  +      {
         1557  +	  block_Y_size = full_size;
         1558  +	  block_Cb_size = full_size;
         1559  +	  block_Cr_size = full_size;
         1560  +      }
         1561  +    else
         1562  +      {
         1563  +	  block_Y_size = full_size;
         1564  +	  block_Cb_size = half_size;
         1565  +	  block_Cr_size = half_size;
         1566  +      }
         1567  +
         1568  +    /* Allocate memory for Y,Cb,Cr channels */
         1569  +    int_block_Y = (int **) malloc_2D (block_Y_size, block_Y_size, sizeof (int));
         1570  +    int_block_Cb = (int **) malloc_2D (block_Cb_size, block_Cb_size,
         1571  +				       sizeof (int));
         1572  +    int_block_Cr = (int **) malloc_2D (block_Cr_size, block_Cr_size,
         1573  +				       sizeof (int));
         1574  +
         1575  +    /* Decode data */
         1576  +    speck_decode (buf_Y, speck_bytes_Y, int_block_Y, block_Y_size);
         1577  +    speck_decode (buf_Cb, speck_bytes_Cb, int_block_Cb, block_Cb_size);
         1578  +    speck_decode (buf_Cr, speck_bytes_Cr, int_block_Cr, block_Cr_size);
         1579  +
         1580  +    /* No longer needed */
         1581  +    free (buf_Y);
         1582  +    free (buf_Cb);
         1583  +    free (buf_Cr);
         1584  +
         1585  +    /* Allocate memory for real-valued wavelet coefficients */
         1586  +    dwt_block_Y = (coeff_t **) malloc_2D (block_Y_size, block_Y_size,
         1587  +					  sizeof (coeff_t));
         1588  +    dwt_block_Cb = (coeff_t **) malloc_2D (block_Cb_size, block_Cb_size,
         1589  +					   sizeof (coeff_t));
         1590  +    dwt_block_Cr = (coeff_t **) malloc_2D (block_Cr_size, block_Cr_size,
         1591  +					   sizeof (coeff_t));
         1592  +
         1593  +    /* Copy data with type extension */
         1594  +    copy_channel (int_block_Y, dwt_block_Y, block_Y_size);
         1595  +    copy_channel (int_block_Cb, dwt_block_Cb, block_Cb_size);
         1596  +    copy_channel (int_block_Cr, dwt_block_Cr, block_Cr_size);
         1597  +
         1598  +    /* No longer needed */
         1599  +    free_2D ((void *) int_block_Y, block_Y_size, block_Y_size);
         1600  +    free_2D ((void *) int_block_Cb, block_Cb_size, block_Cb_size);
         1601  +    free_2D ((void *) int_block_Cr, block_Cr_size, block_Cr_size);
         1602  +
         1603  +    /* Allocate memory for restored Y,Cb,Cr channels */
         1604  +    block_Y = (coeff_t **) malloc_2D (block_Y_size, block_Y_size,
         1605  +				      sizeof (coeff_t));
         1606  +    block_Cb = (coeff_t **) malloc_2D (block_Cb_size, block_Cb_size,
         1607  +				       sizeof (coeff_t));
         1608  +    block_Cr = (coeff_t **) malloc_2D (block_Cr_size, block_Cr_size,
         1609  +				       sizeof (coeff_t));
         1610  +
         1611  +    /* Inverse wavelet transform */
         1612  +    synthesis_2D (dwt_block_Y, block_Y, block_Y_size, hdr->uhdr.tc.mode, fb);
         1613  +    synthesis_2D (dwt_block_Cb, block_Cb, block_Cb_size, hdr->uhdr.tc.mode, fb);
         1614  +    synthesis_2D (dwt_block_Cr, block_Cr, block_Cr_size, hdr->uhdr.tc.mode, fb);
         1615  +
         1616  +    /* No longer needed */
         1617  +    free_2D ((void *) dwt_block_Y, block_Y_size, block_Y_size);
         1618  +    free_2D ((void *) dwt_block_Cb, block_Cb_size, block_Cb_size);
         1619  +    free_2D ((void *) dwt_block_Cr, block_Cr_size, block_Cr_size);
         1620  +
         1621  +    /* Get DC values */
         1622  +    dc_Y_int = (unsigned char) hdr->uhdr.tc.dc_Y;
         1623  +    dc_Cb_int = (unsigned char) hdr->uhdr.tc.dc_Cb;
         1624  +    dc_Cr_int = (unsigned char) hdr->uhdr.tc.dc_Cr;
         1625  +
         1626  +    /* DC level unshift */
         1627  +    dc_level_unshift (block_Y, (coeff_t) dc_Y_int, block_Y_size, block_Y_size);
         1628  +    dc_level_unshift (block_Cb, (coeff_t) dc_Cb_int,
         1629  +		      block_Cb_size, block_Cb_size);
         1630  +    dc_level_unshift (block_Cr, (coeff_t) dc_Cr_int,
         1631  +		      block_Cr_size, block_Cr_size);
         1632  +
         1633  +    if (hdr->uhdr.tc.resample == EPS_RESAMPLE_444)
         1634  +      {
         1635  +	  /* No upsampling */
         1636  +	  pad_block_Y = block_Y;
         1637  +	  pad_block_Cb = block_Cb;
         1638  +	  pad_block_Cr = block_Cr;
         1639  +      }
         1640  +    else
         1641  +      {
         1642  +	  pad_block_Y = block_Y;
         1643  +
         1644  +	  /* Allocate memory for full-sized Cb and Cr channels */
         1645  +	  pad_block_Cb = (coeff_t **) malloc_2D (full_size, full_size,
         1646  +						 sizeof (coeff_t));
         1647  +
         1648  +	  pad_block_Cr = (coeff_t **) malloc_2D (full_size, full_size,
         1649  +						 sizeof (coeff_t));
         1650  +
         1651  +	  /* Upsample Cb and Cr channels according to 4:2:0 scheme */
         1652  +	  bilinear_resample_channel (block_Cb, pad_block_Cb,
         1653  +				     block_Cb_size, block_Cb_size,
         1654  +				     full_size, full_size);
         1655  +
         1656  +	  bilinear_resample_channel (block_Cr, pad_block_Cr,
         1657  +				     block_Cr_size, block_Cr_size,
         1658  +				     full_size, full_size);
         1659  +
         1660  +	  /* No longer needed */
         1661  +	  free_2D ((void *) block_Cb, block_Cb_size, block_Cb_size);
         1662  +	  free_2D ((void *) block_Cr, block_Cr_size, block_Cr_size);
         1663  +      }
         1664  +
         1665  +    /* Allocate memory for extended R,G,B channels */
         1666  +    pad_block_R = (coeff_t **) malloc_2D (full_size, full_size,
         1667  +					  sizeof (coeff_t));
         1668  +    pad_block_G = (coeff_t **) malloc_2D (full_size, full_size,
         1669  +					  sizeof (coeff_t));
         1670  +    pad_block_B = (coeff_t **) malloc_2D (full_size, full_size,
         1671  +					  sizeof (coeff_t));
         1672  +
         1673  +    /* Convert from Y,Cb,Cr to R,G,B color space */
         1674  +    convert_YCbCr_to_RGB (pad_block_Y, pad_block_Cb, pad_block_Cr,
         1675  +			  pad_block_R, pad_block_G, pad_block_B,
         1676  +			  full_size, full_size);
         1677  +
         1678  +    /* No longer needed */
         1679  +    free_2D ((void *) pad_block_Y, full_size, full_size);
         1680  +    free_2D ((void *) pad_block_Cb, full_size, full_size);
         1681  +    free_2D ((void *) pad_block_Cr, full_size, full_size);
         1682  +
         1683  +    /* Clip R,G,B channels */
         1684  +    clip_channel (pad_block_R, full_size, full_size);
         1685  +    clip_channel (pad_block_G, full_size, full_size);
         1686  +    clip_channel (pad_block_B, full_size, full_size);
         1687  +
         1688  +    /* Extract original data from R,G,B channels */
         1689  +    extract_channel (pad_block_R, block_R,
         1690  +		     full_size, full_size, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1691  +
         1692  +    extract_channel (pad_block_G, block_G,
         1693  +		     full_size, full_size, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1694  +
         1695  +    extract_channel (pad_block_B, block_B,
         1696  +		     full_size, full_size, hdr->uhdr.tc.w, hdr->uhdr.tc.h);
         1697  +
         1698  +    /* No longer needed */
         1699  +    free_2D ((void *) pad_block_R, full_size, full_size);
         1700  +    free_2D ((void *) pad_block_G, full_size, full_size);
         1701  +    free_2D ((void *) pad_block_B, full_size, full_size);
         1702  +
         1703  +    return EPS_OK;
         1704  +}
         1705  +
         1706  +int
         1707  +eps_truncate_block (unsigned char *buf_in, unsigned char *buf_out,
         1708  +		    eps_block_header * hdr, int *truncate_size)
         1709  +{
         1710  +    crc32_t data_crc;
         1711  +
         1712  +    /* Sanity checks */
         1713  +    if (!buf_in || !buf_out || !hdr)
         1714  +      {
         1715  +	  return EPS_PARAM_ERROR;
         1716  +      }
         1717  +
         1718  +    if (*truncate_size < MAX (EPS_MIN_GRAYSCALE_BUF, EPS_MIN_TRUECOLOR_BUF))
         1719  +      {
         1720  +	  return EPS_PARAM_ERROR;
         1721  +      }
         1722  +
         1723  +    /* Copy data */
         1724  +    *truncate_size = MIN (*truncate_size, hdr->hdr_size + hdr->data_size);
         1725  +    memcpy (buf_out, buf_in, *truncate_size);
         1726  +
         1727  +    /* Recompute data CRC */
         1728  +    data_crc =
         1729  +	epsilon_crc32 (buf_out + hdr->hdr_size, *truncate_size - hdr->hdr_size);
         1730  +    snprintf ((char *) (buf_out + hdr->hdr_size - 9), 9, "%08x", data_crc);
         1731  +    *(buf_out + hdr->hdr_size - 1) = ';';
         1732  +
         1733  +    return EPS_OK;
         1734  +}

Added epsilon/libmain.h.

            1  +/*
            2  + * $Id: libmain.h,v 1.17 2007/06/15 18:09:16 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Auxiliary support routines
           27  + *
           28  + *  This file contains auxiliary support routines for
           29  + *  the library. While being top-level they are not
           30  + *  intended for direct user access. */
           31  +
           32  +#ifndef __LIBMAIN_H__
           33  +#define __LIBMAIN_H__
           34  +
           35  +#ifdef __cplusplus
           36  +extern "C"
           37  +{
           38  +#endif
           39  +
           40  +/** \addtogroup misc Miscellanea */
           41  +/*@{*/
           42  +
           43  +#include <common.h>
           44  +#include <filterbank.h>
           45  +#include <filter.h>
           46  +
           47  +/** Round a channel
           48  + *
           49  + *  This function rounds each \a in_channel element to the
           50  + *  nearest integer and stores it in the \a out_channel.
           51  + *
           52  + *  \param in_channel Input channel
           53  + *  \param out_channel Output channel
           54  + *  \param channel_size Channel size
           55  + *
           56  + *  \return \c VOID */
           57  +    local void round_channel (coeff_t ** in_channel, int **out_channel,
           58  +			      int channel_size);
           59  +
           60  +/** Copy a channel
           61  + *
           62  + *  This function copies \a in_channel into the \a out_channel.
           63  + *
           64  + *  \param in_channel Input channel
           65  + *  \param out_channel Output channel
           66  + *  \param channel_size Channel size
           67  + *
           68  + *  \return \c VOID */
           69  +    local void copy_channel (int **in_channel, coeff_t ** out_channel,
           70  +			     int channel_size);
           71  +
           72  +/** Reset RGB channels
           73  + *
           74  + *  This function initializes arrays \a block_R, \a block_G
           75  + *  and \a block_B with zero.
           76  + *
           77  + *  \param block_R Red channel
           78  + *  \param block_G Green channel
           79  + *  \param block_B Blue channel
           80  + *  \param width Block width
           81  + *  \param height Block height
           82  + *
           83  + *  \return \c VOID */
           84  +    local void reset_RGB (unsigned char **block_R, unsigned char **block_G,
           85  +			  unsigned char **block_B, int width, int height);
           86  +
           87  +/** Reset Y channel
           88  + *
           89  + *  This function initializes array \a block_Y with zero.
           90  + *
           91  + *  \param block_Y Luma channel
           92  + *  \param width Block width
           93  + *  \param height Block height
           94  + *
           95  + *  \return \c VOID */
           96  +    local void reset_Y (unsigned char **block_Y, int width, int height);
           97  +
           98  +/** Get filterbank pointer from id
           99  + *
          100  + *  This function gets filterbank pointer from \a id.
          101  + *
          102  + *  \param id Filterbank id
          103  + *
          104  + *  \return Filterbank pointer or \c NULL if not found */
          105  +    local filterbank_t *get_fb (char *id);
          106  +
          107  +/** Compute required block size
          108  + *
          109  + *  This function computes block size (width=height) required
          110  + *  for encoding and decoding process. Depending on \a mode
          111  + *  parameter, function returns nearest power of two or
          112  + *  power of two plus one.
          113  + *
          114  + *  \param w Source width
          115  + *  \param h Source height
          116  + *  \param mode Either \ref EPS_MODE_NORMAL or \ref EPS_MODE_OTLPF
          117  + *  \param min Minimal block size
          118  + *
          119  + *  \return Block size (width = height) */
          120  +    local int get_block_size (int w, int h, int mode, int min);
          121  +
          122  +/** Terminate block header
          123  + *
          124  + *  This function replaces \a n_fields -th occurence of \c ;
          125  + *  symbol with \c 0. In other words, this function zero-terminates
          126  + *  header.
          127  + *
          128  + *  \param buf Data buffer
          129  + *  \param buf_size Buffer size
          130  + *  \param n_fields Number of header fields
          131  + *
          132  + *  \return Either \ref EPS_OK or \ref EPS_FORMAT_ERROR */
          133  +    local int terminate_header (unsigned char *buf, int buf_size, int n_fields);
          134  +
          135  +/** Unterminate header
          136  + *
          137  + *  This function is inverse to the previous one. It
          138  + *  replaces first occurence of \c 0 with \c ; symbol.
          139  + *
          140  + *  \param buf Data buffer
          141  + *
          142  + *  \return \c VOID */
          143  +    local void unterminate_header (unsigned char *buf);
          144  +
          145  +/** Header sanity check
          146  + *
          147  + *  This function ensures that header contains only
          148  + *  legal symbols.
          149  + *
          150  + *  \param buf Data buffer
          151  + *
          152  + *  \return Either \ref EPS_OK or \ref EPS_FORMAT_ERROR */
          153  +    local int header_sanity_check (unsigned char *buf);
          154  +
          155  +/** Read GRAYSCALE header
          156  + *
          157  + *  This function reads and checks block header of type
          158  + *  \ref EPS_GRAYSCALE_BLOCK. Result is stored in the \a hdr
          159  + *  structure.
          160  + *
          161  + *  \note Structure \a hdr is undefined unless function
          162  + *  returns \ref EPS_OK.
          163  + *
          164  + *  \param buf Data buffer
          165  + *  \param buf_size Buffer size
          166  + *  \param hdr Block header
          167  + *
          168  + *  \return Either \ref EPS_OK or \ref EPS_PARAM_ERROR
          169  + *  or \ref EPS_FORMAT_ERROR */
          170  +    local int read_gs_header (unsigned char *buf, int buf_size,
          171  +			      eps_block_header * hdr);
          172  +
          173  +/** Read TRUECOLOR header
          174  + *
          175  + *  This function reads and checks block header of type
          176  + *  \ref EPS_TRUECOLOR_BLOCK. Result is stored in the \a hdr
          177  + *  structure.
          178  + *
          179  + *  \note Structure \a hdr is undefined unless function
          180  + *  returns \ref EPS_OK.
          181  + *
          182  + *  \param buf Data buffer
          183  + *  \param buf_size Buffer size
          184  + *  \param hdr Block header
          185  + *
          186  + *  \return Either \ref EPS_OK or \ref EPS_PARAM_ERROR
          187  + *  or \ref EPS_FORMAT_ERROR */
          188  +    local int read_tc_header (unsigned char *buf, int buf_size,
          189  +			      eps_block_header * hdr);
          190  +
          191  +/*@}*/
          192  +
          193  +#ifdef __cplusplus
          194  +}
          195  +#endif
          196  +
          197  +#endif				/* __LIBMAIN_H__ */

Added epsilon/list.c.

            1  +/*
            2  + * $Id: list.c,v 1.16 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <list.h>
           26  +#include <mem_alloc.h>
           27  +
           28  +linked_list *
           29  +alloc_linked_list (void)
           30  +{
           31  +    linked_list *list;
           32  +
           33  +    list = (linked_list *) xmalloc (sizeof (linked_list));
           34  +    list->first = list->last = NULL;
           35  +
           36  +    return list;
           37  +}
           38  +
           39  +void
           40  +free_linked_list (linked_list * list)
           41  +{
           42  +    list_node *cur_node;
           43  +    list_node *next_node;
           44  +
           45  +    cur_node = list->first;
           46  +
           47  +    while (cur_node)
           48  +      {
           49  +	  next_node = cur_node->next;
           50  +	  free_list_node (cur_node);
           51  +	  cur_node = next_node;
           52  +      }
           53  +
           54  +    free (list);
           55  +}
           56  +
           57  +list_node *
           58  +alloc_list_node (int data_size)
           59  +{
           60  +    list_node *node;
           61  +
           62  +    node = (list_node *) xmalloc (sizeof (list_node));
           63  +    node->data = xmalloc (data_size);
           64  +    node->next = node->prev = NULL;
           65  +
           66  +    return node;
           67  +}
           68  +
           69  +void
           70  +free_list_node (list_node * node)
           71  +{
           72  +    free (node->data);
           73  +    free (node);
           74  +}
           75  +
           76  +void
           77  +append_list_node (linked_list * list, list_node * node)
           78  +{
           79  +    if ((list->first == NULL) && (list->last == NULL))
           80  +      {
           81  +	  node->next = node->prev = NULL;
           82  +	  list->first = list->last = node;
           83  +	  return;
           84  +      }
           85  +
           86  +    node->next = NULL;
           87  +    node->prev = list->last;
           88  +
           89  +    list->last->next = node;
           90  +    list->last = node;
           91  +}
           92  +
           93  +void
           94  +prepend_list_node (linked_list * list, list_node * node)
           95  +{
           96  +    if ((list->first == NULL) && (list->last == NULL))
           97  +      {
           98  +	  node->next = node->prev = NULL;
           99  +	  list->first = list->last = node;
          100  +	  return;
          101  +      }
          102  +
          103  +    node->prev = NULL;
          104  +    node->next = list->first;
          105  +
          106  +    list->first->prev = node;
          107  +    list->first = node;
          108  +}
          109  +
          110  +void
          111  +remove_list_node_link (linked_list * list, list_node * node)
          112  +{
          113  +    if (node->prev)
          114  +      {
          115  +	  node->prev->next = node->next;
          116  +      }
          117  +    else
          118  +      {
          119  +	  list->first = node->next;
          120  +      }
          121  +
          122  +    if (node->next)
          123  +      {
          124  +	  node->next->prev = node->prev;
          125  +      }
          126  +    else
          127  +      {
          128  +	  list->last = node->prev;
          129  +      }
          130  +}
          131  +
          132  +void
          133  +remove_list_node (linked_list * list, list_node * node)
          134  +{
          135  +    remove_list_node_link (list, node);
          136  +    free_list_node (node);
          137  +}
          138  +
          139  +void
          140  +move_list_node (linked_list * src_list, linked_list * dst_list,
          141  +		list_node * node)
          142  +{
          143  +    remove_list_node_link (src_list, node);
          144  +    append_list_node (dst_list, node);
          145  +}
          146  +
          147  +void
          148  +insert_before_list_node (linked_list * list, list_node * node,
          149  +			 list_node * new_node)
          150  +{
          151  +    if (!node)
          152  +      {
          153  +	  prepend_list_node (list, new_node);
          154  +	  return;
          155  +      }
          156  +
          157  +    if (node->prev)
          158  +      {
          159  +	  new_node->next = node;
          160  +	  new_node->prev = node->prev;
          161  +	  node->prev = node->prev->next = new_node;
          162  +      }
          163  +    else
          164  +      {
          165  +	  new_node->prev = NULL;
          166  +	  new_node->next = node;
          167  +	  node->prev = list->first = new_node;
          168  +      }
          169  +}
          170  +
          171  +void
          172  +insert_after_list_node (linked_list * list, list_node * node,
          173  +			list_node * new_node)
          174  +{
          175  +    if (!node)
          176  +      {
          177  +	  append_list_node (list, new_node);
          178  +	  return;
          179  +      }
          180  +
          181  +    if (node->next)
          182  +      {
          183  +	  new_node->prev = node;
          184  +	  new_node->next = node->next;
          185  +	  node->next = node->next->prev = new_node;
          186  +      }
          187  +    else
          188  +      {
          189  +	  new_node->next = NULL;
          190  +	  new_node->prev = node;
          191  +	  node->next = list->last = new_node;
          192  +      }
          193  +}

Added epsilon/list.h.

            1  +/*
            2  + * $Id: list.h,v 1.17 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Doubly-linked lists
           27  + *
           28  + *  This file contains routines to deal with doubly-linked lists. */
           29  +
           30  +#ifndef __LIST_H__
           31  +#define __LIST_H__
           32  +
           33  +#ifdef __cplusplus
           34  +extern "C"
           35  +{
           36  +#endif
           37  +
           38  +/** \addtogroup list Doubly-linked lists */
           39  +/*@{*/
           40  +
           41  +#include <common.h>
           42  +
           43  +/** This macro evaluates to 1 if list \a _x is empty */
           44  +#define LIST_IS_EMPTY(_x)       (_x->first == NULL)
           45  +
           46  +/** List node structure */
           47  +    typedef struct list_node_tag list_node;
           48  +
           49  +/** List node structure
           50  + *
           51  + *  This structure represents a doubly-linked list node. */
           52  +    struct list_node_tag
           53  +    {
           54  +    /** Data block pointer */
           55  +	void *data;
           56  +    /** Next list node */
           57  +	list_node *next;
           58  +    /** Previous list node */
           59  +	list_node *prev;
           60  +    };
           61  +
           62  +/** Doubly-linked list structure
           63  + *
           64  + *  This structure represents a doubly-linked list. */
           65  +    typedef struct linked_list_tag
           66  +    {
           67  +    /** First node */
           68  +	list_node *first;
           69  +    /** Last node */
           70  +	list_node *last;
           71  +    } linked_list;
           72  +
           73  +/** Allocate new doubly-linked list
           74  + *
           75  + *  This function allocates new doubly-linked list.
           76  + *
           77  + *  \return New list pointer */
           78  +    linked_list *alloc_linked_list (void);
           79  +
           80  +/** Release doubly-linked list
           81  + *
           82  + *  This function releases doubly-linked \a list with all
           83  + *  its internal nodes. Data blocks associated with nodes
           84  + *  are also released.
           85  + *
           86  + *  \return \c VOID */
           87  +    void free_linked_list (linked_list * list);
           88  +
           89  +/** Allocate new list node
           90  + *
           91  + *  This function allocates new list node with associated
           92  + *  data block of size \a data_size.
           93  + *
           94  + *  \return New node pointer */
           95  +    list_node *alloc_list_node (int data_size);
           96  +
           97  +/** Release list node
           98  + *
           99  + *  This function releases list \a node and data block
          100  + *  associated with it.
          101  + *
          102  + *  \return \c VOID */
          103  +    void free_list_node (list_node * node);
          104  +
          105  +/** Append list node
          106  + *
          107  + *  This function appends new \a node to the \a list tail.
          108  + *
          109  + *  \note Node must be properly allocated beforehand.
          110  + *
          111  + *  \return \c VOID */
          112  +    void append_list_node (linked_list * list, list_node * node);
          113  +
          114  +/** Prepend list node
          115  + *
          116  + *  This function prepends new \a node to the \a list head.
          117  + *
          118  + *  \note Node must be properly allocated beforehand.
          119  + *
          120  + *  \return \c VOID */
          121  +    void prepend_list_node (linked_list * list, list_node * node);
          122  +
          123  +/** Remove list node
          124  + *
          125  + *  This function removes \a node links from the \a list.
          126  + *
          127  + *  \note The \a node itself is not released and can be added
          128  + *  to another list.
          129  + *
          130  + *  \return \c VOID */
          131  +    void remove_list_node_link (linked_list * list, list_node * node);
          132  +
          133  +/** Remove list node
          134  + *
          135  + *  This function removes \a node from the \a list.
          136  + *
          137  + *  \note The \a node itself is released and cannot be added
          138  + *  to another list.
          139  + *
          140  + *  \return \c VOID */
          141  +    void remove_list_node (linked_list * list, list_node * node);
          142  +
          143  +/** Move node
          144  + *
          145  + *  This function moves \a node from \a src_list to \a dst_list.
          146  + *
          147  + *  \return \c VOID */
          148  +    void move_list_node (linked_list * src_list, linked_list * dst_list,
          149  +			 list_node * node);
          150  +
          151  +/** Insert node
          152  + *
          153  + *  This function inserts \a new_node to the \a list just before \a node.
          154  + *
          155  + *  \return \c VOID */
          156  +    void insert_before_list_node (linked_list * list, list_node * node,
          157  +				  list_node * new_node);
          158  +
          159  +/** Insert node
          160  + *
          161  + *  This function inserts \a new_node to the \a list just after \a node.
          162  + *
          163  + *  \return \c VOID */
          164  +    void insert_after_list_node (linked_list * list, list_node * node,
          165  +				 list_node * new_node);
          166  +
          167  +/*@}*/
          168  +
          169  +#ifdef __cplusplus
          170  +}
          171  +#endif
          172  +
          173  +#endif				/* __LIST_H__ */

Added epsilon/mem_alloc.c.

            1  +/*
            2  + * $Id: mem_alloc.c,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <mem_alloc.h>
           26  +
           27  +void *
           28  +xmalloc (size_t size)
           29  +{
           30  +    void *ptr;
           31  +
           32  +    ptr = malloc (size);
           33  +    assert (ptr);
           34  +
           35  +    return ptr;
           36  +}
           37  +
           38  +void **
           39  +malloc_2D (int width, int height, int size)
           40  +{
           41  +    void **ptr;
           42  +    int i;
           43  +
           44  +    assert ((width > 0) && (height > 0) && (size > 0));
           45  +    ptr = (void **) xmalloc (height * sizeof (void *));
           46  +
           47  +    for (i = 0; i < height; i++)
           48  +      {
           49  +	  ptr[i] = (void *) xmalloc (width * size);
           50  +      }
           51  +
           52  +    return ptr;
           53  +}
           54  +
           55  +void
           56  +free_2D (void **ptr, int width, int height)
           57  +{
           58  +    int i;
           59  +
           60  +    assert ((width > 0) && (height > 0));
           61  +
           62  +    for (i = 0; i < height; i++)
           63  +      {
           64  +	  free (ptr[i]);
           65  +      }
           66  +
           67  +    free (ptr);
           68  +}

Added epsilon/mem_alloc.h.

            1  +/*
            2  + * $Id: mem_alloc.h,v 1.14 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Two-dimensional memory management
           27  + *
           28  + *  This file contains two-dimensional memory management routines. */
           29  +
           30  +#ifndef __MEM_ALLOC_H__
           31  +#define __MEM_ALLOC_H__
           32  +
           33  +#ifdef __cplusplus
           34  +extern "C"
           35  +{
           36  +#endif
           37  +
           38  +/** \addtogroup mem_alloc Two-dimensional memory management */
           39  +/*@{*/
           40  +
           41  +#include <common.h>
           42  +
           43  +/** Memory allocation
           44  + *
           45  + *  This function allocates one-dimensional array of desired size.
           46  + *
           47  + *  \param size Size in bytes
           48  + *
           49  + *  \return Array pointer
           50  + *
           51  + *  \warning This function halts program if all virtual memory
           52  + *  is exhausted. */
           53  +    void *xmalloc (size_t size);
           54  +
           55  +/** Two-dimensional memory allocation
           56  + *
           57  + *  This function allocates two-dimensional array of desired size.
           58  + *
           59  + *  \param width Array width
           60  + *  \param height Array height
           61  + *  \param size Element size
           62  + *
           63  + *  \return Array pointer
           64  + *
           65  + *  \warning This function halts program if all virtual memory
           66  + *  is exhausted. */
           67  +    void **malloc_2D (int width, int height, int size);
           68  +
           69  +/** Two-dimensional memory releasing
           70  + *
           71  + *  This function releases two-dimensional array allocated by #malloc_2D.
           72  + *
           73  + *  \param ptr Array pointer
           74  + *  \param width Array width
           75  + *  \param height Array height
           76  + *
           77  + *  \return \c VOID */
           78  +    void free_2D (void **ptr, int width, int height);
           79  +
           80  +/*@}*/
           81  +
           82  +#ifdef __cplusplus
           83  +}
           84  +#endif
           85  +
           86  +#endif				/* __MEM_ALLOC_H__ */

Added epsilon/merge_split.c.

            1  +/*
            2  + * $Id: merge_split.c,v 1.13 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <merge_split.h>
           26  +
           27  +void
           28  +merge_channels (unsigned char *channel_A, unsigned char *channel_B,
           29  +		unsigned char *channel_AB, int len_A, int len_B)
           30  +{
           31  +    int pkg_A, pkg_B;		/* Real number of bytes in the package */
           32  +    int div_A, div_B;		/* Base number of bytes in the package */
           33  +    int rem_A, rem_B;		/* Instant reminder */
           34  +    int cur_A, cur_B;		/* Current savings */
           35  +    int tr0_A, tr0_B;		/* Lower threshold */
           36  +    int tr1_A, tr1_B;		/* Upper threshold */
           37  +    int i, pkg, min;
           38  +
           39  +    /* Sanity checks. I love them! */
           40  +    assert ((len_A > 0) && (len_B > 0));
           41  +
           42  +    /* Total number of packages */
           43  +    min = MIN (len_A, len_B);
           44  +
           45  +    /* 1-st channel setup */
           46  +    div_A = len_A / min;
           47  +    cur_A = len_A;
           48  +    rem_A = 0;
           49  +    tr0_A = div_A * min;
           50  +    tr1_A = tr0_A + min;
           51  +
           52  +    /* 2-nd channel setup */
           53  +    div_B = len_B / min;
           54  +    cur_B = len_B;
           55  +    rem_B = 0;
           56  +    tr0_B = div_B * min;
           57  +    tr1_B = tr0_B + min;
           58  +
           59  +    /* Loop for all packages */
           60  +    for (pkg = 0; pkg < min; pkg++)
           61  +      {
           62  +	  /* Update current savings */
           63  +	  cur_A = len_A + rem_A;
           64  +
           65  +	  if (cur_A >= tr1_A)
           66  +	    {
           67  +		/* Choose maximal package & update reminder */
           68  +		pkg_A = div_A + 1;
           69  +		rem_A = cur_A - tr1_A;
           70  +	    }
           71  +	  else
           72  +	    {
           73  +		/* Choose minimal package & update reminder */
           74  +		pkg_A = div_A;
           75  +		rem_A = cur_A - tr0_A;
           76  +	    }
           77  +
           78  +	  /* Update current savings */
           79  +	  cur_B = len_B + rem_B;
           80  +
           81  +	  if (cur_B >= tr1_B)
           82  +	    {
           83  +		/* Choose maximal package & update reminder */
           84  +		pkg_B = div_B + 1;
           85  +		rem_B = cur_B - tr1_B;
           86  +	    }
           87  +	  else
           88  +	    {
           89  +		/* Choose minimal package & update reminder */
           90  +		pkg_B = div_B;
           91  +		rem_B = cur_B - tr0_B;
           92  +	    }
           93  +
           94  +	  /* Put bytes from the 1-st channel */
           95  +	  for (i = 0; i < pkg_A; i++)
           96  +	    {
           97  +		*channel_AB++ = *channel_A++;
           98  +	    }
           99  +
          100  +	  /* Put bytes from the 2-nd channel */
          101  +	  for (i = 0; i < pkg_B; i++)
          102  +	    {
          103  +		*channel_AB++ = *channel_B++;
          104  +	    }
          105  +      }
          106  +}
          107  +
          108  +void
          109  +split_channels (unsigned char *channel_AB,
          110  +		unsigned char *channel_A, unsigned char *channel_B,
          111  +		int len_AB, int len_A, int len_B,
          112  +		int *real_len_A, int *real_len_B)
          113  +{
          114  +    int pkg_A, pkg_B;		/* Real number of bytes in the package */
          115  +    int div_A, div_B;		/* Base number of bytes in the package */
          116  +    int rem_A, rem_B;		/* Instant reminder */
          117  +    int cur_A, cur_B;		/* Current savings */
          118  +    int tr0_A, tr0_B;		/* Lower threshold */
          119  +    int tr1_A, tr1_B;		/* Upper threshold */
          120  +    int i, pkg, min;
          121  +
          122  +    unsigned char *end_AB;
          123  +    unsigned char *end_A;
          124  +    unsigned char *end_B;
          125  +
          126  +    /* Sanity checks */
          127  +    assert ((len_A > 0) && (len_B > 0) && (len_AB > 0));
          128  +    assert (real_len_A && real_len_B);
          129  +    assert (len_A + len_B >= len_AB);
          130  +
          131  +    /* Set end-of-buffer pointers */
          132  +    end_AB = channel_AB + len_AB;
          133  +    end_A = channel_A + len_A;
          134  +    end_B = channel_B + len_B;
          135  +
          136  +    /* Real amount of saved bytes */
          137  +    *real_len_A = *real_len_B = 0;
          138  +
          139  +    /* Original number of packages (real stream may be truncated) */
          140  +    min = MIN (len_A, len_B);
          141  +
          142  +    /* 1-st channel setup */
          143  +    div_A = len_A / min;
          144  +    cur_A = len_A;
          145  +    rem_A = 0;
          146  +    tr0_A = div_A * min;
          147  +    tr1_A = tr0_A + min;
          148  +
          149  +    /* 2-nd channel setup */
          150  +    div_B = len_B / min;
          151  +    cur_B = len_B;
          152  +    rem_B = 0;
          153  +    tr0_B = div_B * min;
          154  +    tr1_B = tr0_B + min;
          155  +
          156  +    /* Loop for all packages */
          157  +    for (pkg = 0; pkg < min; pkg++)
          158  +      {
          159  +	  /* Update current savings */
          160  +	  cur_A = len_A + rem_A;
          161  +
          162  +	  if (cur_A >= tr1_A)
          163  +	    {
          164  +		/* Choose maximal package & update reminder */
          165  +		pkg_A = div_A + 1;
          166  +		rem_A = cur_A - tr1_A;
          167  +	    }
          168  +	  else
          169  +	    {
          170  +		/* Choose minimal package & update reminder */
          171  +		pkg_A = div_A;
          172  +		rem_A = cur_A - tr0_A;
          173  +	    }
          174  +
          175  +	  /* Update current savings */
          176  +	  cur_B = len_B + rem_B;
          177  +
          178  +	  if (cur_B >= tr1_B)
          179  +	    {
          180  +		/* Choose maximal package & update reminder */
          181  +		pkg_B = div_B + 1;
          182  +		rem_B = cur_B - tr1_B;
          183  +	    }
          184  +	  else
          185  +	    {
          186  +		/* Choose minimal package & update reminder */
          187  +		pkg_B = div_B;
          188  +		rem_B = cur_B - tr0_B;
          189  +	    }
          190  +
          191  +	  /* Extract pkg_A bytes from the stream into the channel_A */
          192  +	  for (i = 0;
          193  +	       (i < pkg_A) && (channel_A < end_A) && (channel_AB < end_AB); i++)
          194  +	    {
          195  +		*channel_A++ = *channel_AB++;
          196  +		(*real_len_A)++;
          197  +	    }
          198  +
          199  +	  /* Extract pkg_B bytes from the stream into the channel_B */
          200  +	  for (i = 0;
          201  +	       (i < pkg_B) && (channel_B < end_B) && (channel_AB < end_AB); i++)
          202  +	    {
          203  +		*channel_B++ = *channel_AB++;
          204  +		(*real_len_B)++;
          205  +	    }
          206  +
          207  +	  /* All avaiable bytes are processed */
          208  +	  if (channel_AB >= end_AB)
          209  +	    {
          210  +		assert (*real_len_A + *real_len_B == len_AB);
          211  +
          212  +		if ((pkg == min - 1) && (channel_A == end_A)
          213  +		    && (channel_B == end_B))
          214  +		  {
          215  +		      assert ((*real_len_A == len_A) && (*real_len_B == len_B));
          216  +		  }
          217  +
          218  +		return;
          219  +	    }
          220  +      }
          221  +}

Added epsilon/merge_split.h.

            1  +/*
            2  + * $Id: merge_split.h,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Merge and split
           27  + *
           28  + *  The library expects that color image consists of 3 independent
           29  + *  channels: Y, Cb and Cr. In order to provide smooth image scaling
           30  + *  corresponding bitstreams should be merged into a singe bitstream.
           31  + *  On decoding, the inverse operation should be taken. */
           32  +
           33  +#ifndef __MERGE_SPLIT_H__
           34  +#define __MERGE_SPLIT_H__
           35  +
           36  +#ifdef __cplusplus
           37  +extern "C"
           38  +{
           39  +#endif
           40  +
           41  +/** \addtogroup merge_split Merge and split */
           42  +/*@{*/
           43  +
           44  +#include <common.h>
           45  +
           46  +/** Merge two channels
           47  + *
           48  + *  This function merges \a channel_A with \a channel_B. Result is stored
           49  + *  in the \a channel_AB. Note that on return, combined \a channel_AB can
           50  + *  be further merged with another channel.
           51  + *
           52  + *  \param channel_A Channel A
           53  + *  \param channel_B Channel B
           54  + *  \param channel_AB Combined channel AB
           55  + *  \param len_A Length of the \a channel_A
           56  + *  \param len_B Length of the \a channel_B
           57  + *
           58  + *  \note The caller should allocate at least \a len_A + \a len_B
           59  + *  bytes for the \a channel_AB array.
           60  + *
           61  + *  \return \c VOID */
           62  +    void merge_channels (unsigned char *channel_A, unsigned char *channel_B,
           63  +			 unsigned char *channel_AB, int len_A, int len_B);
           64  +
           65  +/** Split combined channel
           66  + *
           67  + *  This function splits combined \a channel_AB into
           68  + *  the \a channel_A and \a channel_B. It is important to note
           69  + *  that \a channel_AB can be truncated at any position beforehand.
           70  + *  In this case \a channel_A and \a channel_B will contain only
           71  + *  part of original data. Real amount of saved bytes will be stored
           72  + *  in the \a real_len_A and \a real_len_B respectively.
           73  + *
           74  + *  \param channel_AB Combined channel AB
           75  + *  \param channel_A Channel A
           76  + *  \param channel_B Channel B
           77  + *  \param len_AB Current length of the \a channel_AB
           78  + *  \param len_A Original length of the \a channel_A
           79  + *  \param len_B Original length of the \a channel_B
           80  + *  \param real_len_A Number of bytes actually used in the \a channel_A
           81  + *  \param real_len_B Number of bytes actually used in the \a channel_B
           82  + *
           83  + *  \note The caller should allocate at least \a len_AB bytes for
           84  + *  \a channel_A and \a channel_B arrays.
           85  + *
           86  + *  \return \c VOID */
           87  +    void split_channels (unsigned char *channel_AB,
           88  +			 unsigned char *channel_A, unsigned char *channel_B,
           89  +			 int len_AB, int len_A, int len_B,
           90  +			 int *real_len_A, int *real_len_B);
           91  +
           92  +/*@}*/
           93  +
           94  +#ifdef __cplusplus
           95  +}
           96  +#endif
           97  +
           98  +#endif				/* __MERGE_SPLIT_H__ */

Added epsilon/msvc/inttypes.h.

            1  +// ISO C9x  compliant inttypes.h for Microsoft Visual Studio
            2  +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
            3  +//
            4  +//  Copyright (c) 2006 Alexander Chemeris
            5  +//
            6  +// Redistribution and use in source and binary forms, with or without
            7  +// modification, are permitted provided that the following conditions are met:
            8  +//
            9  +//   1. Redistributions of source code must retain the above copyright notice,
           10  +//      this list of conditions and the following disclaimer.
           11  +//
           12  +//   2. Redistributions in binary form must reproduce the above copyright
           13  +//      notice, this list of conditions and the following disclaimer in the
           14  +//      documentation and/or other materials provided with the distribution.
           15  +//
           16  +//   3. The name of the author may be used to endorse or promote products
           17  +//      derived from this software without specific prior written permission.
           18  +//
           19  +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
           20  +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
           21  +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
           22  +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
           23  +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
           24  +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
           25  +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
           26  +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
           27  +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
           28  +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
           29  +//
           30  +///////////////////////////////////////////////////////////////////////////////
           31  +
           32  +#ifndef _MSC_VER // [
           33  +#error "Use this header only with Microsoft Visual C++ compilers!"
           34  +#endif // _MSC_VER ]
           35  +
           36  +#ifndef _MSC_INTTYPES_H_ // [
           37  +#define _MSC_INTTYPES_H_
           38  +
           39  +#if _MSC_VER > 1000
           40  +#pragma once
           41  +#endif
           42  +
           43  +#include <stdint.h>
           44  +
           45  +// 7.8 Format conversion of integer types
           46  +
           47  +typedef struct {
           48  +   intmax_t quot;
           49  +   intmax_t rem;
           50  +} imaxdiv_t;
           51  +
           52  +// 7.8.1 Macros for format specifiers
           53  +
           54  +// The fprintf macros for signed integers are:
           55  +#define PRId8       "d"
           56  +#define PRIi8       "i"
           57  +#define PRIdLEAST8  "d"
           58  +#define PRIiLEAST8  "i"
           59  +#define PRIdFAST8   "d"
           60  +#define PRIiFAST8   "i"
           61  +
           62  +#define PRId16       "hd"
           63  +#define PRIi16       "hi"
           64  +#define PRIdLEAST16  "hd"
           65  +#define PRIiLEAST16  "hi"
           66  +#define PRIdFAST16   "hd"
           67  +#define PRIiFAST16   "hi"
           68  +
           69  +#define PRId32       "I32d"
           70  +#define PRIi32       "I32i"
           71  +#define PRIdLEAST32  "I32d"
           72  +#define PRIiLEAST32  "I32i"
           73  +#define PRIdFAST32   "I32d"
           74  +#define PRIiFAST32   "I32i"
           75  +
           76  +#define PRId64       "I64d"
           77  +#define PRIi64       "I64i"
           78  +#define PRIdLEAST64  "I64d"
           79  +#define PRIiLEAST64  "I64i"
           80  +#define PRIdFAST64   "I64d"
           81  +#define PRIiFAST64   "I64i"
           82  +
           83  +#define PRIdMAX     "I64d"
           84  +#define PRIiMAX     "I64i"
           85  +
           86  +#define PRIdPTR     "Id"
           87  +#define PRIiPTR     "Ii"
           88  +
           89  +// The fprintf macros for unsigned integers are:
           90  +#define PRIo8       "o"
           91  +#define PRIu8       "u"
           92  +#define PRIx8       "x"
           93  +#define PRIX8       "X"
           94  +#define PRIoLEAST8  "o"
           95  +#define PRIuLEAST8  "u"
           96  +#define PRIxLEAST8  "x"
           97  +#define PRIXLEAST8  "X"
           98  +#define PRIoFAST8   "o"
           99  +#define PRIuFAST8   "u"
          100  +#define PRIxFAST8   "x"
          101  +#define PRIXFAST8   "X"
          102  +
          103  +#define PRIo16       "ho"
          104  +#define PRIu16       "hu"
          105  +#define PRIx16       "hx"
          106  +#define PRIX16       "hX"
          107  +#define PRIoLEAST16  "ho"
          108  +#define PRIuLEAST16  "hu"
          109  +#define PRIxLEAST16  "hx"
          110  +#define PRIXLEAST16  "hX"
          111  +#define PRIoFAST16   "ho"
          112  +#define PRIuFAST16   "hu"
          113  +#define PRIxFAST16   "hx"
          114  +#define PRIXFAST16   "hX"
          115  +
          116  +#define PRIo32       "I32o"
          117  +#define PRIu32       "I32u"
          118  +#define PRIx32       "I32x"
          119  +#define PRIX32       "I32X"
          120  +#define PRIoLEAST32  "I32o"
          121  +#define PRIuLEAST32  "I32u"
          122  +#define PRIxLEAST32  "I32x"
          123  +#define PRIXLEAST32  "I32X"
          124  +#define PRIoFAST32   "I32o"
          125  +#define PRIuFAST32   "I32u"
          126  +#define PRIxFAST32   "I32x"
          127  +#define PRIXFAST32   "I32X"
          128  +
          129  +#define PRIo64       "I64o"
          130  +#define PRIu64       "I64u"
          131  +#define PRIx64       "I64x"
          132  +#define PRIX64       "I64X"
          133  +#define PRIoLEAST64  "I64o"
          134  +#define PRIuLEAST64  "I64u"
          135  +#define PRIxLEAST64  "I64x"
          136  +#define PRIXLEAST64  "I64X"
          137  +#define PRIoFAST64   "I64o"
          138  +#define PRIuFAST64   "I64u"
          139  +#define PRIxFAST64   "I64x"
          140  +#define PRIXFAST64   "I64X"
          141  +
          142  +#define PRIoMAX     "I64o"
          143  +#define PRIuMAX     "I64u"
          144  +#define PRIxMAX     "I64x"
          145  +#define PRIXMAX     "I64X"
          146  +
          147  +#define PRIoPTR     "Io"
          148  +#define PRIuPTR     "Iu"
          149  +#define PRIxPTR     "Ix"
          150  +#define PRIXPTR     "IX"
          151  +
          152  +// The fscanf macros for signed integers are:
          153  +#define SCNd8       "d"
          154  +#define SCNi8       "i"
          155  +#define SCNdLEAST8  "d"
          156  +#define SCNiLEAST8  "i"
          157  +#define SCNdFAST8   "d"
          158  +#define SCNiFAST8   "i"
          159  +
          160  +#define SCNd16       "hd"
          161  +#define SCNi16       "hi"
          162  +#define SCNdLEAST16  "hd"
          163  +#define SCNiLEAST16  "hi"
          164  +#define SCNdFAST16   "hd"
          165  +#define SCNiFAST16   "hi"
          166  +
          167  +#define SCNd32       "ld"
          168  +#define SCNi32       "li"
          169  +#define SCNdLEAST32  "ld"
          170  +#define SCNiLEAST32  "li"
          171  +#define SCNdFAST32   "ld"
          172  +#define SCNiFAST32   "li"
          173  +
          174  +#define SCNd64       "I64d"
          175  +#define SCNi64       "I64i"
          176  +#define SCNdLEAST64  "I64d"
          177  +#define SCNiLEAST64  "I64i"
          178  +#define SCNdFAST64   "I64d"
          179  +#define SCNiFAST64   "I64i"
          180  +
          181  +#define SCNdMAX     "I64d"
          182  +#define SCNiMAX     "I64i"
          183  +
          184  +#ifdef _WIN64 // [
          185  +#  define SCNdPTR     "I64d"
          186  +#  define SCNiPTR     "I64i"
          187  +#else  // _WIN64 ][
          188  +#  define SCNdPTR     "ld"
          189  +#  define SCNiPTR     "li"
          190  +#endif  // _WIN64 ]
          191  +
          192  +// The fscanf macros for unsigned integers are:
          193  +#define SCNo8       "o"
          194  +#define SCNu8       "u"
          195  +#define SCNx8       "x"
          196  +#define SCNX8       "X"
          197  +#define SCNoLEAST8  "o"
          198  +#define SCNuLEAST8  "u"
          199  +#define SCNxLEAST8  "x"
          200  +#define SCNXLEAST8  "X"
          201  +#define SCNoFAST8   "o"
          202  +#define SCNuFAST8   "u"
          203  +#define SCNxFAST8   "x"
          204  +#define SCNXFAST8   "X"
          205  +
          206  +
          207  +#define SCNo16       "ho"
          208  +#define SCNu16       "hu"
          209  +#define SCNx16       "hx"
          210  +#define SCNX16       "hX"
          211  +#define SCNoLEAST16  "ho"
          212  +#define SCNuLEAST16  "hu"
          213  +#define SCNxLEAST16  "hx"
          214  +#define SCNXLEAST16  "hX"
          215  +#define SCNoFAST16   "ho"
          216  +#define SCNuFAST16   "hu"
          217  +#define SCNxFAST16   "hx"
          218  +#define SCNXFAST16   "hX"
          219  +
          220  +#define SCNo32       "lo"
          221  +#define SCNu32       "lu"
          222  +#define SCNx32       "lx"
          223  +#define SCNX32       "lX"
          224  +#define SCNoLEAST32  "lo"
          225  +#define SCNuLEAST32  "lu"
          226  +#define SCNxLEAST32  "lx"
          227  +#define SCNXLEAST32  "lX"
          228  +#define SCNoFAST32   "lo"
          229  +#define SCNuFAST32   "lu"
          230  +#define SCNxFAST32   "lx"
          231  +#define SCNXFAST32   "lX"
          232  +
          233  +#define SCNo64       "I64o"
          234  +#define SCNu64       "I64u"
          235  +#define SCNx64       "I64x"
          236  +#define SCNX64       "I64X"
          237  +#define SCNoLEAST64  "I64o"
          238  +#define SCNuLEAST64  "I64u"
          239  +#define SCNxLEAST64  "I64x"
          240  +#define SCNXLEAST64  "I64X"
          241  +#define SCNoFAST64   "I64o"
          242  +#define SCNuFAST64   "I64u"
          243  +#define SCNxFAST64   "I64x"
          244  +#define SCNXFAST64   "I64X"
          245  +
          246  +#define SCNoMAX     "I64o"
          247  +#define SCNuMAX     "I64u"
          248  +#define SCNxMAX     "I64x"
          249  +#define SCNXMAX     "I64X"
          250  +
          251  +#ifdef _WIN64 // [
          252  +#  define SCNoPTR     "I64o"
          253  +#  define SCNuPTR     "I64u"
          254  +#  define SCNxPTR     "I64x"
          255  +#  define SCNXPTR     "I64X"
          256  +#else  // _WIN64 ][
          257  +#  define SCNoPTR     "lo"
          258  +#  define SCNuPTR     "lu"
          259  +#  define SCNxPTR     "lx"
          260  +#  define SCNXPTR     "lX"
          261  +#endif  // _WIN64 ]
          262  +
          263  +// 7.8.2 Functions for greatest-width integer types
          264  +
          265  +// 7.8.2.1 The imaxabs function
          266  +#define imaxabs _abs64
          267  +
          268  +// 7.8.2.2 The imaxdiv function
          269  +
          270  +// This is modified version of div() function from Microsoft's div.c found
          271  +// in %MSVC.NET%\crt\src\div.c
          272  +#ifdef STATIC_IMAXDIV // [
          273  +static
          274  +#else // STATIC_IMAXDIV ][
          275  +_inline
          276  +#endif // STATIC_IMAXDIV ]
          277  +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
          278  +{
          279  +   imaxdiv_t result;
          280  +
          281  +   result.quot = numer / denom;
          282  +   result.rem = numer % denom;
          283  +
          284  +   if (numer < 0 && result.rem > 0) {
          285  +      // did division wrong; must fix up
          286  +      ++result.quot;
          287  +      result.rem -= denom;
          288  +   }
          289  +
          290  +   return result;
          291  +}
          292  +
          293  +// 7.8.2.3 The strtoimax and strtoumax functions
          294  +#define strtoimax _strtoi64
          295  +#define strtoumax _strtoui64
          296  +
          297  +// 7.8.2.4 The wcstoimax and wcstoumax functions
          298  +#define wcstoimax _wcstoi64
          299  +#define wcstoumax _wcstoui64
          300  +
          301  +
          302  +#endif // _MSC_INTTYPES_H_ ]

Added epsilon/msvc/stdint.h.

            1  +// ISO C9x  compliant stdint.h for Microsoft Visual Studio
            2  +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
            3  +// 
            4  +//  Copyright (c) 2006-2008 Alexander Chemeris
            5  +// 
            6  +// Redistribution and use in source and binary forms, with or without
            7  +// modification, are permitted provided that the following conditions are met:
            8  +// 
            9  +//   1. Redistributions of source code must retain the above copyright notice,
           10  +//      this list of conditions and the following disclaimer.
           11  +// 
           12  +//   2. Redistributions in binary form must reproduce the above copyright
           13  +//      notice, this list of conditions and the following disclaimer in the
           14  +//      documentation and/or other materials provided with the distribution.
           15  +// 
           16  +//   3. The name of the author may be used to endorse or promote products
           17  +//      derived from this software without specific prior written permission.
           18  +// 
           19  +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
           20  +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
           21  +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
           22  +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
           23  +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
           24  +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
           25  +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
           26  +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
           27  +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
           28  +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
           29  +// 
           30  +///////////////////////////////////////////////////////////////////////////////
           31  +
           32  +#ifndef _MSC_VER // [
           33  +#error "Use this header only with Microsoft Visual C++ compilers!"
           34  +#endif // _MSC_VER ]
           35  +
           36  +#ifndef _MSC_STDINT_H_ // [
           37  +#define _MSC_STDINT_H_
           38  +
           39  +#if _MSC_VER > 1000
           40  +#pragma once
           41  +#endif
           42  +
           43  +#include <limits.h>
           44  +
           45  +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
           46  +// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
           47  +// or compiler give many errors like this:
           48  +//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
           49  +#ifdef __cplusplus
           50  +extern "C" {
           51  +#endif
           52  +#  include <wchar.h>
           53  +#ifdef __cplusplus
           54  +}
           55  +#endif
           56  +
           57  +// Define _W64 macros to mark types changing their size, like intptr_t.
           58  +#ifndef _W64
           59  +#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
           60  +#     define _W64 __w64
           61  +#  else
           62  +#     define _W64
           63  +#  endif
           64  +#endif
           65  +
           66  +
           67  +// 7.18.1 Integer types
           68  +
           69  +// 7.18.1.1 Exact-width integer types
           70  +
           71  +// Visual Studio 6 and Embedded Visual C++ 4 doesn't
           72  +// realize that, e.g. char has the same size as __int8
           73  +// so we give up on __intX for them.
           74  +#if (_MSC_VER < 1300)
           75  +   typedef signed char       int8_t;
           76  +   typedef signed short      int16_t;
           77  +   typedef signed int        int32_t;
           78  +   typedef unsigned char     uint8_t;
           79  +   typedef unsigned short    uint16_t;
           80  +   typedef unsigned int      uint32_t;
           81  +#else
           82  +   typedef signed __int8     int8_t;
           83  +   typedef signed __int16    int16_t;
           84  +   typedef signed __int32    int32_t;
           85  +   typedef unsigned __int8   uint8_t;
           86  +   typedef unsigned __int16  uint16_t;
           87  +   typedef unsigned __int32  uint32_t;
           88  +#endif
           89  +typedef signed __int64       int64_t;
           90  +typedef unsigned __int64     uint64_t;
           91  +
           92  +
           93  +// 7.18.1.2 Minimum-width integer types
           94  +typedef int8_t    int_least8_t;
           95  +typedef int16_t   int_least16_t;
           96  +typedef int32_t   int_least32_t;
           97  +typedef int64_t   int_least64_t;
           98  +typedef uint8_t   uint_least8_t;
           99  +typedef uint16_t  uint_least16_t;
          100  +typedef uint32_t  uint_least32_t;
          101  +typedef uint64_t  uint_least64_t;
          102  +
          103  +// 7.18.1.3 Fastest minimum-width integer types
          104  +typedef int8_t    int_fast8_t;
          105  +typedef int16_t   int_fast16_t;
          106  +typedef int32_t   int_fast32_t;
          107  +typedef int64_t   int_fast64_t;
          108  +typedef uint8_t   uint_fast8_t;
          109  +typedef uint16_t  uint_fast16_t;
          110  +typedef uint32_t  uint_fast32_t;
          111  +typedef uint64_t  uint_fast64_t;
          112  +
          113  +// 7.18.1.4 Integer types capable of holding object pointers
          114  +#ifdef _WIN64 // [
          115  +   typedef signed __int64    intptr_t;
          116  +   typedef unsigned __int64  uintptr_t;
          117  +#else // _WIN64 ][
          118  +   typedef _W64 signed int   intptr_t;
          119  +   typedef _W64 unsigned int uintptr_t;
          120  +#endif // _WIN64 ]
          121  +
          122  +// 7.18.1.5 Greatest-width integer types
          123  +typedef int64_t   intmax_t;
          124  +typedef uint64_t  uintmax_t;
          125  +
          126  +
          127  +// 7.18.2 Limits of specified-width integer types
          128  +
          129  +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
          130  +
          131  +// 7.18.2.1 Limits of exact-width integer types
          132  +#define INT8_MIN     ((int8_t)_I8_MIN)
          133  +#define INT8_MAX     _I8_MAX
          134  +#define INT16_MIN    ((int16_t)_I16_MIN)
          135  +#define INT16_MAX    _I16_MAX
          136  +#define INT32_MIN    ((int32_t)_I32_MIN)
          137  +#define INT32_MAX    _I32_MAX
          138  +#define INT64_MIN    ((int64_t)_I64_MIN)
          139  +#define INT64_MAX    _I64_MAX
          140  +#define UINT8_MAX    _UI8_MAX
          141  +#define UINT16_MAX   _UI16_MAX
          142  +#define UINT32_MAX   _UI32_MAX
          143  +#define UINT64_MAX   _UI64_MAX
          144  +
          145  +// 7.18.2.2 Limits of minimum-width integer types
          146  +#define INT_LEAST8_MIN    INT8_MIN
          147  +#define INT_LEAST8_MAX    INT8_MAX
          148  +#define INT_LEAST16_MIN   INT16_MIN
          149  +#define INT_LEAST16_MAX   INT16_MAX
          150  +#define INT_LEAST32_MIN   INT32_MIN
          151  +#define INT_LEAST32_MAX   INT32_MAX
          152  +#define INT_LEAST64_MIN   INT64_MIN
          153  +#define INT_LEAST64_MAX   INT64_MAX
          154  +#define UINT_LEAST8_MAX   UINT8_MAX
          155  +#define UINT_LEAST16_MAX  UINT16_MAX
          156  +#define UINT_LEAST32_MAX  UINT32_MAX
          157  +#define UINT_LEAST64_MAX  UINT64_MAX
          158  +
          159  +// 7.18.2.3 Limits of fastest minimum-width integer types
          160  +#define INT_FAST8_MIN    INT8_MIN
          161  +#define INT_FAST8_MAX    INT8_MAX
          162  +#define INT_FAST16_MIN   INT16_MIN
          163  +#define INT_FAST16_MAX   INT16_MAX
          164  +#define INT_FAST32_MIN   INT32_MIN
          165  +#define INT_FAST32_MAX   INT32_MAX
          166  +#define INT_FAST64_MIN   INT64_MIN
          167  +#define INT_FAST64_MAX   INT64_MAX
          168  +#define UINT_FAST8_MAX   UINT8_MAX
          169  +#define UINT_FAST16_MAX  UINT16_MAX
          170  +#define UINT_FAST32_MAX  UINT32_MAX
          171  +#define UINT_FAST64_MAX  UINT64_MAX
          172  +
          173  +// 7.18.2.4 Limits of integer types capable of holding object pointers
          174  +#ifdef _WIN64 // [
          175  +#  define INTPTR_MIN   INT64_MIN
          176  +#  define INTPTR_MAX   INT64_MAX
          177  +#  define UINTPTR_MAX  UINT64_MAX
          178  +#else // _WIN64 ][
          179  +#  define INTPTR_MIN   INT32_MIN
          180  +#  define INTPTR_MAX   INT32_MAX
          181  +#  define UINTPTR_MAX  UINT32_MAX
          182  +#endif // _WIN64 ]
          183  +
          184  +// 7.18.2.5 Limits of greatest-width integer types
          185  +#define INTMAX_MIN   INT64_MIN
          186  +#define INTMAX_MAX   INT64_MAX
          187  +#define UINTMAX_MAX  UINT64_MAX
          188  +
          189  +// 7.18.3 Limits of other integer types
          190  +
          191  +#ifdef _WIN64 // [
          192  +#  define PTRDIFF_MIN  _I64_MIN
          193  +#  define PTRDIFF_MAX  _I64_MAX
          194  +#else  // _WIN64 ][
          195  +#  define PTRDIFF_MIN  _I32_MIN
          196  +#  define PTRDIFF_MAX  _I32_MAX
          197  +#endif  // _WIN64 ]
          198  +
          199  +#define SIG_ATOMIC_MIN  INT_MIN
          200  +#define SIG_ATOMIC_MAX  INT_MAX
          201  +
          202  +#ifndef SIZE_MAX // [
          203  +#  ifdef _WIN64 // [
          204  +#     define SIZE_MAX  _UI64_MAX
          205  +#  else // _WIN64 ][
          206  +#     define SIZE_MAX  _UI32_MAX
          207  +#  endif // _WIN64 ]
          208  +#endif // SIZE_MAX ]
          209  +
          210  +// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
          211  +#ifndef WCHAR_MIN // [
          212  +#  define WCHAR_MIN  0
          213  +#endif  // WCHAR_MIN ]
          214  +#ifndef WCHAR_MAX // [
          215  +#  define WCHAR_MAX  _UI16_MAX
          216  +#endif  // WCHAR_MAX ]
          217  +
          218  +#define WINT_MIN  0
          219  +#define WINT_MAX  _UI16_MAX
          220  +
          221  +#endif // __STDC_LIMIT_MACROS ]
          222  +
          223  +
          224  +// 7.18.4 Limits of other integer types
          225  +
          226  +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
          227  +
          228  +// 7.18.4.1 Macros for minimum-width integer constants
          229  +
          230  +#define INT8_C(val)  val##i8
          231  +#define INT16_C(val) val##i16
          232  +#define INT32_C(val) val##i32
          233  +#define INT64_C(val) val##i64
          234  +
          235  +#define UINT8_C(val)  val##ui8
          236  +#define UINT16_C(val) val##ui16
          237  +#define UINT32_C(val) val##ui32
          238  +#define UINT64_C(val) val##ui64
          239  +
          240  +// 7.18.4.2 Macros for greatest-width integer constants
          241  +#define INTMAX_C   INT64_C
          242  +#define UINTMAX_C  UINT64_C
          243  +
          244  +#endif // __STDC_CONSTANT_MACROS ]
          245  +
          246  +
          247  +#endif // _MSC_STDINT_H_ ]

Added epsilon/pad.c.

            1  +/*
            2  + * $Id: pad.c,v 1.13 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <pad.h>
           26  +#include <color.h>
           27  +
           28  +void
           29  +extend_channel (unsigned char **input_channel,
           30  +		coeff_t ** output_channel,
           31  +		int input_width, int input_height,
           32  +		int output_width, int output_height)
           33  +{
           34  +    int i, j;
           35  +
           36  +    /* Sanity checks */
           37  +    assert ((input_width > 0) && (input_height > 0));
           38  +    assert ((output_width > 0) && (output_height > 0));
           39  +    assert (output_width >= input_width);
           40  +    assert (output_height >= input_height);
           41  +
           42  +    /* Copy original */
           43  +    for (i = 0; i < input_height; i++)
           44  +      {
           45  +	  for (j = 0; j < input_width; j++)
           46  +	    {
           47  +		output_channel[i][j] = input_channel[i][j];
           48  +	    }
           49  +      }
           50  +
           51  +    /* Fill horizontally */
           52  +    for (i = 0; i < input_height; i++)
           53  +      {
           54  +	  for (j = 0; j < output_width - input_width; j++)
           55  +	    {
           56  +		output_channel[i][input_width + j] =
           57  +		    output_channel[i][ABS (input_width - j - 1)];
           58  +	    }
           59  +      }
           60  +
           61  +    /* Fill vertically */
           62  +    for (j = 0; j < output_width; j++)
           63  +      {
           64  +	  for (i = 0; i < output_height - input_height; i++)
           65  +	    {
           66  +		output_channel[i + input_height][j] =
           67  +		    output_channel[ABS (input_height - i - 1)][j];
           68  +	    }
           69  +      }
           70  +}
           71  +
           72  +void
           73  +extract_channel (coeff_t ** input_channel,
           74  +		 unsigned char **output_channel,
           75  +		 int input_width, int input_height,
           76  +		 int output_width, int output_height)
           77  +{
           78  +    int i, j;
           79  +
           80  +    /* Sanity checks */
           81  +    assert ((input_width > 0) && (input_height > 0));
           82  +    assert ((output_width > 0) && (output_height > 0));
           83  +    assert (output_width <= input_width);
           84  +    assert (output_height <= output_height);
           85  +
           86  +    /* Extract & clip original data */
           87  +    for (i = 0; i < output_height; i++)
           88  +      {
           89  +	  for (j = 0; j < output_width; j++)
           90  +	    {
           91  +		output_channel[i][j] = CLIP (input_channel[i][j]);
           92  +	    }
           93  +      }
           94  +}

Added epsilon/pad.h.

            1  +/*
            2  + * $Id: pad.h,v 1.15 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Padding
           27  + *
           28  + *  The library expects that the image consists of square blocks
           29  + *  of certain size. Namely, 2^N or 2^N + 1 depending on selected
           30  + *  wavelet transform mode. Nevertheless, most real-life images
           31  + *  do not meet this strict requirement. That`s why we need to pad
           32  + *  boundary image blocks to the full size. Missing data is obtained
           33  + *  using pixel mirroring. */
           34  +
           35  +#ifndef __PAD_H__
           36  +#define __PAD_H__
           37  +
           38  +#ifdef __cplusplus
           39  +extern "C"
           40  +{
           41  +#endif
           42  +
           43  +/** \addtogroup pad Padding */
           44  +/*@{*/
           45  +
           46  +#include <common.h>
           47  +
           48  +/** Channel extension
           49  + *
           50  + *  This function extends \a input_channel using mirroring
           51  + *  operation. The result is stored in the \a output_channel.
           52  + *  Note that the \a output_channel must be greater than or
           53  + *  equal to the \a input_channel in both width and height.
           54  + *  Minimal channel size allowed is 1x1 pixels. Boundary
           55  + *  pixels are duplicated.
           56  + *
           57  + *  \param input_channel Input channel
           58  + *  \param output_channel Output channel
           59  + *  \param input_width Input channel width
           60  + *  \param input_height Input channel height
           61  + *  \param output_width Output channel width
           62  + *  \param output_height Output channel height
           63  + *
           64  + *  \return \c VOID */
           65  +    void extend_channel (unsigned char **input_channel,
           66  +			 coeff_t ** output_channel,
           67  +			 int input_width, int input_height,
           68  +			 int output_width, int output_height);
           69  +
           70  +/** Channel extraction
           71  + *
           72  + *  This function extracts a block of pixels from the
           73  + *  \a input_channel and stores it in the \a output_channel.
           74  + *  Note that the \a output_channel size must be less than
           75  + *  or equal to the \a input_channel in both width and height.
           76  + *  Minimal channel size allowed is 1x1 pixels.
           77  + *
           78  + *  \param input_channel Input channel
           79  + *  \param output_channel Output channel
           80  + *  \param input_width Input channel width
           81  + *  \param input_height Input channel height
           82  + *  \param output_width Output channel width
           83  + *  \param output_height Output channel height
           84  + *
           85  + *  \return \c VOID */
           86  +    void extract_channel (coeff_t ** input_channel,
           87  +			  unsigned char **output_channel,
           88  +			  int input_width, int input_height,
           89  +			  int output_width, int output_height);
           90  +
           91  +/*@}*/
           92  +
           93  +#ifdef __cplusplus
           94  +}
           95  +#endif
           96  +
           97  +#endif				/* __PAD_H__ */

Added epsilon/resample.c.

            1  +/*
            2  + * $Id: resample.c,v 1.9 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <resample.h>
           26  +
           27  +void
           28  +bilinear_resample_channel (coeff_t ** input_channel, coeff_t ** output_channel,
           29  +			   int input_width, int input_height,
           30  +			   int output_width, int output_height)
           31  +{
           32  +    coeff_t t, u;
           33  +    coeff_t tmp;
           34  +
           35  +    int i, j;
           36  +    int l, c;
           37  +
           38  +    /* Sanity checks */
           39  +    assert ((input_width > 1) && (input_height > 1));
           40  +    assert ((output_width > 1) && (output_height > 1));
           41  +
           42  +    for (i = 0; i < output_height; i++)
           43  +      {
           44  +	  for (j = 0; j < output_width; j++)
           45  +	    {
           46  +		tmp = (double) (input_height - 1) *
           47  +		    ((double) i / (double) (output_height - 1));
           48  +
           49  +		l = (int) tmp;
           50  +
           51  +		if (l < 0)
           52  +		  {
           53  +		      l = 0;
           54  +		  }
           55  +		else if (l >= input_height - 1)
           56  +		  {
           57  +		      l = input_height - 2;
           58  +		  }
           59  +
           60  +		u = tmp - (double) l;
           61  +
           62  +		tmp = (double) (input_width - 1) *
           63  +		    ((double) j / (double) (output_width - 1));
           64  +
           65  +		c = (int) tmp;
           66  +
           67  +		if (c < 0)
           68  +		  {
           69  +		      c = 0;
           70  +		  }
           71  +		else if (c >= input_width - 1)
           72  +		  {
           73  +		      c = input_width - 2;
           74  +		  }
           75  +
           76  +		t = tmp - (double) c;
           77  +
           78  +		output_channel[i][j] =
           79  +		    input_channel[l][c] * (1 - t) * (1 - u) +
           80  +		    input_channel[l + 1][c] * (1 - t) * u +
           81  +		    input_channel[l][c + 1] * t * (1 - u) +
           82  +		    input_channel[l + 1][c + 1] * t * u;
           83  +	    }
           84  +      }
           85  +}

Added epsilon/resample.h.

            1  +/*
            2  + * $Id: resample.h,v 1.12 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief Resampling
           27  + *
           28  + *  It is well known that human eye is less sensitive to color
           29  + *  than intensity. It is worthwhile to utilize this fact. We can
           30  + *  store chroma channels with lower resolution than luma. One
           31  + *  can achieve this through channel resampling procedure.
           32  + *  At the moment EPSILON library uses bilinear resampling
           33  + *  algorithm.
           34  + *
           35  + *  \section References
           36  + *
           37  + *  <a href="http://en.wikipedia.org/wiki/Bilinear_interpolation">
           38  + *  Bilinear interpolation (Wikipedia) </a>
           39  + *
           40  + *  <a href="http://alglib.sources.ru/interpolation/bilinearresample.php">
           41  + *  Bilinear resampling (in Russian)</a> */
           42  +
           43  +#ifndef __RESAMPLE_H__
           44  +#define __RESAMPLE_H__
           45  +
           46  +#ifdef __cplusplus
           47  +extern "C"
           48  +{
           49  +#endif
           50  +
           51  +/** \addtogroup resampling Resampling */
           52  +/*@{*/
           53  +
           54  +#include <common.h>
           55  +
           56  +/** Bilinear channel resampling
           57  + *
           58  + *  This function performes bilinear channel resampling.
           59  + *
           60  + *  \param input_channel Input channel
           61  + *  \param output_channel Output channel
           62  + *  \param input_width Input channel width
           63  + *  \param input_height Input channel height
           64  + *  \param output_width Output channel width
           65  + *  \param output_height Output channel height
           66  + *
           67  + *  \return \c VOID
           68  + *
           69  + *  \note Input and output dimensions must be greater than 1. */
           70  +    void bilinear_resample_channel (coeff_t ** input_channel,
           71  +				    coeff_t ** output_channel, int input_width,
           72  +				    int input_height, int output_width,
           73  +				    int output_height);
           74  +/*@}*/
           75  +
           76  +#ifdef __cplusplus
           77  +}
           78  +#endif
           79  +
           80  +#endif				/* __RESAMPLE_H__ */

Added epsilon/speck.c.

            1  +/*
            2  + * $Id: speck.c,v 1.58 2008/03/22 18:04:23 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +#include <common.h>
           25  +#include <speck.h>
           26  +#include <mem_alloc.h>
           27  +#include <list.h>
           28  +#include <bit_io.h>
           29  +#include <filter.h>
           30  +#include <color.h>
           31  +
           32  +/* Before you dive into the sources, note that
           33  + * X and Y axes here are swapped. In other words,
           34  + * X denotes vertical position while Y denotes
           35  + * horizontal position. The origin is the top-left
           36  + * point. Now you a warned. */
           37  +
           38  +local int
           39  +max_coeff (int **channel, int channel_size)
           40  +{
           41  +    int i, j, max = 0;
           42  +
           43  +    for (i = 0; i < channel_size; i++)
           44  +      {
           45  +	  for (j = 0; j < channel_size; j++)
           46  +	    {
           47  +		if (ABS (channel[i][j]) > max)
           48  +		  {
           49  +		      max = ABS (channel[i][j]);
           50  +		  }
           51  +	    }
           52  +      }
           53  +
           54  +    return max;
           55  +}
           56  +
           57  +local int
           58  +validate_set (pixel_set * set, int channel_size)
           59  +{
           60  +    int base_size = channel_size & (~1);
           61  +
           62  +    /* Basic checks */
           63  +    if ((set->type != TYPE_POINT) && (set->type != TYPE_S)
           64  +	&& (set->type != TYPE_I))
           65  +	return 0;
           66  +
           67  +    if ((set->x < 0) || (set->x >= channel_size))
           68  +	return 0;
           69  +
           70  +    if ((set->y < 0) || (set->y >= channel_size))
           71  +	return 0;
           72  +
           73  +    if ((set->width <= 0) || (set->width > channel_size))
           74  +	return 0;
           75  +
           76  +    if ((set->height <= 0) || (set->height > channel_size))
           77  +	return 0;
           78  +
           79  +    if (set->x + set->height > channel_size)
           80  +	return 0;
           81  +
           82  +    if (set->y + set->width > channel_size)
           83  +	return 0;
           84  +
           85  +    switch (set->type)
           86  +      {
           87  +      case TYPE_POINT:
           88  +	  {
           89  +	      /* Single point */
           90  +	      if ((set->width != 1) || (set->height != 1))
           91  +		  return 0;
           92  +
           93  +	      return 1;
           94  +	  }
           95  +      case TYPE_S:
           96  +	  {
           97  +	      /* Set of type 'S' */
           98  +	      int scale;
           99  +
          100  +	      if ((set->width == 1) && (set->height == 1))
          101  +		  return 0;
          102  +
          103  +	      if (channel_size == base_size)
          104  +		{
          105  +		    /* Normal mode */
          106  +		    if (set->width != set->height)
          107  +			return 0;
          108  +
          109  +		    if (!is_power_of_two (set->width))
          110  +			return 0;
          111  +
          112  +		    scale = number_of_bits (set->width) - 1;
          113  +
          114  +		    if ((set->x) & (~(~0 << scale)))
          115  +			return 0;
          116  +
          117  +		    if ((set->y) & (~(~0 << scale)))
          118  +			return 0;
          119  +
          120  +		    return 1;
          121  +		}
          122  +	      else
          123  +		{
          124  +		    /* OTLPF mode */
          125  +		    if ((set->x == 0) && (set->y == 0))
          126  +		      {
          127  +			  /* Origin */
          128  +			  if (set->width != set->height)
          129  +			      return 0;
          130  +
          131  +			  if (!is_power_of_two (set->width - 1))
          132  +			      return 0;
          133  +
          134  +			  return 1;
          135  +		      }
          136  +		    else if ((set->x == 0) && (set->y > 1))
          137  +		      {
          138  +			  /* Top border */
          139  +			  if (set->height - set->width != 1)
          140  +			      return 0;
          141  +
          142  +			  if (!is_power_of_two (set->width))
          143  +			      return 0;
          144  +
          145  +			  scale = number_of_bits (set->width) - 1;
          146  +
          147  +			  if ((set->y - 1) & (~(~0 << scale)))
          148  +			      return 0;
          149  +
          150  +			  return 1;
          151  +		      }
          152  +		    else if ((set->x > 1) && (set->y == 0))
          153  +		      {
          154  +			  /* Left border */
          155  +			  if (set->width - set->height != 1)
          156  +			      return 0;
          157  +
          158  +			  if (!is_power_of_two (set->height))
          159  +			      return 0;
          160  +
          161  +			  scale = number_of_bits (set->height) - 1;
          162  +
          163  +			  if ((set->x - 1) & (~(~0 << scale)))
          164  +			      return 0;
          165  +
          166  +			  return 1;
          167  +		      }
          168  +		    else if ((set->x > 1) && (set->y > 1))
          169  +		      {
          170  +			  /* Internal */
          171  +			  if (set->width != set->height)
          172  +			      return 0;
          173  +
          174  +			  if (!is_power_of_two (set->width))
          175  +			      return 0;
          176  +
          177  +			  scale = number_of_bits (set->width) - 1;
          178  +
          179  +			  if ((set->x - 1) & (~(~0 << scale)))
          180  +			      return 0;
          181  +
          182  +			  if ((set->y - 1) & (~(~0 << scale)))
          183  +			      return 0;
          184  +
          185  +			  return 1;
          186  +		      }
          187  +		    else
          188  +		      {
          189  +			  return 0;
          190  +		      }
          191  +		}
          192  +	  }
          193  +      case TYPE_I:
          194  +	  {
          195  +	      /* Set of type 'I' */
          196  +	      if (set->x != set->y)
          197  +		  return 0;
          198  +
          199  +	      if (set->width != set->height)
          200  +		  return 0;
          201  +
          202  +	      if (set->x + set->width != channel_size)
          203  +		  return 0;
          204  +
          205  +	      if (channel_size == base_size)
          206  +		{
          207  +		    /* Normal mode */
          208  +		    if (!is_power_of_two (set->x))
          209  +			return 0;
          210  +		}
          211  +	      else
          212  +		{
          213  +		    /* OTLPF mode */
          214  +		    if (!is_power_of_two (set->x - 1))
          215  +			return 0;
          216  +		}
          217  +
          218  +	      return 1;
          219  +	  }
          220  +      default:
          221  +	  {
          222  +	      return 0;
          223  +	  }
          224  +      }
          225  +}
          226  +
          227  +local int
          228  +significance_test (pixel_set * set, int threshold,
          229  +		   int **channel, int channel_size)
          230  +{
          231  +#ifdef ENABLE_SET_VALIDATION
          232  +    /* Ensure that the set is valid */
          233  +    assert (validate_set (set, channel_size));
          234  +#endif
          235  +
          236  +    assert (threshold > 0);
          237  +
          238  +    switch (set->type)
          239  +      {
          240  +      case TYPE_POINT:
          241  +	  {
          242  +	      /* Single point */
          243  +	      return (ABS (channel[set->x][set->y]) >= threshold);
          244  +	      break;
          245  +	  }
          246  +      case TYPE_S:
          247  +	  {
          248  +	      /* Set of type 'S' */
          249  +	      int x, y;
          250  +
          251  +	      for (x = set->x; x < set->x + set->height; x++)
          252  +		{
          253  +		    for (y = set->y; y < set->y + set->width; y++)
          254  +		      {
          255  +			  if (ABS (channel[x][y]) >= threshold)
          256  +			    {
          257  +				return 1;
          258  +			    }
          259  +		      }
          260  +		}
          261  +
          262  +	      return 0;
          263  +	      break;
          264  +	  }
          265  +      case TYPE_I:
          266  +	  {
          267  +	      /* Set of type 'I' */
          268  +	      int x, y;
          269  +
          270  +	      for (x = 0; x < channel_size; x++)
          271  +		{
          272  +		    for (y = 0; y < channel_size; y++)
          273  +		      {
          274  +			  if ((x >= set->x) || (y >= set->y))
          275  +			    {
          276  +				if (ABS (channel[x][y]) >= threshold)
          277  +				  {
          278  +				      return 1;
          279  +				  }
          280  +			    }
          281  +		      }
          282  +		}
          283  +
          284  +	      return 0;
          285  +	      break;
          286  +	  }
          287  +      default:
          288  +	  {
          289  +	      assert (0);
          290  +	      break;
          291  +	  }
          292  +      }
          293  +    return -1;
          294  +}
          295  +
          296  +local void
          297  +select_part_type (pixel_set * set)
          298  +{
          299  +    /* Guess the set type after split operation */
          300  +    if ((set->width == 1) && (set->height == 1))
          301  +      {
          302  +	  set->type = TYPE_POINT;
          303  +      }
          304  +    else if ((set->width == 0) || (set->height == 0))
          305  +      {
          306  +	  set->type = TYPE_EMPTY;
          307  +      }
          308  +    else
          309  +      {
          310  +	  set->type = TYPE_S;
          311  +      }
          312  +}
          313  +
          314  +local void
          315  +split_set (pixel_set * set, pixel_set * part1, pixel_set * part2,
          316  +	   pixel_set * part3, pixel_set * part4, int channel_size)
          317  +{
          318  +    int base_size = channel_size & (~1);
          319  +
          320  +#ifdef ENABLE_SET_VALIDATION
          321  +    /* Ensure that the set is valid */
          322  +    assert (validate_set (set, channel_size));
          323  +#endif
          324  +
          325  +    switch (set->type)
          326  +      {
          327  +      case TYPE_S:
          328  +	  {
          329  +	      /* Split parent set of type 'S' */
          330  +	      part1->x = set->x;
          331  +	      part1->y = set->y;
          332  +	      part1->width = (set->width + 1) / 2;
          333  +	      part1->height = (set->height + 1) / 2;
          334  +	      select_part_type (part1);
          335  +
          336  +	      part2->x = set->x;
          337  +	      part2->y = set->y + (set->width + 1) / 2;
          338  +	      part2->width = set->width / 2;
          339  +	      part2->height = (set->height + 1) / 2;
          340  +	      select_part_type (part2);
          341  +
          342  +	      part3->x = set->x + (set->height + 1) / 2;
          343  +	      part3->y = set->y;
          344  +	      part3->width = (set->width + 1) / 2;
          345  +	      part3->height = set->height / 2;
          346  +	      select_part_type (part3);
          347  +
          348  +	      part4->x = set->x + (set->height + 1) / 2;
          349  +	      part4->y = set->y + (set->width + 1) / 2;
          350  +	      part4->width = set->width / 2;
          351  +	      part4->height = set->height / 2;
          352  +	      select_part_type (part4);
          353  +
          354  +	      break;
          355  +	  }
          356  +      case TYPE_I:
          357  +	  {
          358  +	      /* Split parent set of type 'I' */
          359  +	      int p0, p1;
          360  +	      int scale;
          361  +
          362  +	      scale = number_of_bits (set->x - (channel_size != base_size));
          363  +
          364  +	      p0 = set->x;
          365  +	      p1 = (1 << scale) + (channel_size != base_size);
          366  +
          367  +	      part1->x = part1->y = p1;
          368  +	      part1->width = part1->height = channel_size - p1;
          369  +	      part1->type = (p1 == channel_size) ? TYPE_EMPTY : TYPE_I;
          370  +
          371  +	      part2->x = 0;
          372  +	      part2->y = p0;
          373  +	      part2->width = p1 - p0;
          374  +	      part2->height = p0;
          375  +	      select_part_type (part2);
          376  +
          377  +	      part3->x = p0;
          378  +	      part3->y = 0;
          379  +	      part3->width = p0;
          380  +	      part3->height = p1 - p0;
          381  +	      select_part_type (part3);
          382  +
          383  +	      part4->x = part4->y = p0;
          384  +	      part4->width = part4->height = p1 - p0;
          385  +	      select_part_type (part4);
          386  +
          387  +	      break;
          388  +	  }
          389  +      default:
          390  +	  {
          391  +	      assert (0);
          392  +	      break;
          393  +	  }
          394  +      }
          395  +}
          396  +
          397  +local linked_list **
          398  +alloc_LIS_slots (int channel_size)
          399  +{
          400  +    linked_list **LIS_slots;
          401  +    int n_slots;
          402  +    int i;
          403  +
          404  +    /* Think of this structure as a list of lists. Splitting
          405  +     * entire list into several slots speed-ups algorithm:
          406  +     * one slot for each scale. */
          407  +    n_slots = number_of_bits (channel_size);
          408  +    LIS_slots = (linked_list **) xmalloc (n_slots * sizeof (linked_list *));
          409  +
          410  +    for (i = 0; i < n_slots; i++)
          411  +      {
          412  +	  LIS_slots[i] = alloc_linked_list ();
          413  +      }
          414  +
          415  +    return LIS_slots;
          416  +}
          417  +
          418  +local void
          419  +free_LIS_slots (linked_list ** LIS_slots, int channel_size)
          420  +{
          421  +    int n_slots;
          422  +    int i;
          423  +
          424  +    n_slots = number_of_bits (channel_size);
          425  +
          426  +    for (i = 0; i < n_slots; i++)
          427  +      {
          428  +	  free_linked_list (LIS_slots[i]);
          429  +      }
          430  +
          431  +    free (LIS_slots);
          432  +}
          433  +
          434  +local void
          435  +assign_set (list_node * node, pixel_set * set)
          436  +{
          437  +    PIXEL_SET (node)->type = set->type;
          438  +    PIXEL_SET (node)->x = set->x;
          439  +    PIXEL_SET (node)->y = set->y;
          440  +    PIXEL_SET (node)->width = set->width;
          441  +    PIXEL_SET (node)->height = set->height;
          442  +}
          443  +
          444  +local void
          445  +zero_channel (int **channel, int channel_size)
          446  +{
          447  +    int i, j;
          448  +
          449  +    /* Reset everything to zero */
          450  +    for (i = 0; i < channel_size; i++)
          451  +      {
          452  +	  for (j = 0; j < channel_size; j++)
          453  +	    {
          454  +		channel[i][j] = 0;
          455  +	    }
          456  +      }
          457  +}
          458  +
          459  +local int
          460  +speck_encode_S (int **channel, int channel_size,
          461  +		pixel_set * set, linked_list ** LIS_slots,
          462  +		linked_list * LSP, bit_buffer * bb, int threshold)
          463  +{
          464  +    pixel_set new_sets[4];
          465  +    int result;
          466  +    int st[4];
          467  +    int flag;
          468  +    int i;
          469  +
          470  +    /* Split parent set */
          471  +    split_set (set, &new_sets[0], &new_sets[1], &new_sets[2], &new_sets[3],
          472  +	       channel_size);
          473  +
          474  +    /* Test each set for significance skipping over empty sets */
          475  +    for (flag = 0, i = 3; i >= 0; i--)
          476  +      {
          477  +	  if (new_sets[i].type == TYPE_EMPTY)
          478  +	    {
          479  +		continue;
          480  +	    }
          481  +
          482  +	  st[i] =
          483  +	      significance_test (&new_sets[i], threshold, channel,
          484  +				 channel_size);
          485  +
          486  +	  if (i)
          487  +	    {
          488  +		flag |= st[i];
          489  +	    }
          490  +
          491  +	  /* If parent set is significant, but first three
          492  +	   * child sets are not, than undoubtedly fourth
          493  +	   * child set is significant: there is no need
          494  +	   * to code this explicitly. Using this trick
          495  +	   * saves some bit-budget. */
          496  +	  if (i || flag)
          497  +	    {
          498  +		result = st[i] ? write_1 (bb) : write_0 (bb);
          499  +		RETURN_IF_OVERFLOW (result);
          500  +	    }
          501  +      }
          502  +
          503  +    /* Process non-empty sets using their significance information */
          504  +    for (i = 0; i < 4; i++)
          505  +      {
          506  +	  if (new_sets[i].type == TYPE_EMPTY)
          507  +	    {
          508  +		continue;
          509  +	    }
          510  +
          511  +	  if (st[i])
          512  +	    {
          513  +		/* Significant set */
          514  +		if (new_sets[i].type == TYPE_POINT)
          515  +		  {
          516  +		      /* Single point */
          517  +		      list_node *new_node;
          518  +
          519  +		      /* Encode coefficient sign */
          520  +		      result =
          521  +			  channel[new_sets[i].x][new_sets[i].y] >
          522  +			  0 ? write_0 (bb) : write_1 (bb);
          523  +		      RETURN_IF_OVERFLOW (result);
          524  +
          525  +		      new_node = alloc_list_node (sizeof (pixel_set));
          526  +		      assign_set (new_node, &new_sets[i]);
          527  +		      append_list_node (LSP, new_node);
          528  +		  }
          529  +		else
          530  +		  {
          531  +		      /* Encode set of type 'S' */
          532  +		      result =
          533  +			  speck_encode_S (channel, channel_size, &new_sets[i],
          534  +					  LIS_slots, LSP, bb, threshold);
          535  +
          536  +		      RETURN_IF_OVERFLOW (result);
          537  +		  }
          538  +	    }
          539  +	  else
          540  +	    {
          541  +		/* Insignificant set */
          542  +		list_node *new_node = alloc_list_node (sizeof (pixel_set));
          543  +		assign_set (new_node, &new_sets[i]);
          544  +		prepend_list_node (LIS_slots[SLOT_INDEX ((&new_sets[i]))],
          545  +				   new_node);
          546  +	    }
          547  +      }
          548  +
          549  +    return BIT_BUFFER_OK;
          550  +}
          551  +
          552  +local int
          553  +speck_process_S (int **channel, int channel_size,
          554  +		 list_node * node, linked_list * slot,
          555  +		 linked_list ** LIS_slots, linked_list * LSP,
          556  +		 bit_buffer * bb, int threshold, int coding_stage)
          557  +{
          558  +    pixel_set *set;
          559  +    int result;
          560  +    int st;
          561  +
          562  +    /* Test the set for significance */
          563  +    set = PIXEL_SET (node);
          564  +    st = significance_test (set, threshold, channel, channel_size);
          565  +
          566  +    result = st ? write_1 (bb) : write_0 (bb);
          567  +    RETURN_IF_OVERFLOW (result);
          568  +
          569  +    if (st)
          570  +      {
          571  +	  /* Significant set */
          572  +	  if (set->type == TYPE_POINT)
          573  +	    {
          574  +		/* Single point: encode coefficient sign */
          575  +		result =
          576  +		    channel[set->x][set->y] > 0 ? write_0 (bb) : write_1 (bb);
          577  +		RETURN_IF_OVERFLOW (result);
          578  +
          579  +		if (coding_stage == STAGE_S)
          580  +		  {
          581  +		      remove_list_node_link (slot, node);
          582  +		  }
          583  +
          584  +		append_list_node (LSP, node);
          585  +	    }
          586  +	  else
          587  +	    {
          588  +		/* Encode set of type 'S' */
          589  +		result = speck_encode_S (channel, channel_size, set,
          590  +					 LIS_slots, LSP, bb, threshold);
          591  +
          592  +		RETURN_IF_OVERFLOW (result);
          593  +
          594  +		if (coding_stage == STAGE_S)
          595  +		  {
          596  +		      remove_list_node (slot, node);
          597  +		  }
          598  +		else
          599  +		  {
          600  +		      free_list_node (node);
          601  +		  }
          602  +	    }
          603  +      }
          604  +    else
          605  +      {
          606  +	  /* Insignificant set */
          607  +	  if (coding_stage == STAGE_I)
          608  +	    {
          609  +		prepend_list_node (LIS_slots[SLOT_INDEX (set)], node);
          610  +	    }
          611  +      }
          612  +
          613  +    return BIT_BUFFER_OK;
          614  +}
          615  +
          616  +local int
          617  +speck_encode_I (int **channel, int channel_size, pixel_set * I,
          618  +		linked_list ** LIS_slots, linked_list * LSP,
          619  +		bit_buffer * bb, int threshold)
          620  +{
          621  +    pixel_set new_sets[3];
          622  +    int result;
          623  +    int i;
          624  +
          625  +    /* Split parent set */
          626  +    split_set (I, I, &new_sets[0], &new_sets[1], &new_sets[2], channel_size);
          627  +
          628  +    /* Process child sets of type 'S' */
          629  +    for (i = 0; i < 3; i++)
          630  +      {
          631  +	  list_node *node = alloc_list_node (sizeof (pixel_set));
          632  +	  assign_set (node, &new_sets[i]);
          633  +
          634  +	  /* Process child set of type 'S' */
          635  +	  result = speck_process_S (channel, channel_size, node,
          636  +				    NULL, LIS_slots, LSP, bb,
          637  +				    threshold, STAGE_I);
          638  +
          639  +	  if (result == BIT_BUFFER_OVERFLOW)
          640  +	    {
          641  +		free_list_node (node);
          642  +		return result;
          643  +	    }
          644  +      }
          645  +
          646  +    /* Process child set of type 'I' */
          647  +    result = speck_process_I (channel, channel_size, I,
          648  +			      LIS_slots, LSP, bb, threshold);
          649  +
          650  +    return result;
          651  +}
          652  +
          653  +local int
          654  +speck_process_I (int **channel, int channel_size, pixel_set * I,
          655  +		 linked_list ** LIS_slots, linked_list * LSP,
          656  +		 bit_buffer * bb, int threshold)
          657  +{
          658  +    int result;
          659  +    int st;
          660  +
          661  +    /* Skip over empty sets */
          662  +    if (I->type == TYPE_EMPTY)
          663  +      {
          664  +	  return BIT_BUFFER_OK;
          665  +      }
          666  +
          667  +    /* Test the set for significance */
          668  +    st = significance_test (I, threshold, channel, channel_size);
          669  +
          670  +    result = st ? write_1 (bb) : write_0 (bb);
          671  +    RETURN_IF_OVERFLOW (result);
          672  +
          673  +    if (st)
          674  +      {
          675  +	  /* Encode set of type 'I' */
          676  +	  result = speck_encode_I (channel, channel_size, I,
          677  +				   LIS_slots, LSP, bb, threshold);
          678  +
          679  +	  RETURN_IF_OVERFLOW (result);
          680  +      }
          681  +
          682  +    return BIT_BUFFER_OK;
          683  +}
          684  +
          685  +local int
          686  +encode_sorting_pass (int **channel, int channel_size,
          687  +		     linked_list ** LIS_slots, linked_list * LSP,
          688  +		     pixel_set * I, bit_buffer * bb, int threshold)
          689  +{
          690  +    int n_slots;
          691  +    int result;
          692  +    int i;
          693  +
          694  +    n_slots = number_of_bits (channel_size);
          695  +
          696  +    /* Travels through all LIS slots */
          697  +    for (i = 0; i < n_slots; i++)
          698  +      {
          699  +	  linked_list *cur_slot = LIS_slots[i];
          700  +	  list_node *cur_node;
          701  +
          702  +	  /* Skip over empty slots */
          703  +	  CONTINUE_IF_EMPTY (cur_slot);
          704  +
          705  +	  /* Get first slot node */
          706  +	  cur_node = cur_slot->first;
          707  +
          708  +	  /* Process all nodes within this slot */
          709  +	  while (cur_node)
          710  +	    {
          711  +		list_node *next_node = cur_node->next;
          712  +
          713  +		/* Process set of type 'S' */
          714  +		result = speck_process_S (channel, channel_size, cur_node,
          715  +					  cur_slot, LIS_slots, LSP, bb,
          716  +					  threshold, STAGE_S);
          717  +
          718  +		RETURN_IF_OVERFLOW (result);
          719  +
          720  +		/* Next node */
          721  +		cur_node = next_node;
          722  +	    }
          723  +      }
          724  +
          725  +    /* Process set of type 'I' */
          726  +    result = speck_process_I (channel, channel_size, I,
          727  +			      LIS_slots, LSP, bb, threshold);
          728  +
          729  +    return result;
          730  +}
          731  +
          732  +local int
          733  +encode_refinement_pass (int **channel, linked_list * LSP,
          734  +			bit_buffer * bb, int threshold)
          735  +{
          736  +    list_node *node;
          737  +    int result;
          738  +
          739  +    node = LSP->first;
          740  +    threshold <<= 1;
          741  +
          742  +    /* Travels through all nodes in LSP */
          743  +    while (node)
          744  +      {
          745  +	  pixel_set *set = PIXEL_SET (node);
          746  +	  int coeff = ABS (channel[set->x][set->y]);
          747  +
          748  +	  /* Output next bit */
          749  +	  if (coeff >= threshold)
          750  +	    {
          751  +		result = coeff & (threshold >> 1) ? write_1 (bb) : write_0 (bb);
          752  +		RETURN_IF_OVERFLOW (result);
          753  +	    }
          754  +
          755  +	  /* Next node */
          756  +	  node = node->next;
          757  +      }
          758  +
          759  +    return BIT_BUFFER_OK;
          760  +}
          761  +
          762  +local int
          763  +speck_decode_S (int **channel, int channel_size,
          764  +		pixel_set * set, linked_list ** LIS_slots,
          765  +		linked_list * LSP, bit_buffer * bb, int threshold)
          766  +{
          767  +    pixel_set new_sets[4];
          768  +    int result;
          769  +    int st[4];
          770  +    int flag;
          771  +    int i;
          772  +
          773  +    /* Split parent set */
          774  +    split_set (set, &new_sets[0], &new_sets[1], &new_sets[2], &new_sets[3],
          775  +	       channel_size);
          776  +
          777  +    /* Test each set for significance skipping over empty sets */
          778  +    for (flag = 0, i = 3; i >= 0; i--)
          779  +      {
          780  +	  if (new_sets[i].type == TYPE_EMPTY)
          781  +	    {
          782  +		continue;
          783  +	    }
          784  +
          785  +	  if (i)
          786  +	    {
          787  +		result = read_bit (bb, &st[i]);
          788  +		RETURN_IF_UNDERFLOW (result);
          789  +
          790  +		flag |= st[i];
          791  +	    }
          792  +	  else
          793  +	    {
          794  +		if (flag)
          795  +		  {
          796  +		      result = read_bit (bb, &st[i]);
          797  +		      RETURN_IF_UNDERFLOW (result);
          798  +		  }
          799  +		else
          800  +		  {
          801  +		      /* Implicitly significant set */
          802  +		      st[i] = 1;
          803  +		  }
          804  +	    }
          805  +      }
          806  +
          807  +    /* Process non-empty sets using their significance information */
          808  +    for (i = 0; i < 4; i++)
          809  +      {
          810  +	  if (new_sets[i].type == TYPE_EMPTY)
          811  +	    {
          812  +		continue;
          813  +	    }
          814  +
          815  +	  if (st[i])
          816  +	    {
          817  +		/* Significant set */
          818  +		if (new_sets[i].type == TYPE_POINT)
          819  +		  {
          820  +		      /* Single point */
          821  +		      list_node *new_node;
          822  +		      int sign = 0;
          823  +
          824  +		      result = read_bit (bb, &sign);
          825  +		      RETURN_IF_UNDERFLOW (result);
          826  +
          827  +		      /* Decode coefficient sign */
          828  +		      if (sign)
          829  +			{
          830  +			    channel[new_sets[i].x][new_sets[i].y] =
          831  +				-(threshold + (threshold >> 1));
          832  +			}
          833  +		      else
          834  +			{
          835  +			    channel[new_sets[i].x][new_sets[i].y] =
          836  +				(threshold + (threshold >> 1));
          837  +			}
          838  +
          839  +		      new_node = alloc_list_node (sizeof (pixel_set));
          840  +		      assign_set (new_node, &new_sets[i]);
          841  +		      append_list_node (LSP, new_node);
          842  +		  }
          843  +		else
          844  +		  {
          845  +		      /* Decode set of type 'S' */
          846  +		      result =
          847  +			  speck_decode_S (channel, channel_size, &new_sets[i],
          848  +					  LIS_slots, LSP, bb, threshold);
          849  +
          850  +		      RETURN_IF_UNDERFLOW (result);
          851  +		  }
          852  +	    }
          853  +	  else
          854  +	    {
          855  +		/* Insignificant set */
          856  +		list_node *new_node = alloc_list_node (sizeof (pixel_set));
          857  +		assign_set (new_node, &new_sets[i]);
          858  +		prepend_list_node (LIS_slots[SLOT_INDEX ((&new_sets[i]))],
          859  +				   new_node);
          860  +	    }
          861  +      }
          862  +
          863  +    return BIT_BUFFER_OK;
          864  +}
          865  +
          866  +local int
          867  +speck_unprocess_S (int **channel, int channel_size,
          868  +		   list_node * node, linked_list * slot,
          869  +		   linked_list ** LIS_slots, linked_list * LSP,
          870  +		   bit_buffer * bb, int threshold, int coding_stage)
          871  +{
          872  +    pixel_set *set;
          873  +    int result;
          874  +    int st;
          875  +
          876  +    set = PIXEL_SET (node);
          877  +
          878  +    /* Read set significance information */
          879  +    result = read_bit (bb, &st);
          880  +    RETURN_IF_UNDERFLOW (result);
          881  +
          882  +    if (st)
          883  +      {
          884  +	  /* Significant set */
          885  +	  if (set->type == TYPE_POINT)
          886  +	    {
          887  +		int sign = 0;
          888  +
          889  +		/* Single point: read coefficient sign */
          890  +		result = read_bit (bb, &sign);
          891  +		RETURN_IF_UNDERFLOW (result);
          892  +
          893  +		if (sign)
          894  +		  {
          895  +		      channel[set->x][set->y] = -(threshold + (threshold >> 1));
          896  +		  }
          897  +		else
          898  +		  {
          899  +		      channel[set->x][set->y] = (threshold + (threshold >> 1));
          900  +		  }
          901  +
          902  +		if (coding_stage == STAGE_S)
          903  +		  {
          904  +		      remove_list_node_link (slot, node);
          905  +		  }
          906  +
          907  +		append_list_node (LSP, node);
          908  +	    }
          909  +	  else
          910  +	    {
          911  +		/* Decode set of type 'S' */
          912  +		result = speck_decode_S (channel, channel_size, set,
          913  +					 LIS_slots, LSP, bb, threshold);
          914  +
          915  +		RETURN_IF_UNDERFLOW (result);
          916  +
          917  +		if (coding_stage == STAGE_S)
          918  +		  {
          919  +		      remove_list_node (slot, node);
          920  +		  }
          921  +		else
          922  +		  {
          923  +		      free_list_node (node);
          924  +		  }
          925  +	    }
          926  +      }
          927  +    else
          928  +      {
          929  +	  /* Insignificant set */
          930  +	  if (coding_stage == STAGE_I)
          931  +	    {
          932  +		prepend_list_node (LIS_slots[SLOT_INDEX (set)], node);
          933  +	    }
          934  +      }
          935  +
          936  +    return BIT_BUFFER_OK;
          937  +}
          938  +
          939  +local int
          940  +speck_decode_I (int **channel, int channel_size, pixel_set * I,
          941  +		linked_list ** LIS_slots, linked_list * LSP,
          942  +		bit_buffer * bb, int threshold)
          943  +{
          944  +    pixel_set new_sets[3];
          945  +    int result;
          946  +    int i;
          947  +
          948  +    /* Split parent set */
          949  +    split_set (I, I, &new_sets[0], &new_sets[1], &new_sets[2], channel_size);
          950  +
          951  +    /* Unprocess sets of type 'S' */
          952  +    for (i = 0; i < 3; i++)
          953  +      {
          954  +	  list_node *node = alloc_list_node (sizeof (pixel_set));
          955  +	  assign_set (node, &new_sets[i]);
          956  +
          957  +	  result = speck_unprocess_S (channel, channel_size, node,
          958  +				      NULL, LIS_slots, LSP, bb,
          959  +				      threshold, STAGE_I);
          960  +
          961  +	  if (result == BIT_BUFFER_UNDERFLOW)
          962  +	    {
          963  +		free_list_node (node);
          964  +		return result;
          965  +	    }
          966  +      }
          967  +
          968  +    /* Unprocess set of type 'I' */
          969  +    result = speck_unprocess_I (channel, channel_size, I,
          970  +				LIS_slots, LSP, bb, threshold);
          971  +
          972  +    return result;
          973  +}
          974  +
          975  +local int
          976  +speck_unprocess_I (int **channel, int channel_size,
          977  +		   pixel_set * I, linked_list ** LIS_slots,
          978  +		   linked_list * LSP, bit_buffer * bb, int threshold)
          979  +{
          980  +    int result;
          981  +    int st;
          982  +
          983  +    /* Skip over empty sets */
          984  +    if (I->type == TYPE_EMPTY)
          985  +      {
          986  +	  return BIT_BUFFER_OK;
          987  +      }
          988  +
          989  +    /* Read significance information */
          990  +    result = read_bit (bb, &st);
          991  +    RETURN_IF_UNDERFLOW (result);
          992  +
          993  +    if (st)
          994  +      {
          995  +	  result = speck_decode_I (channel, channel_size, I,
          996  +				   LIS_slots, LSP, bb, threshold);
          997  +
          998  +	  RETURN_IF_UNDERFLOW (result);
          999  +      }
         1000  +
         1001  +    return BIT_BUFFER_OK;
         1002  +}
         1003  +
         1004  +local int
         1005  +decode_sorting_pass (int **channel, int channel_size,
         1006  +		     linked_list ** LIS_slots, linked_list * LSP,
         1007  +		     pixel_set * I, bit_buffer * bb, int threshold)
         1008  +{
         1009  +    int n_slots;
         1010  +    int result;
         1011  +    int i;
         1012  +
         1013  +    n_slots = number_of_bits (channel_size);
         1014  +
         1015  +    /* Travels through all LIS slots */
         1016  +    for (i = 0; i < n_slots; i++)
         1017  +      {
         1018  +	  linked_list *cur_slot = LIS_slots[i];
         1019  +	  list_node *cur_node;
         1020  +
         1021  +	  /* Skip over empty slots */
         1022  +	  CONTINUE_IF_EMPTY (cur_slot);
         1023  +
         1024  +	  /* Get first node */
         1025  +	  cur_node = cur_slot->first;
         1026  +
         1027  +	  /* Process all nodes within this slot */
         1028  +	  while (cur_node)
         1029  +	    {
         1030  +		list_node *next_node = cur_node->next;
         1031  +
         1032  +		/* Unprocess set of type 'S' */
         1033  +		result = speck_unprocess_S (channel, channel_size, cur_node,
         1034  +					    cur_slot, LIS_slots, LSP,
         1035  +					    bb, threshold, STAGE_S);
         1036  +
         1037  +		RETURN_IF_UNDERFLOW (result);
         1038  +
         1039  +		/* Next node */
         1040  +		cur_node = next_node;
         1041  +	    }
         1042  +      }
         1043  +
         1044  +    /* Unprocess set of type 'I' */
         1045  +    result = speck_unprocess_I (channel, channel_size, I,
         1046  +				LIS_slots, LSP, bb, threshold);
         1047  +
         1048  +    return result;
         1049  +}
         1050  +
         1051  +local int
         1052  +decode_refinement_pass (int **channel, linked_list * LSP,
         1053  +			bit_buffer * bb, int threshold)
         1054  +{
         1055  +    list_node *node;
         1056  +    int result;
         1057  +    int mask;
         1058  +
         1059  +    node = LSP->first;
         1060  +
         1061  +    mask = threshold;
         1062  +    threshold <<= 1;
         1063  +
         1064  +    /* Travels through all nodes in LSP */
         1065  +    while (node)
         1066  +      {
         1067  +	  pixel_set *set = PIXEL_SET (node);
         1068  +
         1069  +	  int coeff = ABS (channel[set->x][set->y]);
         1070  +	  int sign = channel[set->x][set->y] < 0;
         1071  +
         1072  +	  if (coeff >= threshold)
         1073  +	    {
         1074  +		int bit = 0;
         1075  +
         1076  +		/* Read and shift-in next bit */
         1077  +		result = read_bit (bb, &bit);
         1078  +		RETURN_IF_OVERFLOW (result);
         1079  +
         1080  +		if (bit)
         1081  +		  {
         1082  +		      coeff |= mask;
         1083  +		  }
         1084  +		else
         1085  +		  {
         1086  +		      coeff &= ~mask;
         1087  +		  }
         1088  +
         1089  +		coeff |= (mask >> 1);
         1090  +		channel[set->x][set->y] = sign ? -coeff : coeff;
         1091  +	    }
         1092  +
         1093  +	  /* Next node */
         1094  +	  node = node->next;
         1095  +      }
         1096  +
         1097  +    return BIT_BUFFER_OK;
         1098  +}
         1099  +
         1100  +local void
         1101  +speck_init (linked_list ** LIS_slots, pixel_set * I, int channel_size, int mode)
         1102  +{
         1103  +    list_node *root;
         1104  +
         1105  +    root = alloc_list_node (sizeof (pixel_set));
         1106  +
         1107  +    /* Setup root node */
         1108  +    if (mode == MODE_NORMAL)
         1109  +      {
         1110  +	  PIXEL_SET (root)->type = TYPE_POINT;
         1111  +	  PIXEL_SET (root)->x = PIXEL_SET (root)->y = 0;
         1112  +	  PIXEL_SET (root)->width = PIXEL_SET (root)->height = 1;
         1113  +
         1114  +	  I->type = TYPE_I;
         1115  +	  I->x = I->y = 1;
         1116  +	  I->width = I->height = channel_size - 1;
         1117  +
         1118  +	  prepend_list_node (LIS_slots[0], root);
         1119  +      }
         1120  +    else
         1121  +      {
         1122  +	  PIXEL_SET (root)->type = TYPE_S;
         1123  +	  PIXEL_SET (root)->x = PIXEL_SET (root)->y = 0;
         1124  +	  PIXEL_SET (root)->width = PIXEL_SET (root)->height = 2;
         1125  +
         1126  +	  I->type = TYPE_I;
         1127  +	  I->x = I->y = 2;
         1128  +	  I->width = I->height = channel_size - 2;
         1129  +
         1130  +	  prepend_list_node (LIS_slots[1], root);
         1131  +      }
         1132  +}
         1133  +
         1134  +int
         1135  +speck_encode (int **channel, int channel_size, unsigned char *buf, int buf_size)
         1136  +{
         1137  +    int threshold_bits;
         1138  +    int threshold;
         1139  +    int result;
         1140  +    int mode;
         1141  +    int n_bytes;
         1142  +
         1143  +    linked_list **LIS_slots;
         1144  +    linked_list *LSP;
         1145  +    pixel_set *I;
         1146  +
         1147  +    bit_buffer *bb;
         1148  +
         1149  +    mode = channel_size & 1;
         1150  +
         1151  +    /* Sanity checks */
         1152  +    assert (buf_size >= MIN_SPECK_BUF_SIZE);
         1153  +    assert (channel_size >= 2);
         1154  +
         1155  +    /* Allocate list of significant pixels (LSP),
         1156  +     * list of lists of insignificant sets (LIS_slots),
         1157  +     * and set of type 'I' */
         1158  +    LSP = alloc_linked_list ();
         1159  +    LIS_slots = alloc_LIS_slots (channel_size);
         1160  +    I = (pixel_set *) xmalloc (sizeof (pixel_set));
         1161  +
         1162  +    /* Setup initial encoding threshold */
         1163  +    threshold_bits = number_of_bits (max_coeff (channel, channel_size));
         1164  +    threshold = threshold_bits ? (1 << (threshold_bits - 1)) : 0;
         1165  +
         1166  +    /* Allocate bit-buffer */
         1167  +    bb = (bit_buffer *) xmalloc (sizeof (bit_buffer));
         1168  +
         1169  +    /* Initialize bit-buffer */
         1170  +    init_bits (bb, buf, buf_size);
         1171  +    write_bits (bb, threshold_bits, THRESHOLD_BITS);
         1172  +
         1173  +    /* Setup encoder */
         1174  +    speck_init (LIS_slots, I, channel_size, mode);
         1175  +
         1176  +    /* Travels through all bit planes */
         1177  +    while (threshold > 0)
         1178  +      {
         1179  +	  /* Sorting pass */
         1180  +	  result =
         1181  +	      encode_sorting_pass (channel, channel_size, LIS_slots, LSP, I, bb,
         1182  +				   threshold);
         1183  +	  BREAK_IF_OVERFLOW (result);
         1184  +
         1185  +	  /* Refinement pass */
         1186  +	  result = encode_refinement_pass (channel, LSP, bb, threshold);
         1187  +	  BREAK_IF_OVERFLOW (result);
         1188  +
         1189  +	  /* Proceed to the next bit plane */
         1190  +	  threshold >>= 1;
         1191  +      }
         1192  +
         1193  +    /* Flush bit-buffer */
         1194  +    flush_bits (bb);
         1195  +    n_bytes = bb->next - bb->start;
         1196  +
         1197  +    free (bb);
         1198  +    free (I);
         1199  +    free_LIS_slots (LIS_slots, channel_size);
         1200  +    free_linked_list (LSP);
         1201  +
         1202  +    return n_bytes;
         1203  +}
         1204  +
         1205  +void
         1206  +speck_decode (unsigned char *buf, int buf_size, int **channel, int channel_size)
         1207  +{
         1208  +    int threshold_bits;
         1209  +    int threshold;
         1210  +    int result;
         1211  +    int mode;
         1212  +
         1213  +    linked_list **LIS_slots;
         1214  +    linked_list *LSP;
         1215  +    pixel_set *I;
         1216  +
         1217  +    bit_buffer *bb;
         1218  +
         1219  +    mode = channel_size & 1;
         1220  +
         1221  +    /* Sanity checks */
         1222  +    assert (buf_size >= MIN_SPECK_BUF_SIZE);
         1223  +    assert (channel_size >= 2);
         1224  +
         1225  +    /* Reset output channel */
         1226  +    zero_channel (channel, channel_size);
         1227  +
         1228  +    /* Allocate list of significant pixels (LSP),
         1229  +     * list of lists of insignificant sets (LIS_slots),
         1230  +     * and set of type 'I' */
         1231  +    LSP = alloc_linked_list ();
         1232  +    LIS_slots = alloc_LIS_slots (channel_size);
         1233  +    I = (pixel_set *) xmalloc (sizeof (pixel_set));
         1234  +
         1235  +    /* Allocate bit-buffer */
         1236  +    bb = (bit_buffer *) xmalloc (sizeof (bit_buffer));
         1237  +
         1238  +    /* Initialize bit-buffer */
         1239  +    init_bits (bb, buf, buf_size);
         1240  +    read_bits (bb, &threshold_bits, THRESHOLD_BITS);
         1241  +
         1242  +    /* Read encoding threshold */
         1243  +    threshold = threshold_bits ? (1 << (threshold_bits - 1)) : 0;
         1244  +    speck_init (LIS_slots, I, channel_size, mode);
         1245  +
         1246  +    /* Travels through all bit planes */
         1247  +    while (threshold > 0)
         1248  +      {
         1249  +	  /* Decode sorting pass */
         1250  +	  result =
         1251  +	      decode_sorting_pass (channel, channel_size, LIS_slots, LSP, I, bb,
         1252  +				   threshold);
         1253  +	  BREAK_IF_UNDERFLOW (result);
         1254  +
         1255  +	  /* Decode refinement pass */
         1256  +	  result = decode_refinement_pass (channel, LSP, bb, threshold);
         1257  +	  BREAK_IF_UNDERFLOW (result);
         1258  +
         1259  +	  /* Proceed to the next bit plane */
         1260  +	  threshold >>= 1;
         1261  +      }
         1262  +
         1263  +    free (bb);
         1264  +    free (I);
         1265  +    free_LIS_slots (LIS_slots, channel_size);
         1266  +    free_linked_list (LSP);
         1267  +}

Added epsilon/speck.h.

            1  +/*
            2  + * $Id: speck.h,v 1.48 2007/05/20 13:19:12 simakov Exp $
            3  + *
            4  + * EPSILON - wavelet image compression library.
            5  + * Copyright (C) 2006-2007 Alexander Simakov, <xander@entropyware.info>
            6  + *
            7  + * This program is free software; you can redistribute it and/or modify
            8  + * it under the terms of the GNU General Public License as published by
            9  + * the Free Software Foundation; either version 2 of the License, or
           10  + * (at your option) any later version.
           11  + *
           12  + * This program is distributed in the hope that it will be useful,
           13  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
           14  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           15  + * GNU General Public License for more details.
           16  + *
           17  + * You should have received a copy of the GNU General Public License
           18  + * along with this program; if not, write to the Free Software
           19  + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
           20  + *
           21  + * http://epsilon-project.sourceforge.net
           22  + */
           23  +
           24  +/** \file
           25  + *
           26  + *  \brief SPECK wavelet codec
           27  + *
           28  + *  This file represents SPECK - The Set-Partitioning Embedded Block
           29  + *  wavelet codec. To understand the algorithm you have to read
           30  + *  original article from William Pearlman and Asad Islam. Also it
           31  + *  is highly recommended to get familar with coding example.
           32  + *
           33  + *  \warning The Set-Partitioning Embedded Block (SPECK) algorithm is
           34  + *  protected by US Patent #6,671,413 and also may be patented in your
           35  + *  country.
           36  + *
           37  + *  \section References
           38  + *
           39  + *  <a href="http://www.cipr.rpi.edu/~pearlman/">William A. Pearlman home page</a>
           40  + *
           41  + *  <a href="http://www.cipr.rpi.edu/~pearlman/papers/vcip99_ip.pdf">
           42  + *  A. Islam and W. A. Pearlman, An Embedded and Efficient Low-Complexity
           43  + *  Hierarchical Image Coder, Visual Communications and Image Processing 99,
           44  + *  Proceedings of SPIE Vol. 3653, pp. 294-305, Jan. 1999.</a>
           45  + *
           46  + *  <a href="http://www.cipr.rpi.edu/~pearlman/papers/speck_example.pdf">
           47  + *  SPECK coding example</a> */
           48  +
           49  +#ifndef __SPECK_H__
           50  +#define __SPECK_H__
           51  +
           52  +#ifdef __cplusplus
           53  +extern "C"
           54  +{
           55  +#endif
           56  +
           57  +/** \addtogroup speck SPECK wavelet codec */
           58  +/*@{*/
           59  +
           60  +#include <common.h>
           61  +#include <list.h>
           62  +#include <bit_io.h>
           63  +
           64  +/** Pixel set of type 'point' */
           65  +#define TYPE_POINT              0
           66  +/** Pixel set of type 'S' */
           67  +#define TYPE_S                  1
           68  +/** Pixel set of type 'I' */
           69  +#define TYPE_I                  2
           70  +/** Empty pixel set */
           71  +#define TYPE_EMPTY              3
           72  +
           73  +/** Processing sets of type 'S' */
           74  +#define STAGE_S                 0
           75  +/** Processing sets of type 'I' */
           76  +#define STAGE_I                 1
           77  +
           78  +/** Minimal SPECK buffer size */
           79  +#define MIN_SPECK_BUF_SIZE      1
           80  +/** Reserve 6 bits for \a theshold_bits parameter */
           81  +#define THRESHOLD_BITS          6
           82  +
           83  +/** Cast data pointer as \ref pixel_set structure */
           84  +#define PIXEL_SET(_set)         ((pixel_set *) (_set->data))
           85  +/** Select inserting index for array of LIS slots */
           86  +#define SLOT_INDEX(_set)        (number_of_bits(MIN(_set->width, _set->height)) - 1)
           87  +
           88  +/** Break if buffer is full */
           89  +#define BREAK_IF_OVERFLOW(_x)   if (_x == BIT_BUFFER_OVERFLOW) break
           90  +/** Return if buffer is full */
           91  +#define RETURN_IF_OVERFLOW(_x)  if (_x == BIT_BUFFER_OVERFLOW) return _x
           92  +/** Break if buffer is empty */
           93  +#define BREAK_IF_UNDERFLOW(_x)  if (_x == BIT_BUFFER_UNDERFLOW) break
           94  +/** Return if buffer is empty */
           95  +#define RETURN_IF_UNDERFLOW(_x) if (_x == BIT_BUFFER_UNDERFLOW) return _x
           96  +/** Contunue if list is empty */
           97  +#define CONTINUE_IF_EMPTY(_x)   if (LIST_IS_EMPTY(_x)) continue
           98  +
           99  +/** This structure represents pixel_set */
          100  +    typedef struct pixel_set_tag
          101  +    {
          102  +    /** Set type */
          103  +	short type;
          104  +    /** X coordinate */
          105  +	short x;
          106  +    /** Y coordinate */
          107  +	short y;
          108  +    /** Set width */
          109  +	short width;
          110  +    /** Set height */
          111  +	short height;
          112  +    } pixel_set;
          113  +
          114  +/** Find maximal coefficient
          115  + *
          116  + *  This function returns absolute value of maximal
          117  + *  wavelet coefficient.
          118  + *
          119  + *  \param channel Channel
          120  + *  \param channel_size Channel size
          121  + *
          122  + *  \return Maximal coefficient value */
          123  +    local int max_coeff (int **channel, int channel_size);
          124  +
          125  +/** Validate set
          126  + *
          127  + *  The process of splitting, moving and testing sets in the SPECK
          128  + *  algorithm is a bit tricky. This function can be thought as a very
          129  + *  strict validation tool.
          130  + *
          131  + *  \param set Set to validate
          132  + *  \param channel_size Channel size
          133  + *
          134  + *  \return \c 1 for valid sets and \c 0 for invalid ones */
          135  +    local int validate_set (pixel_set * set, int channel_size);
          136  +
          137  +/** Significance test
          138  + *
          139  + *  The purpose of this function is to compare \a set against \a threshold.
          140  + *  If the \a set have a coefficient greater than or equal to \a threshold,
          141  + *  then it is said that the \a set is significant. If all coefficients
          142  + *  of the \a set are below \a threshold, then it is said that the \a set
          143  + *  is insignificant.
          144  + *
          145  + *  \param set Set to test
          146  + *  \param threshold Threshold to compare against
          147  + *  \param channel Channel
          148  + *  \param channel_size Channel size
          149  + *
          150  + *  \return \c 1 for significant sets and \c 0 for insignificant ones */
          151  +    local int significance_test (pixel_set * set, int threshold,
          152  +				 int **channel, int channel_size);
          153  +
          154  +/** Select partition type
          155  + *
          156  + *  This function selects type of the \a set.
          157  + *
          158  + *  \param set Set
          159  + *
          160  + *  \return \c VOID */
          161  +    local void select_part_type (pixel_set * set);
          162  +
          163  +/** Split set
          164  + *
          165  + *  This function splits the \a set into pieces. Actual
          166  + *  splitting rule is defined within SPECK algorithm.
          167  + *
          168  + *  \param set Set to split
          169  + *  \param part1 First part
          170  + *  \param part2 Second part
          171  + *  \param part3 Third part
          172  + *  \param part4 Fourth part
          173  + *  \param channel_size Channel size
          174  + *
          175  + *  \return \c VOID */
          176  +    local void split_set (pixel_set * set, pixel_set * part1, pixel_set * part2,
          177  +			  pixel_set * part3, pixel_set * part4,
          178  +			  int channel_size);
          179  +
          180  +/** Allocate array of LIS slots
          181  + *
          182  + *  This function allocates array of LIS slots.
          183  + *
          184  + *  \param channel_size Channel size
          185  + *
          186  + *  \return Pointer to newly allocated structure */
          187  +    local linked_list **alloc_LIS_slots (int channel_size);
          188  +
          189  +/** Release array of LIS slots
          190  + *
          191  + *  This function releases array of LIS slots.
          192  + *
          193  + *  \param LIS_slots Array of LIS slots
          194  + *  \param channel_size Channel size
          195  + *
          196  + *  \return \c VOID */
          197  +    local void free_LIS_slots (linked_list ** LIS_slots, int channel_size);
          198  +
          199  +/** Assign set attributes
          200  + *
          201  + *  This function assigns \a set attributes to the \a node.
          202  + *
          203  + *  \param node Destination node
          204  + *  \param set Source set
          205  + *
          206  + *  \return \c VOID */
          207  +    local void assign_set (list_node * node, pixel_set * set);
          208  +
          209  +/** Reset channel
          210  + *
          211  + *  This function resets all \a channel components to zero.
          212  + *
          213  + *  \param channel Channel
          214  + *  \param channel_size Channel size
          215  + *
          216  + *  \return \c VOID */
          217  +    local void zero_channel (int **channel, int channel_size);
          218  +
          219  +/** Encode set of type 'S'
          220  + *
          221  + *  This function encodes \a set of type 'S'.
          222  + *
          223  + *  \param channel Channel
          224  + *  \param channel_size Channel size
          225  + *  \param set Set to encode
          226  + *  \param LIS_slots Array of LIS slots
          227  + *  \param LSP List of Significant Pixels
          228  + *  \param bb Bit-buffer
          229  + *  \param threshold Threshold
          230  + *
          231  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          232  +    local int speck_encode_S (int **channel, int channel_size,
          233  +			      pixel_set * set, linked_list ** LIS_slots,
          234  +			      linked_list * LSP, bit_buffer * bb,
          235  +			      int threshold);
          236  +
          237  +/** Process set of type 'S'
          238  + *
          239  + *  This function extracts \ref pixel_set structure from the \a node,
          240  + *  and encodes it using \ref speck_encode_S function.
          241  + *
          242  + *  \param channel Channel
          243  + *  \param channel_size Channel size
          244  + *  \param node Current node
          245  + *  \param slot Current LIS slot
          246  + *  \param LIS_slots Array of LIS slots
          247  + *  \param LSP List of Significant Pixels
          248  + *  \param bb Bit-buffer
          249  + *  \param threshold Threshold
          250  + *  \param coding_stage Either \ref STAGE_S or \ref STAGE_I
          251  + *
          252  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          253  +    local int speck_process_S (int **channel, int channel_size,
          254  +			       list_node * node, linked_list * slot,
          255  +			       linked_list ** LIS_slots, linked_list * LSP,
          256  +			       bit_buffer * bb, int threshold,
          257  +			       int coding_stage);
          258  +
          259  +/** Encode set of type 'I'
          260  + *
          261  + *  This function encodes set of type 'I'.
          262  + *
          263  + *  \param channel Channel
          264  + *  \param channel_size Channel size
          265  + *  \param I Set of type I
          266  + *  \param LIS_slots Array of LIS slots
          267  + *  \param LSP List of Significant Pixels
          268  + *  \param bb Bit-buffer
          269  + *  \param threshold Threshold
          270  + *
          271  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          272  +    local int speck_encode_I (int **channel, int channel_size, pixel_set * I,
          273  +			      linked_list ** LIS_slots, linked_list * LSP,
          274  +			      bit_buffer * bb, int threshold);
          275  +
          276  +/** Process set of type 'I'
          277  + *
          278  + *  This function encodes set \a I using \ref speck_encode_I function.
          279  + *
          280  + *  \param channel Channel
          281  + *  \param channel_size Channel size
          282  + *  \param I Set of type I
          283  + *  \param LIS_slots Array of LIS slots
          284  + *  \param LSP List of Significant Pixels
          285  + *  \param bb Bit-buffer
          286  + *  \param threshold Threshold
          287  + *
          288  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          289  +    local int speck_process_I (int **channel, int channel_size, pixel_set * I,
          290  +			       linked_list ** LIS_slots, linked_list * LSP,
          291  +			       bit_buffer * bb, int threshold);
          292  +
          293  +/** Encode sorting pass
          294  + *
          295  + *  The SPECK encoding algorithm alternates two types of passes
          296  + *  through the data: sorting pass and refinement pass. This
          297  + *  function implements the first one.
          298  + *
          299  + *  \param channel Channel
          300  + *  \param channel_size Channel size
          301  + *  \param LIS_slots Array of LIS slots
          302  + *  \param LSP List of Significant Pixels
          303  + *  \param I Set of type I
          304  + *  \param bb Bit-buffer
          305  + *  \param threshold Threshold
          306  + *
          307  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          308  +    local int encode_sorting_pass (int **channel, int channel_size,
          309  +				   linked_list ** LIS_slots, linked_list * LSP,
          310  +				   pixel_set * I, bit_buffer * bb,
          311  +				   int threshold);
          312  +
          313  +/** Encode refinement pass
          314  + *
          315  + *  The SPECK encoding algorithm alternates two types of passes
          316  + *  through the data: sorting pass and refinement pass. This
          317  + *  function implements the second one.
          318  + *
          319  + *  \param channel Channel
          320  + *  \param LSP List of Significant Pixels
          321  + *  \param bb Bit-buffer
          322  + *  \param threshold Threshold
          323  + *
          324  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_OVERFLOW */
          325  +    local int encode_refinement_pass (int **channel, linked_list * LSP,
          326  +				      bit_buffer * bb, int threshold);
          327  +
          328  +/** Decode set of type 'S'
          329  + *
          330  + *  This function is inverse to \ref speck_encode_S.
          331  + *
          332  + *  \param channel Channel
          333  + *  \param channel_size Channel size
          334  + *  \param set Set to decode
          335  + *  \param LIS_slots Array of LIS slots
          336  + *  \param LSP List of Significant Pixels
          337  + *  \param bb Bit-buffer
          338  + *  \param threshold Threshold
          339  + *
          340  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          341  +    local int speck_decode_S (int **channel, int channel_size,
          342  +			      pixel_set * set, linked_list ** LIS_slots,
          343  +			      linked_list * LSP, bit_buffer * bb,
          344  +			      int threshold);
          345  +
          346  +/** Unprocess set of type 'S'
          347  + *
          348  + *  This function is inverse to \ref speck_process_S.
          349  + *
          350  + *  \param channel Channel
          351  + *  \param channel_size Channel size
          352  + *  \param node Current node
          353  + *  \param slot Current LIS slot
          354  + *  \param LIS_slots Array of LIS slots
          355  + *  \param LSP List of Significant Pixels
          356  + *  \param bb Bit-buffer
          357  + *  \param threshold Threshold
          358  + *  \param coding_stage Either \ref STAGE_S or \ref STAGE_I
          359  + *
          360  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          361  +    local int speck_unprocess_S (int **channel, int channel_size,
          362  +				 list_node * node, linked_list * slot,
          363  +				 linked_list ** LIS_slots,
          364  +				 linked_list * LSP, bit_buffer * bb,
          365  +				 int threshold, int coding_stage);
          366  +
          367  +/** Decode set of type 'I'
          368  + *
          369  + *  This function is inverse to \ref speck_encode_I.
          370  + *
          371  + *  \param channel Channel
          372  + *  \param channel_size Channel size
          373  + *  \param I Set of type I
          374  + *  \param LIS_slots Array of LIS slots
          375  + *  \param LSP List of Significant Pixels
          376  + *  \param bb Bit-buffer
          377  + *  \param threshold Threshold
          378  + *
          379  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          380  +    local int speck_decode_I (int **channel, int channel_size,
          381  +			      pixel_set * I, linked_list ** LIS_slots,
          382  +			      linked_list * LSP, bit_buffer * bb,
          383  +			      int threshold);
          384  +
          385  +/** Unprocess set of type 'I'
          386  + *
          387  + *  This function is inverse to \ref speck_process_I.
          388  + *
          389  + *  \param channel Channel
          390  + *  \param channel_size Channel size
          391  + *  \param I Set of type I
          392  + *  \param LIS_slots Array of LIS slots
          393  + *  \param LSP List of Significant Pixels
          394  + *  \param bb Bit-buffer
          395  + *  \param threshold Threshold
          396  + *
          397  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          398  +    local int speck_unprocess_I (int **channel, int channel_size,
          399  +				 pixel_set * I, linked_list ** LIS_slots,
          400  +				 linked_list * LSP, bit_buffer * bb,
          401  +				 int threshold);
          402  +
          403  +/** Decode sorting pass
          404  + *
          405  + *  The SPECK decoding algorithm alternates two types of passes
          406  + *  through the data: sorting pass and refinement pass. This
          407  + *  function implements the first one.
          408  + *
          409  + *  \param channel Channel
          410  + *  \param channel_size Channel size
          411  + *  \param LIS_slots Array of LIS slots
          412  + *  \param LSP List of Significant Pixels
          413  + *  \param I Set of type I
          414  + *  \param bb Bit-buffer
          415  + *  \param threshold Threshold
          416  + *
          417  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          418  +    local int decode_sorting_pass (int **channel, int channel_size,
          419  +				   linked_list ** LIS_slots,
          420  +				   linked_list * LSP, pixel_set * I,
          421  +				   bit_buffer * bb, int threshold);
          422  +
          423  +/** Decode refinement pass
          424  + *
          425  + *  The SPECK decoding algorithm alternates two types of passes
          426  + *  through the data: sorting pass and refinement pass. This
          427  + *  function implements the second one.
          428  + *
          429  + *  \param channel Channel
          430  + *  \param LSP List of Significant Pixels
          431  + *  \param bb Bit-buffer
          432  + *  \param threshold Threshold
          433  + *
          434  + *  \return Either \ref BIT_BUFFER_OK or \ref BIT_BUFFER_UNDERFLOW */
          435  +    local int decode_refinement_pass (int **channel, linked_list * LSP,
          436  +				      bit_buffer * bb, int threshold);
          437  +
          438  +/** Initialize SPECK encoder or decoder
          439  + *
          440  + *  This function initializes SPECK encoder or decoder.
          441  + *
          442  + *  \param LIS_slots Array of LIS slots
          443  + *  \param I Set of type I
          444  + *  \param channel_size Channel size
          445  + *  \param mode Either \ref MODE_NORMAL or \ref MODE_OTLPF
          446  + *
          447  + *  \return \c VOID */
          448  +    local void speck_init (linked_list ** LIS_slots, pixel_set * I,
          449  +			   int channel_size, int mode);
          450  +
          451  +/** Encode channel using SPECK algorithm
          452  + *
          453  + *  This function encodes \a channel of size \a channel_size
          454  + *  into the buffer \a buf of size \a buf_size.
          455  + *
          456  + *  \note Depending on encoding mode, minimal channel
          457  + *  size is \c 2 (for \ref MODE_NORMAL) or \c 3
          458  + *  (for \ref MODE_OTLPF).
          459  + *
          460  + *  \note Minimal buffer size is \ref MIN_SPECK_BUF_SIZE
          461  + *
          462  + *  \param channel Channel
          463  + *  \param channel_size Channel size
          464  + *  \param buf Buffer
          465  + *  \param buf_size Buffer size
          466  + *
          467  + *  \return Number of bytes in \a buf actualy used by encoder */
          468  +    int speck_encode (int **channel, int channel_size,
          469  +		      unsigned char *buf, int buf_size);
          470  +
          471  +/** Decode channel using SPECK algorithm
          472  + *
          473  + *  This function decodes \a channel of size \a channel_size
          474  + *  from the buffer \a buf of size \a buf_size.
          475  + *
          476  + *  \note Depending on encoding mode, minimal channel
          477  + *  size is \c 2 (for \ref MODE_NORMAL) or \c 3
          478  + *  (for \ref MODE_OTLPF).
          479  + *
          480  + *  \note Minimal buffer size is \ref MIN_SPECK_BUF_SIZE
          481  + *
          482  + *  \param buf Buffer
          483  + *  \param buf_size Buffer size
          484  + *  \param channel Channel
          485  + *  \param channel_size Channel size
          486  + *
          487  + *  \return \c VOID */
          488  +    void speck_decode (unsigned char *buf, int buf_size,
          489  +		       int **channel, int channel_size);
          490  +
          491  +/*@}*/
          492  +
          493  +#ifdef __cplusplus
          494  +}
          495  +#endif
          496  +
          497  +#endif				/* __SPECK_H__ */

Changes to headers/Makefile.am.

     1      1   
     2         -noinst_HEADERS = rasterlite_tiff_hdrs.h rasterlite_internals.h 
            2  +noinst_HEADERS = rasterlite_internals.h 
     3      3   include_HEADERS = rasterlite.h 
     4      4   

Changes to headers/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.1 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
     6         -# Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19     18   pkgdatadir = $(datadir)/@PACKAGE@
    20         -pkgincludedir = $(includedir)/@PACKAGE@
    21     19   pkglibdir = $(libdir)/@PACKAGE@
    22         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    23     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    24     22   install_sh_DATA = $(install_sh) -c -m 644
    25     23   install_sh_PROGRAM = $(install_sh) -c
    26     24   install_sh_SCRIPT = $(install_sh) -c
    27     25   INSTALL_HEADER = $(INSTALL_DATA)
    28     26   transform = $(program_transform_name)
    29     27   NORMAL_INSTALL = :
................................................................................
    39     37   	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
    40     38   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    41     39   am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    42     40   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    43     41   	$(ACLOCAL_M4)
    44     42   mkinstalldirs = $(install_sh) -d
    45     43   CONFIG_CLEAN_FILES =
    46         -CONFIG_CLEAN_VPATH_FILES =
    47     44   SOURCES =
    48     45   DIST_SOURCES =
    49     46   am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    50     47   am__vpath_adj = case $$p in \
    51     48       $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    52     49       *) f=$$p;; \
    53     50     esac;
    54         -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
    55         -am__install_max = 40
    56         -am__nobase_strip_setup = \
    57         -  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
    58         -am__nobase_strip = \
    59         -  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
    60         -am__nobase_list = $(am__nobase_strip_setup); \
    61         -  for p in $$list; do echo "$$p $$p"; done | \
    62         -  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
    63         -  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
    64         -    if (++n[$$2] == $(am__install_max)) \
    65         -      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
    66         -    END { for (dir in files) print dir, files[dir] }'
    67         -am__base_list = \
    68         -  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
    69         -  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
           51  +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
    70     52   am__installdirs = "$(DESTDIR)$(includedir)"
           53  +includeHEADERS_INSTALL = $(INSTALL_HEADER)
    71     54   HEADERS = $(include_HEADERS) $(noinst_HEADERS)
    72     55   ETAGS = etags
    73     56   CTAGS = ctags
    74     57   DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    75     58   ACLOCAL = @ACLOCAL@
    76     59   AMTAR = @AMTAR@
    77     60   AR = @AR@
................................................................................
    90     73   CXXDEPMODE = @CXXDEPMODE@
    91     74   CXXFLAGS = @CXXFLAGS@
    92     75   CYGPATH_W = @CYGPATH_W@
    93     76   DEFS = @DEFS@
    94     77   DEPDIR = @DEPDIR@
    95     78   DLLTOOL = @DLLTOOL@
    96     79   DSYMUTIL = @DSYMUTIL@
    97         -DUMPBIN = @DUMPBIN@
           80  +ECHO = @ECHO@
    98     81   ECHO_C = @ECHO_C@
    99     82   ECHO_N = @ECHO_N@
   100     83   ECHO_T = @ECHO_T@
   101     84   EGREP = @EGREP@
   102     85   EXEEXT = @EXEEXT@
   103         -FGREP = @FGREP@
           86  +F77 = @F77@
           87  +FFLAGS = @FFLAGS@
   104     88   GREP = @GREP@
   105     89   INSTALL = @INSTALL@
   106     90   INSTALL_DATA = @INSTALL_DATA@
   107     91   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   108     92   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   109     93   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   110         -LD = @LD@
   111     94   LDFLAGS = @LDFLAGS@
   112     95   LIBOBJS = @LIBOBJS@
   113     96   LIBS = @LIBS@
   114         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   115         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   116     97   LIBTOOL = @LIBTOOL@
   117         -LIPO = @LIPO@
   118     98   LN_S = @LN_S@
   119     99   LTLIBOBJS = @LTLIBOBJS@
   120    100   MAINT = @MAINT@
   121    101   MAKEINFO = @MAKEINFO@
   122    102   MKDIR_P = @MKDIR_P@
   123         -NM = @NM@
   124    103   NMEDIT = @NMEDIT@
   125    104   OBJDUMP = @OBJDUMP@
   126    105   OBJEXT = @OBJEXT@
   127         -OTOOL = @OTOOL@
   128         -OTOOL64 = @OTOOL64@
   129    106   PACKAGE = @PACKAGE@
   130    107   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   131    108   PACKAGE_NAME = @PACKAGE_NAME@
   132    109   PACKAGE_STRING = @PACKAGE_STRING@
   133    110   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   134         -PACKAGE_URL = @PACKAGE_URL@
   135    111   PACKAGE_VERSION = @PACKAGE_VERSION@
   136    112   PATH_SEPARATOR = @PATH_SEPARATOR@
   137         -PKG_CONFIG = @PKG_CONFIG@
   138         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   139         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   140    113   RANLIB = @RANLIB@
   141    114   SED = @SED@
   142    115   SET_MAKE = @SET_MAKE@
   143    116   SHELL = @SHELL@
   144    117   STRIP = @STRIP@
   145    118   VERSION = @VERSION@
   146    119   abs_builddir = @abs_builddir@
   147    120   abs_srcdir = @abs_srcdir@
   148    121   abs_top_builddir = @abs_top_builddir@
   149    122   abs_top_srcdir = @abs_top_srcdir@
   150    123   ac_ct_CC = @ac_ct_CC@
   151    124   ac_ct_CXX = @ac_ct_CXX@
   152         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          125  +ac_ct_F77 = @ac_ct_F77@
   153    126   am__include = @am__include@
   154    127   am__leading_dot = @am__leading_dot@
   155    128   am__quote = @am__quote@
   156    129   am__tar = @am__tar@
   157    130   am__untar = @am__untar@
   158    131   bindir = @bindir@
   159    132   build = @build@
................................................................................
   176    149   includedir = @includedir@
   177    150   infodir = @infodir@
   178    151   install_sh = @install_sh@
   179    152   libdir = @libdir@
   180    153   libexecdir = @libexecdir@
   181    154   localedir = @localedir@
   182    155   localstatedir = @localstatedir@
   183         -lt_ECHO = @lt_ECHO@
   184    156   mandir = @mandir@
   185    157   mkdir_p = @mkdir_p@
   186    158   oldincludedir = @oldincludedir@
   187    159   pdfdir = @pdfdir@
   188    160   prefix = @prefix@
   189    161   program_transform_name = @program_transform_name@
   190    162   psdir = @psdir@
   191    163   sbindir = @sbindir@
   192    164   sharedstatedir = @sharedstatedir@
   193    165   srcdir = @srcdir@
   194    166   sysconfdir = @sysconfdir@
   195    167   target_alias = @target_alias@
   196         -top_build_prefix = @top_build_prefix@
   197    168   top_builddir = @top_builddir@
   198    169   top_srcdir = @top_srcdir@
   199         -noinst_HEADERS = rasterlite_tiff_hdrs.h rasterlite_internals.h 
          170  +noinst_HEADERS = rasterlite_internals.h 
   200    171   include_HEADERS = rasterlite.h 
   201    172   all: all-am
   202    173   
   203    174   .SUFFIXES:
   204    175   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   205    176   	@for dep in $?; do \
   206    177   	  case '$(am__configure_deps)' in \
   207    178   	    *$$dep*) \
   208         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   209         -	        && { if test -f $@; then exit 0; else break; fi; }; \
          179  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          180  +		&& exit 0; \
   210    181   	      exit 1;; \
   211    182   	  esac; \
   212    183   	done; \
   213         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign headers/Makefile'; \
   214         -	$(am__cd) $(top_srcdir) && \
   215         -	  $(AUTOMAKE) --foreign headers/Makefile
          184  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  headers/Makefile'; \
          185  +	cd $(top_srcdir) && \
          186  +	  $(AUTOMAKE) --foreign  headers/Makefile
   216    187   .PRECIOUS: Makefile
   217    188   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   218    189   	@case '$?' in \
   219    190   	  *config.status*) \
   220    191   	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   221    192   	  *) \
   222    193   	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
................................................................................
   226    197   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   227    198   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   228    199   
   229    200   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   230    201   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   231    202   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   232    203   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   233         -$(am__aclocal_m4_deps):
   234    204   
   235    205   mostlyclean-libtool:
   236    206   	-rm -f *.lo
   237    207   
   238    208   clean-libtool:
   239    209   	-rm -rf .libs _libs
   240    210   install-includeHEADERS: $(include_HEADERS)
   241    211   	@$(NORMAL_INSTALL)
   242    212   	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
   243         -	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
   244         -	for p in $$list; do \
          213  +	@list='$(include_HEADERS)'; for p in $$list; do \
   245    214   	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
   246         -	  echo "$$d$$p"; \
   247         -	done | $(am__base_list) | \
   248         -	while read files; do \
   249         -	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
   250         -	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
          215  +	  f=$(am__strip_dir) \
          216  +	  echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
          217  +	  $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
   251    218   	done
   252    219   
   253    220   uninstall-includeHEADERS:
   254    221   	@$(NORMAL_UNINSTALL)
   255         -	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
   256         -	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
   257         -	test -n "$$files" || exit 0; \
   258         -	echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
   259         -	cd "$(DESTDIR)$(includedir)" && rm -f $$files
          222  +	@list='$(include_HEADERS)'; for p in $$list; do \
          223  +	  f=$(am__strip_dir) \
          224  +	  echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
          225  +	  rm -f "$(DESTDIR)$(includedir)/$$f"; \
          226  +	done
   260    227   
   261    228   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   262    229   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   263    230   	unique=`for i in $$list; do \
   264    231   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   265    232   	  done | \
   266         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          233  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   267    234   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   268    235   	mkid -fID $$unique
   269    236   tags: TAGS
   270    237   
   271    238   TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   272    239   		$(TAGS_FILES) $(LISP)
   273         -	set x; \
          240  +	tags=; \
   274    241   	here=`pwd`; \
   275    242   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   276    243   	unique=`for i in $$list; do \
   277    244   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   278    245   	  done | \
   279    246   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   280    247   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   281         -	shift; \
   282         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          248  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   283    249   	  test -n "$$unique" || unique=$$empty_fix; \
   284         -	  if test $$# -gt 0; then \
   285         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   286         -	      "$$@" $$unique; \
   287         -	  else \
   288         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   289         -	      $$unique; \
   290         -	  fi; \
          250  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          251  +	    $$tags $$unique; \
   291    252   	fi
   292    253   ctags: CTAGS
   293    254   CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   294    255   		$(TAGS_FILES) $(LISP)
          256  +	tags=; \
   295    257   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   296    258   	unique=`for i in $$list; do \
   297    259   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   298    260   	  done | \
   299    261   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   300    262   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   301         -	test -z "$(CTAGS_ARGS)$$unique" \
          263  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   302    264   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   303         -	     $$unique
          265  +	     $$tags $$unique
   304    266   
   305    267   GTAGS:
   306    268   	here=`$(am__cd) $(top_builddir) && pwd` \
   307         -	  && $(am__cd) $(top_srcdir) \
   308         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          269  +	  && cd $(top_srcdir) \
          270  +	  && gtags -i $(GTAGS_ARGS) $$here
   309    271   
   310    272   distclean-tags:
   311    273   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   312    274   
   313    275   distdir: $(DISTFILES)
   314    276   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   315    277   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
................................................................................
   322    284   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   323    285   			   sort -u` ;; \
   324    286   	esac; \
   325    287   	for file in $$dist_files; do \
   326    288   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   327    289   	  if test -d $$d/$$file; then \
   328    290   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   329         -	    if test -d "$(distdir)/$$file"; then \
   330         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          291  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          292  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   331    293   	    fi; \
   332         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   333         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   334         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   335         -	    fi; \
   336         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          294  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   337    295   	  else \
   338         -	    test -f "$(distdir)/$$file" \
   339         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          296  +	    test -f $(distdir)/$$file \
          297  +	    || cp -p $$d/$$file $(distdir)/$$file \
   340    298   	    || exit 1; \
   341    299   	  fi; \
   342    300   	done
   343    301   check-am: all-am
   344    302   check: check-am
   345    303   all-am: Makefile $(HEADERS)
   346    304   installdirs:
................................................................................
   363    321   	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   364    322   mostlyclean-generic:
   365    323   
   366    324   clean-generic:
   367    325   
   368    326   distclean-generic:
   369    327   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   370         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   371    328   
   372    329   maintainer-clean-generic:
   373    330   	@echo "This command is intended for maintainers to use"
   374    331   	@echo "it deletes files that may require special tools to rebuild."
   375    332   clean: clean-am
   376    333   
   377    334   clean-am: clean-generic clean-libtool mostlyclean-am
................................................................................
   382    339   
   383    340   dvi: dvi-am
   384    341   
   385    342   dvi-am:
   386    343   
   387    344   html: html-am
   388    345   
   389         -html-am:
   390         -
   391    346   info: info-am
   392    347   
   393    348   info-am:
   394    349   
   395    350   install-data-am: install-includeHEADERS
   396    351   
   397    352   install-dvi: install-dvi-am
   398    353   
   399         -install-dvi-am:
   400         -
   401    354   install-exec-am:
   402    355   
   403    356   install-html: install-html-am
   404    357   
   405         -install-html-am:
   406         -
   407    358   install-info: install-info-am
   408    359   
   409         -install-info-am:
   410         -
   411    360   install-man:
   412    361   
   413    362   install-pdf: install-pdf-am
   414    363   
   415         -install-pdf-am:
   416         -
   417    364   install-ps: install-ps-am
   418    365   
   419         -install-ps-am:
   420         -
   421    366   installcheck-am:
   422    367   
   423    368   maintainer-clean: maintainer-clean-am
   424    369   	-rm -f Makefile
   425    370   maintainer-clean-am: distclean-am maintainer-clean-generic
   426    371   
   427    372   mostlyclean: mostlyclean-am
................................................................................
   448    393   	install-exec-am install-html install-html-am \
   449    394   	install-includeHEADERS install-info install-info-am \
   450    395   	install-man install-pdf install-pdf-am install-ps \
   451    396   	install-ps-am install-strip installcheck installcheck-am \
   452    397   	installdirs maintainer-clean maintainer-clean-generic \
   453    398   	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
   454    399   	ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS
   455         -
   456    400   
   457    401   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   458    402   # Otherwise a system limit (for SysV at least) may be exceeded.
   459    403   .NOEXPORT:

Changes to headers/rasterlite.h.

     1      1   /* 
     2      2   / rasterlite.h
     3      3   /
     4      4   / public RasterLite declarations
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #ifdef DLL_EXPORT
    28     28   #define RASTERLITE_DECLARE __declspec(dllexport)
    29     29   #else
................................................................................
   142    142   					      const char **auth_name,
   143    143   					      int *auth_srid,
   144    144   					      const char **ref_sys_name,
   145    145   					      const char **proj4text);
   146    146       RASTERLITE_DECLARE int rasterliteGetExtent (void *handle, double *min_x,
   147    147   						double *min_y, double *max_x,
   148    148   						double *max_y);
          149  +    RASTERLITE_DECLARE int rasterliteWaveletToPng (const void *blob,
          150  +						   int blob_size,
          151  +						   void **png_blob,
          152  +						   int *png_size);
   149    153       RASTERLITE_DECLARE int rasterliteExportGeoTiff (void *handle,
   150    154   						    const char *img_path,
   151    155   						    void *raster, int size,
   152    156   						    double cx, double cy,
   153    157   						    double pixel_x_size,
   154    158   						    double pixel_y_size,
   155    159   						    int width, int height);
................................................................................
   156    160       RASTERLITE_DECLARE int rasterliteGetBestAccess (void *handle,
   157    161   						    double pixel_size,
   158    162   						    double *pixel_x_size,
   159    163   						    double *pixel_y_size,
   160    164   						    sqlite3_stmt ** stmt,
   161    165   						    int *use_rtree);
   162    166   
   163         -/*
   164         -/ utility functions returning a Raw image
   165         -*/
   166         -    RASTERLITE_DECLARE int rasterliteJpegBlobToRawImage (const void *blob,
   167         -							 int blob_size,
   168         -							 int raw_format,
   169         -							 void **raw, int *width,
   170         -							 int *height);
   171         -    RASTERLITE_DECLARE int rasterlitePngBlobToRawImage (const void *blob,
   172         -							int blob_size,
   173         -							int raw_format,
   174         -							void **raw, int *width,
   175         -							int *height);
   176         -    RASTERLITE_DECLARE int rasterliteGifBlobToRawImage (const void *blob,
   177         -							int blob_size,
   178         -							int raw_format,
   179         -							void **raw, int *width,
   180         -							int *height);
   181         -    RASTERLITE_DECLARE int rasterliteTiffBlobToRawImage (const void *blob,
   182         -							 int blob_size,
   183         -							 int raw_format,
   184         -							 void **raw, int *width,
   185         -							 int *height);
   186         -
   187         -/*
   188         -/ utility functions generating an image file from a Raw Image
   189         -*/
   190         -    RASTERLITE_DECLARE int rasterliteRawImageToJpegFile (const void *raw,
   191         -							 int raw_format,
   192         -							 int width, int height,
   193         -							 const char *path,
   194         -							 int quality);
   195         -    RASTERLITE_DECLARE int rasterliteRawImageToPngFile (const void *raw,
   196         -							int raw_format,
   197         -							int width, int height,
   198         -							const char *path);
   199         -    RASTERLITE_DECLARE int rasterliteRawImageToGifFile (const void *raw,
   200         -							int raw_format,
   201         -							int width, int height,
   202         -							const char *path);
   203         -    RASTERLITE_DECLARE int rasterliteRawImageToGeoTiffFile (const void *raw,
   204         -							    int raw_format,
   205         -							    int width,
   206         -							    int height,
   207         -							    const char *path,
   208         -							    double x_size,
   209         -							    double y_size,
   210         -							    double xllcorner,
   211         -							    double yllcorner,
   212         -							    const char
   213         -							    *proj4text);
   214         -
   215         -/*
   216         -/ utility functions generating an image mem-buffer from a Raw Image
   217         -*/
   218         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToJpegMemBuf (const void
   219         -								      *raw,
   220         -								      int
   221         -								      raw_format,
   222         -								      int width,
   223         -								      int
   224         -								      height,
   225         -								      int *size,
   226         -								      int
   227         -								      quality);
   228         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToPngMemBuf (const void
   229         -								     *raw,
   230         -								     int
   231         -								     raw_format,
   232         -								     int width,
   233         -								     int height,
   234         -								     int *size);
   235         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToGifMemBuf (const void
   236         -								     *raw,
   237         -								     int
   238         -								     raw_format,
   239         -								     int width,
   240         -								     int height,
   241         -								     int *size);
   242         -    RASTERLITE_DECLARE unsigned char *rasterliteRawImageToTiffMemBuf (const void
   243         -								      *raw,
   244         -								      int
   245         -								      raw_format,
   246         -								      int width,
   247         -								      int
   248         -								      height,
   249         -								      int
   250         -								      *size);
   251         -
   252    167   #ifdef __cplusplus
   253    168   }
   254    169   #endif
   255    170   
   256    171   #endif				/* _RASTERLITE_H */

Changes to headers/rasterlite_internals.h.

     1      1   /* 
     2      2   / rasterlite_internals.h
     3      3   /
     4      4   / internal declarations
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #define COLORSPACE_MONOCHROME	1
    28     28   #define COLORSPACE_PALETTE	2
    29     29   #define COLORSPACE_GRAYSCALE	3
................................................................................
    43     43   #define IMAGE_GIF_PALETTE	111
    44     44   
    45     45   #define NTILES	8192
    46     46   
    47     47   #define STRATEGY_RTREE	1
    48     48   #define STRATEGY_PLAIN	2
    49     49   
    50         -#define RASTERLITE_TRUE	-1
    51         -#define RASTERLITE_FALSE	-2
    52         -
    53     50   #define true_color(r, g, b) (((r) << 16) + ((g) << 8) + (b))
    54     51   #define image_set_pixel(img, x, y, color) 	img->pixels[y][x] = color
    55     52   #define true_color_get_red(c) (((c) & 0xFF0000) >> 16)
    56     53   #define true_color_get_green(c) (((c) & 0x00FF00) >> 8)
    57     54   #define true_color_get_blue(c) ((c) & 0x0000FF)
    58     55   
    59     56   struct tile_info
................................................................................
    90     87       double pixel_y;		/* the Y pixel size [in map units] */
    91     88       int tile_height;		/* the TILE preferred height [in pixels]  */
    92     89       int tile_width;		/* the TILE preferred width [in pixels]  */
    93     90       sqlite3 *handle;		/* SQLite handle */
    94     91       sqlite3_stmt *stmt;		/* SQL preparared statement: INSERT INTO xx_rasters */
    95     92       const char *table;		/* the DB table name */
    96     93       int image_type;		/* the preferred image type [to be used for tiles] */
    97         -    int quality_factor;		/* the quality factor for JPEG compression */
           94  +    int quality_factor;		/* the quality factor for JPEG or Wavelet compression */
    98     95       struct tile_info tiles[NTILES];
    99     96   };
   100     97   
   101     98   struct source_item
   102     99   {
   103    100   /* a raster source item */
   104    101       char *name;
................................................................................
   181    178   /* a generic RGB image  */
   182    179       int **pixels;
   183    180       int sx;
   184    181       int sy;
   185    182       int color_space;
   186    183   } rasterliteImage;
   187    184   
   188         -typedef rasterliteImage *rasterliteImagePtr;
          185  +typedef rasterliteImage *rasterliteImagePrt;
   189    186   
   190         -extern rasterliteImagePtr image_create (int sx, int sy);
   191         -extern void image_destroy (rasterliteImagePtr img);
   192         -extern void image_fill (const rasterliteImagePtr img, int color);
   193         -extern void make_thumbnail (const rasterliteImagePtr thumbnail,
   194         -			    const rasterliteImagePtr image);
   195         -extern void image_resize (const rasterliteImagePtr dst,
   196         -			  const rasterliteImagePtr src);
          187  +extern rasterliteImagePrt image_create (int sx, int sy);
          188  +extern void image_destroy (rasterliteImagePrt img);
          189  +extern void image_fill (const rasterliteImagePrt img, int color);
          190  +extern void make_thumbnail (const rasterliteImagePrt thumbnail,
          191  +			    const rasterliteImagePrt image);
          192  +extern void image_resize (const rasterliteImagePrt dst,
          193  +			  const rasterliteImagePrt src);
   197    194   
   198         -extern void *image_to_jpeg (const rasterliteImagePtr img, int *size,
          195  +extern void *image_to_jpeg (const rasterliteImagePrt img, int *size,
   199    196   			    int quality);
   200         -extern void *image_to_jpeg_grayscale (const rasterliteImagePtr img, int *size,
          197  +extern void *image_to_jpeg_grayscale (const rasterliteImagePrt img, int *size,
   201    198   				      int quality);
   202         -extern void *image_to_png_palette (const rasterliteImagePtr img, int *size);
   203         -extern void *image_to_png_grayscale (const rasterliteImagePtr img, int *size);
   204         -extern void *image_to_png_rgb (const rasterliteImagePtr img, int *size);
   205         -extern void *image_to_gif (const rasterliteImagePtr img, int *size);
   206         -extern void *image_to_tiff_fax4 (const rasterliteImagePtr img, int *size);
   207         -extern void *image_to_tiff_palette (const rasterliteImagePtr img, int *size);
   208         -extern void *image_to_tiff_grayscale (const rasterliteImagePtr img, int *size);
   209         -extern void *image_to_tiff_rgb (const rasterliteImagePtr img, int *size);
   210         -
   211         -extern void *image_to_rgb_array (const rasterliteImagePtr img, int *size);
          199  +extern void *image_to_wavelet (const rasterliteImagePrt img, int *size,
          200  +			       int ratio);
          201  +extern void *image_to_wavelet_grayscale (const rasterliteImagePrt img,
          202  +					 int *size, int ratio);
          203  +extern void *image_to_png_palette (const rasterliteImagePrt img, int *size);
          204  +extern void *image_to_png_grayscale (const rasterliteImagePrt img, int *size);
          205  +extern void *image_to_png_rgb (const rasterliteImagePrt img, int *size);
          206  +extern void *image_to_gif (const rasterliteImagePrt img, int *size);
          207  +extern void *image_to_tiff_fax4 (const rasterliteImagePrt img, int *size);
          208  +extern void *image_to_tiff_palette (const rasterliteImagePrt img, int *size);
          209  +extern void *image_to_tiff_grayscale (const rasterliteImagePrt img, int *size);
          210  +extern void *image_to_tiff_rgb (const rasterliteImagePrt img, int *size);
          211  +extern void *image_to_rgb_array (const rasterliteImagePrt img, int *size);
   212    212   extern void *image_to_rgba_array (int transparent_color,
   213         -				  const rasterliteImagePtr img, int *size);
          213  +				  const rasterliteImagePrt img, int *size);
   214    214   extern void *image_to_argb_array (int transparent_color,
   215         -				  const rasterliteImagePtr img, int *size);
   216         -extern void *image_to_bgr_array (const rasterliteImagePtr img, int *size);
          215  +				  const rasterliteImagePrt img, int *size);
          216  +extern void *image_to_bgr_array (const rasterliteImagePrt img, int *size);
   217    217   extern void *image_to_bgra_array (int transparent_color,
   218         -				  const rasterliteImagePtr img, int *size);
          218  +				  const rasterliteImagePrt img, int *size);
   219    219   
   220         -extern rasterliteImagePtr image_from_rgb_array (const void *raw, int width,
   221         -						int height);
   222         -extern rasterliteImagePtr image_from_rgba_array (const void *raw, int width,
   223         -						 int height);
   224         -extern rasterliteImagePtr image_from_argb_array (const void *raw, int width,
   225         -						 int height);
   226         -extern rasterliteImagePtr image_from_bgr_array (const void *raw, int width,
   227         -						int height);
   228         -extern rasterliteImagePtr image_from_bgra_array (const void *raw, int width,
   229         -						 int height);
   230         -
   231         -extern rasterliteImagePtr image_from_jpeg (int size, const void *data);
   232         -extern rasterliteImagePtr image_from_png (int size, const void *data);
   233         -extern rasterliteImagePtr image_from_gif (int size, const void *data);
   234         -extern rasterliteImagePtr image_from_tiff (int size, const void *data);
   235         -
   236         -extern int is_image_monochrome (const rasterliteImagePtr img);
   237         -extern int is_image_grayscale (const rasterliteImagePtr img);
   238         -extern int is_image_palette256 (const rasterliteImagePtr img);
   239         -extern void image_resample_as_palette256 (const rasterliteImagePtr img);
          220  +extern rasterliteImagePrt image_from_jpeg (int size, const void *data);
          221  +extern rasterliteImagePrt image_from_png (int size, const void *data);
          222  +extern rasterliteImagePrt image_from_gif (int size, const void *data);
          223  +extern rasterliteImagePrt image_from_tiff (int size, const void *data);
          224  +extern rasterliteImagePrt image_from_wavelet (int size, const void *data);
   240    225   
   241    226   extern int write_geotiff (const char *path, const void *raster, int size,
   242    227   			  double xsize, double ysize, double xllcorner,
   243    228   			  double yllcorner, const char *proj4text);
   244    229   
   245    230   /* 
   246    231   /

Deleted headers/rasterlite_tiff_hdrs.h.

     1         -/*
     2         -/ rasterlite_tiff_hrds.h
     3         -/
     4         -/ internal declarations supporting geotiff
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Brad Hards bradh@frogmouth.net
     9         -/
    10         -/ Copyright (C) 2012  Alessandro Furieri
    11         -/
    12         -/    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
    14         -/    the Free Software Foundation, either version 3 of the License, or
    15         -/    (at your option) any later version.
    16         -/
    17         -/    This program is distributed in the hope that it will be useful,
    18         -/    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19         -/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
    21         -/
    22         -/    You should have received a copy of the GNU Lesser General Public License
    23         -/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24         -/
    25         -*/
    26         -
    27         -#ifndef _RASTERLITE_TIFF_HDRS_H
    28         -#define _RASTERLITE_TIFF_HDRS_H
    29         -
    30         -#ifdef HAVE_GEOTIFF_GEOTIFF_H
    31         -#include <geotiff/geotiff.h>
    32         -#include <geotiff/xtiffio.h>
    33         -#include <geotiff/geo_tiffp.h>
    34         -#include <geotiff/geo_keyp.h>
    35         -#include <geotiff/geovalues.h>
    36         -#include <geotiff/geo_normalize.h>
    37         -#elif HAVE_LIBGEOTIFF_GEOTIFF_H
    38         -#include <libgeotiff/geotiff.h>
    39         -#include <libgeotiff/xtiffio.h>
    40         -#include <libgeotiff/geo_tiffp.h>
    41         -#include <libgeotiff/geo_keyp.h>
    42         -#include <libgeotiff/geovalues.h>
    43         -#include <libgeotiff/geo_normalize.h>
    44         -#else
    45         -#include <geotiff.h>
    46         -#include <xtiffio.h>
    47         -#include <geo_tiffp.h>
    48         -#include <geo_keyp.h>
    49         -#include <geovalues.h>
    50         -#include <geo_normalize.h>
    51         -#endif
    52         -
    53         -#endif

Changes to install-sh.

     1         -/usr/share/automake-1.11/install-sh
            1  +#!/bin/sh
            2  +# install - install a program, script, or datafile
            3  +
            4  +scriptversion=2006-12-25.00
            5  +
            6  +# This originates from X11R5 (mit/util/scripts/install.sh), which was
            7  +# later released in X11R6 (xc/config/util/install.sh) with the
            8  +# following copyright and license.
            9  +#
           10  +# Copyright (C) 1994 X Consortium
           11  +#
           12  +# Permission is hereby granted, free of charge, to any person obtaining a copy
           13  +# of this software and associated documentation files (the "Software"), to
           14  +# deal in the Software without restriction, including without limitation the
           15  +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
           16  +# sell copies of the Software, and to permit persons to whom the Software is
           17  +# furnished to do so, subject to the following conditions:
           18  +#
           19  +# The above copyright notice and this permission notice shall be included in
           20  +# all copies or substantial portions of the Software.
           21  +#
           22  +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
           23  +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
           24  +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
           25  +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
           26  +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
           27  +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
           28  +#
           29  +# Except as contained in this notice, the name of the X Consortium shall not
           30  +# be used in advertising or otherwise to promote the sale, use or other deal-
           31  +# ings in this Software without prior written authorization from the X Consor-
           32  +# tium.
           33  +#
           34  +#
           35  +# FSF changes to this file are in the public domain.
           36  +#
           37  +# Calling this script install-sh is preferred over install.sh, to prevent
           38  +# `make' implicit rules from creating a file called install from it
           39  +# when there is no Makefile.
           40  +#
           41  +# This script is compatible with the BSD install script, but was written
           42  +# from scratch.
           43  +
           44  +nl='
           45  +'
           46  +IFS=" ""	$nl"
           47  +
           48  +# set DOITPROG to echo to test this script
           49  +
           50  +# Don't use :- since 4.3BSD and earlier shells don't like it.
           51  +doit=${DOITPROG-}
           52  +if test -z "$doit"; then
           53  +  doit_exec=exec
           54  +else
           55  +  doit_exec=$doit
           56  +fi
           57  +
           58  +# Put in absolute file names if you don't have them in your path;
           59  +# or use environment vars.
           60  +
           61  +chgrpprog=${CHGRPPROG-chgrp}
           62  +chmodprog=${CHMODPROG-chmod}
           63  +chownprog=${CHOWNPROG-chown}
           64  +cmpprog=${CMPPROG-cmp}
           65  +cpprog=${CPPROG-cp}
           66  +mkdirprog=${MKDIRPROG-mkdir}
           67  +mvprog=${MVPROG-mv}
           68  +rmprog=${RMPROG-rm}
           69  +stripprog=${STRIPPROG-strip}
           70  +
           71  +posix_glob='?'
           72  +initialize_posix_glob='
           73  +  test "$posix_glob" != "?" || {
           74  +    if (set -f) 2>/dev/null; then
           75  +      posix_glob=
           76  +    else
           77  +      posix_glob=:
           78  +    fi
           79  +  }
           80  +'
           81  +
           82  +posix_mkdir=
           83  +
           84  +# Desired mode of installed file.
           85  +mode=0755
           86  +
           87  +chgrpcmd=
           88  +chmodcmd=$chmodprog
           89  +chowncmd=
           90  +mvcmd=$mvprog
           91  +rmcmd="$rmprog -f"
           92  +stripcmd=
           93  +
           94  +src=
           95  +dst=
           96  +dir_arg=
           97  +dst_arg=
           98  +
           99  +copy_on_change=false
          100  +no_target_directory=
          101  +
          102  +usage="\
          103  +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
          104  +   or: $0 [OPTION]... SRCFILES... DIRECTORY
          105  +   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
          106  +   or: $0 [OPTION]... -d DIRECTORIES...
          107  +
          108  +In the 1st form, copy SRCFILE to DSTFILE.
          109  +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
          110  +In the 4th, create DIRECTORIES.
          111  +
          112  +Options:
          113  +     --help     display this help and exit.
          114  +     --version  display version info and exit.
          115  +
          116  +  -c            (ignored)
          117  +  -C            install only if different (preserve the last data modification time)
          118  +  -d            create directories instead of installing files.
          119  +  -g GROUP      $chgrpprog installed files to GROUP.
          120  +  -m MODE       $chmodprog installed files to MODE.
          121  +  -o USER       $chownprog installed files to USER.
          122  +  -s            $stripprog installed files.
          123  +  -t DIRECTORY  install into DIRECTORY.
          124  +  -T            report an error if DSTFILE is a directory.
          125  +
          126  +Environment variables override the default commands:
          127  +  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
          128  +  RMPROG STRIPPROG
          129  +"
          130  +
          131  +while test $# -ne 0; do
          132  +  case $1 in
          133  +    -c) ;;
          134  +
          135  +    -C) copy_on_change=true;;
          136  +
          137  +    -d) dir_arg=true;;
          138  +
          139  +    -g) chgrpcmd="$chgrpprog $2"
          140  +	shift;;
          141  +
          142  +    --help) echo "$usage"; exit $?;;
          143  +
          144  +    -m) mode=$2
          145  +	case $mode in
          146  +	  *' '* | *'	'* | *'
          147  +'*	  | *'*'* | *'?'* | *'['*)
          148  +	    echo "$0: invalid mode: $mode" >&2
          149  +	    exit 1;;
          150  +	esac
          151  +	shift;;
          152  +
          153  +    -o) chowncmd="$chownprog $2"
          154  +	shift;;
          155  +
          156  +    -s) stripcmd=$stripprog;;
          157  +
          158  +    -t) dst_arg=$2
          159  +	shift;;
          160  +
          161  +    -T) no_target_directory=true;;
          162  +
          163  +    --version) echo "$0 $scriptversion"; exit $?;;
          164  +
          165  +    --)	shift
          166  +	break;;
          167  +
          168  +    -*)	echo "$0: invalid option: $1" >&2
          169  +	exit 1;;
          170  +
          171  +    *)  break;;
          172  +  esac
          173  +  shift
          174  +done
          175  +
          176  +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
          177  +  # When -d is used, all remaining arguments are directories to create.
          178  +  # When -t is used, the destination is already specified.
          179  +  # Otherwise, the last argument is the destination.  Remove it from $@.
          180  +  for arg
          181  +  do
          182  +    if test -n "$dst_arg"; then
          183  +      # $@ is not empty: it contains at least $arg.
          184  +      set fnord "$@" "$dst_arg"
          185  +      shift # fnord
          186  +    fi
          187  +    shift # arg
          188  +    dst_arg=$arg
          189  +  done
          190  +fi
          191  +
          192  +if test $# -eq 0; then
          193  +  if test -z "$dir_arg"; then
          194  +    echo "$0: no input file specified." >&2
          195  +    exit 1
          196  +  fi
          197  +  # It's OK to call `install-sh -d' without argument.
          198  +  # This can happen when creating conditional directories.
          199  +  exit 0
          200  +fi
          201  +
          202  +if test -z "$dir_arg"; then
          203  +  trap '(exit $?); exit' 1 2 13 15
          204  +
          205  +  # Set umask so as not to create temps with too-generous modes.
          206  +  # However, 'strip' requires both read and write access to temps.
          207  +  case $mode in
          208  +    # Optimize common cases.
          209  +    *644) cp_umask=133;;
          210  +    *755) cp_umask=22;;
          211  +
          212  +    *[0-7])
          213  +      if test -z "$stripcmd"; then
          214  +	u_plus_rw=
          215  +      else
          216  +	u_plus_rw='% 200'
          217  +      fi
          218  +      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
          219  +    *)
          220  +      if test -z "$stripcmd"; then
          221  +	u_plus_rw=
          222  +      else
          223  +	u_plus_rw=,u+rw
          224  +      fi
          225  +      cp_umask=$mode$u_plus_rw;;
          226  +  esac
          227  +fi
          228  +
          229  +for src
          230  +do
          231  +  # Protect names starting with `-'.
          232  +  case $src in
          233  +    -*) src=./$src;;
          234  +  esac
          235  +
          236  +  if test -n "$dir_arg"; then
          237  +    dst=$src
          238  +    dstdir=$dst
          239  +    test -d "$dstdir"
          240  +    dstdir_status=$?
          241  +  else
          242  +
          243  +    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
          244  +    # might cause directories to be created, which would be especially bad
          245  +    # if $src (and thus $dsttmp) contains '*'.
          246  +    if test ! -f "$src" && test ! -d "$src"; then
          247  +      echo "$0: $src does not exist." >&2
          248  +      exit 1
          249  +    fi
          250  +
          251  +    if test -z "$dst_arg"; then
          252  +      echo "$0: no destination specified." >&2
          253  +      exit 1
          254  +    fi
          255  +
          256  +    dst=$dst_arg
          257  +    # Protect names starting with `-'.
          258  +    case $dst in
          259  +      -*) dst=./$dst;;
          260  +    esac
          261  +
          262  +    # If destination is a directory, append the input filename; won't work
          263  +    # if double slashes aren't ignored.
          264  +    if test -d "$dst"; then
          265  +      if test -n "$no_target_directory"; then
          266  +	echo "$0: $dst_arg: Is a directory" >&2
          267  +	exit 1
          268  +      fi
          269  +      dstdir=$dst
          270  +      dst=$dstdir/`basename "$src"`
          271  +      dstdir_status=0
          272  +    else
          273  +      # Prefer dirname, but fall back on a substitute if dirname fails.
          274  +      dstdir=`
          275  +	(dirname "$dst") 2>/dev/null ||
          276  +	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
          277  +	     X"$dst" : 'X\(//\)[^/]' \| \
          278  +	     X"$dst" : 'X\(//\)$' \| \
          279  +	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
          280  +	echo X"$dst" |
          281  +	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
          282  +		   s//\1/
          283  +		   q
          284  +		 }
          285  +		 /^X\(\/\/\)[^/].*/{
          286  +		   s//\1/
          287  +		   q
          288  +		 }
          289  +		 /^X\(\/\/\)$/{
          290  +		   s//\1/
          291  +		   q
          292  +		 }
          293  +		 /^X\(\/\).*/{
          294  +		   s//\1/
          295  +		   q
          296  +		 }
          297  +		 s/.*/./; q'
          298  +      `
          299  +
          300  +      test -d "$dstdir"
          301  +      dstdir_status=$?
          302  +    fi
          303  +  fi
          304  +
          305  +  obsolete_mkdir_used=false
          306  +
          307  +  if test $dstdir_status != 0; then
          308  +    case $posix_mkdir in
          309  +      '')
          310  +	# Create intermediate dirs using mode 755 as modified by the umask.
          311  +	# This is like FreeBSD 'install' as of 1997-10-28.
          312  +	umask=`umask`
          313  +	case $stripcmd.$umask in
          314  +	  # Optimize common cases.
          315  +	  *[2367][2367]) mkdir_umask=$umask;;
          316  +	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
          317  +
          318  +	  *[0-7])
          319  +	    mkdir_umask=`expr $umask + 22 \
          320  +	      - $umask % 100 % 40 + $umask % 20 \
          321  +	      - $umask % 10 % 4 + $umask % 2
          322  +	    `;;
          323  +	  *) mkdir_umask=$umask,go-w;;
          324  +	esac
          325  +
          326  +	# With -d, create the new directory with the user-specified mode.
          327  +	# Otherwise, rely on $mkdir_umask.
          328  +	if test -n "$dir_arg"; then
          329  +	  mkdir_mode=-m$mode
          330  +	else
          331  +	  mkdir_mode=
          332  +	fi
          333  +
          334  +	posix_mkdir=false
          335  +	case $umask in
          336  +	  *[123567][0-7][0-7])
          337  +	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
          338  +	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
          339  +	    ;;
          340  +	  *)
          341  +	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
          342  +	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
          343  +
          344  +	    if (umask $mkdir_umask &&
          345  +		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
          346  +	    then
          347  +	      if test -z "$dir_arg" || {
          348  +		   # Check for POSIX incompatibilities with -m.
          349  +		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
          350  +		   # other-writeable bit of parent directory when it shouldn't.
          351  +		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
          352  +		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
          353  +		   case $ls_ld_tmpdir in
          354  +		     d????-?r-*) different_mode=700;;
          355  +		     d????-?--*) different_mode=755;;
          356  +		     *) false;;
          357  +		   esac &&
          358  +		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
          359  +		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
          360  +		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
          361  +		   }
          362  +		 }
          363  +	      then posix_mkdir=:
          364  +	      fi
          365  +	      rmdir "$tmpdir/d" "$tmpdir"
          366  +	    else
          367  +	      # Remove any dirs left behind by ancient mkdir implementations.
          368  +	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
          369  +	    fi
          370  +	    trap '' 0;;
          371  +	esac;;
          372  +    esac
          373  +
          374  +    if
          375  +      $posix_mkdir && (
          376  +	umask $mkdir_umask &&
          377  +	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
          378  +      )
          379  +    then :
          380  +    else
          381  +
          382  +      # The umask is ridiculous, or mkdir does not conform to POSIX,
          383  +      # or it failed possibly due to a race condition.  Create the
          384  +      # directory the slow way, step by step, checking for races as we go.
          385  +
          386  +      case $dstdir in
          387  +	/*) prefix='/';;
          388  +	-*) prefix='./';;
          389  +	*)  prefix='';;
          390  +      esac
          391  +
          392  +      eval "$initialize_posix_glob"
          393  +
          394  +      oIFS=$IFS
          395  +      IFS=/
          396  +      $posix_glob set -f
          397  +      set fnord $dstdir
          398  +      shift
          399  +      $posix_glob set +f
          400  +      IFS=$oIFS
          401  +
          402  +      prefixes=
          403  +
          404  +      for d
          405  +      do
          406  +	test -z "$d" && continue
          407  +
          408  +	prefix=$prefix$d
          409  +	if test -d "$prefix"; then
          410  +	  prefixes=
          411  +	else
          412  +	  if $posix_mkdir; then
          413  +	    (umask=$mkdir_umask &&
          414  +	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
          415  +	    # Don't fail if two instances are running concurrently.
          416  +	    test -d "$prefix" || exit 1
          417  +	  else
          418  +	    case $prefix in
          419  +	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
          420  +	      *) qprefix=$prefix;;
          421  +	    esac
          422  +	    prefixes="$prefixes '$qprefix'"
          423  +	  fi
          424  +	fi
          425  +	prefix=$prefix/
          426  +      done
          427  +
          428  +      if test -n "$prefixes"; then
          429  +	# Don't fail if two instances are running concurrently.
          430  +	(umask $mkdir_umask &&
          431  +	 eval "\$doit_exec \$mkdirprog $prefixes") ||
          432  +	  test -d "$dstdir" || exit 1
          433  +	obsolete_mkdir_used=true
          434  +      fi
          435  +    fi
          436  +  fi
          437  +
          438  +  if test -n "$dir_arg"; then
          439  +    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
          440  +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
          441  +    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
          442  +      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
          443  +  else
          444  +
          445  +    # Make a couple of temp file names in the proper directory.
          446  +    dsttmp=$dstdir/_inst.$$_
          447  +    rmtmp=$dstdir/_rm.$$_
          448  +
          449  +    # Trap to clean up those temp files at exit.
          450  +    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
          451  +
          452  +    # Copy the file name to the temp name.
          453  +    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
          454  +
          455  +    # and set any options; do chmod last to preserve setuid bits.
          456  +    #
          457  +    # If any of these fail, we abort the whole thing.  If we want to
          458  +    # ignore errors from any of these, just make sure not to ignore
          459  +    # errors from the above "$doit $cpprog $src $dsttmp" command.
          460  +    #
          461  +    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
          462  +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
          463  +    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
          464  +    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
          465  +
          466  +    # If -C, don't bother to copy if it wouldn't change the file.
          467  +    if $copy_on_change &&
          468  +       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
          469  +       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
          470  +
          471  +       eval "$initialize_posix_glob" &&
          472  +       $posix_glob set -f &&
          473  +       set X $old && old=:$2:$4:$5:$6 &&
          474  +       set X $new && new=:$2:$4:$5:$6 &&
          475  +       $posix_glob set +f &&
          476  +
          477  +       test "$old" = "$new" &&
          478  +       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
          479  +    then
          480  +      rm -f "$dsttmp"
          481  +    else
          482  +      # Rename the file to the real destination.
          483  +      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
          484  +
          485  +      # The rename failed, perhaps because mv can't rename something else
          486  +      # to itself, or perhaps because mv is so ancient that it does not
          487  +      # support -f.
          488  +      {
          489  +	# Now remove or move aside any old file at destination location.
          490  +	# We try this two ways since rm can't unlink itself on some
          491  +	# systems and the destination file might be busy for other
          492  +	# reasons.  In this case, the final cleanup might fail but the new
          493  +	# file should still install successfully.
          494  +	{
          495  +	  test ! -f "$dst" ||
          496  +	  $doit $rmcmd -f "$dst" 2>/dev/null ||
          497  +	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
          498  +	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
          499  +	  } ||
          500  +	  { echo "$0: cannot unlink or rename $dst" >&2
          501  +	    (exit 1); exit 1
          502  +	  }
          503  +	} &&
          504  +
          505  +	# Now rename the file to the real destination.
          506  +	$doit $mvcmd "$dsttmp" "$dst"
          507  +      }
          508  +    fi || exit 1
          509  +
          510  +    trap '' 0
          511  +  fi
          512  +done
          513  +
          514  +# Local variables:
          515  +# eval: (add-hook 'write-file-hooks 'time-stamp)
          516  +# time-stamp-start: "scriptversion="
          517  +# time-stamp-format: "%:y-%02m-%02d.%02H"
          518  +# time-stamp-end: "$"
          519  +# End:

Changes to lib/Makefile.am.

     1      1   
     2         -AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 \
     3         -	@LIBSPATIALITE_CFLAGS@
            2  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 
     4      3   
     5      4   INCLUDES = @CFLAGS@
     6      5   INCLUDES += -I$(top_srcdir)/headers
            6  +INCLUDES += -I$(top_srcdir)/epsilon
     7      7   
     8      8   lib_LTLIBRARIES = librasterlite.la 
     9      9   
    10     10   librasterlite_la_SOURCES = \
    11     11        rasterlite_io.c \
    12     12        rasterlite_image.c \
    13         -     rasterlite_aux.c \
    14         -     rasterlite_quantize.c \
    15     13        rasterlite_gif.c \
    16     14        rasterlite_png.c \
    17     15        rasterlite_jpeg.c \
    18     16        rasterlite_tiff.c \
           17  +     rasterlite_wavelet.c \
    19     18        rasterlite.c
    20     19   
    21         -librasterlite_la_LDFLAGS = -version-info 1:0:1 -no-undefined
           20  +librasterlite_la_LDFLAGS = -version-info 1:0:0 -no-undefined
    22     21   
    23         -librasterlite_la_LIBADD = @LIBSPATIALITE_LIBS@ \
           22  +librasterlite_la_LIBADD = \
           23  +	../epsilon/libepsilon.la \
    24     24   	-lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
    25     25   

Changes to lib/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.1 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
     6         -# Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19     18   pkgdatadir = $(datadir)/@PACKAGE@
    20         -pkgincludedir = $(includedir)/@PACKAGE@
    21     19   pkglibdir = $(libdir)/@PACKAGE@
    22         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    23     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    24     22   install_sh_DATA = $(install_sh) -c -m 644
    25     23   install_sh_PROGRAM = $(install_sh) -c
    26     24   install_sh_SCRIPT = $(install_sh) -c
    27     25   INSTALL_HEADER = $(INSTALL_DATA)
    28     26   transform = $(program_transform_name)
    29     27   NORMAL_INSTALL = :
................................................................................
    38     36   DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    39     37   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    40     38   am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    41     39   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    42     40   	$(ACLOCAL_M4)
    43     41   mkinstalldirs = $(install_sh) -d
    44     42   CONFIG_CLEAN_FILES =
    45         -CONFIG_CLEAN_VPATH_FILES =
    46     43   am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    47     44   am__vpath_adj = case $$p in \
    48     45       $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    49     46       *) f=$$p;; \
    50     47     esac;
    51         -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
    52         -am__install_max = 40
    53         -am__nobase_strip_setup = \
    54         -  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
    55         -am__nobase_strip = \
    56         -  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
    57         -am__nobase_list = $(am__nobase_strip_setup); \
    58         -  for p in $$list; do echo "$$p $$p"; done | \
    59         -  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
    60         -  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
    61         -    if (++n[$$2] == $(am__install_max)) \
    62         -      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
    63         -    END { for (dir in files) print dir, files[dir] }'
    64         -am__base_list = \
    65         -  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
    66         -  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
           48  +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
    67     49   am__installdirs = "$(DESTDIR)$(libdir)"
           50  +libLTLIBRARIES_INSTALL = $(INSTALL)
    68     51   LTLIBRARIES = $(lib_LTLIBRARIES)
    69         -librasterlite_la_DEPENDENCIES =
           52  +librasterlite_la_DEPENDENCIES = ../epsilon/libepsilon.la
    70     53   am_librasterlite_la_OBJECTS = rasterlite_io.lo rasterlite_image.lo \
    71         -	rasterlite_aux.lo rasterlite_quantize.lo rasterlite_gif.lo \
    72         -	rasterlite_png.lo rasterlite_jpeg.lo rasterlite_tiff.lo \
    73         -	rasterlite.lo
           54  +	rasterlite_gif.lo rasterlite_png.lo rasterlite_jpeg.lo \
           55  +	rasterlite_tiff.lo rasterlite_wavelet.lo rasterlite.lo
    74     56   librasterlite_la_OBJECTS = $(am_librasterlite_la_OBJECTS)
    75     57   librasterlite_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
    76     58   	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
    77     59   	$(librasterlite_la_LDFLAGS) $(LDFLAGS) -o $@
    78     60   DEFAULT_INCLUDES = -I.@am__isrc@
    79     61   depcomp = $(SHELL) $(top_srcdir)/depcomp
    80     62   am__depfiles_maybe = depfiles
    81         -am__mv = mv -f
    82     63   COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    83     64   	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    84     65   LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
    85     66   	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    86     67   	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    87     68   CCLD = $(CC)
    88     69   LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
................................................................................
   111     92   CXXDEPMODE = @CXXDEPMODE@
   112     93   CXXFLAGS = @CXXFLAGS@
   113     94   CYGPATH_W = @CYGPATH_W@
   114     95   DEFS = @DEFS@
   115     96   DEPDIR = @DEPDIR@
   116     97   DLLTOOL = @DLLTOOL@
   117     98   DSYMUTIL = @DSYMUTIL@
   118         -DUMPBIN = @DUMPBIN@
           99  +ECHO = @ECHO@
   119    100   ECHO_C = @ECHO_C@
   120    101   ECHO_N = @ECHO_N@
   121    102   ECHO_T = @ECHO_T@
   122    103   EGREP = @EGREP@
   123    104   EXEEXT = @EXEEXT@
   124         -FGREP = @FGREP@
          105  +F77 = @F77@
          106  +FFLAGS = @FFLAGS@
   125    107   GREP = @GREP@
   126    108   INSTALL = @INSTALL@
   127    109   INSTALL_DATA = @INSTALL_DATA@
   128    110   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   129    111   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   130    112   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   131         -LD = @LD@
   132    113   LDFLAGS = @LDFLAGS@
   133    114   LIBOBJS = @LIBOBJS@
   134    115   LIBS = @LIBS@
   135         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   136         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   137    116   LIBTOOL = @LIBTOOL@
   138         -LIPO = @LIPO@
   139    117   LN_S = @LN_S@
   140    118   LTLIBOBJS = @LTLIBOBJS@
   141    119   MAINT = @MAINT@
   142    120   MAKEINFO = @MAKEINFO@
   143    121   MKDIR_P = @MKDIR_P@
   144         -NM = @NM@
   145    122   NMEDIT = @NMEDIT@
   146    123   OBJDUMP = @OBJDUMP@
   147    124   OBJEXT = @OBJEXT@
   148         -OTOOL = @OTOOL@
   149         -OTOOL64 = @OTOOL64@
   150    125   PACKAGE = @PACKAGE@
   151    126   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   152    127   PACKAGE_NAME = @PACKAGE_NAME@
   153    128   PACKAGE_STRING = @PACKAGE_STRING@
   154    129   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   155         -PACKAGE_URL = @PACKAGE_URL@
   156    130   PACKAGE_VERSION = @PACKAGE_VERSION@
   157    131   PATH_SEPARATOR = @PATH_SEPARATOR@
   158         -PKG_CONFIG = @PKG_CONFIG@
   159         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   160         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   161    132   RANLIB = @RANLIB@
   162    133   SED = @SED@
   163    134   SET_MAKE = @SET_MAKE@
   164    135   SHELL = @SHELL@
   165    136   STRIP = @STRIP@
   166    137   VERSION = @VERSION@
   167    138   abs_builddir = @abs_builddir@
   168    139   abs_srcdir = @abs_srcdir@
   169    140   abs_top_builddir = @abs_top_builddir@
   170    141   abs_top_srcdir = @abs_top_srcdir@
   171    142   ac_ct_CC = @ac_ct_CC@
   172    143   ac_ct_CXX = @ac_ct_CXX@
   173         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          144  +ac_ct_F77 = @ac_ct_F77@
   174    145   am__include = @am__include@
   175    146   am__leading_dot = @am__leading_dot@
   176    147   am__quote = @am__quote@
   177    148   am__tar = @am__tar@
   178    149   am__untar = @am__untar@
   179    150   bindir = @bindir@
   180    151   build = @build@
................................................................................
   197    168   includedir = @includedir@
   198    169   infodir = @infodir@
   199    170   install_sh = @install_sh@
   200    171   libdir = @libdir@
   201    172   libexecdir = @libexecdir@
   202    173   localedir = @localedir@
   203    174   localstatedir = @localstatedir@
   204         -lt_ECHO = @lt_ECHO@
   205    175   mandir = @mandir@
   206    176   mkdir_p = @mkdir_p@
   207    177   oldincludedir = @oldincludedir@
   208    178   pdfdir = @pdfdir@
   209    179   prefix = @prefix@
   210    180   program_transform_name = @program_transform_name@
   211    181   psdir = @psdir@
   212    182   sbindir = @sbindir@
   213    183   sharedstatedir = @sharedstatedir@
   214    184   srcdir = @srcdir@
   215    185   sysconfdir = @sysconfdir@
   216    186   target_alias = @target_alias@
   217         -top_build_prefix = @top_build_prefix@
   218    187   top_builddir = @top_builddir@
   219    188   top_srcdir = @top_srcdir@
   220         -AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 \
   221         -	@LIBSPATIALITE_CFLAGS@
   222         -
   223         -INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers
          189  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 
          190  +INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers -I$(top_srcdir)/epsilon
   224    191   lib_LTLIBRARIES = librasterlite.la 
   225    192   librasterlite_la_SOURCES = \
   226    193        rasterlite_io.c \
   227    194        rasterlite_image.c \
   228         -     rasterlite_aux.c \
   229         -     rasterlite_quantize.c \
   230    195        rasterlite_gif.c \
   231    196        rasterlite_png.c \
   232    197        rasterlite_jpeg.c \
   233    198        rasterlite_tiff.c \
          199  +     rasterlite_wavelet.c \
   234    200        rasterlite.c
   235    201   
   236         -librasterlite_la_LDFLAGS = -version-info 1:0:1 -no-undefined
   237         -librasterlite_la_LIBADD = @LIBSPATIALITE_LIBS@ \
          202  +librasterlite_la_LDFLAGS = -version-info 1:0:0 -no-undefined
          203  +librasterlite_la_LIBADD = \
          204  +	../epsilon/libepsilon.la \
   238    205   	-lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
   239    206   
   240    207   all: all-am
   241    208   
   242    209   .SUFFIXES:
   243    210   .SUFFIXES: .c .lo .o .obj
   244    211   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   245    212   	@for dep in $?; do \
   246    213   	  case '$(am__configure_deps)' in \
   247    214   	    *$$dep*) \
   248         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   249         -	        && { if test -f $@; then exit 0; else break; fi; }; \
          215  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          216  +		&& exit 0; \
   250    217   	      exit 1;; \
   251    218   	  esac; \
   252    219   	done; \
   253         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \
   254         -	$(am__cd) $(top_srcdir) && \
   255         -	  $(AUTOMAKE) --foreign lib/Makefile
          220  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  lib/Makefile'; \
          221  +	cd $(top_srcdir) && \
          222  +	  $(AUTOMAKE) --foreign  lib/Makefile
   256    223   .PRECIOUS: Makefile
   257    224   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   258    225   	@case '$?' in \
   259    226   	  *config.status*) \
   260    227   	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   261    228   	  *) \
   262    229   	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
................................................................................
   266    233   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   267    234   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   268    235   
   269    236   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   270    237   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   271    238   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   272    239   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   273         -$(am__aclocal_m4_deps):
   274    240   install-libLTLIBRARIES: $(lib_LTLIBRARIES)
   275    241   	@$(NORMAL_INSTALL)
   276    242   	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
   277         -	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
   278         -	list2=; for p in $$list; do \
          243  +	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
   279    244   	  if test -f $$p; then \
   280         -	    list2="$$list2 $$p"; \
          245  +	    f=$(am__strip_dir) \
          246  +	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
          247  +	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
   281    248   	  else :; fi; \
   282         -	done; \
   283         -	test -z "$$list2" || { \
   284         -	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
   285         -	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
   286         -	}
          249  +	done
   287    250   
   288    251   uninstall-libLTLIBRARIES:
   289    252   	@$(NORMAL_UNINSTALL)
   290         -	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
   291         -	for p in $$list; do \
   292         -	  $(am__strip_dir) \
   293         -	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
   294         -	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
          253  +	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
          254  +	  p=$(am__strip_dir) \
          255  +	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
          256  +	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
   295    257   	done
   296    258   
   297    259   clean-libLTLIBRARIES:
   298    260   	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
   299    261   	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
   300    262   	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
   301    263   	  test "$$dir" != "$$p" || dir=.; \
................................................................................
   308    270   mostlyclean-compile:
   309    271   	-rm -f *.$(OBJEXT)
   310    272   
   311    273   distclean-compile:
   312    274   	-rm -f *.tab.c
   313    275   
   314    276   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite.Plo@am__quote@
   315         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_aux.Plo@am__quote@
   316    277   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_gif.Plo@am__quote@
   317    278   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_image.Plo@am__quote@
   318    279   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_io.Plo@am__quote@
   319    280   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_jpeg.Plo@am__quote@
   320    281   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_png.Plo@am__quote@
   321         -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_quantize.Plo@am__quote@
   322    282   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_tiff.Plo@am__quote@
          283  +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_wavelet.Plo@am__quote@
   323    284   
   324    285   .c.o:
   325    286   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   326         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          287  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   327    288   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   328    289   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   329    290   @am__fastdepCC_FALSE@	$(COMPILE) -c $<
   330    291   
   331    292   .c.obj:
   332    293   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
   333         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          294  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   334    295   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   335    296   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   336    297   @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   337    298   
   338    299   .c.lo:
   339    300   @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   340         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
          301  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
   341    302   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
   342    303   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   343    304   @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
   344    305   
   345    306   mostlyclean-libtool:
   346    307   	-rm -f *.lo
   347    308   
................................................................................
   349    310   	-rm -rf .libs _libs
   350    311   
   351    312   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   352    313   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   353    314   	unique=`for i in $$list; do \
   354    315   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   355    316   	  done | \
   356         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          317  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   357    318   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   358    319   	mkid -fID $$unique
   359    320   tags: TAGS
   360    321   
   361    322   TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   362    323   		$(TAGS_FILES) $(LISP)
   363         -	set x; \
          324  +	tags=; \
   364    325   	here=`pwd`; \
   365    326   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   366    327   	unique=`for i in $$list; do \
   367    328   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   368    329   	  done | \
   369    330   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   370    331   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   371         -	shift; \
   372         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          332  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   373    333   	  test -n "$$unique" || unique=$$empty_fix; \
   374         -	  if test $$# -gt 0; then \
   375         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   376         -	      "$$@" $$unique; \
   377         -	  else \
   378         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   379         -	      $$unique; \
   380         -	  fi; \
          334  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          335  +	    $$tags $$unique; \
   381    336   	fi
   382    337   ctags: CTAGS
   383    338   CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   384    339   		$(TAGS_FILES) $(LISP)
          340  +	tags=; \
   385    341   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   386    342   	unique=`for i in $$list; do \
   387    343   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   388    344   	  done | \
   389    345   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   390    346   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   391         -	test -z "$(CTAGS_ARGS)$$unique" \
          347  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   392    348   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   393         -	     $$unique
          349  +	     $$tags $$unique
   394    350   
   395    351   GTAGS:
   396    352   	here=`$(am__cd) $(top_builddir) && pwd` \
   397         -	  && $(am__cd) $(top_srcdir) \
   398         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          353  +	  && cd $(top_srcdir) \
          354  +	  && gtags -i $(GTAGS_ARGS) $$here
   399    355   
   400    356   distclean-tags:
   401    357   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   402    358   
   403    359   distdir: $(DISTFILES)
   404    360   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   405    361   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
................................................................................
   412    368   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   413    369   			   sort -u` ;; \
   414    370   	esac; \
   415    371   	for file in $$dist_files; do \
   416    372   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   417    373   	  if test -d $$d/$$file; then \
   418    374   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   419         -	    if test -d "$(distdir)/$$file"; then \
   420         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          375  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          376  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   421    377   	    fi; \
   422         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   423         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   424         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   425         -	    fi; \
   426         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          378  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   427    379   	  else \
   428         -	    test -f "$(distdir)/$$file" \
   429         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          380  +	    test -f $(distdir)/$$file \
          381  +	    || cp -p $$d/$$file $(distdir)/$$file \
   430    382   	    || exit 1; \
   431    383   	  fi; \
   432    384   	done
   433    385   check-am: all-am
   434    386   check: check-am
   435    387   all-am: Makefile $(LTLIBRARIES)
   436    388   installdirs:
................................................................................
   453    405   	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   454    406   mostlyclean-generic:
   455    407   
   456    408   clean-generic:
   457    409   
   458    410   distclean-generic:
   459    411   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   460         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   461    412   
   462    413   maintainer-clean-generic:
   463    414   	@echo "This command is intended for maintainers to use"
   464    415   	@echo "it deletes files that may require special tools to rebuild."
   465    416   clean: clean-am
   466    417   
   467    418   clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
................................................................................
   475    426   
   476    427   dvi: dvi-am
   477    428   
   478    429   dvi-am:
   479    430   
   480    431   html: html-am
   481    432   
   482         -html-am:
   483         -
   484    433   info: info-am
   485    434   
   486    435   info-am:
   487    436   
   488    437   install-data-am:
   489    438   
   490    439   install-dvi: install-dvi-am
   491    440   
   492         -install-dvi-am:
   493         -
   494    441   install-exec-am: install-libLTLIBRARIES
   495    442   
   496    443   install-html: install-html-am
   497    444   
   498         -install-html-am:
   499         -
   500    445   install-info: install-info-am
   501    446   
   502         -install-info-am:
   503         -
   504    447   install-man:
   505    448   
   506    449   install-pdf: install-pdf-am
   507    450   
   508         -install-pdf-am:
   509         -
   510    451   install-ps: install-ps-am
   511    452   
   512         -install-ps-am:
   513         -
   514    453   installcheck-am:
   515    454   
   516    455   maintainer-clean: maintainer-clean-am
   517    456   	-rm -rf ./$(DEPDIR)
   518    457   	-rm -f Makefile
   519    458   maintainer-clean-am: distclean-am maintainer-clean-generic
   520    459   
................................................................................
   544    483   	install-html-am install-info install-info-am \
   545    484   	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
   546    485   	install-ps install-ps-am install-strip installcheck \
   547    486   	installcheck-am installdirs maintainer-clean \
   548    487   	maintainer-clean-generic mostlyclean mostlyclean-compile \
   549    488   	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
   550    489   	tags uninstall uninstall-am uninstall-libLTLIBRARIES
   551         -
   552    490   
   553    491   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   554    492   # Otherwise a system limit (for SysV at least) may be exceeded.
   555    493   .NOEXPORT:

Changes to lib/rasterlite.c.

     1      1   /* 
     2      2   / rasterlite.c
     3      3   /
     4      4   / the RasterLite library core 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdlib.h>
    28     28   #include <stdio.h>
    29     29   #include <string.h>
    30     30   #include <float.h>
    31     31   #include <math.h>
    32     32   
    33         -#include "rasterlite_tiff_hdrs.h"
           33  +#include <geotiff.h>
           34  +#include <xtiffio.h>
           35  +#include <geo_normalize.h>
           36  +#include <geovalues.h>
    34     37   #include <tiffio.h>
    35     38   
    36         -#ifdef SPATIALITE_AMALGAMATION
    37     39   #include <spatialite/sqlite3.h>
    38         -#else
    39         -#include <sqlite3.h>
    40         -#endif
    41         -
    42     40   #include <spatialite/gaiaexif.h>
    43     41   #include <spatialite/gaiageo.h>
    44     42   #include <spatialite.h>
    45     43   
    46     44   #include "rasterlite.h"
    47     45   #include "rasterlite_internals.h"
    48     46   
................................................................................
   722    720   	  /* best access strategy: TABLE SCAN */
   723    721   	  *strategy = STRATEGY_PLAIN;
   724    722         }
   725    723       return RASTERLITE_OK;
   726    724   }
   727    725   
   728    726   static void
   729         -mark_gray_rectangle (rasterliteImagePtr output, int base_x, int base_y,
          727  +mark_gray_rectangle (rasterliteImagePrt output, int base_x, int base_y,
   730    728   		     int width, int height)
   731    729   {
   732    730   /* marking a gray rectangle */
   733    731       int x;
   734    732       int y;
   735    733       int dst_x;
   736    734       int dst_y;
................................................................................
   755    753   		else
   756    754   		    image_set_pixel (output, dst_x, dst_y, fill_color);
   757    755   	    }
   758    756         }
   759    757   }
   760    758   
   761    759   static void
   762         -copy_rectangle (rasterliteImagePtr output, rasterliteImagePtr input,
          760  +copy_rectangle (rasterliteImagePrt output, rasterliteImagePrt input,
   763    761   		int transparent_color, int base_x, int base_y)
   764    762   {
   765    763   /* copying a raster rectangle */
   766    764       int x;
   767    765       int y;
   768    766       int dst_x;
   769    767       int dst_y;
................................................................................
   828    826       sqlite3_stmt *stmt;
   829    827       double map_width = (double) width * ext_pixel_x_size;
   830    828       double map_height = (double) height * ext_pixel_y_size;
   831    829       double min_x = cx - (map_width / 2.0);
   832    830       double max_x = cx + (map_width / 2.0);
   833    831       double min_y = cy - (map_height / 2.0);
   834    832       double max_y = cy + (map_height / 2.0);
   835         -    rasterliteImagePtr output = NULL;
          833  +    rasterliteImagePrt output = NULL;
   836    834       reset_error (handle);
   837    835       if (handle->handle == NULL || handle->stmt_rtree == NULL
   838    836   	|| handle->stmt_plain == NULL)
   839    837         {
   840    838   	  sprintf (error, "invalid datasource");
   841    839   	  set_error (handle, error);
   842    840   	  *raster = NULL;
................................................................................
   894    892   	  ret = sqlite3_step (stmt);
   895    893   	  if (ret == SQLITE_DONE)
   896    894   	      break;		/* end of result set */
   897    895   	  if (ret == SQLITE_ROW)
   898    896   	    {
   899    897   		/* retrieving query values */
   900    898   		gaiaGeomCollPtr geom = NULL;
   901         -		rasterliteImagePtr img = NULL;
          899  +		rasterliteImagePrt img = NULL;
   902    900   		if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
   903    901   		  {
   904    902   		      /* fetching Geometry */
   905    903   		      const void *blob = sqlite3_column_blob (stmt, 0);
   906    904   		      int blob_size = sqlite3_column_bytes (stmt, 0);
   907    905   		      geom =
   908    906   			  gaiaFromSpatiaLiteBlobWkb ((const unsigned char *)
................................................................................
   950    948   		      else
   951    949   			{
   952    950   			    /* resizing the raster tile */
   953    951   			    if (new_width == img->sx && new_height == img->sy)
   954    952   				;
   955    953   			    else
   956    954   			      {
   957         -				  rasterliteImagePtr img2 = img;
          955  +				  rasterliteImagePrt img2 = img;
   958    956   				  img = image_create (new_width, new_height);
   959    957   				  image_resize (img, img2);
   960    958   				  image_destroy (img2);
   961    959   			      }
   962    960   			    /* drawing the raster tile */
   963    961   			    copy_rectangle (output, img,
   964    962   					    handle->transparent_color,
................................................................................
  1169   1167       sqlite3_stmt *stmt;
  1170   1168       double map_width = (double) width * ext_pixel_x_size;
  1171   1169       double map_height = (double) height * ext_pixel_y_size;
  1172   1170       double min_x = cx - (map_width / 2.0);
  1173   1171       double max_x = cx + (map_width / 2.0);
  1174   1172       double min_y = cy - (map_height / 2.0);
  1175   1173       double max_y = cy + (map_height / 2.0);
  1176         -    rasterliteImagePtr output = NULL;
         1174  +    rasterliteImagePrt output = NULL;
  1177   1175       reset_error (handle);
  1178   1176       if (handle->handle == NULL || handle->stmt_rtree == NULL
  1179   1177   	|| handle->stmt_plain == NULL)
  1180   1178         {
  1181   1179   	  sprintf (error, "invalid datasource");
  1182   1180   	  set_error (handle, error);
  1183   1181   	  *raster = NULL;
................................................................................
  1247   1245   	  ret = sqlite3_step (stmt);
  1248   1246   	  if (ret == SQLITE_DONE)
  1249   1247   	      break;		/* end of result set */
  1250   1248   	  if (ret == SQLITE_ROW)
  1251   1249   	    {
  1252   1250   		/* retrieving query values */
  1253   1251   		gaiaGeomCollPtr geom = NULL;
  1254         -		rasterliteImagePtr img = NULL;
         1252  +		rasterliteImagePrt img = NULL;
  1255   1253   		if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
  1256   1254   		  {
  1257   1255   		      /* fetching Geometry */
  1258   1256   		      const void *blob = sqlite3_column_blob (stmt, 0);
  1259   1257   		      int blob_size = sqlite3_column_bytes (stmt, 0);
  1260   1258   		      geom =
  1261   1259   			  gaiaFromSpatiaLiteBlobWkb ((const unsigned char *)
................................................................................
  1303   1301   		      else
  1304   1302   			{
  1305   1303   			    /* resizing the raster tile */
  1306   1304   			    if (new_width == img->sx && new_height == img->sy)
  1307   1305   				;
  1308   1306   			    else
  1309   1307   			      {
  1310         -				  rasterliteImagePtr img2 = img;
         1308  +				  rasterliteImagePrt img2 = img;
  1311   1309   				  img = image_create (new_width, new_height);
  1312   1310   				  image_resize (img, img2);
  1313   1311   				  image_destroy (img2);
  1314   1312   			      }
  1315   1313   			    /* drawing the raster tile */
  1316   1314   			    copy_rectangle (output, img,
  1317   1315   					    handle->transparent_color,
................................................................................
  1565   1563   
  1566   1564   RASTERLITE_DECLARE const char *
  1567   1565   rasterliteGetSpatialiteVersion (void *ext_handle)
  1568   1566   {
  1569   1567       rasterlitePtr handle = (rasterlitePtr) ext_handle;
  1570   1568       return handle->spatialite_version;
  1571   1569   }
         1570  +
         1571  +RASTERLITE_DECLARE int
         1572  +rasterliteWaveletToPng (const void *blob, int blob_size, void **png_blob,
         1573  +			int *png_size)
         1574  +{
         1575  +/* transforming a Wavelet compressed image into a PNG */
         1576  +    rasterliteImagePrt img;
         1577  +    void *png;
         1578  +    int sz;
         1579  +    img = image_from_wavelet (blob_size, blob);
         1580  +    if (!img)
         1581  +      {
         1582  +	  *png_size = 0;
         1583  +	  *png_blob = NULL;
         1584  +	  return RASTERLITE_ERROR;
         1585  +      }
         1586  +    if (img->color_space == COLORSPACE_GRAYSCALE)
         1587  +	png = image_to_png_grayscale (img, &sz);
         1588  +    else
         1589  +	png = image_to_png_rgb (img, &sz);
         1590  +    *png_size = sz;
         1591  +    *png_blob = png;
         1592  +    return RASTERLITE_OK;
         1593  +}
  1572   1594   
  1573   1595   RASTERLITE_DECLARE int
  1574   1596   rasterliteExportGeoTiff (void *handle, const char *img_path, void *raster,
  1575   1597   			 int size, double cx, double cy, double pixel_x_size,
  1576   1598   			 double pixel_y_size, int width, int height)
  1577   1599   {
  1578   1600   /* exporting a TIFF as a GeoTIFF */

Deleted lib/rasterlite_aux.c.

     1         -/* 
     2         -/ rasterlite_aux.c
     3         -/
     4         -/ RAW image helpers
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Sandro Furieri a.furieri@lqt.it
     9         -/
    10         -/ Copyright (C) 2009  Alessandro Furieri
    11         -/
    12         -/    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
    14         -/    the Free Software Foundation, either version 3 of the License, or
    15         -/    (at your option) any later version.
    16         -/
    17         -/    This program is distributed in the hope that it will be useful,
    18         -/    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19         -/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
    21         -/
    22         -/    You should have received a copy of the GNU Lesser General Public License
    23         -/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24         -/
    25         -*/
    26         -
    27         -#include <stdlib.h>
    28         -#include <stdio.h>
    29         -#include <string.h>
    30         -#include <float.h>
    31         -#include <math.h>
    32         -
    33         -#ifdef _WIN32
    34         -#include <io.h>
    35         -#else
    36         -#include <unistd.h>
    37         -#endif
    38         -
    39         -#include "rasterlite_tiff_hdrs.h"
    40         -#include <tiffio.h>
    41         -
    42         -#ifdef SPATIALITE_AMALGAMATION
    43         -#include <spatialite/sqlite3.h>
    44         -#else
    45         -#include <sqlite3.h>
    46         -#endif
    47         -
    48         -#include <spatialite/gaiaexif.h>
    49         -#include <spatialite/gaiageo.h>
    50         -#include <spatialite.h>
    51         -
    52         -#include "rasterlite.h"
    53         -#include "rasterlite_internals.h"
    54         -
    55         -RASTERLITE_DECLARE int
    56         -rasterliteJpegBlobToRawImage (const void *blob, int blob_size, int raw_format,
    57         -			      void **raw, int *width, int *height)
    58         -{
    59         -/* decompressing a Jpeg compressed image and returning a RAW image */
    60         -    void *raw_array;
    61         -    int size;
    62         -    rasterliteImagePtr img = NULL;
    63         -    char *errmsg;
    64         -
    65         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
    66         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
    67         -	|| raw_format == GAIA_BGRA_ARRAY)
    68         -	;
    69         -    else
    70         -      {
    71         -	  errmsg = "invalid raster RAW format";
    72         -	  goto error;
    73         -      }
    74         -
    75         -    img = image_from_jpeg (blob_size, blob);
    76         -    if (!img)
    77         -      {
    78         -	  errmsg = "Jpeg decoder error";
    79         -	  goto error;
    80         -      }
    81         -
    82         -    if (raw_format == GAIA_RGB_ARRAY)
    83         -      {
    84         -	  raw_array = image_to_rgb_array (img, &size);
    85         -	  if (!raw_array)
    86         -	    {
    87         -		errmsg = "RGB ARRAY generation error";
    88         -		goto error;
    89         -	    }
    90         -      }
    91         -    if (raw_format == GAIA_RGBA_ARRAY)
    92         -      {
    93         -	  raw_array = image_to_rgba_array (-1, img, &size);
    94         -	  if (!raw_array)
    95         -	    {
    96         -		errmsg = "RGBA ARRAY generation error";
    97         -		goto error;
    98         -	    }
    99         -      }
   100         -    if (raw_format == GAIA_ARGB_ARRAY)
   101         -      {
   102         -	  raw_array = image_to_argb_array (-1, img, &size);
   103         -	  if (!raw_array)
   104         -	    {
   105         -		errmsg = "ARGB ARRAY generation error";
   106         -		goto error;
   107         -	    }
   108         -      }
   109         -    if (raw_format == GAIA_BGR_ARRAY)
   110         -      {
   111         -	  raw_array = image_to_bgr_array (img, &size);
   112         -	  if (!raw_array)
   113         -	    {
   114         -		errmsg = "BGR ARRAY generation error";
   115         -		goto error;
   116         -	    }
   117         -      }
   118         -    if (raw_format == GAIA_BGRA_ARRAY)
   119         -      {
   120         -	  raw_array = image_to_bgra_array (-1, img, &size);
   121         -	  if (!raw_array)
   122         -	    {
   123         -		errmsg = "BGRA ARRAY generation error";
   124         -		goto error;
   125         -	    }
   126         -      }
   127         -
   128         -    image_destroy (img);
   129         -    *raw = raw_array;
   130         -    *width = img->sx;
   131         -    *height = img->sy;
   132         -    return RASTERLITE_OK;
   133         -
   134         -  error:
   135         -    fprintf (stderr, "%s\n", errmsg);
   136         -    if (img)
   137         -	image_destroy (img);
   138         -    *raw = NULL;
   139         -    *width = 0;
   140         -    *height = 0;
   141         -    return RASTERLITE_ERROR;
   142         -}
   143         -
   144         -RASTERLITE_DECLARE int
   145         -rasterlitePngBlobToRawImage (const void *blob, int blob_size, int raw_format,
   146         -			     void **raw, int *width, int *height)
   147         -{
   148         -/* decompressing a Png compressed image and returning a RAW image*/
   149         -    void *raw_array;
   150         -    int size;
   151         -    rasterliteImagePtr img = NULL;
   152         -    char *errmsg;
   153         -
   154         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   155         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   156         -	|| raw_format == GAIA_BGRA_ARRAY)
   157         -	;
   158         -    else
   159         -      {
   160         -	  errmsg = "invalid raster RAW format";
   161         -	  goto error;
   162         -      }
   163         -
   164         -    img = image_from_png (blob_size, blob);
   165         -    if (!img)
   166         -      {
   167         -	  errmsg = "Png decoder error";
   168         -	  goto error;
   169         -      }
   170         -
   171         -    if (raw_format == GAIA_RGB_ARRAY)
   172         -      {
   173         -	  raw_array = image_to_rgb_array (img, &size);
   174         -	  if (!raw_array)
   175         -	    {
   176         -		errmsg = "RGB ARRAY generation error";
   177         -		goto error;
   178         -	    }
   179         -      }
   180         -    if (raw_format == GAIA_RGBA_ARRAY)
   181         -      {
   182         -	  raw_array = image_to_rgba_array (-1, img, &size);
   183         -	  if (!raw_array)
   184         -	    {
   185         -		errmsg = "RGBA ARRAY generation error";
   186         -		goto error;
   187         -	    }
   188         -      }
   189         -    if (raw_format == GAIA_ARGB_ARRAY)
   190         -      {
   191         -	  raw_array = image_to_argb_array (-1, img, &size);
   192         -	  if (!raw_array)
   193         -	    {
   194         -		errmsg = "ARGB ARRAY generation error";
   195         -		goto error;
   196         -	    }
   197         -      }
   198         -    if (raw_format == GAIA_BGR_ARRAY)
   199         -      {
   200         -	  raw_array = image_to_bgr_array (img, &size);
   201         -	  if (!raw_array)
   202         -	    {
   203         -		errmsg = "BGR ARRAY generation error";
   204         -		goto error;
   205         -	    }
   206         -      }
   207         -    if (raw_format == GAIA_BGRA_ARRAY)
   208         -      {
   209         -	  raw_array = image_to_bgra_array (-1, img, &size);
   210         -	  if (!raw_array)
   211         -	    {
   212         -		errmsg = "BGRA ARRAY generation error";
   213         -		goto error;
   214         -	    }
   215         -      }
   216         -
   217         -    image_destroy (img);
   218         -    *raw = raw_array;
   219         -    *width = img->sx;
   220         -    *height = img->sy;
   221         -    return RASTERLITE_OK;
   222         -
   223         -  error:
   224         -    fprintf (stderr, "%s\n", errmsg);
   225         -    if (img)
   226         -	image_destroy (img);
   227         -    *raw = NULL;
   228         -    *width = 0;
   229         -    *height = 0;
   230         -    return RASTERLITE_ERROR;
   231         -}
   232         -
   233         -RASTERLITE_DECLARE int
   234         -rasterliteGifBlobToRawImage (const void *blob, int blob_size, int raw_format,
   235         -			     void **raw, int *width, int *height)
   236         -{
   237         -/* decompressing a GIF compressed image and returning a RAW image */
   238         -    void *raw_array;
   239         -    int size;
   240         -    rasterliteImagePtr img = NULL;
   241         -    char *errmsg;
   242         -
   243         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   244         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   245         -	|| raw_format == GAIA_BGRA_ARRAY)
   246         -	;
   247         -    else
   248         -      {
   249         -	  errmsg = "invalid raster RAW format";
   250         -	  goto error;
   251         -      }
   252         -
   253         -    img = image_from_gif (blob_size, blob);
   254         -    if (!img)
   255         -      {
   256         -	  errmsg = "Gif decoder error";
   257         -	  goto error;
   258         -      }
   259         -
   260         -    if (raw_format == GAIA_RGB_ARRAY)
   261         -      {
   262         -	  raw_array = image_to_rgb_array (img, &size);
   263         -	  if (!raw_array)
   264         -	    {
   265         -		errmsg = "RGB ARRAY generation error";
   266         -		goto error;
   267         -	    }
   268         -      }
   269         -    if (raw_format == GAIA_RGBA_ARRAY)
   270         -      {
   271         -	  raw_array = image_to_rgba_array (-1, img, &size);
   272         -	  if (!raw_array)
   273         -	    {
   274         -		errmsg = "RGBA ARRAY generation error";
   275         -		goto error;
   276         -	    }
   277         -      }
   278         -    if (raw_format == GAIA_ARGB_ARRAY)
   279         -      {
   280         -	  raw_array = image_to_argb_array (-1, img, &size);
   281         -	  if (!raw_array)
   282         -	    {
   283         -		errmsg = "ARGB ARRAY generation error";
   284         -		goto error;
   285         -	    }
   286         -      }
   287         -    if (raw_format == GAIA_BGR_ARRAY)
   288         -      {
   289         -	  raw_array = image_to_bgr_array (img, &size);
   290         -	  if (!raw_array)
   291         -	    {
   292         -		errmsg = "BGR ARRAY generation error";
   293         -		goto error;
   294         -	    }
   295         -      }
   296         -    if (raw_format == GAIA_BGRA_ARRAY)
   297         -      {
   298         -	  raw_array = image_to_bgra_array (-1, img, &size);
   299         -	  if (!raw_array)
   300         -	    {
   301         -		errmsg = "BGRA ARRAY generation error";
   302         -		goto error;
   303         -	    }
   304         -      }
   305         -
   306         -    image_destroy (img);
   307         -    *raw = raw_array;
   308         -    *width = img->sx;
   309         -    *height = img->sy;
   310         -    return RASTERLITE_OK;
   311         -
   312         -  error:
   313         -    fprintf (stderr, "%s\n", errmsg);
   314         -    if (img)
   315         -	image_destroy (img);
   316         -    *raw = NULL;
   317         -    *width = 0;
   318         -    *height = 0;
   319         -    return RASTERLITE_ERROR;
   320         -}
   321         -
   322         -RASTERLITE_DECLARE int
   323         -rasterliteTiffBlobToRawImage (const void *blob, int blob_size, int raw_format,
   324         -			      void **raw, int *width, int *height)
   325         -{
   326         -/* decoding a TIFF encoded image and returning a RAW image */
   327         -    void *raw_array;
   328         -    int size;
   329         -    rasterliteImagePtr img = NULL;
   330         -    char *errmsg;
   331         -
   332         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   333         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   334         -	|| raw_format == GAIA_BGRA_ARRAY)
   335         -	;
   336         -    else
   337         -      {
   338         -	  errmsg = "invalid raster RAW format";
   339         -	  goto error;
   340         -      }
   341         -
   342         -    img = image_from_tiff (blob_size, blob);
   343         -    if (!img)
   344         -      {
   345         -	  errmsg = "Tiff decoder error";
   346         -	  goto error;
   347         -      }
   348         -
   349         -    if (raw_format == GAIA_RGB_ARRAY)
   350         -      {
   351         -	  raw_array = image_to_rgb_array (img, &size);
   352         -	  if (!raw_array)
   353         -	    {
   354         -		errmsg = "RGB ARRAY generation error";
   355         -		goto error;
   356         -	    }
   357         -      }
   358         -    if (raw_format == GAIA_RGBA_ARRAY)
   359         -      {
   360         -	  raw_array = image_to_rgba_array (-1, img, &size);
   361         -	  if (!raw_array)
   362         -	    {
   363         -		errmsg = "RGBA ARRAY generation error";
   364         -		goto error;
   365         -	    }
   366         -      }
   367         -    if (raw_format == GAIA_ARGB_ARRAY)
   368         -      {
   369         -	  raw_array = image_to_argb_array (-1, img, &size);
   370         -	  if (!raw_array)
   371         -	    {
   372         -		errmsg = "ARGB ARRAY generation error";
   373         -		goto error;
   374         -	    }
   375         -      }
   376         -    if (raw_format == GAIA_BGR_ARRAY)
   377         -      {
   378         -	  raw_array = image_to_bgr_array (img, &size);
   379         -	  if (!raw_array)
   380         -	    {
   381         -		errmsg = "BGR ARRAY generation error";
   382         -		goto error;
   383         -	    }
   384         -      }
   385         -    if (raw_format == GAIA_BGRA_ARRAY)
   386         -      {
   387         -	  raw_array = image_to_bgra_array (-1, img, &size);
   388         -	  if (!raw_array)
   389         -	    {
   390         -		errmsg = "BGRA ARRAY generation error";
   391         -		goto error;
   392         -	    }
   393         -      }
   394         -
   395         -    image_destroy (img);
   396         -    *raw = raw_array;
   397         -    *width = img->sx;
   398         -    *height = img->sy;
   399         -    return RASTERLITE_OK;
   400         -
   401         -  error:
   402         -    fprintf (stderr, "%s\n", errmsg);
   403         -    if (img)
   404         -	image_destroy (img);
   405         -    *raw = NULL;
   406         -    *width = 0;
   407         -    *height = 0;
   408         -    return RASTERLITE_ERROR;
   409         -}
   410         -
   411         -RASTERLITE_DECLARE int
   412         -rasterliteRawImageToJpegFile (const void *raw, int raw_format, int width,
   413         -			      int height, const char *path, int quality)
   414         -{
   415         -/* exports a RAW image into a JPEG compressed file */
   416         -    rasterliteImagePtr img = NULL;
   417         -    void *blob = NULL;
   418         -    int blob_size;
   419         -    char *errmsg;
   420         -    int err = 0;
   421         -    FILE *out;
   422         -
   423         -    if (raw == NULL)
   424         -      {
   425         -	  errmsg = "NULL RAW image";
   426         -	  goto error;
   427         -      }
   428         -    if (width <= 0 || height <= 0)
   429         -      {
   430         -	  errmsg = "invalid RAW image width/height";
   431         -	  goto error;
   432         -      }
   433         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   434         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   435         -	|| raw_format == GAIA_BGRA_ARRAY)
   436         -	;
   437         -    else
   438         -      {
   439         -	  errmsg = "invalid raster RAW format";
   440         -	  goto error;
   441         -      }
   442         -    if (raw_format == GAIA_RGB_ARRAY)
   443         -      {
   444         -	  img = image_from_rgb_array (raw, width, height);
   445         -	  if (!img)
   446         -	    {
   447         -		errmsg = "unable to get an image from RGB ARRAY";
   448         -		goto error;
   449         -	    }
   450         -      }
   451         -    if (raw_format == GAIA_RGBA_ARRAY)
   452         -      {
   453         -	  img = image_from_rgba_array (raw, width, height);
   454         -	  if (!img)
   455         -	    {
   456         -		errmsg = "unable to get an image from RGBA ARRAY";
   457         -		goto error;
   458         -	    }
   459         -      }
   460         -    if (raw_format == GAIA_ARGB_ARRAY)
   461         -      {
   462         -	  img = image_from_argb_array (raw, width, height);
   463         -	  if (!img)
   464         -	    {
   465         -		errmsg = "unable to get an image from ARGB ARRAY";
   466         -		goto error;
   467         -	    }
   468         -      }
   469         -    if (raw_format == GAIA_BGR_ARRAY)
   470         -      {
   471         -	  img = image_from_bgr_array (raw, width, height);
   472         -	  if (!img)
   473         -	    {
   474         -		errmsg = "unable to get an image from BGR ARRAY";
   475         -		goto error;
   476         -	    }
   477         -      }
   478         -    if (raw_format == GAIA_BGRA_ARRAY)
   479         -      {
   480         -	  img = image_from_bgra_array (raw, width, height);
   481         -	  if (!img)
   482         -	    {
   483         -		errmsg = "unable to get an image from BGRA ARRAY";
   484         -		goto error;
   485         -	    }
   486         -      }
   487         -
   488         -/* compressing as JPEG */
   489         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   490         -	blob = image_to_jpeg_grayscale (img, &blob_size, quality);
   491         -    else
   492         -	blob = image_to_jpeg (img, &blob_size, quality);
   493         -    if (!blob)
   494         -      {
   495         -	  errmsg = "Jpeg encoder error";
   496         -	  goto error;
   497         -      }
   498         -
   499         -/* exporting to file */
   500         -    out = fopen (path, "wb");
   501         -    if (out == NULL)
   502         -      {
   503         -	  errmsg = "Unable to create output image";
   504         -	  goto error;
   505         -      }
   506         -    if (fwrite (blob, 1, blob_size, out) != (size_t) blob_size)
   507         -	err = 1;
   508         -    fclose (out);
   509         -    if (err)
   510         -      {
   511         -	  unlink (path);
   512         -	  goto error;
   513         -      }
   514         -    free (blob);
   515         -    image_destroy (img);
   516         -    return RASTERLITE_OK;
   517         -
   518         -  error:
   519         -    fprintf (stderr, "%s\n", errmsg);
   520         -    if (img)
   521         -	image_destroy (img);
   522         -    if (blob)
   523         -	free (blob);
   524         -    return RASTERLITE_ERROR;
   525         -}
   526         -
   527         -RASTERLITE_DECLARE unsigned char *
   528         -rasterliteRawImageToJpegMemBuf (const void *raw, int raw_format, int width,
   529         -				int height, int *size, int quality)
   530         -{
   531         -/* exports a RAW image into a JPEG compressed memory buffer */
   532         -    rasterliteImagePtr img = NULL;
   533         -    void *blob = NULL;
   534         -    int blob_size;
   535         -    char *errmsg;
   536         -    int err = 0;
   537         -
   538         -    if (raw == NULL)
   539         -      {
   540         -	  errmsg = "NULL RAW image";
   541         -	  goto error;
   542         -      }
   543         -    if (width <= 0 || height <= 0)
   544         -      {
   545         -	  errmsg = "invalid RAW image width/height";
   546         -	  goto error;
   547         -      }
   548         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   549         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   550         -	|| raw_format == GAIA_BGRA_ARRAY)
   551         -	;
   552         -    else
   553         -      {
   554         -	  errmsg = "invalid raster RAW format";
   555         -	  goto error;
   556         -      }
   557         -    if (raw_format == GAIA_RGB_ARRAY)
   558         -      {
   559         -	  img = image_from_rgb_array (raw, width, height);
   560         -	  if (!img)
   561         -	    {
   562         -		errmsg = "unable to get an image from RGB ARRAY";
   563         -		goto error;
   564         -	    }
   565         -      }
   566         -    if (raw_format == GAIA_RGBA_ARRAY)
   567         -      {
   568         -	  img = image_from_rgba_array (raw, width, height);
   569         -	  if (!img)
   570         -	    {
   571         -		errmsg = "unable to get an image from RGBA ARRAY";
   572         -		goto error;
   573         -	    }
   574         -      }
   575         -    if (raw_format == GAIA_ARGB_ARRAY)
   576         -      {
   577         -	  img = image_from_argb_array (raw, width, height);
   578         -	  if (!img)
   579         -	    {
   580         -		errmsg = "unable to get an image from ARGB ARRAY";
   581         -		goto error;
   582         -	    }
   583         -      }
   584         -    if (raw_format == GAIA_BGR_ARRAY)
   585         -      {
   586         -	  img = image_from_bgr_array (raw, width, height);
   587         -	  if (!img)
   588         -	    {
   589         -		errmsg = "unable to get an image from BGR ARRAY";
   590         -		goto error;
   591         -	    }
   592         -      }
   593         -    if (raw_format == GAIA_BGRA_ARRAY)
   594         -      {
   595         -	  img = image_from_bgra_array (raw, width, height);
   596         -	  if (!img)
   597         -	    {
   598         -		errmsg = "unable to get an image from BGRA ARRAY";
   599         -		goto error;
   600         -	    }
   601         -      }
   602         -
   603         -/* compressing as JPEG */
   604         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   605         -	blob = image_to_jpeg_grayscale (img, &blob_size, quality);
   606         -    else
   607         -	blob = image_to_jpeg (img, &blob_size, quality);
   608         -    if (!blob)
   609         -      {
   610         -	  errmsg = "Jpeg encoder error";
   611         -	  goto error;
   612         -      }
   613         -
   614         -/* exporting the memory buffer */
   615         -    image_destroy (img);
   616         -    *size = blob_size;
   617         -    return blob;
   618         -
   619         -  error:
   620         -    fprintf (stderr, "%s\n", errmsg);
   621         -    if (img)
   622         -	image_destroy (img);
   623         -    if (blob)
   624         -	free (blob);
   625         -    *size = 0;
   626         -    return NULL;
   627         -}
   628         -
   629         -RASTERLITE_DECLARE int
   630         -rasterliteRawImageToPngFile (const void *raw, int raw_format, int width,
   631         -			     int height, const char *path)
   632         -{
   633         -/* exports a RAW image into a PNG compressed file */
   634         -    rasterliteImagePtr img = NULL;
   635         -    void *blob = NULL;
   636         -    int blob_size;
   637         -    char *errmsg;
   638         -    int err = 0;
   639         -    FILE *out;
   640         -
   641         -    if (raw == NULL)
   642         -      {
   643         -	  errmsg = "NULL RAW image";
   644         -	  goto error;
   645         -      }
   646         -    if (width <= 0 || height <= 0)
   647         -      {
   648         -	  errmsg = "invalid RAW image width/height";
   649         -	  goto error;
   650         -      }
   651         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   652         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   653         -	|| raw_format == GAIA_BGRA_ARRAY)
   654         -	;
   655         -    else
   656         -      {
   657         -	  errmsg = "invalid raster RAW format";
   658         -	  goto error;
   659         -      }
   660         -    if (raw_format == GAIA_RGB_ARRAY)
   661         -      {
   662         -	  img = image_from_rgb_array (raw, width, height);
   663         -	  if (!img)
   664         -	    {
   665         -		errmsg = "unable to get an image from RGB ARRAY";
   666         -		goto error;
   667         -	    }
   668         -      }
   669         -    if (raw_format == GAIA_RGBA_ARRAY)
   670         -      {
   671         -	  img = image_from_rgba_array (raw, width, height);
   672         -	  if (!img)
   673         -	    {
   674         -		errmsg = "unable to get an image from RGBA ARRAY";
   675         -		goto error;
   676         -	    }
   677         -      }
   678         -    if (raw_format == GAIA_ARGB_ARRAY)
   679         -      {
   680         -	  img = image_from_argb_array (raw, width, height);
   681         -	  if (!img)
   682         -	    {
   683         -		errmsg = "unable to get an image from ARGB ARRAY";
   684         -		goto error;
   685         -	    }
   686         -      }
   687         -    if (raw_format == GAIA_BGR_ARRAY)
   688         -      {
   689         -	  img = image_from_bgr_array (raw, width, height);
   690         -	  if (!img)
   691         -	    {
   692         -		errmsg = "unable to get an image from BGR ARRAY";
   693         -		goto error;
   694         -	    }
   695         -      }
   696         -    if (raw_format == GAIA_BGRA_ARRAY)
   697         -      {
   698         -	  img = image_from_bgra_array (raw, width, height);
   699         -	  if (!img)
   700         -	    {
   701         -		errmsg = "unable to get an image from BGRA ARRAY";
   702         -		goto error;
   703         -	    }
   704         -      }
   705         -
   706         -/* compressing as PNG */
   707         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   708         -	blob = image_to_png_grayscale (img, &blob_size);
   709         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
   710         -	blob = image_to_png_palette (img, &blob_size);
   711         -    else
   712         -	blob = image_to_png_rgb (img, &blob_size);
   713         -    if (!blob)
   714         -      {
   715         -	  errmsg = "Png encoder error";
   716         -	  goto error;
   717         -      }
   718         -
   719         -/* exporting to file */
   720         -    out = fopen (path, "wb");
   721         -    if (out == NULL)
   722         -      {
   723         -	  errmsg = "Unable to create output image";
   724         -	  goto error;
   725         -      }
   726         -    if (fwrite (blob, 1, blob_size, out) != (size_t) blob_size)
   727         -	err = 1;
   728         -    fclose (out);
   729         -    if (err)
   730         -      {
   731         -	  unlink (path);
   732         -	  goto error;
   733         -      }
   734         -    free (blob);
   735         -    image_destroy (img);
   736         -    return RASTERLITE_OK;
   737         -
   738         -  error:
   739         -    fprintf (stderr, "%s\n", errmsg);
   740         -    if (img)
   741         -	image_destroy (img);
   742         -    if (blob)
   743         -	free (blob);
   744         -    return RASTERLITE_ERROR;
   745         -}
   746         -
   747         -RASTERLITE_DECLARE unsigned char *
   748         -rasterliteRawImageToPngMemBuf (const void *raw, int raw_format, int width,
   749         -			       int height, int *size)
   750         -{
   751         -/* exports a RAW image into a PNG compressed memory buffer */
   752         -    rasterliteImagePtr img = NULL;
   753         -    void *blob = NULL;
   754         -    int blob_size;
   755         -    char *errmsg;
   756         -    int err = 0;
   757         -
   758         -    if (raw == NULL)
   759         -      {
   760         -	  errmsg = "NULL RAW image";
   761         -	  goto error;
   762         -      }
   763         -    if (width <= 0 || height <= 0)
   764         -      {
   765         -	  errmsg = "invalid RAW image width/height";
   766         -	  goto error;
   767         -      }
   768         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   769         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   770         -	|| raw_format == GAIA_BGRA_ARRAY)
   771         -	;
   772         -    else
   773         -      {
   774         -	  errmsg = "invalid raster RAW format";
   775         -	  goto error;
   776         -      }
   777         -    if (raw_format == GAIA_RGB_ARRAY)
   778         -      {
   779         -	  img = image_from_rgb_array (raw, width, height);
   780         -	  if (!img)
   781         -	    {
   782         -		errmsg = "unable to get an image from RGB ARRAY";
   783         -		goto error;
   784         -	    }
   785         -      }
   786         -    if (raw_format == GAIA_RGBA_ARRAY)
   787         -      {
   788         -	  img = image_from_rgba_array (raw, width, height);
   789         -	  if (!img)
   790         -	    {
   791         -		errmsg = "unable to get an image from RGBA ARRAY";
   792         -		goto error;
   793         -	    }
   794         -      }
   795         -    if (raw_format == GAIA_ARGB_ARRAY)
   796         -      {
   797         -	  img = image_from_argb_array (raw, width, height);
   798         -	  if (!img)
   799         -	    {
   800         -		errmsg = "unable to get an image from ARGB ARRAY";
   801         -		goto error;
   802         -	    }
   803         -      }
   804         -    if (raw_format == GAIA_BGR_ARRAY)
   805         -      {
   806         -	  img = image_from_bgr_array (raw, width, height);
   807         -	  if (!img)
   808         -	    {
   809         -		errmsg = "unable to get an image from BGR ARRAY";
   810         -		goto error;
   811         -	    }
   812         -      }
   813         -    if (raw_format == GAIA_BGRA_ARRAY)
   814         -      {
   815         -	  img = image_from_bgra_array (raw, width, height);
   816         -	  if (!img)
   817         -	    {
   818         -		errmsg = "unable to get an image from BGRA ARRAY";
   819         -		goto error;
   820         -	    }
   821         -      }
   822         -
   823         -/* compressing as PNG */
   824         -    if (is_image_grayscale (img) == RASTERLITE_TRUE)
   825         -	blob = image_to_png_grayscale (img, &blob_size);
   826         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
   827         -	blob = image_to_png_palette (img, &blob_size);
   828         -    else
   829         -	blob = image_to_png_rgb (img, &blob_size);
   830         -    if (!blob)
   831         -      {
   832         -	  errmsg = "Png encoder error";
   833         -	  goto error;
   834         -      }
   835         -
   836         -/* exporting the memory buffer */
   837         -    image_destroy (img);
   838         -    *size = blob_size;
   839         -    return blob;
   840         -
   841         -  error:
   842         -    fprintf (stderr, "%s\n", errmsg);
   843         -    if (img)
   844         -	image_destroy (img);
   845         -    if (blob)
   846         -	free (blob);
   847         -    *size = 0;
   848         -    return NULL;
   849         -}
   850         -
   851         -RASTERLITE_DECLARE int
   852         -rasterliteRawImageToGifFile (const void *raw, int raw_format, int width,
   853         -			     int height, const char *path)
   854         -{
   855         -/* exports a RAW image into a GIF compressed file */
   856         -    rasterliteImagePtr img = NULL;
   857         -    void *blob = NULL;
   858         -    int blob_size;
   859         -    char *errmsg;
   860         -    int err = 0;
   861         -    FILE *out;
   862         -
   863         -    if (raw == NULL)
   864         -      {
   865         -	  errmsg = "NULL RAW image";
   866         -	  goto error;
   867         -      }
   868         -    if (width <= 0 || height <= 0)
   869         -      {
   870         -	  errmsg = "invalid RAW image width/height";
   871         -	  goto error;
   872         -      }
   873         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   874         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   875         -	|| raw_format == GAIA_BGRA_ARRAY)
   876         -	;
   877         -    else
   878         -      {
   879         -	  errmsg = "invalid raster RAW format";
   880         -	  goto error;
   881         -      }
   882         -    if (raw_format == GAIA_RGB_ARRAY)
   883         -      {
   884         -	  img = image_from_rgb_array (raw, width, height);
   885         -	  if (!img)
   886         -	    {
   887         -		errmsg = "unable to get an image from RGB ARRAY";
   888         -		goto error;
   889         -	    }
   890         -      }
   891         -    if (raw_format == GAIA_RGBA_ARRAY)
   892         -      {
   893         -	  img = image_from_rgba_array (raw, width, height);
   894         -	  if (!img)
   895         -	    {
   896         -		errmsg = "unable to get an image from RGBA ARRAY";
   897         -		goto error;
   898         -	    }
   899         -      }
   900         -    if (raw_format == GAIA_ARGB_ARRAY)
   901         -      {
   902         -	  img = image_from_argb_array (raw, width, height);
   903         -	  if (!img)
   904         -	    {
   905         -		errmsg = "unable to get an image from ARGB ARRAY";
   906         -		goto error;
   907         -	    }
   908         -      }
   909         -    if (raw_format == GAIA_BGR_ARRAY)
   910         -      {
   911         -	  img = image_from_bgr_array (raw, width, height);
   912         -	  if (!img)
   913         -	    {
   914         -		errmsg = "unable to get an image from BGR ARRAY";
   915         -		goto error;
   916         -	    }
   917         -      }
   918         -    if (raw_format == GAIA_BGRA_ARRAY)
   919         -      {
   920         -	  img = image_from_bgra_array (raw, width, height);
   921         -	  if (!img)
   922         -	    {
   923         -		errmsg = "unable to get an image from BGRA ARRAY";
   924         -		goto error;
   925         -	    }
   926         -      }
   927         -
   928         -/* compressing as GIF */
   929         -    if (is_image_palette256 (img) == RASTERLITE_FALSE)
   930         -	image_resample_as_palette256 (img);
   931         -
   932         -    blob = image_to_gif (img, &blob_size);
   933         -    if (!blob)
   934         -      {
   935         -	  errmsg = "Gif encoder error";
   936         -	  goto error;
   937         -      }
   938         -
   939         -/* exporting to file */
   940         -    out = fopen (path, "wb");
   941         -    if (out == NULL)
   942         -      {
   943         -	  errmsg = "Unable to create output image";
   944         -	  goto error;
   945         -      }
   946         -    if (fwrite (blob, 1, blob_size, out) != (size_t) blob_size)
   947         -	err = 1;
   948         -    fclose (out);
   949         -    if (err)
   950         -      {
   951         -	  unlink (path);
   952         -	  goto error;
   953         -      }
   954         -    free (blob);
   955         -    image_destroy (img);
   956         -    return RASTERLITE_OK;
   957         -
   958         -  error:
   959         -    fprintf (stderr, "%s\n", errmsg);
   960         -    if (img)
   961         -	image_destroy (img);
   962         -    if (blob)
   963         -	free (blob);
   964         -    return RASTERLITE_ERROR;
   965         -}
   966         -
   967         -RASTERLITE_DECLARE unsigned char *
   968         -rasterliteRawImageToGifMemBuf (const void *raw, int raw_format, int width,
   969         -			       int height, int *size)
   970         -{
   971         -/* exports a RAW image into a GIF compressed memory buffer */
   972         -    rasterliteImagePtr img = NULL;
   973         -    void *blob = NULL;
   974         -    int blob_size;
   975         -    char *errmsg;
   976         -    int err = 0;
   977         -
   978         -    if (raw == NULL)
   979         -      {
   980         -	  errmsg = "NULL RAW image";
   981         -	  goto error;
   982         -      }
   983         -    if (width <= 0 || height <= 0)
   984         -      {
   985         -	  errmsg = "invalid RAW image width/height";
   986         -	  goto error;
   987         -      }
   988         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
   989         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
   990         -	|| raw_format == GAIA_BGRA_ARRAY)
   991         -	;
   992         -    else
   993         -      {
   994         -	  errmsg = "invalid raster RAW format";
   995         -	  goto error;
   996         -      }
   997         -    if (raw_format == GAIA_RGB_ARRAY)
   998         -      {
   999         -	  img = image_from_rgb_array (raw, width, height);
  1000         -	  if (!img)
  1001         -	    {
  1002         -		errmsg = "unable to get an image from RGB ARRAY";
  1003         -		goto error;
  1004         -	    }
  1005         -      }
  1006         -    if (raw_format == GAIA_RGBA_ARRAY)
  1007         -      {
  1008         -	  img = image_from_rgba_array (raw, width, height);
  1009         -	  if (!img)
  1010         -	    {
  1011         -		errmsg = "unable to get an image from RGBA ARRAY";
  1012         -		goto error;
  1013         -	    }
  1014         -      }
  1015         -    if (raw_format == GAIA_ARGB_ARRAY)
  1016         -      {
  1017         -	  img = image_from_argb_array (raw, width, height);
  1018         -	  if (!img)
  1019         -	    {
  1020         -		errmsg = "unable to get an image from ARGB ARRAY";
  1021         -		goto error;
  1022         -	    }
  1023         -      }
  1024         -    if (raw_format == GAIA_BGR_ARRAY)
  1025         -      {
  1026         -	  img = image_from_bgr_array (raw, width, height);
  1027         -	  if (!img)
  1028         -	    {
  1029         -		errmsg = "unable to get an image from BGR ARRAY";
  1030         -		goto error;
  1031         -	    }
  1032         -      }
  1033         -    if (raw_format == GAIA_BGRA_ARRAY)
  1034         -      {
  1035         -	  img = image_from_bgra_array (raw, width, height);
  1036         -	  if (!img)
  1037         -	    {
  1038         -		errmsg = "unable to get an image from BGRA ARRAY";
  1039         -		goto error;
  1040         -	    }
  1041         -      }
  1042         -
  1043         -/* compressing as GIF */
  1044         -    if (is_image_palette256 (img) == RASTERLITE_FALSE)
  1045         -	image_resample_as_palette256 (img);
  1046         -
  1047         -    blob = image_to_gif (img, &blob_size);
  1048         -    if (!blob)
  1049         -      {
  1050         -	  errmsg = "Gif encoder error";
  1051         -	  goto error;
  1052         -      }
  1053         -
  1054         -/* exporting the memory buffer */
  1055         -    image_destroy (img);
  1056         -    *size = blob_size;
  1057         -    return blob;
  1058         -
  1059         -  error:
  1060         -    fprintf (stderr, "%s\n", errmsg);
  1061         -    if (img)
  1062         -	image_destroy (img);
  1063         -    if (blob)
  1064         -	free (blob);
  1065         -    *size = 0;
  1066         -    return NULL;
  1067         -}
  1068         -
  1069         -RASTERLITE_DECLARE int
  1070         -rasterliteRawImageToGeoTiffFile (const void *raw, int raw_format, int width,
  1071         -				 int height, const char *path, double x_size,
  1072         -				 double y_size, double xllcorner,
  1073         -				 double yllcorner, const char *proj4text)
  1074         -{
  1075         -/* exports a RAW image into a TIFF encoded file */
  1076         -    rasterliteImagePtr img = NULL;
  1077         -    void *blob = NULL;
  1078         -    int blob_size;
  1079         -    char *errmsg;
  1080         -
  1081         -    if (raw == NULL)
  1082         -      {
  1083         -	  errmsg = "NULL RAW image";
  1084         -	  goto error;
  1085         -      }
  1086         -    if (width <= 0 || height <= 0)
  1087         -      {
  1088         -	  errmsg = "invalid RAW image width/height";
  1089         -	  goto error;
  1090         -      }
  1091         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
  1092         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
  1093         -	|| raw_format == GAIA_BGRA_ARRAY)
  1094         -	;
  1095         -    else
  1096         -      {
  1097         -	  errmsg = "invalid raster RAW format";
  1098         -	  goto error;
  1099         -      }
  1100         -    if (raw_format == GAIA_RGB_ARRAY)
  1101         -      {
  1102         -	  img = image_from_rgb_array (raw, width, height);
  1103         -	  if (!img)
  1104         -	    {
  1105         -		errmsg = "unable to get an image from RGB ARRAY";
  1106         -		goto error;
  1107         -	    }
  1108         -      }
  1109         -    if (raw_format == GAIA_RGBA_ARRAY)
  1110         -      {
  1111         -	  img = image_from_rgba_array (raw, width, height);
  1112         -	  if (!img)
  1113         -	    {
  1114         -		errmsg = "unable to get an image from RGBA ARRAY";
  1115         -		goto error;
  1116         -	    }
  1117         -      }
  1118         -    if (raw_format == GAIA_ARGB_ARRAY)
  1119         -      {
  1120         -	  img = image_from_argb_array (raw, width, height);
  1121         -	  if (!img)
  1122         -	    {
  1123         -		errmsg = "unable to get an image from ARGB ARRAY";
  1124         -		goto error;
  1125         -	    }
  1126         -      }
  1127         -    if (raw_format == GAIA_BGR_ARRAY)
  1128         -      {
  1129         -	  img = image_from_bgr_array (raw, width, height);
  1130         -	  if (!img)
  1131         -	    {
  1132         -		errmsg = "unable to get an image from BGR ARRAY";
  1133         -		goto error;
  1134         -	    }
  1135         -      }
  1136         -    if (raw_format == GAIA_BGRA_ARRAY)
  1137         -      {
  1138         -	  img = image_from_bgra_array (raw, width, height);
  1139         -	  if (!img)
  1140         -	    {
  1141         -		errmsg = "unable to get an image from BGRA ARRAY";
  1142         -		goto error;
  1143         -	    }
  1144         -      }
  1145         -
  1146         -/* encoding as TIFF */
  1147         -    if (is_image_monochrome (img) == RASTERLITE_TRUE)
  1148         -	blob = image_to_tiff_fax4 (img, &blob_size);
  1149         -    else if (is_image_grayscale (img) == RASTERLITE_TRUE)
  1150         -	blob = image_to_tiff_grayscale (img, &blob_size);
  1151         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
  1152         -	blob = image_to_tiff_palette (img, &blob_size);
  1153         -    else
  1154         -	blob = image_to_tiff_rgb (img, &blob_size);
  1155         -    if (!blob)
  1156         -      {
  1157         -	  errmsg = "Tiff encoder error";
  1158         -	  goto error;
  1159         -      }
  1160         -
  1161         -/* exporting to file as GeoTiff */
  1162         -    if (!write_geotiff
  1163         -	(path, blob, blob_size, x_size, y_size, xllcorner, yllcorner,
  1164         -	 proj4text))
  1165         -      {
  1166         -	  errmsg = "Unable to create output image";
  1167         -	  goto error;
  1168         -      }
  1169         -    free (blob);
  1170         -    image_destroy (img);
  1171         -    return RASTERLITE_OK;
  1172         -
  1173         -  error:
  1174         -    fprintf (stderr, "%s\n", errmsg);
  1175         -    if (img)
  1176         -	image_destroy (img);
  1177         -    if (blob)
  1178         -	free (blob);
  1179         -    return RASTERLITE_ERROR;
  1180         -}
  1181         -
  1182         -RASTERLITE_DECLARE unsigned char *
  1183         -rasterliteRawImageToTiffMemBuf (const void *raw, int raw_format, int width,
  1184         -				int height, int *size)
  1185         -{
  1186         -/* exports a RAW image into a TIFF encoded memory buffer */
  1187         -    rasterliteImagePtr img = NULL;
  1188         -    void *blob = NULL;
  1189         -    int blob_size;
  1190         -    char *errmsg;
  1191         -
  1192         -    if (raw == NULL)
  1193         -      {
  1194         -	  errmsg = "NULL RAW image";
  1195         -	  goto error;
  1196         -      }
  1197         -    if (width <= 0 || height <= 0)
  1198         -      {
  1199         -	  errmsg = "invalid RAW image width/height";
  1200         -	  goto error;
  1201         -      }
  1202         -    if (raw_format == GAIA_RGB_ARRAY || raw_format == GAIA_RGBA_ARRAY
  1203         -	|| raw_format == GAIA_ARGB_ARRAY || raw_format == GAIA_BGR_ARRAY
  1204         -	|| raw_format == GAIA_BGRA_ARRAY)
  1205         -	;
  1206         -    else
  1207         -      {
  1208         -	  errmsg = "invalid raster RAW format";
  1209         -	  goto error;
  1210         -      }
  1211         -    if (raw_format == GAIA_RGB_ARRAY)
  1212         -      {
  1213         -	  img = image_from_rgb_array (raw, width, height);
  1214         -	  if (!img)
  1215         -	    {
  1216         -		errmsg = "unable to get an image from RGB ARRAY";
  1217         -		goto error;
  1218         -	    }
  1219         -      }
  1220         -    if (raw_format == GAIA_RGBA_ARRAY)
  1221         -      {
  1222         -	  img = image_from_rgba_array (raw, width, height);
  1223         -	  if (!img)
  1224         -	    {
  1225         -		errmsg = "unable to get an image from RGBA ARRAY";
  1226         -		goto error;
  1227         -	    }
  1228         -      }
  1229         -    if (raw_format == GAIA_ARGB_ARRAY)
  1230         -      {
  1231         -	  img = image_from_argb_array (raw, width, height);
  1232         -	  if (!img)
  1233         -	    {
  1234         -		errmsg = "unable to get an image from ARGB ARRAY";
  1235         -		goto error;
  1236         -	    }
  1237         -      }
  1238         -    if (raw_format == GAIA_BGR_ARRAY)
  1239         -      {
  1240         -	  img = image_from_bgr_array (raw, width, height);
  1241         -	  if (!img)
  1242         -	    {
  1243         -		errmsg = "unable to get an image from BGR ARRAY";
  1244         -		goto error;
  1245         -	    }
  1246         -      }
  1247         -    if (raw_format == GAIA_BGRA_ARRAY)
  1248         -      {
  1249         -	  img = image_from_bgra_array (raw, width, height);
  1250         -	  if (!img)
  1251         -	    {
  1252         -		errmsg = "unable to get an image from BGRA ARRAY";
  1253         -		goto error;
  1254         -	    }
  1255         -      }
  1256         -
  1257         -/* encoding as TIFF */
  1258         -    if (is_image_monochrome (img) == RASTERLITE_TRUE)
  1259         -	blob = image_to_tiff_fax4 (img, &blob_size);
  1260         -    else if (is_image_grayscale (img) == RASTERLITE_TRUE)
  1261         -	blob = image_to_tiff_grayscale (img, &blob_size);
  1262         -    else if (is_image_palette256 (img) == RASTERLITE_TRUE)
  1263         -	blob = image_to_tiff_palette (img, &blob_size);
  1264         -    else
  1265         -	blob = image_to_tiff_rgb (img, &blob_size);
  1266         -    if (!blob)
  1267         -      {
  1268         -	  errmsg = "Tiff encoder error";
  1269         -	  goto error;
  1270         -      }
  1271         -
  1272         -/* exporting the memory buffer */
  1273         -    image_destroy (img);
  1274         -    *size = blob_size;
  1275         -    return blob;
  1276         -
  1277         -  error:
  1278         -    fprintf (stderr, "%s\n", errmsg);
  1279         -    if (img)
  1280         -	image_destroy (img);
  1281         -    if (blob)
  1282         -	free (blob);
  1283         -    *size = 0;
  1284         -    return NULL;
  1285         -}

Changes to lib/rasterlite_gif.c.

     1      1   /* 
     2      2   / rasterlite_gif.c
     3      3   /
     4      4   / GIF auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdio.h>
    28     28   #include <math.h>
    29     29   #include <string.h>
    30     30   #include <stdlib.h>
    31     31   
    32         -#include <tiffio.h>
    33         -
    34         -#ifdef SPATIALITE_AMALGAMATION
    35     32   #include <spatialite/sqlite3.h>
    36         -#else
    37         -#include <sqlite3.h>
    38         -#endif
    39         -
    40     33   #include <spatialite/gaiageo.h>
           34  +
           35  +#include <tiffio.h>
    41     36   
    42     37   #include "rasterlite_internals.h"
    43     38   
    44     39   /* 
    45     40   /
    46     41   / DISCLAIMER:
    47     42   / all the following code merely is an 'ad hoc' adaption
................................................................................
   369    364   {
   370    365       int rv;
   371    366       rv = LWZReadByte_ (fd, sd, flag, input_code_size, ZeroDataBlockP);
   372    367       return (rv);
   373    368   }
   374    369   
   375    370   static void
   376         -ReadImage (rasterliteImagePtr im, xgdIOCtx * fd, int len, int height,
          371  +ReadImage (rasterliteImagePrt im, xgdIOCtx * fd, int len, int height,
   377    372   	   unsigned char (*cmap)[256], int interlace, int *ZeroDataBlockP)
   378    373   {
   379    374       unsigned char c;
   380    375       int v;
   381    376       int xpos = 0, ypos = 0, pass = 0;
   382    377       int i;
   383    378       int red[256];
................................................................................
   526    521   		      break;
   527    522   		  }
   528    523   	    }
   529    524         }
   530    525   }
   531    526   
   532    527   static int
   533         -GIFNextPixel (rasterliteImagePtr img, GifCtx * ctx)
          528  +GIFNextPixel (rasterliteImagePrt img, GifCtx * ctx)
   534    529   {
   535    530       int r;
   536    531       int **ptpixels = img->pixels;
   537    532       int *pThisRow;
   538    533       if (ctx->CountDown == 0)
   539    534   	return EOF;
   540    535       --(ctx->CountDown);
................................................................................
   674    669   {
   675    670       xgdPutC (w & 0xFF, out);
   676    671       xgdPutC ((w >> 8) & 0xFF, out);
   677    672       return 0;
   678    673   }
   679    674   
   680    675   static void
   681         -GIFcompress (int init_bits, xgdIOCtxPtr outfile, rasterliteImagePtr img,
          676  +GIFcompress (int init_bits, xgdIOCtxPtr outfile, rasterliteImagePrt img,
   682    677   	     GifCtx * ctx)
   683    678   {
   684    679   /*
   685    680    * compress stdin to stdout
   686    681    *
   687    682    * Algorithm:  use open addressing double hashing (no chaining) on the
   688    683    * prefix code / next character combination.  We do a variant of Knuth's
................................................................................
   773    768       ++(ctx->out_count);
   774    769       output ((code_int) ctx->EOFCode, ctx);
   775    770   }
   776    771   
   777    772   static void
   778    773   GIFEncode (xgdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace,
   779    774   	   int Background, int Transparent, int BitsPerPixel, int *Red,
   780         -	   int *Green, int *Blue, rasterliteImagePtr img)
          775  +	   int *Green, int *Blue, rasterliteImagePrt img)
   781    776   {
   782    777       int B;
   783    778       int RWidth, RHeight;
   784    779       int LeftOfs, TopOfs;
   785    780       int Resolution;
   786    781       int ColorMapSize;
   787    782       int InitCodeSize;
................................................................................
   863    858       else if (colors <= 128)
   864    859   	bpp = 7;
   865    860       else if (colors <= 256)
   866    861   	bpp = 8;
   867    862       return bpp;
   868    863   }
   869    864   
   870         -static rasterliteImagePtr
          865  +static rasterliteImagePrt
   871    866   xgdImageCreateFromGifCtx (xgdIOCtxPtr fd)
   872    867   {
   873    868       int BitPixel;
   874    869       int Transparent = (-1);
   875    870       unsigned char buf[16];
   876    871       unsigned char c;
   877    872       unsigned char ColorMap[3][MAXCOLORMAPSIZE];
   878    873       unsigned char localColorMap[3][MAXCOLORMAPSIZE];
   879    874       int imw, imh, screen_width, screen_height;
   880    875       int gif87a, useGlobalColormap;
   881    876       int bitPixel;
   882    877       int ZeroDataBlock = FALSE;
   883    878       int haveGlobalColormap;
   884         -    rasterliteImagePtr im = 0;
          879  +    rasterliteImagePrt im = 0;
   885    880       if (!ReadOK (fd, buf, 6))
   886    881         {
   887    882   	  return 0;
   888    883         }
   889    884       if (strncmp ((char *) buf, "GIF", 3) != 0)
   890    885         {
   891    886   	  return 0;
................................................................................
   989    984         {
   990    985   	  return 0;
   991    986         }
   992    987       return im;
   993    988   }
   994    989   
   995    990   static void
   996         -xgdImageGifCtx (rasterliteImagePtr img, xgdIOCtxPtr out)
          991  +xgdImageGifCtx (rasterliteImagePrt img, xgdIOCtxPtr out)
   997    992   {
   998    993       int BitsPerPixel;
   999    994       int mapping[256];
  1000    995       int Red[256];
  1001    996       int Green[256];
  1002    997       int Blue[256];
  1003    998       int i, j, colors;
................................................................................
  1029   1024         }
  1030   1025       BitsPerPixel = colorstobpp (colors);
  1031   1026       GIFEncode (out, img->sx, img->sy, 0, 0, -1, BitsPerPixel, Red, Green, Blue,
  1032   1027   	       img);
  1033   1028   }
  1034   1029   
  1035   1030   extern void *
  1036         -image_to_gif (const rasterliteImagePtr img, int *size)
         1031  +image_to_gif (const rasterliteImagePrt img, int *size)
  1037   1032   {
  1038   1033   /* compressing an image as GIF */
  1039   1034       void *rv;
  1040   1035       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
  1041   1036       xgdImageGifCtx (img, out);
  1042   1037       rv = xgdDPExtractData (out, size);
  1043   1038       out->xgd_free (out);
  1044   1039       return rv;
  1045   1040   }
  1046   1041   
  1047         -extern rasterliteImagePtr
         1042  +extern rasterliteImagePrt
  1048   1043   image_from_gif (int size, const void *data)
  1049   1044   {
  1050   1045   /* uncompressing a GIF */
  1051         -    rasterliteImagePtr img;
         1046  +    rasterliteImagePrt img;
  1052   1047       xgdIOCtx *in = xgdNewDynamicCtxEx (size, data, 0);
  1053   1048       img = xgdImageCreateFromGifCtx (in);
  1054   1049       img->color_space = COLORSPACE_PALETTE;
  1055   1050       in->xgd_free (in);
  1056   1051       return img;
  1057   1052   }

Changes to lib/rasterlite_image.c.

     1      1   /* 
     2      2   / rasterlite_image.c
     3      3   /
     4      4   / image methods
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdio.h>
    28     28   #include <stdlib.h>
    29     29   #include <string.h>
    30         -#include <float.h>
    31     30   #include <limits.h>
    32     31   
    33     32   #include <tiffio.h>
    34         -
    35         -#ifdef SPATIALITE_AMALGAMATION
    36     33   #include <spatialite/sqlite3.h>
    37         -#else
    38         -#include <sqlite3.h>
    39         -#endif
    40         -
    41     34   #include <spatialite/gaiageo.h>
    42     35   
    43     36   #include "rasterlite_internals.h"
    44     37   
    45         -extern rasterliteImagePtr
           38  +extern rasterliteImagePrt
    46     39   image_create (int sx, int sy)
    47     40   {
    48     41   /*
    49     42   / creating a generic RGB image
    50     43   / vaguely inspired by GD lib
    51     44   */
    52     45       int i;
    53     46       int i2;
    54         -    rasterliteImagePtr img;
           47  +    rasterliteImagePrt img;
    55     48       img = malloc (sizeof (rasterliteImage));
    56     49       if (!img)
    57     50   	return NULL;
    58     51       img->pixels = NULL;
    59     52       img->sx = sx;
    60     53       img->sy = sy;
    61     54       img->color_space = COLORSPACE_RGB;
................................................................................
    77     70   		return NULL;
    78     71   	    }
    79     72         }
    80     73       return img;
    81     74   }
    82     75   
    83     76   extern void
    84         -image_destroy (rasterliteImagePtr img)
           77  +image_destroy (rasterliteImagePrt img)
    85     78   {
    86     79   /*
    87     80   / destroying a generic RGB image
    88     81   / vaguely inspired by GD lib
    89     82   */
    90     83       int i;
    91     84       if (img->pixels)
................................................................................
    94     87   	      free (img->pixels[i]);
    95     88   	  free (img->pixels);
    96     89         }
    97     90       free (img);
    98     91   }
    99     92   
   100     93   extern void
   101         -image_fill (const rasterliteImagePtr img, int color)
           94  +image_fill (const rasterliteImagePrt img, int color)
   102     95   {
   103     96   /* filling the image with given color */
   104     97       int x;
   105     98       int y;
   106     99       if (img->pixels)
   107    100         {
   108    101   	  for (y = 0; y < img->sy; y++)
................................................................................
   110    103   		for (x = 0; x < img->sx; x++)
   111    104   		    img->pixels[y][x] = color;
   112    105   	    }
   113    106         }
   114    107   }
   115    108   
   116    109   static void
   117         -shrink_by (const rasterliteImagePtr dst, const rasterliteImagePtr src)
          110  +shrink_by (const rasterliteImagePrt dst, const rasterliteImagePrt src)
   118    111   {
   119    112   /*
   120    113   / this code is widely base upon the original wxWidgets gwxImage wxImage::ShrinkBy(() function
   121    114   */
   122    115       int xFactor = src->sx / dst->sx;
   123    116       int yFactor = src->sy / dst->sy;
   124    117       int x;
   125    118       int y;
   126    119       int x1;
   127    120       int y1;
   128    121       int y_offset;
   129         -    int x_offset;
          122  +    unsigned int avgRed = 0;
          123  +    unsigned int avgGreen = 0;
          124  +    unsigned int avgBlue = 0;
          125  +    unsigned int counter = 0;
   130    126       int pixel;
          127  +    printf ("shrink\n");
          128  +    fflush (stdout);
   131    129       for (y = 0; y < dst->sy; y++)
   132    130         {
   133    131   	  for (x = 0; x < dst->sx; x++)
   134    132   	    {
   135    133   		/* determine average */
   136         -		unsigned int avgRed = 0;
   137         -		unsigned int avgGreen = 0;
   138         -		unsigned int avgBlue = 0;
   139         -		unsigned int counter = 0;
   140    134   		for (y1 = 0; y1 < yFactor; ++y1)
   141    135   		  {
   142    136   		      y_offset = (y * yFactor + y1) * src->sx;
   143    137   		      for (x1 = 0; x1 < xFactor; ++x1)
   144    138   			{
   145         -			    x_offset = (x * xFactor) + x1;
   146         -			    pixel = src->pixels[y_offset][x_offset];
          139  +			    pixel = src->pixels[y1][x1];
   147    140   			    avgRed += true_color_get_red (pixel);
   148    141   			    avgGreen += true_color_get_green (pixel);
   149    142   			    avgBlue += true_color_get_blue (pixel);
   150    143   			    counter++;
   151    144   			}
   152    145   		  }
   153    146   		pixel =
................................................................................
   155    148   				(avgBlue / counter));
   156    149   		dst->pixels[y][x] = pixel;
   157    150   	    }
   158    151         }
   159    152   }
   160    153   
   161    154   extern void
   162         -image_resize (const rasterliteImagePtr dst, const rasterliteImagePtr src)
          155  +image_resize (const rasterliteImagePrt dst, const rasterliteImagePrt src)
   163    156   {
   164    157   /*
   165    158   / this function builds an ordinary quality resized image, applying pixel replication
   166    159   /
   167    160   / this code is widely base upon the original wxWidgets gwxImage wxImage::Scale(() function
   168    161   / wxIMAGE_QUALITY_NORMAL
   169    162   */
................................................................................
   195    188   	  y += y_delta;
   196    189         }
   197    190   }
   198    191   
   199    192   #define floor2(exp) ((long) exp)
   200    193   
   201    194   extern void
   202         -make_thumbnail (const rasterliteImagePtr thumbnail,
   203         -		const rasterliteImagePtr image)
          195  +make_thumbnail (const rasterliteImagePrt thumbnail,
          196  +		const rasterliteImagePrt image)
   204    197   {
   205    198   /*
   206    199   / this function builds an high quality thumbnail image, applying pixel interpolation
   207    200   /
   208    201   / this code is widely base upon the original GD gdImageCopyResampled() function
   209    202   */
   210    203       int x, y;
................................................................................
   296    289   				 true_color ((int) red, (int) green,
   297    290   					     (int) blue));
   298    291   	    }
   299    292         }
   300    293   }
   301    294   
   302    295   extern void *
   303         -image_to_rgb_array (const rasterliteImagePtr img, int *size)
          296  +image_to_rgb_array (const rasterliteImagePrt img, int *size)
   304    297   {
   305    298   /* building a flat RGB array from this image */
   306    299       int x;
   307    300       int y;
   308    301       int pixel;
   309    302       unsigned char *data = NULL;
   310    303       unsigned char *p;
................................................................................
   324    317   	    }
   325    318         }
   326    319       *size = sz;
   327    320       return data;
   328    321   }
   329    322   
   330    323   extern void *
   331         -image_to_rgba_array (int transparent_color, const rasterliteImagePtr img,
          324  +image_to_rgba_array (int transparent_color, const rasterliteImagePrt img,
   332    325   		     int *size)
   333    326   {
   334    327   /* building a flat RGBA array from this image */
   335    328       int x;
   336    329       int y;
   337    330       int pixel;
   338    331       int r;
................................................................................
   365    358   	    }
   366    359         }
   367    360       *size = sz;
   368    361       return data;
   369    362   }
   370    363   
   371    364   extern void *
   372         -image_to_argb_array (int transparent_color, const rasterliteImagePtr img,
          365  +image_to_argb_array (int transparent_color, const rasterliteImagePrt img,
   373    366   		     int *size)
   374    367   {
   375    368   /* building a flat ARGB array from this image */
   376    369       int x;
   377    370       int y;
   378    371       int pixel;
   379    372       int r;
................................................................................
   406    399   	    }
   407    400         }
   408    401       *size = sz;
   409    402       return data;
   410    403   }
   411    404   
   412    405   extern void *
   413         -image_to_bgr_array (const rasterliteImagePtr img, int *size)
          406  +image_to_bgr_array (const rasterliteImagePrt img, int *size)
   414    407   {
   415    408   /* building a flat BGR array from this image */
   416    409       int x;
   417    410       int y;
   418    411       int pixel;
   419    412       unsigned char *data = NULL;
   420    413       unsigned char *p;
................................................................................
   434    427   	    }
   435    428         }
   436    429       *size = sz;
   437    430       return data;
   438    431   }
   439    432   
   440    433   extern void *
   441         -image_to_bgra_array (int transparent_color, const rasterliteImagePtr img,
          434  +image_to_bgra_array (int transparent_color, const rasterliteImagePrt img,
   442    435   		     int *size)
   443    436   {
   444    437   /* building a flat BGRA array from this image */
   445    438       int x;
   446    439       int y;
   447    440       int pixel;
   448    441       int r;
................................................................................
   473    466   		*p++ = r;
   474    467   		*p++ = a;
   475    468   	    }
   476    469         }
   477    470       *size = sz;
   478    471       return data;
   479    472   }
   480         -
   481         -extern rasterliteImagePtr
   482         -image_from_rgb_array (const void *raw, int width, int height)
   483         -{
   484         -/* building an image form this flat RGB array */
   485         -    int x;
   486         -    int y;
   487         -    int r;
   488         -    int g;
   489         -    int b;
   490         -    int pixel;
   491         -    const unsigned char *data = raw;
   492         -    const unsigned char *p;
   493         -    rasterliteImagePtr img = image_create (width, height);
   494         -    if (!img)
   495         -	return NULL;
   496         -    for (y = 0; y < img->sy; y++)
   497         -      {
   498         -	  p = data + (y * (width * 3));
   499         -	  for (x = 0; x < img->sx; x++)
   500         -	    {
   501         -		r = *p++;
   502         -		g = *p++;
   503         -		b = *p++;
   504         -		pixel = true_color (r, g, b);
   505         -		img->pixels[y][x] = pixel;
   506         -	    }
   507         -      }
   508         -    return img;
   509         -}
   510         -
   511         -extern rasterliteImagePtr
   512         -image_from_rgba_array (const void *raw, int width, int height)
   513         -{
   514         -/* building an image form this flat RGBA array */
   515         -    int x;
   516         -    int y;
   517         -    int r;
   518         -    int g;
   519         -    int b;
   520         -    int alpha;
   521         -    int pixel;
   522         -    const unsigned char *data = raw;
   523         -    const unsigned char *p;
   524         -    rasterliteImagePtr img = image_create (width, height);
   525         -    if (!img)
   526         -	return NULL;
   527         -    for (y = 0; y < img->sy; y++)
   528         -      {
   529         -	  p = data + (y * (width * 4));
   530         -	  for (x = 0; x < img->sx; x++)
   531         -	    {
   532         -		r = *p++;
   533         -		g = *p++;
   534         -		b = *p++;
   535         -		alpha = *p++;
   536         -		pixel = true_color (r, g, b);
   537         -		img->pixels[y][x] = pixel;
   538         -	    }
   539         -      }
   540         -    return img;
   541         -}
   542         -
   543         -extern rasterliteImagePtr
   544         -image_from_argb_array (const void *raw, int width, int height)
   545         -{
   546         -/* building an image form this flat ARGB array */
   547         -    int x;
   548         -    int y;
   549         -    int r;
   550         -    int g;
   551         -    int b;
   552         -    int alpha;
   553         -    int pixel;
   554         -    const unsigned char *data = raw;
   555         -    const unsigned char *p;
   556         -    rasterliteImagePtr img = image_create (width, height);
   557         -    if (!img)
   558         -	return NULL;
   559         -    for (y = 0; y < img->sy; y++)
   560         -      {
   561         -	  p = data + (y * (width * 4));
   562         -	  for (x = 0; x < img->sx; x++)
   563         -	    {
   564         -
   565         -		alpha = *p++;
   566         -		r = *p++;
   567         -		g = *p++;
   568         -		b = *p++;
   569         -		pixel = true_color (r, g, b);
   570         -		img->pixels[y][x] = pixel;
   571         -	    }
   572         -      }
   573         -    return img;
   574         -}
   575         -
   576         -extern rasterliteImagePtr
   577         -image_from_bgr_array (const void *raw, int width, int height)
   578         -{
   579         -/* building an image form this flat BGR array */
   580         -    int x;
   581         -    int y;
   582         -    int r;
   583         -    int g;
   584         -    int b;
   585         -    int pixel;
   586         -    const unsigned char *data = raw;
   587         -    const unsigned char *p;
   588         -    rasterliteImagePtr img = image_create (width, height);
   589         -    if (!img)
   590         -	return NULL;
   591         -    for (y = 0; y < img->sy; y++)
   592         -      {
   593         -	  p = data + (y * (width * 3));
   594         -	  for (x = 0; x < img->sx; x++)
   595         -	    {
   596         -		b = *p++;
   597         -		g = *p++;
   598         -		r = *p++;
   599         -		pixel = true_color (r, g, b);
   600         -		img->pixels[y][x] = pixel;
   601         -	    }
   602         -      }
   603         -    return img;
   604         -}
   605         -
   606         -extern rasterliteImagePtr
   607         -image_from_bgra_array (const void *raw, int width, int height)
   608         -{
   609         -/* building an image form this flat BGRA array */
   610         -    int x;
   611         -    int y;
   612         -    int r;
   613         -    int g;
   614         -    int b;
   615         -    int alpha;
   616         -    int pixel;
   617         -    const unsigned char *data = raw;
   618         -    const unsigned char *p;
   619         -    rasterliteImagePtr img = image_create (width, height);
   620         -    if (!img)
   621         -	return NULL;
   622         -    for (y = 0; y < img->sy; y++)
   623         -      {
   624         -	  p = data + (y * (width * 4));
   625         -	  for (x = 0; x < img->sx; x++)
   626         -	    {
   627         -		b = *p++;
   628         -		g = *p++;
   629         -		r = *p++;
   630         -		alpha = *p++;
   631         -		pixel = true_color (r, g, b);
   632         -		img->pixels[y][x] = pixel;
   633         -	    }
   634         -      }
   635         -    return img;
   636         -}
   637         -
   638         -extern int
   639         -is_image_monochrome (rasterliteImagePtr img)
   640         -{
   641         -/* checking if this Image is into the Monochrome colorspace */
   642         -    int x;
   643         -    int y;
   644         -    int pixel;
   645         -    int r;
   646         -    int g;
   647         -    int b;
   648         -    for (y = 0; y < img->sy; y++)
   649         -      {
   650         -	  for (x = 0; x < img->sx; x++)
   651         -	    {
   652         -		pixel = img->pixels[y][x];
   653         -		r = true_color_get_red (pixel);
   654         -		g = true_color_get_green (pixel);
   655         -		b = true_color_get_blue (pixel);
   656         -		if (r == 0 && g == 0 && b == 0)
   657         -		    continue;
   658         -		if (r == 255 && g == 255 && b == 255)
   659         -		    continue;
   660         -		return RASTERLITE_FALSE;
   661         -	    }
   662         -      }
   663         -    return RASTERLITE_TRUE;
   664         -}
   665         -
   666         -extern int
   667         -is_image_grayscale (rasterliteImagePtr img)
   668         -{
   669         -/* checking if this Image is into the GrayScale colorspace */
   670         -    int x;
   671         -    int y;
   672         -    int pixel;
   673         -    int r;
   674         -    int g;
   675         -    int b;
   676         -    for (y = 0; y < img->sy; y++)
   677         -      {
   678         -	  for (x = 0; x < img->sx; x++)
   679         -	    {
   680         -		pixel = img->pixels[y][x];
   681         -		r = true_color_get_red (pixel);
   682         -		g = true_color_get_green (pixel);
   683         -		b = true_color_get_blue (pixel);
   684         -		if (r == g && r == b)
   685         -		    continue;
   686         -		return RASTERLITE_FALSE;
   687         -	    }
   688         -      }
   689         -    return RASTERLITE_TRUE;
   690         -}
   691         -
   692         -static void
   693         -palette_init (int *palette)
   694         -{
   695         -/* initializing an empty palette */
   696         -    int x;
   697         -    for (x = 0; x < 256; x++)
   698         -	palette[x] = INT_MAX;
   699         -}
   700         -
   701         -static int
   702         -palette_check (int *palette, int pixel)
   703         -{
   704         -    int x;
   705         -    for (x = 0; x < 256; x++)
   706         -      {
   707         -	  if (palette[x] == pixel)
   708         -	      return RASTERLITE_TRUE;
   709         -	  if (palette[x] == INT_MAX)
   710         -	    {
   711         -		palette[x] = pixel;
   712         -		return RASTERLITE_TRUE;
   713         -	    }
   714         -      }
   715         -    return RASTERLITE_FALSE;
   716         -}
   717         -
   718         -extern int
   719         -is_image_palette256 (rasterliteImagePtr img)
   720         -{
   721         -/* checking if this Image may be represented using a 256 colors palette */
   722         -    int x;
   723         -    int y;
   724         -    int pixel;
   725         -    int palette[256];
   726         -    palette_init (palette);
   727         -    for (y = 0; y < img->sy; y++)
   728         -      {
   729         -	  for (x = 0; x < img->sx; x++)
   730         -	    {
   731         -		pixel = img->pixels[y][x];
   732         -		if (palette_check (palette, pixel) == RASTERLITE_TRUE)
   733         -		    continue;
   734         -		return RASTERLITE_FALSE;
   735         -	    }
   736         -      }
   737         -    return RASTERLITE_TRUE;
   738         -}

Changes to lib/rasterlite_io.c.

     1      1   /* 
     2      2   / rasterlite_io.c
     3      3   /
     4      4   / IO helper methods
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdio.h>
    28     28   #include <stdlib.h>
    29     29   #include <string.h>
    30     30   #include <limits.h>
    31     31   
    32     32   #include <tiffio.h>
    33         -
    34         -#ifdef SPATIALITE_AMALGAMATION
    35     33   #include <spatialite/sqlite3.h>
    36         -#else
    37         -#include <sqlite3.h>
    38         -#endif
    39         -
    40     34   #include <spatialite/gaiageo.h>
    41     35   
    42     36   #include "rasterlite_internals.h"
    43     37   
    44     38   #define TRUE 1
    45     39   #define FALSE 0
    46     40   

Changes to lib/rasterlite_jpeg.c.

     1      1   /* 
     2      2   / rasterlite_jpeg.c
     3      3   /
     4      4   / JPEG auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdio.h>
    28     28   #include <stdlib.h>
    29     29   #include <setjmp.h>
    30     30   #include <limits.h>
    31     31   #include <string.h>
    32     32   
           33  +#include <spatialite/sqlite3.h>
           34  +#include <spatialite/gaiageo.h>
           35  +
    33     36   #include <tiffio.h>
           37  +
    34     38   #include <jpeglib.h>
    35     39   #include <jerror.h>
    36     40   
    37         -#ifdef SPATIALITE_AMALGAMATION
    38         -#include <spatialite/sqlite3.h>
    39         -#else
    40         -#include <sqlite3.h>
    41         -#endif
    42         -
    43         -#include <spatialite/gaiageo.h>
    44         -
    45     41   #include "rasterlite_internals.h"
    46     42   
    47     43   /* 
    48     44   /
    49     45   / DISCLAIMER:
    50     46   / all the following code merely is an 'ad hoc' adaption
    51     47   / deriving from the original GD lib code
................................................................................
   111    107   	  fprintf (stderr, "jpeg-wrappeg: EXTREMELY fatal error: jmpbuf"
   112    108   		   " unrecoverable; terminating\n");
   113    109         }
   114    110       fflush (stderr);
   115    111       exit (99);
   116    112   }
   117    113   
   118         -static void
          114  +void
   119    115   init_source (j_decompress_ptr cinfo)
   120    116   {
   121    117       my_src_ptr src = (my_src_ptr) cinfo->src;
   122    118       src->start_of_file = TRUE;
   123    119   }
   124    120   
   125    121   #define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n"
   126         -static safeboolean
          122  +safeboolean
   127    123   fill_input_buffer (j_decompress_ptr cinfo)
   128    124   {
   129    125       my_src_ptr src = (my_src_ptr) cinfo->src;
   130    126       int nbytes = 0;
   131    127       memset (src->buffer, 0, INPUT_BUF_SIZE);
   132    128       while (nbytes < INPUT_BUF_SIZE)
   133    129         {
................................................................................
   155    151         }
   156    152       src->pub.next_input_byte = src->buffer;
   157    153       src->pub.bytes_in_buffer = nbytes;
   158    154       src->start_of_file = FALSE;
   159    155       return TRUE;
   160    156   }
   161    157   
   162         -static void
          158  +void
   163    159   skip_input_data (j_decompress_ptr cinfo, long num_bytes)
   164    160   {
   165    161       my_src_ptr src = (my_src_ptr) cinfo->src;
   166    162       if (num_bytes > 0)
   167    163         {
   168    164   	  while (num_bytes > (long) src->pub.bytes_in_buffer)
   169    165   	    {
................................................................................
   171    167   		(void) fill_input_buffer (cinfo);
   172    168   	    }
   173    169   	  src->pub.next_input_byte += (size_t) num_bytes;
   174    170   	  src->pub.bytes_in_buffer -= (size_t) num_bytes;
   175    171         }
   176    172   }
   177    173   
   178         -static void
          174  +void
   179    175   term_source (j_decompress_ptr cinfo)
   180    176   {
   181    177       if (cinfo)
   182    178   	return;			/* does absolutely nothing - required in order to suppress warnings */
   183    179   }
   184    180   
   185    181   static void
................................................................................
   259    255       dest->pub.init_destination = init_destination;
   260    256       dest->pub.empty_output_buffer = empty_output_buffer;
   261    257       dest->pub.term_destination = term_destination;
   262    258       dest->outfile = outfile;
   263    259   }
   264    260   
   265    261   static void
   266         -xgdImageJpegCtx (rasterliteImagePtr img, xgdIOCtx * outfile, int quality,
          262  +xgdImageJpegCtx (rasterliteImagePrt img, xgdIOCtx * outfile, int quality,
   267    263   		 int mode)
   268    264   {
   269    265       struct jpeg_compress_struct cinfo;
   270    266       struct jpeg_error_mgr jerr;
   271    267       int i, j, jidx;
   272    268       volatile JSAMPROW row = 0;
   273    269       JSAMPROW rowptr[1];
................................................................................
   372    368   	  k = 255 - k;
   373    369         }
   374    370       return true_color ((255 - c) * (255 - k) / 255,
   375    371   		       (255 - m) * (255 - k) / 255,
   376    372   		       (255 - y) * (255 - k) / 255);
   377    373   }
   378    374   
   379         -static rasterliteImagePtr
          375  +static rasterliteImagePrt
   380    376   xgdImageCreateFromJpegCtx (xgdIOCtx * infile)
   381    377   {
   382    378       struct jpeg_decompress_struct cinfo;
   383    379       struct jpeg_error_mgr jerr;
   384    380       jmpbuf_wrapper jmpbufw;
   385    381       volatile JSAMPROW row = 0;
   386         -    volatile rasterliteImagePtr img = 0;
          382  +    volatile rasterliteImagePrt img = 0;
   387    383       JSAMPROW rowptr[1];
   388    384       int i, j, retval;
   389    385       JDIMENSION nrows;
   390    386       int channels = 3;
   391    387       int inverted = 0;
   392    388       memset (&cinfo, 0, sizeof (cinfo));
   393    389       memset (&jerr, 0, sizeof (jerr));
................................................................................
   394    390       cinfo.err = jpeg_std_error (&jerr);
   395    391       cinfo.client_data = &jmpbufw;
   396    392       if (setjmp (jmpbufw.jmpbuf) != 0)
   397    393         {
   398    394   	  if (row)
   399    395   	      free (row);
   400    396   	  if (img)
   401         -	      image_destroy ((rasterliteImagePtr) img);
          397  +	      image_destroy ((rasterliteImagePrt) img);
   402    398   	  return 0;
   403    399         }
   404    400       cinfo.err->error_exit = fatal_jpeg_error;
   405    401       jpeg_create_decompress (&cinfo);
   406    402       jpeg_xgdIOCtx_src (&cinfo, infile);
   407    403       jpeg_save_markers (&cinfo, JPEG_APP0 + 14, 256);
   408    404       retval = jpeg_read_header (&cinfo, TRUE);
................................................................................
   573    569   	    }
   574    570         }
   575    571       if (jpeg_finish_decompress (&cinfo) != TRUE)
   576    572   	fprintf (stderr,
   577    573   		 "jpeg-wrapper: warning: jpeg_finish_decompress reports suspended data source\n");
   578    574       jpeg_destroy_decompress (&cinfo);
   579    575       free (row);
   580         -    return (rasterliteImagePtr) img;
          576  +    return (rasterliteImagePrt) img;
   581    577     error:
   582    578       jpeg_destroy_decompress (&cinfo);
   583    579       if (row)
   584    580   	free (row);
   585    581       if (img)
   586         -	image_destroy ((rasterliteImagePtr) img);
          582  +	image_destroy ((rasterliteImagePrt) img);
   587    583       return 0;
   588    584   }
   589    585   
   590    586   extern void *
   591         -image_to_jpeg (const rasterliteImagePtr img, int *size, int quality)
          587  +image_to_jpeg (const rasterliteImagePrt img, int *size, int quality)
   592    588   {
   593    589   /* compressing an image as JPEG RGB */
   594    590       void *rv;
   595    591       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   596    592       xgdImageJpegCtx (img, out, quality, IMAGE_JPEG_RGB);
   597    593       rv = xgdDPExtractData (out, size);
   598    594       out->xgd_free (out);
   599    595       return rv;
   600    596   }
   601    597   
   602    598   extern void *
   603         -image_to_jpeg_grayscale (const rasterliteImagePtr img, int *size, int quality)
          599  +image_to_jpeg_grayscale (const rasterliteImagePrt img, int *size, int quality)
   604    600   {
   605    601   /* compressing an image as JPEG GRAYSCALE */
   606    602       void *rv;
   607    603       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   608    604       xgdImageJpegCtx (img, out, quality, IMAGE_JPEG_BW);
   609    605       rv = xgdDPExtractData (out, size);
   610    606       out->xgd_free (out);
   611    607       return rv;
   612    608   }
   613    609   
   614         -extern rasterliteImagePtr
          610  +extern rasterliteImagePrt
   615    611   image_from_jpeg (int size, const void *data)
   616    612   {
   617    613   /* uncompressing a JPEG */
   618         -    rasterliteImagePtr img;
          614  +    rasterliteImagePrt img;
   619    615       xgdIOCtx *in = xgdNewDynamicCtxEx (size, data, 0);
   620    616       img = xgdImageCreateFromJpegCtx (in);
   621    617       in->xgd_free (in);
   622    618       return img;
   623    619   }

Changes to lib/rasterlite_png.c.

     1      1   /* 
     2      2   / rasterlite_png.c
     3      3   /
     4      4   / PNG auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdio.h>
    28     28   #include <math.h>
    29     29   #include <string.h>
    30     30   #include <stdlib.h>
    31     31   
    32         -#include <tiffio.h>
    33         -#include <png.h>
    34         -
    35         -#ifdef SPATIALITE_AMALGAMATION
    36     32   #include <spatialite/sqlite3.h>
    37         -#else
    38         -#include <sqlite3.h>
    39         -#endif
    40         -
    41     33   #include <spatialite/gaiageo.h>
           34  +
           35  +#include <tiffio.h>
           36  +
           37  +#include <png.h>
    42     38   
    43     39   #define TRUE 1
    44     40   #define FALSE 0
    45     41   
    46     42   #include "rasterlite_internals.h"
    47     43   
    48     44   /* 
................................................................................
   100     96   static void
   101     97   xgdPngFlushData (png_structp png_ptr)
   102     98   {
   103     99       if (png_ptr)
   104    100   	return;			/* does absolutely nothing - required in order to suppress warnings */
   105    101   }
   106    102   
   107         -static rasterliteImagePtr
          103  +static rasterliteImagePrt
   108    104   xgdImageCreateFromPngCtx (xgdIOCtx * infile)
   109    105   {
   110    106       png_byte sig[8];
   111    107       png_structp png_ptr;
   112    108       png_infop info_ptr;
   113    109       png_uint_32 width, height, rowbytes, w, h;
   114    110       int bit_depth, color_type, interlace_type;
................................................................................
   115    111       int num_palette;
   116    112       png_colorp palette;
   117    113       int red[256];
   118    114       int green[256];
   119    115       int blue[256];
   120    116       png_bytep image_data = NULL;
   121    117       png_bytepp row_pointers = NULL;
   122         -    rasterliteImagePtr im = NULL;
          118  +    rasterliteImagePrt im = NULL;
   123    119       int i, j;
   124    120       volatile int palette_allocated = FALSE;
   125    121       memset (sig, 0, sizeof (sig));
   126    122       if (xgdGetBuf (sig, 8, infile) < 8)
   127    123         {
   128    124   	  return NULL;
   129    125         }
   130         -    if (png_sig_cmp (sig, 0, 8))
          126  +    if (!png_check_sig (sig, 8))
   131    127         {
   132    128   	  return NULL;
   133    129         }
   134    130   #ifndef PNG_SETJMP_NOT_SUPPORTED
   135    131       png_ptr =
   136    132   	png_create_read_struct (PNG_LIBPNG_VER_STRING, &xgdPngJmpbufStruct,
   137    133   				xgdPngErrorHandler, NULL);
................................................................................
   350    346         }
   351    347       free (image_data);
   352    348       free (row_pointers);
   353    349       return im;
   354    350   }
   355    351   
   356    352   static void
   357         -xgdImagePngCtxPalette (rasterliteImagePtr img, xgdIOCtx * outfile, int level)
          353  +xgdImagePngCtxPalette (rasterliteImagePrt img, xgdIOCtx * outfile, int level)
   358    354   {
   359    355       int i, j, bit_depth = 0, interlace_type;
   360    356       int width = img->sx;
   361    357       int height = img->sy;
   362    358       int mapping[256];
   363    359       int colors;
   364    360       png_color palette[256];
................................................................................
   472    468       for (j = 0; j < height; ++j)
   473    469   	free (row_pointers[j]);
   474    470       free (row_pointers);
   475    471       png_destroy_write_struct (&png_ptr, &info_ptr);
   476    472   }
   477    473   
   478    474   static void
   479         -xgdImagePngCtxGrayscale (rasterliteImagePtr img, xgdIOCtx * outfile, int level)
          475  +xgdImagePngCtxGrayscale (rasterliteImagePrt img, xgdIOCtx * outfile, int level)
   480    476   {
   481    477       int i, j, bit_depth = 0, interlace_type;
   482    478       int width = img->sx;
   483    479       int height = img->sy;
   484    480       png_structp png_ptr;
   485    481       png_infop info_ptr;
   486    482       png_bytep *row_pointers;
................................................................................
   556    552       for (j = 0; j < height; ++j)
   557    553   	free (row_pointers[j]);
   558    554       free (row_pointers);
   559    555       png_destroy_write_struct (&png_ptr, &info_ptr);
   560    556   }
   561    557   
   562    558   static void
   563         -xgdImagePngCtxRgb (rasterliteImagePtr img, xgdIOCtx * outfile, int level)
          559  +xgdImagePngCtxRgb (rasterliteImagePrt img, xgdIOCtx * outfile, int level)
   564    560   {
   565    561       int i, j, bit_depth = 0, interlace_type;
   566    562       int width = img->sx;
   567    563       int height = img->sy;
   568    564       png_structp png_ptr;
   569    565       png_infop info_ptr;
   570    566       png_bytep *row_pointers;
................................................................................
   648    644       for (j = 0; j < height; ++j)
   649    645   	free (row_pointers[j]);
   650    646       free (row_pointers);
   651    647       png_destroy_write_struct (&png_ptr, &info_ptr);
   652    648   }
   653    649   
   654    650   extern void *
   655         -image_to_png_palette (const rasterliteImagePtr img, int *size)
          651  +image_to_png_palette (const rasterliteImagePrt img, int *size)
   656    652   {
   657    653   /* compressing an image as PNG PALETTE */
   658    654       void *rv;
   659    655       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   660    656       xgdImagePngCtxPalette (img, out, -1);
   661    657       rv = xgdDPExtractData (out, size);
   662    658       out->xgd_free (out);
   663    659       return rv;
   664    660   }
   665    661   
   666    662   extern void *
   667         -image_to_png_grayscale (const rasterliteImagePtr img, int *size)
          663  +image_to_png_grayscale (const rasterliteImagePrt img, int *size)
   668    664   {
   669    665   /* compressing an image as PNG GRAYSCALE */
   670    666       void *rv;
   671    667       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   672    668       xgdImagePngCtxGrayscale (img, out, -1);
   673    669       rv = xgdDPExtractData (out, size);
   674    670       out->xgd_free (out);
   675    671       return rv;
   676    672   }
   677    673   
   678    674   extern void *
   679         -image_to_png_rgb (const rasterliteImagePtr img, int *size)
          675  +image_to_png_rgb (const rasterliteImagePrt img, int *size)
   680    676   {
   681    677   /* compressing an image as PNG RGB */
   682    678       void *rv;
   683    679       xgdIOCtx *out = xgdNewDynamicCtx (2048, NULL);
   684    680       xgdImagePngCtxRgb (img, out, -1);
   685    681       rv = xgdDPExtractData (out, size);
   686    682       out->xgd_free (out);
   687    683       return rv;
   688    684   }
   689    685   
   690         -extern rasterliteImagePtr
          686  +extern rasterliteImagePrt
   691    687   image_from_png (int size, const void *data)
   692    688   {
   693    689   /* uncompressing a PNG */
   694         -    rasterliteImagePtr img;
          690  +    rasterliteImagePrt img;
   695    691       xgdIOCtx *in = xgdNewDynamicCtxEx (size, data, 0);
   696    692       img = xgdImageCreateFromPngCtx (in);
   697    693       in->xgd_free (in);
   698    694       return img;
   699    695   }

Deleted lib/rasterlite_quantize.c.

     1         -/* 
     2         -/ rasterlite_quantize.c
     3         -/
     4         -/ quantization methods
     5         -/
     6         -/ version 1.1a, 2011 November 12
     7         -/
     8         -/ Author: Sandro Furieri a.furieri@lqt.it
     9         -/
    10         -/ Copyright (C) 2009  Alessandro Furieri
    11         -/
    12         -/    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
    14         -/    the Free Software Foundation, either version 3 of the License, or
    15         -/    (at your option) any later version.
    16         -/
    17         -/    This program is distributed in the hope that it will be useful,
    18         -/    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19         -/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
    21         -/
    22         -/    You should have received a copy of the GNU Lesser General Public License
    23         -/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24         -/
    25         -*/
    26         -
    27         -/* 
    28         -/
    29         -/ DISCLAIMER:
    30         -/ all the following code merely is an 'ad hoc' adaption
    31         -/ of the following LGPLed code:
    32         -/
    33         -//////////////////////////////////////////////////////////////////////////////
    34         -/
    35         - median.c: median cut - reducing a high color bitmap to certain number of colors
    36         -
    37         -   Copyright (C) 2001, 2002 Martin Weber
    38         -
    39         -   This library is free software; you can redistribute it and/or
    40         -   modify it under the terms of the GNU Lesser General Public License
    41         -   as published by the Free Software Foundation; either version 2.1 of
    42         -   the License, or (at your option) any later version.
    43         -
    44         -   This library is distributed in the hope that it will be useful, but
    45         -   WITHOUT ANY WARRANTY; without even the implied warranty of
    46         -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    47         -   Lesser General Public License for more details.
    48         -
    49         -   You should have received a copy of the GNU Lesser General Public
    50         -   License along with this library; if not, write to the Free Software
    51         -   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    52         -   USA. 
    53         -*/
    54         -
    55         -#include <stdlib.h>
    56         -
    57         -#include <tiffio.h>
    58         -
    59         -#ifdef SPATIALITE_AMALGAMATION
    60         -#include <spatialite/sqlite3.h>
    61         -#else
    62         -#include <sqlite3.h>
    63         -#endif
    64         -
    65         -#include <spatialite/gaiageo.h>
    66         -
    67         -#include "rasterlite_internals.h"
    68         -
    69         -#define MAXNUMCOLORS 256
    70         -
    71         -/* scale RGB distances by *2,*3,*1 */
    72         -#define R_SCALE  <<1
    73         -#define G_SCALE  *3
    74         -#define B_SCALE
    75         -
    76         -#define BITS_IN_SAMPLE 	8
    77         -
    78         -#define R_SHIFT  	(BITS_IN_SAMPLE - PRECISION_R)
    79         -#define G_SHIFT  	(BITS_IN_SAMPLE - PRECISION_G)
    80         -#define B_SHIFT  	(BITS_IN_SAMPLE - PRECISION_B)
    81         -
    82         -#define PRECISION_R 	7
    83         -#define PRECISION_G 	7
    84         -#define PRECISION_B 	7
    85         -
    86         -#define HIST_R_ELEMS 	(1<<PRECISION_R)
    87         -#define HIST_G_ELEMS 	(1<<PRECISION_G)
    88         -#define HIST_B_ELEMS 	(1<<PRECISION_B)
    89         -
    90         -#define MR 		HIST_G_ELEMS*HIST_B_ELEMS
    91         -#define MG 		HIST_B_ELEMS
    92         -
    93         -typedef unsigned long ColorFreq;
    94         -typedef ColorFreq *Histogram;
    95         -
    96         -typedef struct
    97         -{
    98         -    int desired_number_of_colors;	/* Number of colors we will allow */
    99         -    int actual_number_of_colors;	/* Number of colors actually needed */
   100         -    int cmap[256];		/* colormap created by quantization */
   101         -    ColorFreq freq[256];
   102         -    Histogram histogram;	/* holds the histogram */
   103         -} QuantizeObj;
   104         -
   105         -typedef struct
   106         -{
   107         -    /* The bounds of the box (inclusive); expressed as histogram indexes */
   108         -    int Rmin, Rmax;
   109         -    int Gmin, Gmax;
   110         -    int Bmin, Bmax;
   111         -    /* The volume (actually 2-norm) of the box */
   112         -    int volume;
   113         -    /* The number of nonzero histogram cells within this box */
   114         -    long colorcount;
   115         -} box, *boxptr;
   116         -
   117         -static void
   118         -zero_histogram_rgb (Histogram histogram)
   119         -{
   120         -    int r, g, b;
   121         -    for (r = 0; r < HIST_R_ELEMS; r++)
   122         -	for (g = 0; g < HIST_G_ELEMS; g++)
   123         -	    for (b = 0; b < HIST_B_ELEMS; b++)
   124         -		histogram[r * MR + g * MG + b] = 0;
   125         -}
   126         -
   127         -static void
   128         -generate_histogram_rgb (Histogram histogram, rasterliteImagePtr image)
   129         -{
   130         -    int pixel;
   131         -    int x;
   132         -    int y;
   133         -    int r;
   134         -    int g;
   135         -    int b;
   136         -    ColorFreq *col;
   137         -
   138         -    zero_histogram_rgb (histogram);
   139         -
   140         -    for (y = 0; y < image->sy; y++)
   141         -      {
   142         -	  for (x = 0; x < image->sx; x++)
   143         -	    {
   144         -		pixel = image->pixels[y][x];
   145         -		r = true_color_get_red (pixel);
   146         -		g = true_color_get_green (pixel);
   147         -		b = true_color_get_blue (pixel);
   148         -		col = &histogram[(r >> R_SHIFT) * MR
   149         -				 + (g >> G_SHIFT) * MG + (b >> B_SHIFT)];
   150         -		(*col)++;
   151         -	    }
   152         -      }
   153         -}
   154         -
   155         -
   156         -static boxptr
   157         -find_biggest_volume (boxptr boxlist, int numboxes)
   158         -/* Find the splittable box with the largest (scaled) volume */
   159         -/* Returns 0 if no splittable boxes remain */
   160         -{
   161         -    boxptr boxp;
   162         -    int i;
   163         -    int maxv = 0;
   164         -    boxptr which = 0;
   165         -
   166         -    for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++)
   167         -      {
   168         -	  if (boxp->volume > maxv)
   169         -	    {
   170         -		which = boxp;
   171         -		maxv = boxp->volume;
   172         -	    }
   173         -      }
   174         -
   175         -    return which;
   176         -}
   177         -
   178         -
   179         -static void
   180         -update_box_rgb (Histogram histogram, boxptr boxp)
   181         -/* Shrink the min/max bounds of a box to enclose only nonzero elements, */
   182         -/* and recompute its volume and population */
   183         -{
   184         -    ColorFreq *histp;
   185         -    int R, G, B;
   186         -    int Rmin, Rmax, Gmin, Gmax, Bmin, Bmax;
   187         -    int dist0, dist1, dist2;
   188         -    long ccount;
   189         -
   190         -    Rmin = boxp->Rmin;
   191         -    Rmax = boxp->Rmax;
   192         -    Gmin = boxp->Gmin;
   193         -    Gmax = boxp->Gmax;
   194         -    Bmin = boxp->Bmin;
   195         -    Bmax = boxp->Bmax;
   196         -
   197         -    if (Rmax > Rmin)
   198         -	for (R = Rmin; R <= Rmax; R++)
   199         -	    for (G = Gmin; G <= Gmax; G++)
   200         -	      {
   201         -		  histp = histogram + R * MR + G * MG + Bmin;
   202         -		  for (B = Bmin; B <= Bmax; B++)
   203         -		      if (*histp++ != 0)
   204         -			{
   205         -			    boxp->Rmin = Rmin = R;
   206         -			    goto have_Rmin;
   207         -			}
   208         -	      }
   209         -  have_Rmin:
   210         -    if (Rmax > Rmin)
   211         -	for (R = Rmax; R >= Rmin; R--)
   212         -	    for (G = Gmin; G <= Gmax; G++)
   213         -	      {
   214         -		  histp = histogram + R * MR + G * MG + Bmin;
   215         -		  for (B = Bmin; B <= Bmax; B++)
   216         -		      if (*histp++ != 0)
   217         -			{
   218         -			    boxp->Rmax = Rmax = R;
   219         -			    goto have_Rmax;
   220         -			}
   221         -	      }
   222         -  have_Rmax:
   223         -    if (Gmax > Gmin)
   224         -	for (G = Gmin; G <= Gmax; G++)
   225         -	    for (R = Rmin; R <= Rmax; R++)
   226         -	      {
   227         -		  histp = histogram + R * MR + G * MG + Bmin;
   228         -		  for (B = Bmin; B <= Bmax; B++)
   229         -		      if (*histp++ != 0)
   230         -			{
   231         -			    boxp->Gmin = Gmin = G;
   232         -			    goto have_Gmin;
   233         -			}
   234         -	      }
   235         -  have_Gmin:
   236         -    if (Gmax > Gmin)
   237         -	for (G = Gmax; G >= Gmin; G--)
   238         -	    for (R = Rmin; R <= Rmax; R++)
   239         -	      {
   240         -		  histp = histogram + R * MR + G * MG + Bmin;
   241         -		  for (B = Bmin; B <= Bmax; B++)
   242         -		      if (*histp++ != 0)
   243         -			{
   244         -			    boxp->Gmax = Gmax = G;
   245         -			    goto have_Gmax;
   246         -			}
   247         -	      }
   248         -  have_Gmax:
   249         -    if (Bmax > Bmin)
   250         -	for (B = Bmin; B <= Bmax; B++)
   251         -	    for (R = Rmin; R <= Rmax; R++)
   252         -	      {
   253         -		  histp = histogram + R * MR + Gmin * MG + B;
   254         -		  for (G = Gmin; G <= Gmax; G++, histp += MG)
   255         -		      if (*histp != 0)
   256         -			{
   257         -			    boxp->Bmin = Bmin = B;
   258         -			    goto have_Bmin;
   259         -			}
   260         -	      }
   261         -  have_Bmin:
   262         -    if (Bmax > Bmin)
   263         -	for (B = Bmax; B >= Bmin; B--)
   264         -	    for (R = Rmin; R <= Rmax; R++)
   265         -	      {
   266         -		  histp = histogram + R * MR + Gmin * MG + B;
   267         -		  for (G = Gmin; G <= Gmax; G++, histp += MG)
   268         -		      if (*histp != 0)
   269         -			{
   270         -			    boxp->Bmax = Bmax = B;
   271         -			    goto have_Bmax;
   272         -			}
   273         -	      }
   274         -  have_Bmax:
   275         -
   276         -    /* Update box volume.
   277         -     * We use 2-norm rather than real volume here; this biases the method
   278         -     * against making long narrow boxes, and it has the side benefit that
   279         -     * a box is splittable iff norm > 0.
   280         -     * Since the differences are expressed in histogram-cell units,
   281         -     * we have to shift back to JSAMPLE units to get consistent distances;
   282         -     * after which, we scale according to the selected distance scale factors.
   283         -     */
   284         -    dist0 = Rmax - Rmin;
   285         -    dist1 = Gmax - Gmin;
   286         -    dist2 = Bmax - Bmin;
   287         -    boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2;
   288         -
   289         -    /* Now scan remaining volume of box and compute population */
   290         -    ccount = 0;
   291         -    for (R = Rmin; R <= Rmax; R++)
   292         -	for (G = Gmin; G <= Gmax; G++)
   293         -	  {
   294         -	      histp = histogram + R * MR + G * MG + Bmin;
   295         -	      for (B = Bmin; B <= Bmax; B++, histp++)
   296         -		  if (*histp != 0)
   297         -		    {
   298         -			ccount++;
   299         -		    }
   300         -	  }
   301         -
   302         -    boxp->colorcount = ccount;
   303         -}
   304         -
   305         -
   306         -static int
   307         -median_cut_rgb (Histogram histogram, boxptr boxlist, int numboxes,
   308         -		int desired_colors)
   309         -/* Repeatedly select and split the largest box until we have enough boxes */
   310         -{
   311         -    int n, lb;
   312         -    int R, G, B, cmax;
   313         -    boxptr b1, b2;
   314         -
   315         -    while (numboxes < desired_colors)
   316         -      {
   317         -	  /* Select box to split.
   318         -	   * Current algorithm: by population for first half, then by volume.
   319         -	   */
   320         -	  b1 = find_biggest_volume (boxlist, numboxes);
   321         -
   322         -	  if (b1 == 0)		/* no splittable boxes left! */
   323         -	      break;
   324         -	  b2 = boxlist + numboxes;	/* where new box will go */
   325         -	  /* Copy the color bounds to the new box. */
   326         -	  b2->Rmax = b1->Rmax;
   327         -	  b2->Gmax = b1->Gmax;
   328         -	  b2->Bmax = b1->Bmax;
   329         -	  b2->Rmin = b1->Rmin;
   330         -	  b2->Gmin = b1->Gmin;
   331         -	  b2->Bmin = b1->Bmin;
   332         -	  /* Choose which axis to split the box on.
   333         -	   * Current algorithm: longest scaled axis.
   334         -	   * See notes in update_box about scaling distances.
   335         -	   */
   336         -	  R = b1->Rmax - b1->Rmin;
   337         -	  G = b1->Gmax - b1->Gmin;
   338         -	  B = b1->Bmax - b1->Bmin;
   339         -	  /* We want to break any ties in favor of green, then red, blue last.
   340         -	   */
   341         -	  cmax = G;
   342         -	  n = 1;
   343         -	  if (R > cmax)
   344         -	    {
   345         -		cmax = R;
   346         -		n = 0;
   347         -	    }
   348         -	  if (B > cmax)
   349         -	    {
   350         -		n = 2;
   351         -	    }
   352         -	  /* Choose split point along selected axis, and update box bounds.
   353         -	   * Current algorithm: split at halfway point.
   354         -	   * (Since the box has been shrunk to minimum volume,
   355         -	   * any split will produce two nonempty subboxes.)
   356         -	   * Note that lb value is max for lower box, so must be < old max.
   357         -	   */
   358         -	  switch (n)
   359         -	    {
   360         -	    case 0:
   361         -		lb = (b1->Rmax + b1->Rmin) / 2;
   362         -		b1->Rmax = lb;
   363         -		b2->Rmin = lb + 1;
   364         -		break;
   365         -	    case 1:
   366         -		lb = (b1->Gmax + b1->Gmin) / 2;
   367         -		b1->Gmax = lb;
   368         -		b2->Gmin = lb + 1;
   369         -		break;
   370         -	    case 2:
   371         -		lb = (b1->Bmax + b1->Bmin) / 2;
   372         -		b1->Bmax = lb;
   373         -		b2->Bmin = lb + 1;
   374         -		break;
   375         -	    }
   376         -	  /* Update stats for boxes */
   377         -	  update_box_rgb (histogram, b1);
   378         -	  update_box_rgb (histogram, b2);
   379         -	  numboxes++;
   380         -      }
   381         -    return numboxes;
   382         -}
   383         -
   384         -
   385         -static void
   386         -compute_color_rgb (QuantizeObj * quantobj, Histogram histogram,
   387         -		   boxptr boxp, int icolor)
   388         -/* Compute representative color for a box, put it in colormap[icolor] */
   389         -{
   390         -    /* Current algorithm: mean weighted by pixels (not colors) */
   391         -    /* Note it is important to get the rounding correct! */
   392         -    ColorFreq *histp;
   393         -    int R, G, B;
   394         -    int Rmin, Rmax;
   395         -    int Gmin, Gmax;
   396         -    int Bmin, Bmax;
   397         -    unsigned long count;
   398         -    unsigned long total = 0;
   399         -    unsigned long Rtotal = 0;
   400         -    unsigned long Gtotal = 0;
   401         -    unsigned long Btotal = 0;
   402         -    int pixel;
   403         -    int r;
   404         -    int g;
   405         -    int b;
   406         -
   407         -    Rmin = boxp->Rmin;
   408         -    Rmax = boxp->Rmax;
   409         -    Gmin = boxp->Gmin;
   410         -    Gmax = boxp->Gmax;
   411         -    Bmin = boxp->Bmin;
   412         -    Bmax = boxp->Bmax;
   413         -
   414         -    for (R = Rmin; R <= Rmax; R++)
   415         -	for (G = Gmin; G <= Gmax; G++)
   416         -	  {
   417         -	      histp = histogram + R * MR + G * MG + Bmin;
   418         -	      for (B = Bmin; B <= Bmax; B++)
   419         -		{
   420         -		    if ((count = *histp++) != 0)
   421         -		      {
   422         -			  total += count;
   423         -			  Rtotal +=
   424         -			      ((R << R_SHIFT) + ((1 << R_SHIFT) >> 1)) * count;
   425         -			  Gtotal +=
   426         -			      ((G << G_SHIFT) + ((1 << G_SHIFT) >> 1)) * count;
   427         -			  Btotal +=
   428         -			      ((B << B_SHIFT) + ((1 << B_SHIFT) >> 1)) * count;
   429         -		      }
   430         -		}
   431         -	  }
   432         -
   433         -    r = (unsigned char) ((Rtotal + (total >> 1)) / total);
   434         -    g = (unsigned char) ((Gtotal + (total >> 1)) / total);
   435         -    b = (unsigned char) ((Btotal + (total >> 1)) / total);
   436         -    pixel = true_color (r, g, b);
   437         -    quantobj->cmap[icolor] = pixel;
   438         -    quantobj->freq[icolor] = total;
   439         -}
   440         -
   441         -
   442         -static void
   443         -select_colors_rgb (QuantizeObj * quantobj, Histogram histogram)
   444         -/* Master routine for color selection */
   445         -{
   446         -    boxptr boxlist;
   447         -    int numboxes;
   448         -    int desired = quantobj->desired_number_of_colors;
   449         -    int i;
   450         -
   451         -    /* Allocate workspace for box list */
   452         -    boxlist = malloc (desired * sizeof (box));
   453         -
   454         -    /* Initialize one box containing whole space */
   455         -    numboxes = 1;
   456         -    boxlist[0].Rmin = 0;
   457         -    boxlist[0].Rmax = (1 << PRECISION_R) - 1;
   458         -    boxlist[0].Gmin = 0;
   459         -    boxlist[0].Gmax = (1 << PRECISION_G) - 1;
   460         -    boxlist[0].Bmin = 0;
   461         -    boxlist[0].Bmax = (1 << PRECISION_B) - 1;
   462         -    /* Shrink it to actually-used volume and set its statistics */
   463         -    update_box_rgb (histogram, boxlist);
   464         -    /* Perform median-cut to produce final box list */
   465         -    numboxes = median_cut_rgb (histogram, boxlist, numboxes, desired);
   466         -    quantobj->actual_number_of_colors = numboxes;
   467         -    /* Compute the representative color for each box, fill colormap */
   468         -    for (i = 0; i < numboxes; i++)
   469         -	compute_color_rgb (quantobj, histogram, boxlist + i, i);
   470         -    free (boxlist);
   471         -}
   472         -
   473         -
   474         -/*
   475         - * These routines are concerned with the time-critical task of mapping input
   476         - * colors to the nearest color in the selected colormap.
   477         - *
   478         - * We re-use the histogram space as an "inverse color map", essentially a
   479         - * cache for the results of nearest-color searches.  All colors within a
   480         - * histogram cell will be mapped to the same colormap entry, namely the one
   481         - * closest to the cell's center.  This may not be quite the closest entry to
   482         - * the actual input color, but it's almost as good.  A zero in the cache
   483         - * indicates we haven't found the nearest color for that cell yet; the array
   484         - * is cleared to zeroes before starting the mapping pass.  When we find the
   485         - * nearest color for a cell, its colormap index plus one is recorded in the
   486         - * cache for future use.  The pass2 scanning routines call fill_inverse_cmap
   487         - * when they need to use an unfilled entry in the cache.
   488         - *
   489         - * Our method of efficiently finding nearest colors is based on the "locally
   490         - * sorted search" idea described by Heckbert and on the incremental distance
   491         - * calculation described by Spencer W. Thomas in chapter III.1 of Graphics
   492         - * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that
   493         - * the distances from a given colormap entry to each cell of the histogram can
   494         - * be computed quickly using an incremental method: the differences between
   495         - * distances to adjacent cells themselves differ by a constant.  This allows a
   496         - * fairly fast implementation of the "brute force" approach of computing the
   497         - * distance from every colormap entry to every histogram cell.  Unfortunately,
   498         - * it needs a work array to hold the best-distance-so-far for each histogram
   499         - * cell (because the inner loop has to be over cells, not colormap entries).
   500         - * The work array elements have to be ints, so the work array would need
   501         - * 256Kb at our recommended precision.  This is not feasible in DOS machines.
   502         -
   503         -[ 256*1024/4 = 65,536 ]
   504         -
   505         - * To get around these problems, we apply Thomas' method to compute the
   506         - * nearest colors for only the cells within a small subbox of the histogram.
   507         - * The work array need be only as big as the subbox, so the memory usage
   508         - * problem is solved.  Furthermore, we need not fill subboxes that are never
   509         - * referenced in pass2; many images use only part of the color gamut, so a
   510         - * fair amount of work is saved.  An additional advantage of this
   511         - * approach is that we can apply Heckbert's locality criterion to quickly
   512         - * eliminate colormap entries that are far away from the subbox; typically
   513         - * three-fourths of the colormap entries are rejected by Heckbert's criterion,
   514         - * and we need not compute their distances to individual cells in the subbox.
   515         - * The speed of this approach is heavily influenced by the subbox size: too
   516         - * small means too much overhead, too big loses because Heckbert's criterion
   517         - * can't eliminate as many colormap entries.  Empirically the best subbox
   518         - * size seems to be about 1/512th of the histogram (1/8th in each direction).
   519         - *
   520         - * Thomas' article also describes a refined method which is asymptotically
   521         - * faster than the brute-force method, but it is also far more complex and
   522         - * cannot efficiently be applied to small subboxes.  It is therefore not
   523         - * useful for programs intended to be portable to DOS machines.  On machines
   524         - * with plenty of memory, filling the whole histogram in one shot with Thomas'
   525         - * refined method might be faster than the present code --- but then again,
   526         - * it might not be any faster, and it's certainly more complicated.
   527         - */
   528         -
   529         -/* log2(histogram cells in update box) for each axis; this can be adjusted */
   530         -#define BOX_R_LOG  (PRECISION_R-3)
   531         -#define BOX_G_LOG  (PRECISION_G-3)
   532         -#define BOX_B_LOG  (PRECISION_B-3)
   533         -
   534         -#define BOX_R_ELEMS  (1<<BOX_R_LOG)	/* # of hist cells in update box */
   535         -#define BOX_G_ELEMS  (1<<BOX_G_LOG)
   536         -#define BOX_B_ELEMS  (1<<BOX_B_LOG)
   537         -
   538         -#define BOX_R_SHIFT  (R_SHIFT + BOX_R_LOG)
   539         -#define BOX_G_SHIFT  (G_SHIFT + BOX_G_LOG)
   540         -#define BOX_B_SHIFT  (B_SHIFT + BOX_B_LOG)
   541         -
   542         -/*
   543         - * The next three routines implement inverse colormap filling.  They could
   544         - * all be folded into one big routine, but splitting them up this way saves
   545         - * some stack space (the mindist[] and bestdist[] arrays need not coexist)
   546         - * and may allow some compilers to produce better code by registerizing more
   547         - * inner-loop variables.
   548         - */
   549         -
   550         -static int
   551         -find_nearby_colors (QuantizeObj * quantobj, int minR, int minG,
   552         -		    int minB, int *colorlist)
   553         -/* Locate the colormap entries close enough to an update box to be candidates
   554         - * for the nearest entry to some cell(s) in the update box.  The update box
   555         - * is specified by the center coordinates of its first cell.  The number of
   556         - * candidate colormap entries is returned, and their colormap indexes are
   557         - * placed in colorlist[].
   558         - * This routine uses Heckbert's "locally sorted search" criterion to select
   559         - * the colors that need further consideration.
   560         - */
   561         -{
   562         -    int numcolors = quantobj->actual_number_of_colors;
   563         -    int maxR, maxG, maxB;
   564         -    int centerR, centerG, centerB;
   565         -    int i, x, ncolors;
   566         -    int minmaxdist, min_dist = 0, max_dist, tdist;
   567         -    int mindist[MAXNUMCOLORS];	/* min distance to colormap entry i */
   568         -    int pixel;
   569         -    int r;
   570         -    int g;
   571         -    int b;
   572         -
   573         -    /* Compute TRUE coordinates of update box's upper corner and center.
   574         -     * Actually we compute the coordinates of the center of the upper-corner
   575         -     * histogram cell, which are the upper bounds of the volume we care about.
   576         -     * Note that since ">>" rounds down, the "center" values may be closer to
   577         -     * min than to max; hence comparisons to them must be "<=", not "<".
   578         -     */
   579         -    maxR = minR + ((1 << BOX_R_SHIFT) - (1 << R_SHIFT));
   580         -    centerR = (minR + maxR) >> 1;
   581         -    maxG = minG + ((1 << BOX_G_SHIFT) - (1 << G_SHIFT));
   582         -    centerG = (minG + maxG) >> 1;
   583         -    maxB = minB + ((1 << BOX_B_SHIFT) - (1 << B_SHIFT));
   584         -    centerB = (minB + maxB) >> 1;
   585         -
   586         -    /* For each color in colormap, find:
   587         -     *  1. its minimum squared-distance to any point in the update box
   588         -     *     (zero if color is within update box);
   589         -     *  2. its maximum squared-distance to any point in the update box.
   590         -     * Both of these can be found by considering only the corners of the box.
   591         -     * We save the minimum distance for each color in mindist[];
   592         -     * only the smallest maximum distance is of interest.
   593         -     */
   594         -    minmaxdist = 0x7FFFFFFFL;
   595         -
   596         -    for (i = 0; i < numcolors; i++)
   597         -      {
   598         -	  /* We compute the squared-R-distance term, then add in the other two. */
   599         -	  pixel = quantobj->cmap[i];
   600         -	  r = true_color_get_red (pixel);
   601         -	  g = true_color_get_green (pixel);
   602         -	  b = true_color_get_blue (pixel);
   603         -	  x = r;
   604         -	  if (x < minR)
   605         -	    {
   606         -		tdist = (x - minR) R_SCALE;
   607         -		min_dist = tdist * tdist;
   608         -		tdist = (x - maxR) R_SCALE;
   609         -		max_dist = tdist * tdist;
   610         -	    }
   611         -	  else if (x > maxR)
   612         -	    {
   613         -		tdist = (x - maxR) R_SCALE;
   614         -		min_dist = tdist * tdist;
   615         -		tdist = (x - minR) R_SCALE;
   616         -		max_dist = tdist * tdist;
   617         -	    }
   618         -	  else
   619         -	    {
   620         -		/* within cell range so no contribution to min_dist */
   621         -		min_dist = 0;
   622         -		if (x <= centerR)
   623         -		  {
   624         -		      tdist = (x - maxR) R_SCALE;
   625         -		      max_dist = tdist * tdist;
   626         -		  }
   627         -		else
   628         -		  {
   629         -		      tdist = (x - minR) R_SCALE;
   630         -		      max_dist = tdist * tdist;
   631         -		  }
   632         -	    }
   633         -
   634         -	  x = g;
   635         -	  if (x < minG)
   636         -	    {
   637         -		tdist = (x - minG) G_SCALE;
   638         -		min_dist += tdist * tdist;
   639         -		tdist = (x - maxG) G_SCALE;
   640         -		max_dist += tdist * tdist;
   641         -	    }
   642         -	  else if (x > maxG)
   643         -	    {
   644         -		tdist = (x - maxG) G_SCALE;
   645         -		min_dist += tdist * tdist;
   646         -		tdist = (x - minG) G_SCALE;
   647         -		max_dist += tdist * tdist;
   648         -	    }
   649         -	  else
   650         -	    {
   651         -		/* within cell range so no contribution to min_dist */
   652         -		if (x <= centerG)
   653         -		  {
   654         -		      tdist = (x - maxG) G_SCALE;
   655         -		      max_dist += tdist * tdist;
   656         -		  }
   657         -		else
   658         -		  {
   659         -		      tdist = (x - minG) G_SCALE;
   660         -		      max_dist += tdist * tdist;
   661         -		  }
   662         -	    }
   663         -
   664         -	  x = b;
   665         -	  if (x < minB)
   666         -	    {
   667         -		tdist = (x - minB) B_SCALE;
   668         -		min_dist += tdist * tdist;
   669         -		tdist = (x - maxB) B_SCALE;
   670         -		max_dist += tdist * tdist;
   671         -	    }
   672         -	  else if (x > maxB)
   673         -	    {
   674         -		tdist = (x - maxB) B_SCALE;
   675         -		min_dist += tdist * tdist;
   676         -		tdist = (x - minB) B_SCALE;
   677         -		max_dist += tdist * tdist;
   678         -	    }
   679         -	  else
   680         -	    {
   681         -		/* within cell range so no contribution to min_dist */
   682         -		if (x <= centerB)
   683         -		  {
   684         -		      tdist = (x - maxB) B_SCALE;
   685         -		      max_dist += tdist * tdist;
   686         -		  }
   687         -		else
   688         -		  {
   689         -		      tdist = (x - minB) B_SCALE;
   690         -		      max_dist += tdist * tdist;
   691         -		  }
   692         -	    }
   693         -
   694         -	  mindist[i] = min_dist;	/* save away the results */
   695         -	  if (max_dist < minmaxdist)
   696         -	      minmaxdist = max_dist;
   697         -      }
   698         -
   699         -    /* Now we know that no cell in the update box is more than minmaxdist
   700         -     * away from some colormap entry.  Therefore, only colors that are
   701         -     * within minmaxdist of some part of the box need be considered.
   702         -     */
   703         -    ncolors = 0;
   704         -    for (i = 0; i < numcolors; i++)
   705         -      {
   706         -	  if (mindist[i] <= minmaxdist)
   707         -	      colorlist[ncolors++] = i;
   708         -      }
   709         -    return ncolors;
   710         -}
   711         -
   712         -
   713         -static void
   714         -find_best_colors (QuantizeObj * quantobj, int minR, int minG,
   715         -		  int minB, int numcolors, int *colorlist, int *bestcolor)
   716         -/* Find the closest colormap entry for each cell in the update box,
   717         -  given the list of candidate colors prepared by find_nearby_colors.
   718         -  Return the indexes of the closest entries in the bestcolor[] array.
   719         -  This routine uses Thomas' incremental distance calculation method to
   720         -  find the distance from a colormap entry to successive cells in the box.
   721         - */
   722         -{
   723         -    int iR, iG, iB;
   724         -    int i, icolor;
   725         -    int *bptr;			/* pointer into bestdist[] array */
   726         -    int *cptr;			/* pointer into bestcolor[] array */
   727         -    int dist0, dist1;		/* initial distance values */
   728         -    int dist2;			/* current distance in inner loop */
   729         -    int xx0, xx1;		/* distance increments */
   730         -    int xx2;
   731         -    int inR, inG, inB;		/* initial values for increments */
   732         -    int pixel;
   733         -    int r;
   734         -    int g;
   735         -    int b;
   736         -
   737         -    /* This array holds the distance to the nearest-so-far color for each cell */
   738         -    int bestdist[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS];
   739         -
   740         -    /* Initialize best-distance for each cell of the update box */
   741         -    bptr = bestdist;
   742         -    for (i = BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS - 1; i >= 0; i--)
   743         -	*bptr++ = 0x7FFFFFFFL;
   744         -
   745         -    /* For each color selected by find_nearby_colors,
   746         -     * compute its distance to the center of each cell in the box.
   747         -     * If that's less than best-so-far, update best distance and color number.
   748         -     */
   749         -
   750         -    /* Nominal steps between cell centers ("x" in Thomas article) */
   751         -#define STEP_R  ((1 << R_SHIFT) R_SCALE)
   752         -#define STEP_G  ((1 << G_SHIFT) G_SCALE)
   753         -#define STEP_B  ((1 << B_SHIFT) B_SCALE)
   754         -
   755         -    for (i = 0; i < numcolors; i++)
   756         -      {
   757         -	  icolor = colorlist[i];
   758         -	  /* Compute (square of) distance from minR/G/B to this color */
   759         -	  pixel = quantobj->cmap[icolor];
   760         -	  r = true_color_get_red (pixel);
   761         -	  g = true_color_get_green (pixel);
   762         -	  b = true_color_get_blue (pixel);
   763         -	  inR = (minR - r) R_SCALE;
   764         -	  dist0 = inR * inR;
   765         -	  inG = (minG - g) G_SCALE;
   766         -	  dist0 += inG * inG;
   767         -	  inB = (minB - b) B_SCALE;
   768         -	  dist0 += inB * inB;
   769         -	  /* Form the initial difference increments */
   770         -	  inR = inR * (2 * STEP_R) + STEP_R * STEP_R;
   771         -	  inG = inG * (2 * STEP_G) + STEP_G * STEP_G;
   772         -	  inB = inB * (2 * STEP_B) + STEP_B * STEP_B;
   773         -	  /* Now loop over all cells in box, updating distance per Thomas method */
   774         -	  bptr = bestdist;
   775         -	  cptr = bestcolor;
   776         -	  xx0 = inR;
   777         -	  for (iR = BOX_R_ELEMS - 1; iR >= 0; iR--)
   778         -	    {
   779         -		dist1 = dist0;
   780         -		xx1 = inG;
   781         -		for (iG = BOX_G_ELEMS - 1; iG >= 0; iG--)
   782         -		  {
   783         -		      dist2 = dist1;
   784         -		      xx2 = inB;
   785         -		      for (iB = BOX_B_ELEMS - 1; iB >= 0; iB--)
   786         -			{
   787         -			    if (dist2 < *bptr)
   788         -			      {
   789         -				  *bptr = dist2;
   790         -				  *cptr = icolor;
   791         -			      }
   792         -			    dist2 += xx2;
   793         -			    xx2 += 2 * STEP_B * STEP_B;
   794         -			    bptr++;
   795         -			    cptr++;
   796         -			}
   797         -		      dist1 += xx1;
   798         -		      xx1 += 2 * STEP_G * STEP_G;
   799         -		  }
   800         -		dist0 += xx0;
   801         -		xx0 += 2 * STEP_R * STEP_R;
   802         -	    }
   803         -      }
   804         -}
   805         -
   806         -static void
   807         -fill_inverse_cmap_rgb (QuantizeObj * quantobj, Histogram histogram,
   808         -		       int R, int G, int B)
   809         -/* Fill the inverse-colormap entries in the update box that contains
   810         - histogram cell R/G/B.  (Only that one cell MUST be filled, but
   811         - we can fill as many others as we wish.) */
   812         -{
   813         -    int minR, minG, minB;	/* lower left corner of update box */
   814         -    int iR, iG, iB;
   815         -    int *cptr;			/* pointer into bestcolor[] array */
   816         -    ColorFreq *cachep;		/* pointer into main cache array */
   817         -    /* This array lists the candidate colormap indexes. */
   818         -    int colorlist[MAXNUMCOLORS];
   819         -    int numcolors;		/* number of candidate colors */
   820         -    /* This array holds the actually closest colormap index for each cell. */
   821         -    int bestcolor[BOX_R_ELEMS * BOX_G_ELEMS * BOX_B_ELEMS];
   822         -
   823         -    /* Convert cell coordinates to update box ID */
   824         -    R >>= BOX_R_LOG;
   825         -    G >>= BOX_G_LOG;
   826         -    B >>= BOX_B_LOG;
   827         -
   828         -    /* Compute TRUE coordinates of update box's origin corner.
   829         -     * Actually we compute the coordinates of the center of the corner
   830         -     * histogram cell, which are the lower bounds of the volume we care about.
   831         -     */
   832         -    minR = (R << BOX_R_SHIFT) + ((1 << R_SHIFT) >> 1);
   833         -    minG = (G << BOX_G_SHIFT) + ((1 << G_SHIFT) >> 1);
   834         -    minB = (B << BOX_B_SHIFT) + ((1 << B_SHIFT) >> 1);
   835         -
   836         -    /* Determine which colormap entries are close enough to be candidates
   837         -     * for the nearest entry to some cell in the update box.
   838         -     */
   839         -    numcolors = find_nearby_colors (quantobj, minR, minG, minB, colorlist);
   840         -
   841         -    /* Determine the actually nearest colors. */
   842         -    find_best_colors (quantobj, minR, minG, minB, numcolors, colorlist,
   843         -		      bestcolor);
   844         -
   845         -    /* Save the best color numbers (plus 1) in the main cache array */
   846         -    R <<= BOX_R_LOG;		/* convert ID back to base cell indexes */
   847         -    G <<= BOX_G_LOG;
   848         -    B <<= BOX_B_LOG;
   849         -    cptr = bestcolor;
   850         -    for (iR = 0; iR < BOX_R_ELEMS; iR++)
   851         -      {
   852         -	  for (iG = 0; iG < BOX_G_ELEMS; iG++)
   853         -	    {
   854         -		cachep = &histogram[(R + iR) * MR + (G + iG) * MG + B];
   855         -		for (iB = 0; iB < BOX_B_ELEMS; iB++)
   856         -		  {
   857         -		      *cachep++ = (*cptr++) + 1;
   858         -		  }
   859         -	    }
   860         -      }
   861         -}
   862         -
   863         -/*  This is pass 1  */
   864         -static void
   865         -median_cut_pass1_rgb (QuantizeObj * quantobj, rasterliteImagePtr image)
   866         -{
   867         -    generate_histogram_rgb (quantobj->histogram, image);
   868         -    select_colors_rgb (quantobj, quantobj->histogram);
   869         -}
   870         -
   871         -
   872         -/* Map some rows of pixels to the output colormapped representation. */
   873         -static void
   874         -median_cut_pass2_rgb (QuantizeObj * quantobj, rasterliteImagePtr image)
   875         - /* This version performs no dithering */
   876         -{
   877         -    Histogram histogram = quantobj->histogram;
   878         -    ColorFreq *cachep;
   879         -    int R, G, B;
   880         -    int origR, origG, origB;
   881         -    int row, col;
   882         -    int width = image->sx;
   883         -    int height = image->sy;
   884         -    int pixel;
   885         -
   886         -    zero_histogram_rgb (histogram);
   887         -
   888         -    for (row = 0; row < height; row++)
   889         -      {
   890         -	  for (col = 0; col < width; col++)
   891         -	    {
   892         -		/* get pixel value and index into the cache */
   893         -		pixel = image->pixels[row][col];
   894         -		origR = true_color_get_red (pixel);
   895         -		origG = true_color_get_green (pixel);
   896         -		origB = true_color_get_blue (pixel);
   897         -
   898         -		/* get pixel value and index into the cache */
   899         -		R = origR >> R_SHIFT;
   900         -		G = origG >> G_SHIFT;
   901         -		B = origB >> B_SHIFT;
   902         -		cachep = &histogram[R * MR + G * MG + B];
   903         -		/* If we have not seen this color before, find nearest
   904         -		   colormap entry and update the cache */
   905         -		if (*cachep == 0)
   906         -		  {
   907         -		      fill_inverse_cmap_rgb (quantobj, histogram, R, G, B);
   908         -		  }
   909         -		/* Now emit the colormap index for this cell */
   910         -		pixel = quantobj->cmap[*cachep - 1];
   911         -		image->pixels[row][col] = pixel;
   912         -	    }
   913         -      }
   914         -}
   915         -
   916         -static QuantizeObj *
   917         -initialize_median_cut (int num_colors)
   918         -{
   919         -    QuantizeObj *quantobj;
   920         -
   921         -    /* Initialize the data structures */
   922         -    quantobj = malloc (sizeof (QuantizeObj));
   923         -
   924         -    quantobj->histogram = malloc (sizeof (ColorFreq) *
   925         -				  HIST_R_ELEMS * HIST_G_ELEMS * HIST_B_ELEMS);
   926         -    quantobj->desired_number_of_colors = num_colors;
   927         -
   928         -    return quantobj;
   929         -}
   930         -
   931         -static void
   932         -quantize_object_free (QuantizeObj * quantobj)
   933         -{
   934         -    free (quantobj->histogram);
   935         -    free (quantobj);
   936         -}
   937         -
   938         -extern void
   939         -image_resample_as_palette256 (const rasterliteImagePtr img)
   940         -{
   941         -/* applies quantization to the current image, so to get 256 colors */
   942         -    QuantizeObj *quantobj;
   943         -
   944         -    /* If a pointer was sent in, let's use it. */
   945         -    quantobj = initialize_median_cut (256);
   946         -    median_cut_pass1_rgb (quantobj, img);
   947         -    median_cut_pass2_rgb (quantobj, img);
   948         -    quantize_object_free (quantobj);
   949         -}

Changes to lib/rasterlite_tiff.c.

     1      1   /* 
     2      2   / rasterlite_tiff.c
     3      3   /
     4      4   / TIFF auxiliary helpers
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13         -/    it under the terms of the GNU Lesser General Public License as published by
           13  +/    it under the terms of the GNU General Public License as published by
    14     14   /    the Free Software Foundation, either version 3 of the License, or
    15     15   /    (at your option) any later version.
    16     16   /
    17     17   /    This program is distributed in the hope that it will be useful,
    18     18   /    but WITHOUT ANY WARRANTY; without even the implied warranty of
    19     19   /    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    20         -/    GNU Lesser General Public License for more details.
           20  +/    GNU General Public License for more details.
    21     21   /
    22         -/    You should have received a copy of the GNU Lesser General Public License
           22  +/    You should have received a copy of the GNU General Public License
    23     23   /    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    24     24   /
    25     25   */
    26     26   
    27     27   #include <stdio.h>
    28     28   #include <math.h>
    29     29   #include <string.h>
    30     30   #include <stdlib.h>
    31     31   
    32         -#include "rasterlite_tiff_hdrs.h"
           32  +#include <geotiff.h>
           33  +#include <xtiffio.h>
           34  +#include <geo_tiffp.h>
           35  +#include <geo_keyp.h>
           36  +#include <geovalues.h>
           37  +#include <geo_normalize.h>
    33     38   
    34         -#ifdef SPATIALITE_AMALGAMATION
    35     39   #include <spatialite/sqlite3.h>
    36         -#else
    37         -#include <sqlite3.h>
    38         -#endif
    39         -
    40     40   #include <spatialite/gaiageo.h>
    41     41   
    42     42   #include "rasterlite_internals.h"
    43     43   
    44     44   struct memfile
    45     45   {
    46     46   /* a struct emulating a file [memory mapped] */
................................................................................
   143    143   {
   144    144       if (clientdata || data || offset)
   145    145   	return;			/* does absolutely nothing - required in order to suppress warnings */
   146    146       return;
   147    147   }
   148    148   
   149    149   extern void *
   150         -image_to_tiff_fax4 (const rasterliteImagePtr img, int *size)
          150  +image_to_tiff_fax4 (const rasterliteImagePrt img, int *size)
   151    151   {
   152    152   /* compressing a bi-level (monocrhome) image as TIFF FAX-4 */
   153    153       unsigned char *tiff_image = NULL;
   154    154       TIFF *out;
   155    155       int row;
   156    156       int col;
   157    157       int strip_rows;
................................................................................
   272    272   	  *size = clientdata.eof;
   273    273         }
   274    274       free (clientdata.buffer);
   275    275       return tiff_image;
   276    276   }
   277    277   
   278    278   extern void *
   279         -image_to_tiff_palette (const rasterliteImagePtr img, int *size)
          279  +image_to_tiff_palette (const rasterliteImagePrt img, int *size)
   280    280   {
   281    281   /* compressing a palettte image as TIFF  PALETTE */
   282    282       unsigned char *tiff_image = NULL;
   283    283       TIFF *out;
   284    284       int row;
   285    285       int col;
   286    286       int extimated_size;
................................................................................
   369    369   	  *size = clientdata.eof;
   370    370         }
   371    371       free (clientdata.buffer);
   372    372       return tiff_image;
   373    373   }
   374    374   
   375    375   extern void *
   376         -image_to_tiff_grayscale (const rasterliteImagePtr img, int *size)
          376  +image_to_tiff_grayscale (const rasterliteImagePrt img, int *size)
   377    377   {
   378    378   /* compressing a grayscale image as TIFF  GRAYSCALE */
   379    379       unsigned char *tiff_image = NULL;
   380    380       TIFF *out;
   381    381       int row;
   382    382       int col;
   383    383       int extimated_size;
................................................................................
   435    435   	  *size = clientdata.eof;
   436    436         }
   437    437       free (clientdata.buffer);
   438    438       return tiff_image;
   439    439   }
   440    440   
   441    441   extern void *
   442         -image_to_tiff_rgb (const rasterliteImagePtr img, int *size)
          442  +image_to_tiff_rgb (const rasterliteImagePrt img, int *size)
   443    443   {
   444    444   /* compressing an RGBimage as TIFF  RGB */
   445    445       unsigned char *tiff_image = NULL;
   446    446       TIFF *out;
   447    447       int row;
   448    448       int col;
   449    449       int extimated_size;
................................................................................
   502    502   	  memcpy (tiff_image, clientdata.buffer, clientdata.eof);
   503    503   	  *size = clientdata.eof;
   504    504         }
   505    505       free (clientdata.buffer);
   506    506       return tiff_image;
   507    507   }
   508    508   
   509         -extern rasterliteImagePtr
          509  +extern rasterliteImagePrt
   510    510   image_from_tiff (int size, const void *data)
   511    511   {
   512    512   /* uncompressing a TIFF */
   513         -    rasterliteImagePtr img;
          513  +    rasterliteImagePrt img;
   514    514       uint16 bits_per_sample;
   515    515       uint16 samples_per_pixel;
   516    516       uint16 photometric;
   517    517       uint32 width = 0;
   518    518       uint32 height = 0;
   519    519       uint32 rows_strip = 0;
   520    520       uint32 *raster = NULL;

Added lib/rasterlite_wavelet.c.

            1  +/* 
            2  +/ rasterlite_wavelet.c
            3  +/
            4  +/ WAVELET auxiliary helpers
            5  +/
            6  +/ version 1.0, 2009 June 5
            7  +/
            8  +/ Author: Sandro Furieri a.furieri@lqt.it
            9  +/
           10  +/ Copyright (C) 2009  Alessandro Furieri
           11  +/
           12  +/    This program is free software: you can redistribute it and/or modify
           13  +/    it under the terms of the GNU General Public License as published by
           14  +/    the Free Software Foundation, either version 3 of the License, or
           15  +/    (at your option) any later version.
           16  +/
           17  +/    This program is distributed in the hope that it will be useful,
           18  +/    but WITHOUT ANY WARRANTY; without even the implied warranty of
           19  +/    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           20  +/    GNU General Public License for more details.
           21  +/
           22  +/    You should have received a copy of the GNU General Public License
           23  +/    along with this program.  If not, see <http://www.gnu.org/licenses/>.
           24  +/
           25  +*/
           26  +
           27  +#include <stdio.h>
           28  +#include <math.h>
           29  +#include <string.h>
           30  +#include <stdlib.h>
           31  +
           32  +#include <epsilon.h>
           33  +
           34  +#include <spatialite/sqlite3.h>
           35  +#include <spatialite/gaiageo.h>
           36  +
           37  +#include <tiffio.h>
           38  +
           39  +#include "rasterlite_internals.h"
           40  +
           41  +/* 
           42  +/
           43  +/ this code is widely based upon the cmd_encode_file.c 
           44  +/ source from the 'epsilon' library
           45  +/
           46  +*/
           47  +
           48  +#define BIORTHOGONAL	1
           49  +
           50  +#define MAX(_x, _y)		((_x) > (_y) ? (_x) : (_y))
           51  +
           52  +typedef struct decode_ctx_tag
           53  +{
           54  +    int buf_size;
           55  +    int n_blocks;
           56  +    int *done_blocks;
           57  +    int W;
           58  +    int H;
           59  +    int max_block_w;
           60  +    int max_block_h;
           61  +    rasterliteImagePrt img;
           62  +    int image_type;
           63  +    unsigned char *input;
           64  +    int in_size;
           65  +    int in_base;
           66  +    int in_current;
           67  +    int *clear_len;
           68  +    int *stop_flag;
           69  +} decode_ctx;
           70  +
           71  +typedef struct encode_ctx_tag
           72  +{
           73  +    char *filter_id;
           74  +    int block_size;
           75  +    int mode;
           76  +    int bytes_per_block;
           77  +    double Y_ratio;
           78  +    double Cb_ratio;
           79  +    double Cr_ratio;
           80  +    int resample;
           81  +    int W;
           82  +    int H;
           83  +    rasterliteImagePrt img;
           84  +    int image_type;
           85  +    unsigned char *output;
           86  +    int out_size;
           87  +    int out_current;
           88  +    int n_blocks;
           89  +    int *done_blocks;
           90  +    int *clear_len;
           91  +    int *stop_flag;
           92  +} encode_ctx;
           93  +
           94  +static int
           95  +get_byte (decode_ctx * ctx)
           96  +{
           97  +/* fetching the next byte from the input source */
           98  +    if (ctx->in_current < ctx->in_size)
           99  +	return *(ctx->input + ctx->in_current++);
          100  +    return EOF;
          101  +}
          102  +
          103  +static int
          104  +decoder_read_next_block (decode_ctx * ctx, unsigned char *buf, int *buf_size)
          105  +{
          106  +/* inserting input into the input buffer [decompressed image] */
          107  +    unsigned char *next_byte;
          108  +    int bytes_left;
          109  +    int ch;
          110  +/* Copy no more than *buf_size bytes */
          111  +    bytes_left = *buf_size;
          112  +    next_byte = buf;
          113  +/* Find first non-marker byte */
          114  +    for (;;)
          115  +      {
          116  +	  ch = get_byte (ctx);
          117  +	  if (ch == EOF)
          118  +	      return 0;
          119  +	  if (ch != EPS_MARKER)
          120  +	    {
          121  +		*next_byte++ = (unsigned char) ch;
          122  +		bytes_left--;
          123  +		break;
          124  +	    }
          125  +      }
          126  +/* Copy data until next marker, EOF or buffer end */
          127  +    for (;;)
          128  +      {
          129  +	  ch = get_byte (ctx);
          130  +	  if ((ch == EOF) || (ch == EPS_MARKER))
          131  +	      break;
          132  +/* No more space in the buffer or currupted data. Continue until EOF or syncronization marker */
          133  +	  if (!bytes_left)
          134  +	      continue;
          135  +	  *next_byte++ = (unsigned char) ch;
          136  +	  bytes_left--;
          137  +      }
          138  +/* Actual number of read bytes */
          139  +    *buf_size = next_byte - buf;
          140  +    return 1;
          141  +}
          142  +
          143  +static int
          144  +guess_wavelet_type (decode_ctx * ctx, int *ext_type, int *width, int *height,
          145  +		    int *max_block_w, int *max_block_h)
          146  +{
          147  +/* Block buffer */
          148  +    unsigned char *buf;
          149  +    int buf_size;
          150  +/* Image characteristics */
          151  +    int W;
          152  +    int H;
          153  +    int w;
          154  +    int h;
          155  +    int type;
          156  +/* Allocate block buffer */
          157  +    buf_size = MAX (EPS_MAX_GRAYSCALE_BUF, EPS_MAX_TRUECOLOR_BUF);
          158  +    buf = (unsigned char *) eps_xmalloc (buf_size);
          159  +    W = H = w = h = type = -1;
          160  +/* For all blocks */
          161  +    while (1)
          162  +      {
          163  +	  eps_block_header hdr;
          164  +	  /* Read next block */
          165  +	  if (!decoder_read_next_block (ctx, buf, &buf_size))
          166  +	      break;
          167  +/* Parse block header */
          168  +	  if (eps_read_block_header (buf, buf_size, &hdr) != EPS_OK)
          169  +	      continue;
          170  +/* Check block header CRC */
          171  +	  if (hdr.chk_flag == EPS_BAD_CRC)
          172  +	      continue;
          173  +/* Image type */
          174  +	  if (type == -1)
          175  +	      type = hdr.block_type;
          176  +	  else
          177  +	    {
          178  +		if (type != hdr.block_type)
          179  +		    return 0;
          180  +	    }
          181  +/* Image width */
          182  +	  if (W == -1)
          183  +	      W = type == EPS_GRAYSCALE_BLOCK ? hdr.uhdr.gs.W : hdr.uhdr.tc.W;
          184  +	  else
          185  +	    {
          186  +		if (type == EPS_GRAYSCALE_BLOCK ? W != hdr.uhdr.gs.W : W !=
          187  +		    hdr.uhdr.tc.W)
          188  +		    return 0;
          189  +	    }
          190  +/* Image height */
          191  +	  if (H == -1)
          192  +	      H = type == EPS_GRAYSCALE_BLOCK ? hdr.uhdr.gs.H : hdr.uhdr.tc.H;
          193  +	  else
          194  +	    {
          195  +		if (type == EPS_GRAYSCALE_BLOCK ? H != hdr.uhdr.gs.H : H !=
          196  +		    hdr.uhdr.tc.H)
          197  +		    return 0;
          198  +	    }
          199  +/* Maximal block width and height */
          200  +	  if (type == EPS_GRAYSCALE_BLOCK)
          201  +	    {
          202  +		if (hdr.uhdr.gs.w > w)
          203  +		    w = hdr.uhdr.gs.w;
          204  +		if (hdr.uhdr.gs.h > h)
          205  +		    h = hdr.uhdr.gs.h;
          206  +	    }
          207  +	  else
          208  +	    {
          209  +		if (hdr.uhdr.tc.w > w)
          210  +		    w = hdr.uhdr.tc.w;
          211  +		if (hdr.uhdr.tc.h > h)
          212  +		    h = hdr.uhdr.tc.h;
          213  +	    }
          214  +      }
          215  +/* Rewind file and free buffer */
          216  +    ctx->in_current = ctx->in_base;
          217  +    free (buf);
          218  +/* Buggy file */
          219  +    if (type == -1 || W == -1 || H == -1 || w == -1 || h == -1)
          220  +	return 0;
          221  +/* Save results */
          222  +    *ext_type =
          223  +	(type == EPS_GRAYSCALE_BLOCK) ? IMAGE_WAVELET_BW : IMAGE_WAVELET_RGB;
          224  +    *width = W;
          225  +    *height = H;
          226  +    *max_block_w = w;
          227  +    *max_block_h = h;
          228  +    return 1;
          229  +}
          230  +
          231  +static int
          232  +encoder_read_grayscale (rasterliteImagePrt img, unsigned char **Y, int x,
          233  +			int y, int width, int height)
          234  +{
          235  +/* fetching GRAYSCALE pixels from the uncompressed image */
          236  +    int j;
          237  +    int i;
          238  +    int pixel;
          239  +    int *p_scan;
          240  +/* Check params for consistency */
          241  +    if (x < 0 || y < 0)
          242  +	return 0;
          243  +    if (x >= img->sx || y >= img->sy)
          244  +	return 0;
          245  +    if (width <= 0 || height <= 0)
          246  +	return 0;
          247  +    if (x + width > img->sx)
          248  +	return 0;
          249  +    if (y + height > img->sy)
          250  +	return 0;
          251  +    for (j = 0; j < height; j++)
          252  +      {
          253  +	  /* fetching image rows */
          254  +	  p_scan = img->pixels[y + j];
          255  +	  p_scan += x;
          256  +	  for (i = 0; i < width; i++)
          257  +	    {
          258  +		/* fetching pixel by scanline */
          259  +		pixel = *p_scan++;
          260  +		Y[j][i] = true_color_get_red (pixel);
          261  +	    }
          262  +      }
          263  +    return 1;
          264  +}
          265  +
          266  +static int
          267  +encoder_read_rgb (rasterliteImagePrt img, unsigned char **R, unsigned char **G,
          268  +		  unsigned char **B, int x, int y, int width, int height)
          269  +{
          270  +/* fetching RGB pixels from the uncompressed image */
          271  +    int j;
          272  +    int i;
          273  +    int pixel;
          274  +    int *p_scan;
          275  +/* Check params for consistency */
          276  +    if (x < 0 || y < 0)
          277  +	return 0;
          278  +    if (x >= img->sx || y >= img->sy)
          279  +	return 0;
          280  +    if (width <= 0 || height <= 0)
          281  +	return 0;
          282  +    if (x + width > img->sx)
          283  +	return 0;
          284  +    if (y + height > img->sy)
          285  +	return 0;
          286  +    for (j = 0; j < height; j++)
          287  +      {
          288  +	  /* fetching image rows */
          289  +	  p_scan = img->pixels[y + j];
          290  +	  p_scan += x;
          291  +	  for (i = 0; i < width; i++)
          292  +	    {
          293  +		/* fetching pixel by scanline */
          294  +		pixel = *p_scan++;
          295  +		R[j][i] = true_color_get_red (pixel);
          296  +		G[j][i] = true_color_get_green (pixel);
          297  +		B[j][i] = true_color_get_blue (pixel);
          298  +	    }
          299  +      }
          300  +    return 1;
          301  +}
          302  +
          303  +static int
          304  +decoder_write_grayscale (rasterliteImagePrt img, unsigned char **Y, int x,
          305  +			 int y, int width, int height)
          306  +{
          307  +/* feeding grayscale pixels into the uncompressed image */
          308  +    int i;
          309  +    int j;
          310  +    int gray;
          311  +    int *p_scan;
          312  +/* Check params for consistency */
          313  +    if ((x < 0) || (y < 0))
          314  +	return 0;
          315  +    if (x >= img->sx || y >= img->sy)
          316  +	return 0;
          317  +    if (width <= 0 || height <= 0)
          318  +	return 0;
          319  +    if (x + width > img->sx)
          320  +	return 0;
          321  +    if (y + height > img->sy)
          322  +	return 0;
          323  +    for (j = 0; j < height; j++)
          324  +      {
          325  +	  p_scan = img->pixels[y + j];
          326  +	  p_scan += x;
          327  +	  for (i = 0; i < width; i++)
          328  +	    {
          329  +		gray = Y[j][i];
          330  +		*p_scan++ = true_color (gray, gray, gray);
          331  +	    }
          332  +      }
          333  +    return 1;
          334  +}
          335  +
          336  +static int
          337  +decoder_write_rgb (rasterliteImagePrt img, unsigned char **R,
          338  +		   unsigned char **G, unsigned char **B, int x, int y,
          339  +		   int width, int height)
          340  +{
          341  +/* feeding RGB pixels into the uncompressed image */
          342  +    int i;
          343  +    int j;
          344  +    int red;
          345  +    int green;
          346  +    int blue;
          347  +    int *p_scan;
          348  +/* Check params for consistency */
          349  +    if ((x < 0) || (y < 0))
          350  +	return 0;
          351  +    if (x >= img->sx || y >= img->sy)
          352  +	return 0;
          353  +    if (width <= 0 || height <= 0)
          354  +	return 0;
          355  +    if (x + width > img->sx)
          356  +	return 0;
          357  +    if (y + height > img->sy)
          358  +	return 0;
          359  +    for (j = 0; j < height; j++)
          360  +      {
          361  +	  p_scan = img->pixels[y + j];
          362  +	  p_scan += x;
          363  +	  for (i = 0; i < width; i++)
          364  +	    {
          365  +		red = R[j][i];
          366  +		green = G[j][i];
          367  +		blue = B[j][i];
          368  +		*p_scan++ = true_color (red, green, blue);
          369  +	    }
          370  +      }
          371  +    return 1;
          372  +}
          373  +
          374  +static int
          375  +encoder_write_next_block (encode_ctx * ctx, unsigned char *buf, int buf_size)
          376  +{
          377  +/* inserting output into the output buffer [compressed image] */
          378  +    if (ctx->out_current + buf_size + 1 > ctx->out_size)
          379  +	return 0;
          380  +/* Write data */
          381  +    memcpy (ctx->output + ctx->out_current, buf, buf_size);
          382  +    ctx->out_current += buf_size;
          383  +/* Write syncronization marker */
          384  +    *(ctx->output + ctx->out_current) = EPS_MARKER;
          385  +    ctx->out_current++;
          386  +    return 1;
          387  +}
          388  +
          389  +static int
          390  +encode_blocks (encode_ctx * ctx)
          391  +{
          392  +/* Input buffers */
          393  +    unsigned char **Y;
          394  +    unsigned char **R;
          395  +    unsigned char **G;
          396  +    unsigned char **B;
          397  +/* Output buffer */
          398  +    unsigned char *buf;
          399  +    int buf_size;
          400  +    int x;
          401  +    int y;
          402  +    int w;
          403  +    int h;
          404  +    char header[128];
          405  +/* Handy shortcuts */
          406  +    int block_size = ctx->block_size;
          407  +    int W = ctx->W;
          408  +    int H = ctx->H;
          409  +/* Error flag */
          410  +    int error_flag = 0;
          411  +/* Write wavelet image header */
          412  +    strcpy (header, "StartWaveletsImage$$");
          413  +    if (!encoder_write_next_block
          414  +	(ctx, (unsigned char *) header, strlen (header)))
          415  +      {
          416  +	  error_flag = 1;
          417  +	  fprintf (stderr, "Waveletets-wrapper: Cannot write header\n");
          418  +	  goto error;
          419  +      }
          420  +/* Allocate input buffers */
          421  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          422  +	Y = (unsigned char **) eps_malloc_2D (block_size, block_size,
          423  +					      sizeof (unsigned char));
          424  +    else
          425  +      {
          426  +	  R = (unsigned char **) eps_malloc_2D (block_size, block_size,
          427  +						sizeof (unsigned char));
          428  +	  G = (unsigned char **) eps_malloc_2D (block_size, block_size,
          429  +						sizeof (unsigned char));
          430  +	  B = (unsigned char **) eps_malloc_2D (block_size, block_size,
          431  +						sizeof (unsigned char));
          432  +      }
          433  +/* Allocate output buffer */
          434  +    buf = (unsigned char *) eps_xmalloc (ctx->bytes_per_block);
          435  +/* Process all blocks */
          436  +    for (y = 0; y < H; y += block_size)
          437  +      {
          438  +	  for (x = 0; x < W; x += block_size)
          439  +	    {
          440  +		/* Block width */
          441  +		if (x + block_size > W)
          442  +		    w = W - x;
          443  +		else
          444  +		    w = block_size;
          445  +		/* Block height */
          446  +		if (y + block_size > H)
          447  +		    h = H - y;
          448  +		else
          449  +		    h = block_size;
          450  +		/* Output buffer size (not including marker) */
          451  +		buf_size = ctx->bytes_per_block - 1;
          452  +		if (ctx->image_type == IMAGE_WAVELET_BW)
          453  +		  {
          454  +		      /* Read next block */
          455  +		      if (!encoder_read_grayscale (ctx->img, Y, x, y, w, h))
          456  +			{
          457  +			    error_flag = 1;
          458  +			    fprintf (stderr,
          459  +				     "Waveletets-wrapper: Cannot read block\n");
          460  +			    goto error;
          461  +			}
          462  +		      /* Encode block */
          463  +		      if (eps_encode_grayscale_block
          464  +			  (Y, W, H, w, h, x, y, buf, &buf_size, ctx->filter_id,
          465  +			   ctx->mode) != EPS_OK)
          466  +			{
          467  +			    /* All function parameters are checked at the moment,  so everything except EPS_OK is a logical error. */
          468  +			    error_flag = 1;
          469  +			    fprintf (stderr,
          470  +				     "Waveletets-wrapper: encoder error\n");
          471  +			    goto error;
          472  +			}
          473  +		      /* Write encoded block */
          474  +		      if (!encoder_write_next_block (ctx, buf, buf_size))
          475  +			{
          476  +			    error_flag = 1;
          477  +			    fprintf (stderr,
          478  +				     "Waveletets-wrapper: Cannot write block\n");
          479  +			    goto error;
          480  +			}
          481  +		  }
          482  +		else
          483  +		  {
          484  +		      /* Read next block */
          485  +		      if (!encoder_read_rgb (ctx->img, R, G, B, x, y, w, h))
          486  +			{
          487  +			    error_flag = 1;
          488  +			    fprintf (stderr,
          489  +				     "Waveletets-wrapper: Cannot read block\n");
          490  +			    goto error;
          491  +			}
          492  +		      /* Encode block */
          493  +		      if (eps_encode_truecolor_block
          494  +			  (R, G, B, W, H, w, h, x, y, ctx->resample, buf,
          495  +			   &buf_size, (int) (ctx->Y_ratio),
          496  +			   (int) (ctx->Cb_ratio), (int) (ctx->Cr_ratio),
          497  +			   ctx->filter_id, ctx->mode) != EPS_OK)
          498  +			{
          499  +			    /* All function parameters are checked at the moment,  so everything except EPS_OK is a logical error. */
          500  +			    error_flag = 1;
          501  +			    fprintf (stderr,
          502  +				     "Waveletets-wrapper: encoder error\n");
          503  +			    goto error;
          504  +			}
          505  +		      /* Write encoded block */
          506  +		      if (!encoder_write_next_block (ctx, buf, buf_size))
          507  +			{
          508  +			    error_flag = 1;
          509  +			    fprintf (stderr,
          510  +				     "Waveletets-wrapper: Cannot write block\n");
          511  +			    goto error;
          512  +			}
          513  +		  }
          514  +	    }
          515  +      }
          516  +/* Write wavelet image footer */
          517  +    strcpy (header, "$$EndWaveletsImage");
          518  +    if (!encoder_write_next_block
          519  +	(ctx, (unsigned char *) header, strlen (header)))
          520  +      {
          521  +	  error_flag = 1;
          522  +	  fprintf (stderr, "Waveletets-wrapper: Cannot write footer\n");
          523  +	  goto error;
          524  +      }
          525  +  error:
          526  +/* Free input buffers */
          527  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          528  +	eps_free_2D ((void **) Y, block_size, block_size);
          529  +    else
          530  +      {
          531  +	  eps_free_2D ((void **) R, block_size, block_size);
          532  +	  eps_free_2D ((void **) G, block_size, block_size);
          533  +	  eps_free_2D ((void **) B, block_size, block_size);
          534  +      }
          535  +/* Free output buffer */
          536  +    free (buf);
          537  +/* Return 0 for success or 1 for error */
          538  +    return error_flag;
          539  +}
          540  +
          541  +static void *
          542  +wavelet_compress (rasterliteImagePrt img, int *size, int ratio, int image_type)
          543  +{
          544  +/* preparing the compression */
          545  +    int W;
          546  +    int H;
          547  +    int bytes_per_block;
          548  +    int x_blocks;
          549  +    int y_blocks;
          550  +    int n_blocks;
          551  +    int block_size = 257;
          552  +    int data_size;
          553  +    int done_blocks = 0;
          554  +    int clear_len = 0;
          555  +    int stop_flag = 0;
          556  +    encode_ctx ctx;
          557  +    int ret;
          558  +/* Get image width and height */
          559  +    W = img->sx;
          560  +    H = img->sy;
          561  +    data_size = img->sx * img->sy;
          562  +    if (image_type != IMAGE_WAVELET_BW)
          563  +	data_size *= 3;
          564  +/* Compute number of blocks */
          565  +    if (W % block_size)
          566  +	x_blocks = W / block_size + 1;
          567  +    else
          568  +	x_blocks = W / block_size;
          569  +    if (H % block_size)
          570  +	y_blocks = H / block_size + 1;
          571  +    else
          572  +	y_blocks = H / block_size;
          573  +/* Compute number of bytes per block */
          574  +    n_blocks = x_blocks * y_blocks;
          575  +    bytes_per_block = (int) ((double) data_size / (ratio * n_blocks));
          576  +/* Clip buffer size if needed */
          577  +    if (image_type == IMAGE_WAVELET_BW)
          578  +	bytes_per_block = MAX (bytes_per_block, EPS_MIN_GRAYSCALE_BUF + 1);
          579  +    else
          580  +	bytes_per_block = MAX (bytes_per_block, EPS_MIN_TRUECOLOR_BUF + 1);
          581  +    /* Prepare CTXs */
          582  +    ctx.filter_id = malloc (strlen ("daub97lift") + 1);
          583  +    strcpy (ctx.filter_id, "daub97lift");
          584  +    ctx.block_size = block_size;
          585  +    ctx.mode = EPS_MODE_OTLPF;
          586  +    ctx.bytes_per_block = bytes_per_block;
          587  +    ctx.Y_ratio = EPS_Y_RT;
          588  +    ctx.Cb_ratio = EPS_Cb_RT;
          589  +    ctx.Cr_ratio = EPS_Cr_RT;
          590  +    ctx.resample = EPS_RESAMPLE_420;
          591  +    ctx.W = W;
          592  +    ctx.H = H;
          593  +    ctx.img = img;
          594  +    ctx.image_type = image_type;
          595  +    ctx.output = malloc (1024 * 1024);
          596  +    ctx.out_size = 1024 * 1024;
          597  +    ctx.out_current = 0;
          598  +    ctx.n_blocks = n_blocks;
          599  +    ctx.done_blocks = &done_blocks;
          600  +    ctx.clear_len = &clear_len;
          601  +    ctx.stop_flag = &stop_flag;
          602  +/* performing actual encoding */
          603  +    ret = encode_blocks (&ctx);
          604  +/* memory clean-up */
          605  +    free (ctx.filter_id);
          606  +    if (ret)
          607  +      {
          608  +	  /* error case */
          609  +	  free (ctx.output);
          610  +	  *size = 0;
          611  +	  return NULL;
          612  +      }
          613  +    *size = ctx.out_current;
          614  +    return ctx.output;
          615  +}
          616  +
          617  +static int
          618  +decode_blocks (decode_ctx * ctx)
          619  +{
          620  +/* Input buffer */
          621  +    unsigned char *buf;
          622  +/* Output buffers */
          623  +    unsigned char **Y;
          624  +    unsigned char **R;
          625  +    unsigned char **G;
          626  +    unsigned char **B;
          627  +/* Handy shortcuts */
          628  +    int max_block_w = ctx->max_block_w;
          629  +    int max_block_h = ctx->max_block_h;
          630  +    int W = ctx->W;
          631  +    int H = ctx->H;
          632  +/* Error flag */
          633  +    int error_flag = 0;
          634  +/* Allocate input buffer */
          635  +    buf = (unsigned char *) eps_xmalloc (ctx->buf_size);
          636  +/* Allocate output buffers */
          637  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          638  +	Y = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          639  +					      sizeof (unsigned char));
          640  +    else
          641  +      {
          642  +	  R = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          643  +						sizeof (unsigned char));
          644  +	  G = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          645  +						sizeof (unsigned char));
          646  +	  B = (unsigned char **) eps_malloc_2D (max_block_w, max_block_h,
          647  +						sizeof (unsigned char));
          648  +      }
          649  +/* Process blocks */
          650  +    while (1)
          651  +      {
          652  +	  eps_block_header hdr;
          653  +	  int real_buf_size = ctx->buf_size;
          654  +	  int rc;
          655  +	  /* Are there any unprocessed blocks? */
          656  +	  if (*ctx->done_blocks == ctx->n_blocks)
          657  +	      break;
          658  +	  else
          659  +	      (*ctx->done_blocks)++;
          660  +	  /* Read next input block */
          661  +	  if (!decoder_read_next_block (ctx, buf, &real_buf_size))
          662  +	    {
          663  +		error_flag = 1;
          664  +		fprintf (stderr, "Waveletets-wrapper: Cannot read block\n");
          665  +		goto error;
          666  +	    }
          667  +	  /* Parse and check block header */
          668  +	  rc = eps_read_block_header (buf, real_buf_size, &hdr);
          669  +	  if (rc != EPS_OK)
          670  +	    {
          671  +		error_flag = 1;
          672  +		fprintf (stderr, "Waveletets-wrapper: Malformed block\n");
          673  +		goto error;
          674  +	    }
          675  +	  /* Check header CRC flag */
          676  +	  if (hdr.chk_flag == EPS_BAD_CRC)
          677  +	    {
          678  +		error_flag = 1;
          679  +		fprintf (stderr, "Wavelet-wrapper: Incorrect header CRC\n");
          680  +		goto error;
          681  +	    }
          682  +	  /* Check data CRC flag */
          683  +	  if (hdr.crc_flag == EPS_BAD_CRC)
          684  +	    {
          685  +		error_flag = 1;
          686  +		fprintf (stderr, "Wavelet-wrapper: Incorrect data CRC\n");
          687  +		goto error;
          688  +	    }
          689  +	  if (ctx->image_type == IMAGE_WAVELET_BW)
          690  +	    {
          691  +		/* Skip over broken blocks */
          692  +		if ((hdr.uhdr.gs.W != W) || (hdr.uhdr.gs.H != H))
          693  +		    continue;
          694  +		/* All function parameters are checked at the moment so everything except EPS_OK is a logical error. */
          695  +		rc = eps_decode_grayscale_block (Y, buf, &hdr);
          696  +		if (rc != EPS_OK)
          697  +		  {
          698  +		      error_flag = 1;
          699  +		      fprintf (stderr, "Wavelet-wrapper: decode error\n");
          700  +		      goto error;
          701  +		  }
          702  +		if (!decoder_write_grayscale
          703  +		    (ctx->img, Y, hdr.uhdr.gs.x, hdr.uhdr.gs.y, hdr.uhdr.gs.w,
          704  +		     hdr.uhdr.gs.h))
          705  +		  {
          706  +		      error_flag = 1;
          707  +		      fprintf (stderr, "Wavelet-wrapper: cannot write block\n");
          708  +		      goto error;
          709  +		  }
          710  +	    }
          711  +	  else
          712  +	    {
          713  +		/* Skip over broken blocks */
          714  +		if ((hdr.uhdr.tc.W != W) || (hdr.uhdr.tc.H != H))
          715  +		    continue;
          716  +		/* Decode block */
          717  +		rc = eps_decode_truecolor_block (R, G, B, buf, &hdr);
          718  +		if (rc != EPS_OK)
          719  +		  {
          720  +		      error_flag = 1;
          721  +		      fprintf (stderr, "Wavelet-wrapper: decode error\n");
          722  +		      goto error;
          723  +		  }
          724  +		/* Write encoded block */
          725  +		if (!decoder_write_rgb
          726  +		    (ctx->img, R, G, B, hdr.uhdr.tc.x, hdr.uhdr.tc.y,
          727  +		     hdr.uhdr.tc.w, hdr.uhdr.tc.h))
          728  +		  {
          729  +		      error_flag = 1;
          730  +		      fprintf (stderr, "Wavelet-wrapper: cannot write block\n");
          731  +		      goto error;
          732  +		  }
          733  +	    }
          734  +      }
          735  +  error:
          736  +/* Free input buffer */
          737  +    free (buf);
          738  +/* Free output buffers */
          739  +    if (ctx->image_type == IMAGE_WAVELET_BW)
          740  +	eps_free_2D ((void **) Y, max_block_w, max_block_h);
          741  +    else
          742  +      {
          743  +	  eps_free_2D ((void **) R, max_block_w, max_block_h);
          744  +	  eps_free_2D ((void **) G, max_block_w, max_block_h);
          745  +	  eps_free_2D ((void **) B, max_block_w, max_block_h);
          746  +      }
          747  +/* Return 0 for success or 1 for error */
          748  +    return error_flag;
          749  +}
          750  +
          751  +static int
          752  +check_header (const void *data, int size)
          753  +{
          754  +/* checking the SpatiaLite header */
          755  +    int len;
          756  +    char to_check[64];
          757  +    strcpy (to_check, "StartWaveletsImage$$");
          758  +    len = strlen (to_check) + 1;
          759  +    if (size > len)
          760  +      {
          761  +	  if (memcmp ((char *) data, to_check, len) == 0)
          762  +	      return len;
          763  +      }
          764  +    return 0;
          765  +}
          766  +
          767  +static int
          768  +check_footer (const void *data, int size)
          769  +{
          770  +/* checking the SpatiaLite footer */
          771  +    int len;
          772  +    char to_check[64];
          773  +    strcpy (to_check, "$$EndWaveletsImage");
          774  +    len = strlen (to_check) + 1;
          775  +    if (size > len)
          776  +      {
          777  +	  if (memcmp ((char *) data + (size - len), to_check, len) == 0)
          778  +	      return len;
          779  +      }
          780  +    return 0;
          781  +}
          782  +
          783  +static rasterliteImagePrt
          784  +wavelet_uncompress (int size, const void *data)
          785  +{
          786  +/* preparing the decompression */
          787  +    rasterliteImagePrt img;
          788  +    int ret;
          789  +    decode_ctx ctx;
          790  +/* Input buffer size */
          791  +    int buf_size;
          792  +/* Miscellaneous block stuff */
          793  +    int max_block_w;
          794  +    int max_block_h;
          795  +    int x_blocks;
          796  +    int y_blocks;
          797  +    int n_blocks;
          798  +    int done_blocks = 0;
          799  +    int clear_len = 0;
          800  +    int stop_flag = 0;
          801  +    int W;
          802  +    int H;
          803  +    int ext_type;
          804  +    int len;
          805  +/* checking the SpatiaLite header and footer */
          806  +    ctx.input = (unsigned char *) data;
          807  +    ctx.in_size = size;
          808  +    ctx.in_current = 0;
          809  +    len = check_header (data, size);
          810  +    if (len)
          811  +	ctx.in_current += len;
          812  +    else
          813  +	return NULL;
          814  +    len = check_footer (data, size);
          815  +    if (len)
          816  +	ctx.in_size -= len;
          817  +    else
          818  +	return NULL;
          819  +    ctx.in_base = ctx.in_current;
          820  +    if (!guess_wavelet_type
          821  +	(&ctx, &ext_type, &W, &H, &max_block_w, &max_block_h))
          822  +	return NULL;
          823  +    img = image_create (W, H);
          824  +/* Compute number of blocks */
          825  +    if (W % max_block_w)
          826  +	x_blocks = W / max_block_w + 1;
          827  +    else
          828  +	x_blocks = W / max_block_w;
          829  +    if (H % max_block_h)
          830  +	y_blocks = H / max_block_h + 1;
          831  +    else
          832  +	y_blocks = H / max_block_h;
          833  +/* Compute total number of blocks in the file */
          834  +    n_blocks = x_blocks * y_blocks;
          835  +    stop_flag = 0;
          836  +/* Prepare CTXs */
          837  +    if (ext_type == IMAGE_WAVELET_RGB)
          838  +      {
          839  +	  img->color_space = COLORSPACE_RGB;
          840  +	  buf_size = EPS_MAX_GRAYSCALE_BUF;
          841  +      }
          842  +    else
          843  +      {
          844  +	  img->color_space = COLORSPACE_GRAYSCALE;
          845  +	  buf_size = EPS_MAX_TRUECOLOR_BUF;
          846  +      }
          847  +    ctx.buf_size = buf_size;
          848  +    ctx.n_blocks = n_blocks;
          849  +    ctx.done_blocks = &done_blocks;
          850  +    ctx.clear_len = &clear_len;
          851  +    ctx.W = W;
          852  +    ctx.H = H;
          853  +    ctx.img = img;
          854  +    ctx.max_block_w = max_block_w;
          855  +    ctx.max_block_h = max_block_h;
          856  +    ctx.stop_flag = &stop_flag;
          857  +/* Decode blocks */
          858  +    ret = decode_blocks (&ctx);
          859  +    if (ret == 0)
          860  +	return img;
          861  +    image_destroy (img);
          862  +    return NULL;
          863  +}
          864  +
          865  +extern void *
          866  +image_to_wavelet (const rasterliteImagePrt img, int *size, int ratio)
          867  +{
          868  +/* compressing an image as WAVELET RGB */
          869  +    return wavelet_compress (img, size, ratio, IMAGE_WAVELET_RGB);
          870  +}
          871  +
          872  +extern void *
          873  +image_to_wavelet_grayscale (const rasterliteImagePrt img, int *size, int ratio)
          874  +{
          875  +/* compressing an image as JPEG WAVELET GRAYSCALE */
          876  +    return wavelet_compress (img, size, ratio, IMAGE_WAVELET_BW);
          877  +}
          878  +
          879  +extern rasterliteImagePrt
          880  +image_from_wavelet (int size, const void *data)
          881  +{
          882  +/* uncompressing a WAVELET compressed image */
          883  +    rasterliteImagePrt img;
          884  +    img = wavelet_uncompress (size, data);
          885  +    return img;
          886  +}

Added librasterlite.def.

            1  +LIBRARY rasterlite.dll
            2  +EXPORTS
            3  +rasterliteClose
            4  +rasterliteExportGeoTiff
            5  +rasterliteGetBackgroundColor
            6  +rasterliteGetBestAccess
            7  +rasterliteGetExtent
            8  +rasterliteGetLastError
            9  +rasterliteGetLevels
           10  +rasterliteGetPath
           11  +rasterliteGetRaster
           12  +rasterliteGetRaster2
           13  +rasterliteGetRasterByRect
           14  +rasterliteGetRasterByRect2
           15  +rasterliteGetResolution
           16  +rasterliteGetSpatialiteVersion
           17  +rasterliteGetSqliteVersion
           18  +rasterliteGetSrid
           19  +rasterliteGetTablePrefix
           20  +rasterliteGetTransparentColor
           21  +rasterliteHasTransparentColor
           22  +rasterliteIsError
           23  +rasterliteOpen
           24  +rasterliteSetBackgroundColor
           25  +rasterliteSetTransparentColor
           26  +rasterliteWaveletToPng

Changes to ltmain.sh.

     1         -/usr/share/libtool/config/ltmain.sh
            1  +# ltmain.sh - Provide generalized library-building support services.
            2  +# NOTE: Changing this file will not affect anything until you rerun configure.
            3  +#
            4  +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
            5  +# 2007, 2008  Free Software Foundation, Inc.
            6  +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
            7  +#
            8  +# This program is free software; you can redistribute it and/or modify
            9  +# it under the terms of the GNU General Public License as published by
           10  +# the Free Software Foundation; either version 2 of the License, or
           11  +# (at your option) any later version.
           12  +#
           13  +# This program is distributed in the hope that it will be useful, but
           14  +# WITHOUT ANY WARRANTY; without even the implied warranty of
           15  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
           16  +# General Public License for more details.
           17  +#
           18  +# You should have received a copy of the GNU General Public License
           19  +# along with this program; if not, write to the Free Software
           20  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
           21  +#
           22  +# As a special exception to the GNU General Public License, if you
           23  +# distribute this file as part of a program that contains a
           24  +# configuration script generated by Autoconf, you may include it under
           25  +# the same distribution terms that you use for the rest of that program.
           26  +
           27  +basename="s,^.*/,,g"
           28  +
           29  +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
           30  +# is ksh but when the shell is invoked as "sh" and the current value of
           31  +# the _XPG environment variable is not equal to 1 (one), the special
           32  +# positional parameter $0, within a function call, is the name of the
           33  +# function.
           34  +progpath="$0"
           35  +
           36  +# The name of this program:
           37  +progname=`echo "$progpath" | $SED $basename`
           38  +modename="$progname"
           39  +
           40  +# Global variables:
           41  +EXIT_SUCCESS=0
           42  +EXIT_FAILURE=1
           43  +
           44  +PROGRAM=ltmain.sh
           45  +PACKAGE=libtool
           46  +VERSION="1.5.26 Debian 1.5.26-1ubuntu1"
           47  +TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
           48  +
           49  +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
           50  +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
           51  +  emulate sh
           52  +  NULLCMD=:
           53  +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
           54  +  # is contrary to our usage.  Disable this feature.
           55  +  alias -g '${1+"$@"}'='"$@"'
           56  +  setopt NO_GLOB_SUBST
           57  +else
           58  +  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
           59  +fi
           60  +BIN_SH=xpg4; export BIN_SH # for Tru64
           61  +DUALCASE=1; export DUALCASE # for MKS sh
           62  +
           63  +# Check that we have a working $echo.
           64  +if test "X$1" = X--no-reexec; then
           65  +  # Discard the --no-reexec flag, and continue.
           66  +  shift
           67  +elif test "X$1" = X--fallback-echo; then
           68  +  # Avoid inline document here, it may be left over
           69  +  :
           70  +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
           71  +  # Yippee, $echo works!
           72  +  :
           73  +else
           74  +  # Restart under the correct shell, and then maybe $echo will work.
           75  +  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
           76  +fi
           77  +
           78  +if test "X$1" = X--fallback-echo; then
           79  +  # used as fallback echo
           80  +  shift
           81  +  cat <<EOF
           82  +$*
           83  +EOF
           84  +  exit $EXIT_SUCCESS
           85  +fi
           86  +
           87  +default_mode=
           88  +help="Try \`$progname --help' for more information."
           89  +magic="%%%MAGIC variable%%%"
           90  +mkdir="mkdir"
           91  +mv="mv -f"
           92  +rm="rm -f"
           93  +
           94  +# Sed substitution that helps us do robust quoting.  It backslashifies
           95  +# metacharacters that are still active within double-quoted strings.
           96  +Xsed="${SED}"' -e 1s/^X//'
           97  +sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
           98  +# test EBCDIC or ASCII
           99  +case `echo X|tr X '\101'` in
          100  + A) # ASCII based system
          101  +    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
          102  +  SP2NL='tr \040 \012'
          103  +  NL2SP='tr \015\012 \040\040'
          104  +  ;;
          105  + *) # EBCDIC based system
          106  +  SP2NL='tr \100 \n'
          107  +  NL2SP='tr \r\n \100\100'
          108  +  ;;
          109  +esac
          110  +
          111  +# NLS nuisances.
          112  +# Only set LANG and LC_ALL to C if already set.
          113  +# These must not be set unconditionally because not all systems understand
          114  +# e.g. LANG=C (notably SCO).
          115  +# We save the old values to restore during execute mode.
          116  +lt_env=
          117  +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
          118  +do
          119  +  eval "if test \"\${$lt_var+set}\" = set; then
          120  +	  save_$lt_var=\$$lt_var
          121  +	  lt_env=\"$lt_var=\$$lt_var \$lt_env\"
          122  +	  $lt_var=C
          123  +	  export $lt_var
          124  +	fi"
          125  +done
          126  +
          127  +if test -n "$lt_env"; then
          128  +  lt_env="env $lt_env"
          129  +fi
          130  +
          131  +# Make sure IFS has a sensible default
          132  +lt_nl='
          133  +'
          134  +IFS=" 	$lt_nl"
          135  +
          136  +if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
          137  +  $echo "$modename: not configured to build any kind of library" 1>&2
          138  +  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
          139  +  exit $EXIT_FAILURE
          140  +fi
          141  +
          142  +# Global variables.
          143  +mode=$default_mode
          144  +nonopt=
          145  +prev=
          146  +prevopt=
          147  +run=
          148  +show="$echo"
          149  +show_help=
          150  +execute_dlfiles=
          151  +duplicate_deps=no
          152  +preserve_args=
          153  +lo2o="s/\\.lo\$/.${objext}/"
          154  +o2lo="s/\\.${objext}\$/.lo/"
          155  +extracted_archives=
          156  +extracted_serial=0
          157  +
          158  +#####################################
          159  +# Shell function definitions:
          160  +# This seems to be the best place for them
          161  +
          162  +# func_mktempdir [string]
          163  +# Make a temporary directory that won't clash with other running
          164  +# libtool processes, and avoids race conditions if possible.  If
          165  +# given, STRING is the basename for that directory.
          166  +func_mktempdir ()
          167  +{
          168  +    my_template="${TMPDIR-/tmp}/${1-$progname}"
          169  +
          170  +    if test "$run" = ":"; then
          171  +      # Return a directory name, but don't create it in dry-run mode
          172  +      my_tmpdir="${my_template}-$$"
          173  +    else
          174  +
          175  +      # If mktemp works, use that first and foremost
          176  +      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
          177  +
          178  +      if test ! -d "$my_tmpdir"; then
          179  +	# Failing that, at least try and use $RANDOM to avoid a race
          180  +	my_tmpdir="${my_template}-${RANDOM-0}$$"
          181  +
          182  +	save_mktempdir_umask=`umask`
          183  +	umask 0077
          184  +	$mkdir "$my_tmpdir"
          185  +	umask $save_mktempdir_umask
          186  +      fi
          187  +
          188  +      # If we're not in dry-run mode, bomb out on failure
          189  +      test -d "$my_tmpdir" || {
          190  +        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
          191  +	exit $EXIT_FAILURE
          192  +      }
          193  +    fi
          194  +
          195  +    $echo "X$my_tmpdir" | $Xsed
          196  +}
          197  +
          198  +
          199  +# func_win32_libid arg
          200  +# return the library type of file 'arg'
          201  +#
          202  +# Need a lot of goo to handle *both* DLLs and import libs
          203  +# Has to be a shell function in order to 'eat' the argument
          204  +# that is supplied when $file_magic_command is called.
          205  +func_win32_libid ()
          206  +{
          207  +  win32_libid_type="unknown"
          208  +  win32_fileres=`file -L $1 2>/dev/null`
          209  +  case $win32_fileres in
          210  +  *ar\ archive\ import\ library*) # definitely import
          211  +    win32_libid_type="x86 archive import"
          212  +    ;;
          213  +  *ar\ archive*) # could be an import, or static
          214  +    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
          215  +      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
          216  +      win32_nmres=`eval $NM -f posix -A $1 | \
          217  +	$SED -n -e '1,100{
          218  +		/ I /{
          219  +			s,.*,import,
          220  +			p
          221  +			q
          222  +			}
          223  +		}'`
          224  +      case $win32_nmres in
          225  +      import*)  win32_libid_type="x86 archive import";;
          226  +      *)        win32_libid_type="x86 archive static";;
          227  +      esac
          228  +    fi
          229  +    ;;
          230  +  *DLL*)
          231  +    win32_libid_type="x86 DLL"
          232  +    ;;
          233  +  *executable*) # but shell scripts are "executable" too...
          234  +    case $win32_fileres in
          235  +    *MS\ Windows\ PE\ Intel*)
          236  +      win32_libid_type="x86 DLL"
          237  +      ;;
          238  +    esac
          239  +    ;;
          240  +  esac
          241  +  $echo $win32_libid_type
          242  +}
          243  +
          244  +
          245  +# func_infer_tag arg
          246  +# Infer tagged configuration to use if any are available and
          247  +# if one wasn't chosen via the "--tag" command line option.
          248  +# Only attempt this if the compiler in the base compile
          249  +# command doesn't match the default compiler.
          250  +# arg is usually of the form 'gcc ...'
          251  +func_infer_tag ()
          252  +{
          253  +    if test -n "$available_tags" && test -z "$tagname"; then
          254  +      CC_quoted=
          255  +      for arg in $CC; do
          256  +	case $arg in
          257  +	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
          258  +	  arg="\"$arg\""
          259  +	  ;;
          260  +	esac
          261  +	CC_quoted="$CC_quoted $arg"
          262  +      done
          263  +      case $@ in
          264  +      # Blanks in the command may have been stripped by the calling shell,
          265  +      # but not from the CC environment variable when configure was run.
          266  +      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
          267  +      # Blanks at the start of $base_compile will cause this to fail
          268  +      # if we don't check for them as well.
          269  +      *)
          270  +	for z in $available_tags; do
          271  +	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
          272  +	    # Evaluate the configuration.
          273  +	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
          274  +	    CC_quoted=
          275  +	    for arg in $CC; do
          276  +	    # Double-quote args containing other shell metacharacters.
          277  +	    case $arg in
          278  +	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
          279  +	      arg="\"$arg\""
          280  +	      ;;
          281  +	    esac
          282  +	    CC_quoted="$CC_quoted $arg"
          283  +	  done
          284  +	    case "$@ " in
          285  +	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
          286  +	      # The compiler in the base compile command matches
          287  +	      # the one in the tagged configuration.
          288  +	      # Assume this is the tagged configuration we want.
          289  +	      tagname=$z
          290  +	      break
          291  +	      ;;
          292  +	    esac
          293  +	  fi
          294  +	done
          295  +	# If $tagname still isn't set, then no tagged configuration
          296  +	# was found and let the user know that the "--tag" command
          297  +	# line option must be used.
          298  +	if test -z "$tagname"; then
          299  +	  $echo "$modename: unable to infer tagged configuration"
          300  +	  $echo "$modename: specify a tag with \`--tag'" 1>&2
          301  +	  exit $EXIT_FAILURE
          302  +#        else
          303  +#          $echo "$modename: using $tagname tagged configuration"
          304  +	fi
          305  +	;;
          306  +      esac
          307  +    fi
          308  +}
          309  +
          310  +
          311  +# func_extract_an_archive dir oldlib
          312  +func_extract_an_archive ()
          313  +{
          314  +    f_ex_an_ar_dir="$1"; shift
          315  +    f_ex_an_ar_oldlib="$1"
          316  +
          317  +    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
          318  +    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
          319  +    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
          320  +     :
          321  +    else
          322  +      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
          323  +      exit $EXIT_FAILURE
          324  +    fi
          325  +}
          326  +
          327  +# func_extract_archives gentop oldlib ...
          328  +func_extract_archives ()
          329  +{
          330  +    my_gentop="$1"; shift
          331  +    my_oldlibs=${1+"$@"}
          332  +    my_oldobjs=""
          333  +    my_xlib=""
          334  +    my_xabs=""
          335  +    my_xdir=""
          336  +    my_status=""
          337  +
          338  +    $show "${rm}r $my_gentop"
          339  +    $run ${rm}r "$my_gentop"
          340  +    $show "$mkdir $my_gentop"
          341  +    $run $mkdir "$my_gentop"
          342  +    my_status=$?
          343  +    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
          344  +      exit $my_status
          345  +    fi
          346  +
          347  +    for my_xlib in $my_oldlibs; do
          348  +      # Extract the objects.
          349  +      case $my_xlib in
          350  +	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
          351  +	*) my_xabs=`pwd`"/$my_xlib" ;;
          352  +      esac
          353  +      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
          354  +      my_xlib_u=$my_xlib
          355  +      while :; do
          356  +        case " $extracted_archives " in
          357  +	*" $my_xlib_u "*)
          358  +	  extracted_serial=`expr $extracted_serial + 1`
          359  +	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
          360  +	*) break ;;
          361  +	esac
          362  +      done
          363  +      extracted_archives="$extracted_archives $my_xlib_u"
          364  +      my_xdir="$my_gentop/$my_xlib_u"
          365  +
          366  +      $show "${rm}r $my_xdir"
          367  +      $run ${rm}r "$my_xdir"
          368  +      $show "$mkdir $my_xdir"
          369  +      $run $mkdir "$my_xdir"
          370  +      exit_status=$?
          371  +      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
          372  +	exit $exit_status
          373  +      fi
          374  +      case $host in
          375  +      *-darwin*)
          376  +	$show "Extracting $my_xabs"
          377  +	# Do not bother doing anything if just a dry run
          378  +	if test -z "$run"; then
          379  +	  darwin_orig_dir=`pwd`
          380  +	  cd $my_xdir || exit $?
          381  +	  darwin_archive=$my_xabs
          382  +	  darwin_curdir=`pwd`
          383  +	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
          384  +	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
          385  +	  if test -n "$darwin_arches"; then 
          386  +	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
          387  +	    darwin_arch=
          388  +	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
          389  +	    for darwin_arch in  $darwin_arches ; do
          390  +	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
          391  +	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
          392  +	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
          393  +	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
          394  +	      cd "$darwin_curdir"
          395  +	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
          396  +	    done # $darwin_arches
          397  +      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
          398  +	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
          399  +	    darwin_file=
          400  +	    darwin_files=
          401  +	    for darwin_file in $darwin_filelist; do
          402  +	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
          403  +	      lipo -create -output "$darwin_file" $darwin_files
          404  +	    done # $darwin_filelist
          405  +	    ${rm}r unfat-$$
          406  +	    cd "$darwin_orig_dir"
          407  +	  else
          408  +	    cd "$darwin_orig_dir"
          409  + 	    func_extract_an_archive "$my_xdir" "$my_xabs"
          410  +	  fi # $darwin_arches
          411  +	fi # $run
          412  +	;;
          413  +      *)
          414  +        func_extract_an_archive "$my_xdir" "$my_xabs"
          415  +        ;;
          416  +      esac
          417  +      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
          418  +    done
          419  +    func_extract_archives_result="$my_oldobjs"
          420  +}
          421  +# End of Shell function definitions
          422  +#####################################
          423  +
          424  +# Darwin sucks
          425  +eval std_shrext=\"$shrext_cmds\"
          426  +
          427  +disable_libs=no
          428  +
          429  +# Parse our command line options once, thoroughly.
          430  +while test "$#" -gt 0
          431  +do
          432  +  arg="$1"
          433  +  shift
          434  +
          435  +  case $arg in
          436  +  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
          437  +  *) optarg= ;;
          438  +  esac
          439  +
          440  +  # If the previous option needs an argument, assign it.
          441  +  if test -n "$prev"; then
          442  +    case $prev in
          443  +    execute_dlfiles)
          444  +      execute_dlfiles="$execute_dlfiles $arg"
          445  +      ;;
          446  +    tag)
          447  +      tagname="$arg"
          448  +      preserve_args="${preserve_args}=$arg"
          449  +
          450  +      # Check whether tagname contains only valid characters
          451  +      case $tagname in
          452  +      *[!-_A-Za-z0-9,/]*)
          453  +	$echo "$progname: invalid tag name: $tagname" 1>&2
          454  +	exit $EXIT_FAILURE
          455  +	;;
          456  +      esac
          457  +
          458  +      case $tagname in
          459  +      CC)
          460  +	# Don't test for the "default" C tag, as we know, it's there, but
          461  +	# not specially marked.
          462  +	;;
          463  +      *)
          464  +	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
          465  +	  taglist="$taglist $tagname"
          466  +	  # Evaluate the configuration.
          467  +	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
          468  +	else
          469  +	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
          470  +	fi
          471  +	;;
          472  +      esac
          473  +      ;;
          474  +    *)
          475  +      eval "$prev=\$arg"
          476  +      ;;
          477  +    esac
          478  +
          479  +    prev=
          480  +    prevopt=
          481  +    continue
          482  +  fi
          483  +
          484  +  # Have we seen a non-optional argument yet?
          485  +  case $arg in
          486  +  --help)
          487  +    show_help=yes
          488  +    ;;
          489  +
          490  +  --version)
          491  +    echo "\
          492  +$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
          493  +
          494  +Copyright (C) 2008  Free Software Foundation, Inc.
          495  +This is free software; see the source for copying conditions.  There is NO
          496  +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
          497  +    exit $?
          498  +    ;;
          499  +
          500  +  --config)
          501  +    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
          502  +    # Now print the configurations for the tags.
          503  +    for tagname in $taglist; do
          504  +      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
          505  +    done
          506  +    exit $?
          507  +    ;;
          508  +
          509  +  --debug)
          510  +    $echo "$progname: enabling shell trace mode"
          511  +    set -x
          512  +    preserve_args="$preserve_args $arg"
          513  +    ;;
          514  +
          515  +  --dry-run | -n)
          516  +    run=:
          517  +    ;;
          518  +
          519  +  --features)
          520  +    $echo "host: $host"
          521  +    if test "$build_libtool_libs" = yes; then
          522  +      $echo "enable shared libraries"
          523  +    else
          524  +      $echo "disable shared libraries"
          525  +    fi
          526  +    if test "$build_old_libs" = yes; then
          527  +      $echo "enable static libraries"
          528  +    else
          529  +      $echo "disable static libraries"
          530  +    fi
          531  +    exit $?
          532  +    ;;
          533  +
          534  +  --finish) mode="finish" ;;
          535  +
          536  +  --mode) prevopt="--mode" prev=mode ;;
          537  +  --mode=*) mode="$optarg" ;;
          538  +
          539  +  --preserve-dup-deps) duplicate_deps="yes" ;;
          540  +
          541  +  --quiet | --silent)
          542  +    show=:
          543  +    preserve_args="$preserve_args $arg"
          544  +    ;;
          545  +
          546  +  --tag)
          547  +    prevopt="--tag"
          548  +    prev=tag
          549  +    preserve_args="$preserve_args --tag"
          550  +    ;;
          551  +  --tag=*)
          552  +    set tag "$optarg" ${1+"$@"}
          553  +    shift
          554  +    prev=tag
          555  +    preserve_args="$preserve_args --tag"
          556  +    ;;
          557  +
          558  +  -dlopen)
          559  +    prevopt="-dlopen"
          560  +    prev=execute_dlfiles
          561  +    ;;
          562  +
          563  +  -*)
          564  +    $echo "$modename: unrecognized option \`$arg'" 1>&2
          565  +    $echo "$help" 1>&2
          566  +    exit $EXIT_FAILURE
          567  +    ;;
          568  +
          569  +  *)
          570  +    nonopt="$arg"
          571  +    break
          572  +    ;;
          573  +  esac
          574  +done
          575  +
          576  +if test -n "$prevopt"; then
          577  +  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
          578  +  $echo "$help" 1>&2
          579  +  exit $EXIT_FAILURE
          580  +fi
          581  +
          582  +case $disable_libs in
          583  +no) 
          584  +  ;;
          585  +shared)
          586  +  build_libtool_libs=no
          587  +  build_old_libs=yes
          588  +  ;;
          589  +static)
          590  +  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
          591  +  ;;
          592  +esac
          593  +
          594  +# If this variable is set in any of the actions, the command in it
          595  +# will be execed at the end.  This prevents here-documents from being
          596  +# left over by shells.
          597  +exec_cmd=
          598  +
          599  +if test -z "$show_help"; then
          600  +
          601  +  # Infer the operation mode.
          602  +  if test -z "$mode"; then
          603  +    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
          604  +    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
          605  +    case $nonopt in
          606  +    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
          607  +      mode=link
          608  +      for arg
          609  +      do
          610  +	case $arg in
          611  +	-c)
          612  +	   mode=compile
          613  +	   break
          614  +	   ;;
          615  +	esac
          616  +      done
          617  +      ;;
          618  +    *db | *dbx | *strace | *truss)
          619  +      mode=execute
          620  +      ;;
          621  +    *install*|cp|mv)
          622  +      mode=install
          623  +      ;;
          624  +    *rm)
          625  +      mode=uninstall
          626  +      ;;
          627  +    *)
          628  +      # If we have no mode, but dlfiles were specified, then do execute mode.
          629  +      test -n "$execute_dlfiles" && mode=execute
          630  +
          631  +      # Just use the default operation mode.
          632  +      if test -z "$mode"; then
          633  +	if test -n "$nonopt"; then
          634  +	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
          635  +	else
          636  +	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
          637  +	fi
          638  +      fi
          639  +      ;;
          640  +    esac
          641  +  fi
          642  +
          643  +  # Only execute mode is allowed to have -dlopen flags.
          644  +  if test -n "$execute_dlfiles" && test "$mode" != execute; then
          645  +    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
          646  +    $echo "$help" 1>&2
          647  +    exit $EXIT_FAILURE
          648  +  fi
          649  +
          650  +  # Change the help message to a mode-specific one.
          651  +  generic_help="$help"
          652  +  help="Try \`$modename --help --mode=$mode' for more information."
          653  +
          654  +  # These modes are in order of execution frequency so that they run quickly.
          655  +  case $mode in
          656  +  # libtool compile mode
          657  +  compile)
          658  +    modename="$modename: compile"
          659  +    # Get the compilation command and the source file.
          660  +    base_compile=
          661  +    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
          662  +    suppress_opt=yes
          663  +    suppress_output=
          664  +    arg_mode=normal
          665  +    libobj=
          666  +    later=
          667  +
          668  +    for arg
          669  +    do
          670  +      case $arg_mode in
          671  +      arg  )
          672  +	# do not "continue".  Instead, add this to base_compile
          673  +	lastarg="$arg"
          674  +	arg_mode=normal
          675  +	;;
          676  +
          677  +      target )
          678  +	libobj="$arg"
          679  +	arg_mode=normal
          680  +	continue
          681  +	;;
          682  +
          683  +      normal )
          684  +	# Accept any command-line options.
          685  +	case $arg in
          686  +	-o)
          687  +	  if test -n "$libobj" ; then
          688  +	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
          689  +	    exit $EXIT_FAILURE
          690  +	  fi
          691  +	  arg_mode=target
          692  +	  continue
          693  +	  ;;
          694  +
          695  +	-static | -prefer-pic | -prefer-non-pic)
          696  +	  later="$later $arg"
          697  +	  continue
          698  +	  ;;
          699  +
          700  +	-no-suppress)
          701  +	  suppress_opt=no
          702  +	  continue
          703  +	  ;;
          704  +
          705  +	-Xcompiler)
          706  +	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
          707  +	  continue      #  The current "srcfile" will either be retained or
          708  +	  ;;            #  replaced later.  I would guess that would be a bug.
          709  +
          710  +	-Wc,*)
          711  +	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
          712  +	  lastarg=
          713  +	  save_ifs="$IFS"; IFS=','
          714  + 	  for arg in $args; do
          715  +	    IFS="$save_ifs"
          716  +
          717  +	    # Double-quote args containing other shell metacharacters.
          718  +	    # Many Bourne shells cannot handle close brackets correctly
          719  +	    # in scan sets, so we specify it separately.
          720  +	    case $arg in
          721  +	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
          722  +	      arg="\"$arg\""
          723  +	      ;;
          724  +	    esac
          725  +	    lastarg="$lastarg $arg"
          726  +	  done
          727  +	  IFS="$save_ifs"
          728  +	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
          729  +
          730  +	  # Add the arguments to base_compile.
          731  +	  base_compile="$base_compile $lastarg"
          732  +	  continue
          733  +	  ;;
          734  +
          735  +	* )
          736  +	  # Accept the current argument as the source file.
          737  +	  # The previous "srcfile" becomes the current argument.
          738  +	  #
          739  +	  lastarg="$srcfile"
          740  +	  srcfile="$arg"
          741  +	  ;;
          742  +	esac  #  case $arg
          743  +	;;
          744  +      esac    #  case $arg_mode
          745  +
          746  +      # Aesthetically quote the previous argument.
          747  +      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
          748  +
          749  +      case $lastarg in
          750  +      # Double-quote args containing other shell metacharacters.
          751  +      # Many Bourne shells cannot handle close brackets correctly
          752  +      # in scan sets, and some SunOS ksh mistreat backslash-escaping
          753  +      # in scan sets (worked around with variable expansion),
          754  +      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
          755  +      # at all, so we specify them separately.
          756  +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
          757  +	lastarg="\"$lastarg\""
          758  +	;;
          759  +      esac
          760  +
          761  +      base_compile="$base_compile $lastarg"
          762  +    done # for arg
          763  +
          764  +    case $arg_mode in
          765  +    arg)
          766  +      $echo "$modename: you must specify an argument for -Xcompile"
          767  +      exit $EXIT_FAILURE
          768  +      ;;
          769  +    target)
          770  +      $echo "$modename: you must specify a target with \`-o'" 1>&2
          771  +      exit $EXIT_FAILURE
          772  +      ;;
          773  +    *)
          774  +      # Get the name of the library object.
          775  +      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
          776  +      ;;
          777  +    esac
          778  +
          779  +    # Recognize several different file suffixes.
          780  +    # If the user specifies -o file.o, it is replaced with file.lo
          781  +    xform='[cCFSifmso]'
          782  +    case $libobj in
          783  +    *.ada) xform=ada ;;
          784  +    *.adb) xform=adb ;;
          785  +    *.ads) xform=ads ;;
          786  +    *.asm) xform=asm ;;
          787  +    *.c++) xform=c++ ;;
          788  +    *.cc) xform=cc ;;
          789  +    *.ii) xform=ii ;;
          790  +    *.class) xform=class ;;
          791  +    *.cpp) xform=cpp ;;
          792  +    *.cxx) xform=cxx ;;
          793  +    *.[fF][09]?) xform=[fF][09]. ;;
          794  +    *.for) xform=for ;;
          795  +    *.java) xform=java ;;
          796  +    *.obj) xform=obj ;;
          797  +    *.sx) xform=sx ;;
          798  +    esac
          799  +
          800  +    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
          801  +
          802  +    case $libobj in
          803  +    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
          804  +    *)
          805  +      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
          806  +      exit $EXIT_FAILURE
          807  +      ;;
          808  +    esac
          809  +
          810  +    func_infer_tag $base_compile
          811  +
          812  +    for arg in $later; do
          813  +      case $arg in
          814  +      -static)
          815  +	build_old_libs=yes
          816  +	continue
          817  +	;;
          818  +
          819  +      -prefer-pic)
          820  +	pic_mode=yes
          821  +	continue
          822  +	;;
          823  +
          824  +      -prefer-non-pic)
          825  +	pic_mode=no
          826  +	continue
          827  +	;;
          828  +      esac
          829  +    done
          830  +
          831  +    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
          832  +    case $qlibobj in
          833  +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
          834  +	qlibobj="\"$qlibobj\"" ;;
          835  +    esac
          836  +    test "X$libobj" != "X$qlibobj" \
          837  +	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
          838  +	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
          839  +    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
          840  +    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
          841  +    if test "X$xdir" = "X$obj"; then
          842  +      xdir=
          843  +    else
          844  +      xdir=$xdir/
          845  +    fi
          846  +    lobj=${xdir}$objdir/$objname
          847  +
          848  +    if test -z "$base_compile"; then
          849  +      $echo "$modename: you must specify a compilation command" 1>&2
          850  +      $echo "$help" 1>&2
          851  +      exit $EXIT_FAILURE
          852  +    fi
          853  +
          854  +    # Delete any leftover library objects.
          855  +    if test "$build_old_libs" = yes; then
          856  +      removelist="$obj $lobj $libobj ${libobj}T"
          857  +    else
          858  +      removelist="$lobj $libobj ${libobj}T"
          859  +    fi
          860  +
          861  +    $run $rm $removelist
          862  +    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
          863  +
          864  +    # On Cygwin there's no "real" PIC flag so we must build both object types
          865  +    case $host_os in
          866  +    cygwin* | mingw* | pw32* | os2*)
          867  +      pic_mode=default
          868  +      ;;
          869  +    esac
          870  +    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
          871  +      # non-PIC code in shared libraries is not supported
          872  +      pic_mode=default
          873  +    fi
          874  +
          875  +    # Calculate the filename of the output object if compiler does
          876  +    # not support -o with -c
          877  +    if test "$compiler_c_o" = no; then
          878  +      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
          879  +      lockfile="$output_obj.lock"
          880  +      removelist="$removelist $output_obj $lockfile"
          881  +      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
          882  +    else
          883  +      output_obj=
          884  +      need_locks=no
          885  +      lockfile=
          886  +    fi
          887  +
          888  +    # Lock this critical section if it is needed
          889  +    # We use this script file to make the link, it avoids creating a new file
          890  +    if test "$need_locks" = yes; then
          891  +      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
          892  +	$show "Waiting for $lockfile to be removed"
          893  +	sleep 2
          894  +      done
          895  +    elif test "$need_locks" = warn; then
          896  +      if test -f "$lockfile"; then
          897  +	$echo "\
          898  +*** ERROR, $lockfile exists and contains:
          899  +`cat $lockfile 2>/dev/null`
          900  +
          901  +This indicates that another process is trying to use the same
          902  +temporary object file, and libtool could not work around it because
          903  +your compiler does not support \`-c' and \`-o' together.  If you
          904  +repeat this compilation, it may succeed, by chance, but you had better
          905  +avoid parallel builds (make -j) in this platform, or get a better
          906  +compiler."
          907  +
          908  +	$run $rm $removelist
          909  +	exit $EXIT_FAILURE
          910  +      fi
          911  +      $echo "$srcfile" > "$lockfile"
          912  +    fi
          913  +
          914  +    if test -n "$fix_srcfile_path"; then
          915  +      eval srcfile=\"$fix_srcfile_path\"
          916  +    fi
          917  +    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
          918  +    case $qsrcfile in
          919  +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
          920  +      qsrcfile="\"$qsrcfile\"" ;;
          921  +    esac
          922  +
          923  +    $run $rm "$libobj" "${libobj}T"
          924  +
          925  +    # Create a libtool object file (analogous to a ".la" file),
          926  +    # but don't create it if we're doing a dry run.
          927  +    test -z "$run" && cat > ${libobj}T <<EOF
          928  +# $libobj - a libtool object file
          929  +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
          930  +#
          931  +# Please DO NOT delete this file!
          932  +# It is necessary for linking the library.
          933  +
          934  +# Name of the PIC object.
          935  +EOF
          936  +
          937  +    # Only build a PIC object if we are building libtool libraries.
          938  +    if test "$build_libtool_libs" = yes; then
          939  +      # Without this assignment, base_compile gets emptied.
          940  +      fbsd_hideous_sh_bug=$base_compile
          941  +
          942  +      if test "$pic_mode" != no; then
          943  +	command="$base_compile $qsrcfile $pic_flag"
          944  +      else
          945  +	# Don't build PIC code
          946  +	command="$base_compile $qsrcfile"
          947  +      fi
          948  +
          949  +      if test ! -d "${xdir}$objdir"; then
          950  +	$show "$mkdir ${xdir}$objdir"
          951  +	$run $mkdir ${xdir}$objdir
          952  +	exit_status=$?
          953  +	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
          954  +	  exit $exit_status
          955  +	fi
          956  +      fi
          957  +
          958  +      if test -z "$output_obj"; then
          959  +	# Place PIC objects in $objdir
          960  +	command="$command -o $lobj"
          961  +      fi
          962  +
          963  +      $run $rm "$lobj" "$output_obj"
          964  +
          965  +      $show "$command"
          966  +      if $run eval $lt_env "$command"; then :
          967  +      else
          968  +	test -n "$output_obj" && $run $rm $removelist
          969  +	exit $EXIT_FAILURE
          970  +      fi
          971  +
          972  +      if test "$need_locks" = warn &&
          973  +	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
          974  +	$echo "\
          975  +*** ERROR, $lockfile contains:
          976  +`cat $lockfile 2>/dev/null`
          977  +
          978  +but it should contain:
          979  +$srcfile
          980  +
          981  +This indicates that another process is trying to use the same
          982  +temporary object file, and libtool could not work around it because
          983  +your compiler does not support \`-c' and \`-o' together.  If you
          984  +repeat this compilation, it may succeed, by chance, but you had better
          985  +avoid parallel builds (make -j) in this platform, or get a better
          986  +compiler."
          987  +
          988  +	$run $rm $removelist
          989  +	exit $EXIT_FAILURE
          990  +      fi
          991  +
          992  +      # Just move the object if needed, then go on to compile the next one
          993  +      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
          994  +	$show "$mv $output_obj $lobj"
          995  +	if $run $mv $output_obj $lobj; then :
          996  +	else
          997  +	  error=$?
          998  +	  $run $rm $removelist
          999  +	  exit $error
         1000  +	fi
         1001  +      fi
         1002  +
         1003  +      # Append the name of the PIC object to the libtool object file.
         1004  +      test -z "$run" && cat >> ${libobj}T <<EOF
         1005  +pic_object='$objdir/$objname'
         1006  +
         1007  +EOF
         1008  +
         1009  +      # Allow error messages only from the first compilation.
         1010  +      if test "$suppress_opt" = yes; then
         1011  +        suppress_output=' >/dev/null 2>&1'
         1012  +      fi
         1013  +    else
         1014  +      # No PIC object so indicate it doesn't exist in the libtool
         1015  +      # object file.
         1016  +      test -z "$run" && cat >> ${libobj}T <<EOF
         1017  +pic_object=none
         1018  +
         1019  +EOF
         1020  +    fi
         1021  +
         1022  +    # Only build a position-dependent object if we build old libraries.
         1023  +    if test "$build_old_libs" = yes; then
         1024  +      if test "$pic_mode" != yes; then
         1025  +	# Don't build PIC code
         1026  +	command="$base_compile $qsrcfile"
         1027  +      else
         1028  +	command="$base_compile $qsrcfile $pic_flag"
         1029  +      fi
         1030  +      if test "$compiler_c_o" = yes; then
         1031  +	command="$command -o $obj"
         1032  +      fi
         1033  +
         1034  +      # Suppress compiler output if we already did a PIC compilation.
         1035  +      command="$command$suppress_output"
         1036  +      $run $rm "$obj" "$output_obj"
         1037  +      $show "$command"
         1038  +      if $run eval $lt_env "$command"; then :
         1039  +      else
         1040  +	$run $rm $removelist
         1041  +	exit $EXIT_FAILURE
         1042  +      fi
         1043  +
         1044  +      if test "$need_locks" = warn &&
         1045  +	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
         1046  +	$echo "\
         1047  +*** ERROR, $lockfile contains:
         1048  +`cat $lockfile 2>/dev/null`
         1049  +
         1050  +but it should contain:
         1051  +$srcfile
         1052  +
         1053  +This indicates that another process is trying to use the same
         1054  +temporary object file, and libtool could not work around it because
         1055  +your compiler does not support \`-c' and \`-o' together.  If you
         1056  +repeat this compilation, it may succeed, by chance, but you had better
         1057  +avoid parallel builds (make -j) in this platform, or get a better
         1058  +compiler."
         1059  +
         1060  +	$run $rm $removelist
         1061  +	exit $EXIT_FAILURE
         1062  +      fi
         1063  +
         1064  +      # Just move the object if needed
         1065  +      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
         1066  +	$show "$mv $output_obj $obj"
         1067  +	if $run $mv $output_obj $obj; then :
         1068  +	else
         1069  +	  error=$?
         1070  +	  $run $rm $removelist
         1071  +	  exit $error
         1072  +	fi
         1073  +      fi
         1074  +
         1075  +      # Append the name of the non-PIC object the libtool object file.
         1076  +      # Only append if the libtool object file exists.
         1077  +      test -z "$run" && cat >> ${libobj}T <<EOF
         1078  +# Name of the non-PIC object.
         1079  +non_pic_object='$objname'
         1080  +
         1081  +EOF
         1082  +    else
         1083  +      # Append the name of the non-PIC object the libtool object file.
         1084  +      # Only append if the libtool object file exists.
         1085  +      test -z "$run" && cat >> ${libobj}T <<EOF
         1086  +# Name of the non-PIC object.
         1087  +non_pic_object=none
         1088  +
         1089  +EOF
         1090  +    fi
         1091  +
         1092  +    $run $mv "${libobj}T" "${libobj}"
         1093  +
         1094  +    # Unlock the critical section if it was locked
         1095  +    if test "$need_locks" != no; then
         1096  +      $run $rm "$lockfile"
         1097  +    fi
         1098  +
         1099  +    exit $EXIT_SUCCESS
         1100  +    ;;
         1101  +
         1102  +  # libtool link mode
         1103  +  link | relink)
         1104  +    modename="$modename: link"
         1105  +    case $host in
         1106  +    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
         1107  +      # It is impossible to link a dll without this setting, and
         1108  +      # we shouldn't force the makefile maintainer to figure out
         1109  +      # which system we are compiling for in order to pass an extra
         1110  +      # flag for every libtool invocation.
         1111  +      # allow_undefined=no
         1112  +
         1113  +      # FIXME: Unfortunately, there are problems with the above when trying
         1114  +      # to make a dll which has undefined symbols, in which case not
         1115  +      # even a static library is built.  For now, we need to specify
         1116  +      # -no-undefined on the libtool link line when we can be certain
         1117  +      # that all symbols are satisfied, otherwise we get a static library.
         1118  +      allow_undefined=yes
         1119  +      ;;
         1120  +    *)
         1121  +      allow_undefined=yes
         1122  +      ;;
         1123  +    esac
         1124  +    libtool_args="$nonopt"
         1125  +    base_compile="$nonopt $@"
         1126  +    compile_command="$nonopt"
         1127  +    finalize_command="$nonopt"
         1128  +
         1129  +    compile_rpath=
         1130  +    finalize_rpath=
         1131  +    compile_shlibpath=
         1132  +    finalize_shlibpath=
         1133  +    convenience=
         1134  +    old_convenience=
         1135  +    deplibs=
         1136  +    old_deplibs=
         1137  +    compiler_flags=
         1138  +    linker_flags=
         1139  +    dllsearchpath=
         1140  +    lib_search_path=`pwd`
         1141  +    inst_prefix_dir=
         1142  +
         1143  +    avoid_version=no
         1144  +    dlfiles=
         1145  +    dlprefiles=
         1146  +    dlself=no
         1147  +    export_dynamic=no
         1148  +    export_symbols=
         1149  +    export_symbols_regex=
         1150  +    generated=
         1151  +    libobjs=
         1152  +    ltlibs=
         1153  +    module=no
         1154  +    no_install=no
         1155  +    objs=
         1156  +    non_pic_objects=
         1157  +    notinst_path= # paths that contain not-installed libtool libraries
         1158  +    precious_files_regex=
         1159  +    prefer_static_libs=no
         1160  +    preload=no
         1161  +    prev=
         1162  +    prevarg=
         1163  +    release=
         1164  +    rpath=
         1165  +    xrpath=
         1166  +    perm_rpath=
         1167  +    temp_rpath=
         1168  +    thread_safe=no
         1169  +    vinfo=
         1170  +    vinfo_number=no
         1171  +    single_module="${wl}-single_module"
         1172  +
         1173  +    func_infer_tag $base_compile
         1174  +
         1175  +    # We need to know -static, to get the right output filenames.
         1176  +    for arg
         1177  +    do
         1178  +      case $arg in
         1179  +      -all-static | -static | -static-libtool-libs)
         1180  +	case $arg in
         1181  +	-all-static)
         1182  +	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
         1183  +	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
         1184  +	  fi
         1185  +	  if test -n "$link_static_flag"; then
         1186  +	    dlopen_self=$dlopen_self_static
         1187  +	  fi
         1188  +	  prefer_static_libs=yes
         1189  +	  ;;
         1190  +	-static)
         1191  +	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
         1192  +	    dlopen_self=$dlopen_self_static
         1193  +	  fi
         1194  +	  prefer_static_libs=built
         1195  +	  ;;
         1196  +	-static-libtool-libs)
         1197  +	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
         1198  +	    dlopen_self=$dlopen_self_static
         1199  +	  fi
         1200  +	  prefer_static_libs=yes
         1201  +	  ;;
         1202  +	esac
         1203  +	build_libtool_libs=no
         1204  +	build_old_libs=yes
         1205  +	break
         1206  +	;;
         1207  +      esac
         1208  +    done
         1209  +
         1210  +    # See if our shared archives depend on static archives.
         1211  +    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
         1212  +
         1213  +    # Go through the arguments, transforming them on the way.
         1214  +    while test "$#" -gt 0; do
         1215  +      arg="$1"
         1216  +      shift
         1217  +      case $arg in
         1218  +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         1219  +	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
         1220  +	;;
         1221  +      *) qarg=$arg ;;
         1222  +      esac
         1223  +      libtool_args="$libtool_args $qarg"
         1224  +
         1225  +      # If the previous option needs an argument, assign it.
         1226  +      if test -n "$prev"; then
         1227  +	case $prev in
         1228  +	output)
         1229  +	  compile_command="$compile_command @OUTPUT@"
         1230  +	  finalize_command="$finalize_command @OUTPUT@"
         1231  +	  ;;
         1232  +	esac
         1233  +
         1234  +	case $prev in
         1235  +	dlfiles|dlprefiles)
         1236  +	  if test "$preload" = no; then
         1237  +	    # Add the symbol object into the linking commands.
         1238  +	    compile_command="$compile_command @SYMFILE@"
         1239  +	    finalize_command="$finalize_command @SYMFILE@"
         1240  +	    preload=yes
         1241  +	  fi
         1242  +	  case $arg in
         1243  +	  *.la | *.lo) ;;  # We handle these cases below.
         1244  +	  force)
         1245  +	    if test "$dlself" = no; then
         1246  +	      dlself=needless
         1247  +	      export_dynamic=yes
         1248  +	    fi
         1249  +	    prev=
         1250  +	    continue
         1251  +	    ;;
         1252  +	  self)
         1253  +	    if test "$prev" = dlprefiles; then
         1254  +	      dlself=yes
         1255  +	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
         1256  +	      dlself=yes
         1257  +	    else
         1258  +	      dlself=needless
         1259  +	      export_dynamic=yes
         1260  +	    fi
         1261  +	    prev=
         1262  +	    continue
         1263  +	    ;;
         1264  +	  *)
         1265  +	    if test "$prev" = dlfiles; then
         1266  +	      dlfiles="$dlfiles $arg"
         1267  +	    else
         1268  +	      dlprefiles="$dlprefiles $arg"
         1269  +	    fi
         1270  +	    prev=
         1271  +	    continue
         1272  +	    ;;
         1273  +	  esac
         1274  +	  ;;
         1275  +	expsyms)
         1276  +	  export_symbols="$arg"
         1277  +	  if test ! -f "$arg"; then
         1278  +	    $echo "$modename: symbol file \`$arg' does not exist"
         1279  +	    exit $EXIT_FAILURE
         1280  +	  fi
         1281  +	  prev=
         1282  +	  continue
         1283  +	  ;;
         1284  +	expsyms_regex)
         1285  +	  export_symbols_regex="$arg"
         1286  +	  prev=
         1287  +	  continue
         1288  +	  ;;
         1289  +	inst_prefix)
         1290  +	  inst_prefix_dir="$arg"
         1291  +	  prev=
         1292  +	  continue
         1293  +	  ;;
         1294  +	precious_regex)
         1295  +	  precious_files_regex="$arg"
         1296  +	  prev=
         1297  +	  continue
         1298  +	  ;;
         1299  +	release)
         1300  +	  release="-$arg"
         1301  +	  prev=
         1302  +	  continue
         1303  +	  ;;
         1304  +	objectlist)
         1305  +	  if test -f "$arg"; then
         1306  +	    save_arg=$arg
         1307  +	    moreargs=
         1308  +	    for fil in `cat $save_arg`
         1309  +	    do
         1310  +#	      moreargs="$moreargs $fil"
         1311  +	      arg=$fil
         1312  +	      # A libtool-controlled object.
         1313  +
         1314  +	      # Check to see that this really is a libtool object.
         1315  +	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         1316  +		pic_object=
         1317  +		non_pic_object=
         1318  +
         1319  +		# Read the .lo file
         1320  +		# If there is no directory component, then add one.
         1321  +		case $arg in
         1322  +		*/* | *\\*) . $arg ;;
         1323  +		*) . ./$arg ;;
         1324  +		esac
         1325  +
         1326  +		if test -z "$pic_object" || \
         1327  +		   test -z "$non_pic_object" ||
         1328  +		   test "$pic_object" = none && \
         1329  +		   test "$non_pic_object" = none; then
         1330  +		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
         1331  +		  exit $EXIT_FAILURE
         1332  +		fi
         1333  +
         1334  +		# Extract subdirectory from the argument.
         1335  +		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
         1336  +		if test "X$xdir" = "X$arg"; then
         1337  +		  xdir=
         1338  +		else
         1339  +		  xdir="$xdir/"
         1340  +		fi
         1341  +
         1342  +		if test "$pic_object" != none; then
         1343  +		  # Prepend the subdirectory the object is found in.
         1344  +		  pic_object="$xdir$pic_object"
         1345  +
         1346  +		  if test "$prev" = dlfiles; then
         1347  +		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
         1348  +		      dlfiles="$dlfiles $pic_object"
         1349  +		      prev=
         1350  +		      continue
         1351  +		    else
         1352  +		      # If libtool objects are unsupported, then we need to preload.
         1353  +		      prev=dlprefiles
         1354  +		    fi
         1355  +		  fi
         1356  +
         1357  +		  # CHECK ME:  I think I busted this.  -Ossama
         1358  +		  if test "$prev" = dlprefiles; then
         1359  +		    # Preload the old-style object.
         1360  +		    dlprefiles="$dlprefiles $pic_object"
         1361  +		    prev=
         1362  +		  fi
         1363  +
         1364  +		  # A PIC object.
         1365  +		  libobjs="$libobjs $pic_object"
         1366  +		  arg="$pic_object"
         1367  +		fi
         1368  +
         1369  +		# Non-PIC object.
         1370  +		if test "$non_pic_object" != none; then
         1371  +		  # Prepend the subdirectory the object is found in.
         1372  +		  non_pic_object="$xdir$non_pic_object"
         1373  +
         1374  +		  # A standard non-PIC object
         1375  +		  non_pic_objects="$non_pic_objects $non_pic_object"
         1376  +		  if test -z "$pic_object" || test "$pic_object" = none ; then
         1377  +		    arg="$non_pic_object"
         1378  +		  fi
         1379  +		else
         1380  +		  # If the PIC object exists, use it instead.
         1381  +		  # $xdir was prepended to $pic_object above.
         1382  +		  non_pic_object="$pic_object"
         1383  +		  non_pic_objects="$non_pic_objects $non_pic_object"
         1384  +		fi
         1385  +	      else
         1386  +		# Only an error if not doing a dry-run.
         1387  +		if test -z "$run"; then
         1388  +		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
         1389  +		  exit $EXIT_FAILURE
         1390  +		else
         1391  +		  # Dry-run case.
         1392  +
         1393  +		  # Extract subdirectory from the argument.
         1394  +		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
         1395  +		  if test "X$xdir" = "X$arg"; then
         1396  +		    xdir=
         1397  +		  else
         1398  +		    xdir="$xdir/"
         1399  +		  fi
         1400  +
         1401  +		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
         1402  +		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
         1403  +		  libobjs="$libobjs $pic_object"
         1404  +		  non_pic_objects="$non_pic_objects $non_pic_object"
         1405  +		fi
         1406  +	      fi
         1407  +	    done
         1408  +	  else
         1409  +	    $echo "$modename: link input file \`$save_arg' does not exist"
         1410  +	    exit $EXIT_FAILURE
         1411  +	  fi
         1412  +	  arg=$save_arg
         1413  +	  prev=
         1414  +	  continue
         1415  +	  ;;
         1416  +	rpath | xrpath)
         1417  +	  # We need an absolute path.
         1418  +	  case $arg in
         1419  +	  [\\/]* | [A-Za-z]:[\\/]*) ;;
         1420  +	  *)
         1421  +	    $echo "$modename: only absolute run-paths are allowed" 1>&2
         1422  +	    exit $EXIT_FAILURE
         1423  +	    ;;
         1424  +	  esac
         1425  +	  if test "$prev" = rpath; then
         1426  +	    case "$rpath " in
         1427  +	    *" $arg "*) ;;
         1428  +	    *) rpath="$rpath $arg" ;;
         1429  +	    esac
         1430  +	  else
         1431  +	    case "$xrpath " in
         1432  +	    *" $arg "*) ;;
         1433  +	    *) xrpath="$xrpath $arg" ;;
         1434  +	    esac
         1435  +	  fi
         1436  +	  prev=
         1437  +	  continue
         1438  +	  ;;
         1439  +	xcompiler)
         1440  +	  compiler_flags="$compiler_flags $qarg"
         1441  +	  prev=
         1442  +	  compile_command="$compile_command $qarg"
         1443  +	  finalize_command="$finalize_command $qarg"
         1444  +	  continue
         1445  +	  ;;
         1446  +	xlinker)
         1447  +	  linker_flags="$linker_flags $qarg"
         1448  +	  compiler_flags="$compiler_flags $wl$qarg"
         1449  +	  prev=
         1450  +	  compile_command="$compile_command $wl$qarg"
         1451  +	  finalize_command="$finalize_command $wl$qarg"
         1452  +	  continue
         1453  +	  ;;
         1454  +	xcclinker)
         1455  +	  linker_flags="$linker_flags $qarg"
         1456  +	  compiler_flags="$compiler_flags $qarg"
         1457  +	  prev=
         1458  +	  compile_command="$compile_command $qarg"
         1459  +	  finalize_command="$finalize_command $qarg"
         1460  +	  continue
         1461  +	  ;;
         1462  +	shrext)
         1463  +  	  shrext_cmds="$arg"
         1464  +	  prev=
         1465  +	  continue
         1466  +	  ;;
         1467  +	darwin_framework|darwin_framework_skip)
         1468  +	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
         1469  +	  compile_command="$compile_command $arg"
         1470  +	  finalize_command="$finalize_command $arg"
         1471  +	  prev=
         1472  +	  continue
         1473  +	  ;;
         1474  +	*)
         1475  +	  eval "$prev=\"\$arg\""
         1476  +	  prev=
         1477  +	  continue
         1478  +	  ;;
         1479  +	esac
         1480  +      fi # test -n "$prev"
         1481  +
         1482  +      prevarg="$arg"
         1483  +
         1484  +      case $arg in
         1485  +      -all-static)
         1486  +	if test -n "$link_static_flag"; then
         1487  +	  compile_command="$compile_command $link_static_flag"
         1488  +	  finalize_command="$finalize_command $link_static_flag"
         1489  +	fi
         1490  +	continue
         1491  +	;;
         1492  +
         1493  +      -allow-undefined)
         1494  +	# FIXME: remove this flag sometime in the future.
         1495  +	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
         1496  +	continue
         1497  +	;;
         1498  +
         1499  +      -avoid-version)
         1500  +	avoid_version=yes
         1501  +	continue
         1502  +	;;
         1503  +
         1504  +      -dlopen)
         1505  +	prev=dlfiles
         1506  +	continue
         1507  +	;;
         1508  +
         1509  +      -dlpreopen)
         1510  +	prev=dlprefiles
         1511  +	continue
         1512  +	;;
         1513  +
         1514  +      -export-dynamic)
         1515  +	export_dynamic=yes
         1516  +	continue
         1517  +	;;
         1518  +
         1519  +      -export-symbols | -export-symbols-regex)
         1520  +	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
         1521  +	  $echo "$modename: more than one -exported-symbols argument is not allowed"
         1522  +	  exit $EXIT_FAILURE
         1523  +	fi
         1524  +	if test "X$arg" = "X-export-symbols"; then
         1525  +	  prev=expsyms
         1526  +	else
         1527  +	  prev=expsyms_regex
         1528  +	fi
         1529  +	continue
         1530  +	;;
         1531  +
         1532  +      -framework|-arch|-isysroot)
         1533  +	case " $CC " in
         1534  +	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
         1535  +		prev=darwin_framework_skip ;;
         1536  +	  *) compiler_flags="$compiler_flags $arg"
         1537  +	     prev=darwin_framework ;;
         1538  +	esac
         1539  +	compile_command="$compile_command $arg"
         1540  +	finalize_command="$finalize_command $arg"
         1541  +	continue
         1542  +	;;
         1543  +
         1544  +      -inst-prefix-dir)
         1545  +	prev=inst_prefix
         1546  +	continue
         1547  +	;;
         1548  +
         1549  +      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
         1550  +      # so, if we see these flags be careful not to treat them like -L
         1551  +      -L[A-Z][A-Z]*:*)
         1552  +	case $with_gcc/$host in
         1553  +	no/*-*-irix* | /*-*-irix*)
         1554  +	  compile_command="$compile_command $arg"
         1555  +	  finalize_command="$finalize_command $arg"
         1556  +	  ;;
         1557  +	esac
         1558  +	continue
         1559  +	;;
         1560  +
         1561  +      -L*)
         1562  +	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
         1563  +	# We need an absolute path.
         1564  +	case $dir in
         1565  +	[\\/]* | [A-Za-z]:[\\/]*) ;;
         1566  +	*)
         1567  +	  absdir=`cd "$dir" && pwd`
         1568  +	  if test -z "$absdir"; then
         1569  +	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
         1570  +	    absdir="$dir"
         1571  +	    notinst_path="$notinst_path $dir"
         1572  +	  fi
         1573  +	  dir="$absdir"
         1574  +	  ;;
         1575  +	esac
         1576  +	case "$deplibs " in
         1577  +	*" -L$dir "*) ;;
         1578  +	*)
         1579  +	  deplibs="$deplibs -L$dir"
         1580  +	  lib_search_path="$lib_search_path $dir"
         1581  +	  ;;
         1582  +	esac
         1583  +	case $host in
         1584  +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
         1585  +	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
         1586  +	  case :$dllsearchpath: in
         1587  +	  *":$dir:"*) ;;
         1588  +	  *) dllsearchpath="$dllsearchpath:$dir";;
         1589  +	  esac
         1590  +	  case :$dllsearchpath: in
         1591  +	  *":$testbindir:"*) ;;
         1592  +	  *) dllsearchpath="$dllsearchpath:$testbindir";;
         1593  +	  esac
         1594  +	  ;;
         1595  +	esac
         1596  +	continue
         1597  +	;;
         1598  +
         1599  +      -l*)
         1600  +	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
         1601  +	  case $host in
         1602  +	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
         1603  +	    # These systems don't actually have a C or math library (as such)
         1604  +	    continue
         1605  +	    ;;
         1606  +	  *-*-os2*)
         1607  +	    # These systems don't actually have a C library (as such)
         1608  +	    test "X$arg" = "X-lc" && continue
         1609  +	    ;;
         1610  +	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
         1611  +	    # Do not include libc due to us having libc/libc_r.
         1612  +	    test "X$arg" = "X-lc" && continue
         1613  +	    ;;
         1614  +	  *-*-rhapsody* | *-*-darwin1.[012])
         1615  +	    # Rhapsody C and math libraries are in the System framework
         1616  +	    deplibs="$deplibs -framework System"
         1617  +	    continue
         1618  +	    ;;
         1619  +	  *-*-sco3.2v5* | *-*-sco5v6*)
         1620  +	    # Causes problems with __ctype
         1621  +	    test "X$arg" = "X-lc" && continue
         1622  +	    ;;
         1623  +	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
         1624  +	    # Compiler inserts libc in the correct place for threads to work
         1625  +	    test "X$arg" = "X-lc" && continue
         1626  +	    ;;
         1627  +	  esac
         1628  +	elif test "X$arg" = "X-lc_r"; then
         1629  +	 case $host in
         1630  +	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
         1631  +	   # Do not include libc_r directly, use -pthread flag.
         1632  +	   continue
         1633  +	   ;;
         1634  +	 esac
         1635  +	fi
         1636  +	deplibs="$deplibs $arg"
         1637  +	continue
         1638  +	;;
         1639  +
         1640  +      # Tru64 UNIX uses -model [arg] to determine the layout of C++
         1641  +      # classes, name mangling, and exception handling.
         1642  +      -model)
         1643  +	compile_command="$compile_command $arg"
         1644  +	compiler_flags="$compiler_flags $arg"
         1645  +	finalize_command="$finalize_command $arg"
         1646  +	prev=xcompiler
         1647  +	continue
         1648  +	;;
         1649  +
         1650  +     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
         1651  +	compiler_flags="$compiler_flags $arg"
         1652  +	compile_command="$compile_command $arg"
         1653  +	finalize_command="$finalize_command $arg"
         1654  +	continue
         1655  +	;;
         1656  +
         1657  +      -multi_module)
         1658  +	single_module="${wl}-multi_module"
         1659  +	continue
         1660  +	;;
         1661  +
         1662  +      -module)
         1663  +	module=yes
         1664  +	continue
         1665  +	;;
         1666  +
         1667  +      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
         1668  +      # -r[0-9][0-9]* specifies the processor on the SGI compiler
         1669  +      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
         1670  +      # +DA*, +DD* enable 64-bit mode on the HP compiler
         1671  +      # -q* pass through compiler args for the IBM compiler
         1672  +      # -m* pass through architecture-specific compiler args for GCC
         1673  +      # -m*, -t[45]*, -txscale* pass through architecture-specific
         1674  +      # compiler args for GCC
         1675  +      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
         1676  +      # -F/path gives path to uninstalled frameworks, gcc on darwin
         1677  +      # @file GCC response files
         1678  +      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
         1679  +      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
         1680  +
         1681  +	# Unknown arguments in both finalize_command and compile_command need
         1682  +	# to be aesthetically quoted because they are evaled later.
         1683  +	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
         1684  +	case $arg in
         1685  +	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         1686  +	  arg="\"$arg\""
         1687  +	  ;;
         1688  +	esac
         1689  +        compile_command="$compile_command $arg"
         1690  +        finalize_command="$finalize_command $arg"
         1691  +        compiler_flags="$compiler_flags $arg"
         1692  +        continue
         1693  +        ;;
         1694  +
         1695  +      -shrext)
         1696  +	prev=shrext
         1697  +	continue
         1698  +	;;
         1699  +
         1700  +      -no-fast-install)
         1701  +	fast_install=no
         1702  +	continue
         1703  +	;;
         1704  +
         1705  +      -no-install)
         1706  +	case $host in
         1707  +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
         1708  +	  # The PATH hackery in wrapper scripts is required on Windows
         1709  +	  # and Darwin in order for the loader to find any dlls it needs.
         1710  +	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
         1711  +	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
         1712  +	  fast_install=no
         1713  +	  ;;
         1714  +	*) no_install=yes ;;
         1715  +	esac
         1716  +	continue
         1717  +	;;
         1718  +
         1719  +      -no-undefined)
         1720  +	allow_undefined=no
         1721  +	continue
         1722  +	;;
         1723  +
         1724  +      -objectlist)
         1725  +	prev=objectlist
         1726  +	continue
         1727  +	;;
         1728  +
         1729  +      -o) prev=output ;;
         1730  +
         1731  +      -precious-files-regex)
         1732  +	prev=precious_regex
         1733  +	continue
         1734  +	;;
         1735  +
         1736  +      -release)
         1737  +	prev=release
         1738  +	continue
         1739  +	;;
         1740  +
         1741  +      -rpath)
         1742  +	prev=rpath
         1743  +	continue
         1744  +	;;
         1745  +
         1746  +      -R)
         1747  +	prev=xrpath
         1748  +	continue
         1749  +	;;
         1750  +
         1751  +      -R*)
         1752  +	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
         1753  +	# We need an absolute path.
         1754  +	case $dir in
         1755  +	[\\/]* | [A-Za-z]:[\\/]*) ;;
         1756  +	*)
         1757  +	  $echo "$modename: only absolute run-paths are allowed" 1>&2
         1758  +	  exit $EXIT_FAILURE
         1759  +	  ;;
         1760  +	esac
         1761  +	case "$xrpath " in
         1762  +	*" $dir "*) ;;
         1763  +	*) xrpath="$xrpath $dir" ;;
         1764  +	esac
         1765  +	continue
         1766  +	;;
         1767  +
         1768  +      -static | -static-libtool-libs)
         1769  +	# The effects of -static are defined in a previous loop.
         1770  +	# We used to do the same as -all-static on platforms that
         1771  +	# didn't have a PIC flag, but the assumption that the effects
         1772  +	# would be equivalent was wrong.  It would break on at least
         1773  +	# Digital Unix and AIX.
         1774  +	continue
         1775  +	;;
         1776  +
         1777  +      -thread-safe)
         1778  +	thread_safe=yes
         1779  +	continue
         1780  +	;;
         1781  +
         1782  +      -version-info)
         1783  +	prev=vinfo
         1784  +	continue
         1785  +	;;
         1786  +      -version-number)
         1787  +	prev=vinfo
         1788  +	vinfo_number=yes
         1789  +	continue
         1790  +	;;
         1791  +
         1792  +      -Wc,*)
         1793  +	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
         1794  +	arg=
         1795  +	save_ifs="$IFS"; IFS=','
         1796  +	for flag in $args; do
         1797  +	  IFS="$save_ifs"
         1798  +	  case $flag in
         1799  +	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         1800  +	    flag="\"$flag\""
         1801  +	    ;;
         1802  +	  esac
         1803  +	  arg="$arg $wl$flag"
         1804  +	  compiler_flags="$compiler_flags $flag"
         1805  +	done
         1806  +	IFS="$save_ifs"
         1807  +	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
         1808  +	;;
         1809  +
         1810  +      -Wl,*)
         1811  +	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
         1812  +	arg=
         1813  +	save_ifs="$IFS"; IFS=','
         1814  +	for flag in $args; do
         1815  +	  IFS="$save_ifs"
         1816  +	  case $flag in
         1817  +	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         1818  +	    flag="\"$flag\""
         1819  +	    ;;
         1820  +	  esac
         1821  +	  arg="$arg $wl$flag"
         1822  +	  compiler_flags="$compiler_flags $wl$flag"
         1823  +	  linker_flags="$linker_flags $flag"
         1824  +	done
         1825  +	IFS="$save_ifs"
         1826  +	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
         1827  +	;;
         1828  +
         1829  +      -Xcompiler)
         1830  +	prev=xcompiler
         1831  +	continue
         1832  +	;;
         1833  +
         1834  +      -Xlinker)
         1835  +	prev=xlinker
         1836  +	continue
         1837  +	;;
         1838  +
         1839  +      -XCClinker)
         1840  +	prev=xcclinker
         1841  +	continue
         1842  +	;;
         1843  +
         1844  +      # Some other compiler flag.
         1845  +      -* | +*)
         1846  +	# Unknown arguments in both finalize_command and compile_command need
         1847  +	# to be aesthetically quoted because they are evaled later.
         1848  +	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
         1849  +	case $arg in
         1850  +	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         1851  +	  arg="\"$arg\""
         1852  +	  ;;
         1853  +	esac
         1854  +	;;
         1855  +
         1856  +      *.$objext)
         1857  +	# A standard object.
         1858  +	objs="$objs $arg"
         1859  +	;;
         1860  +
         1861  +      *.lo)
         1862  +	# A libtool-controlled object.
         1863  +
         1864  +	# Check to see that this really is a libtool object.
         1865  +	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         1866  +	  pic_object=
         1867  +	  non_pic_object=
         1868  +
         1869  +	  # Read the .lo file
         1870  +	  # If there is no directory component, then add one.
         1871  +	  case $arg in
         1872  +	  */* | *\\*) . $arg ;;
         1873  +	  *) . ./$arg ;;
         1874  +	  esac
         1875  +
         1876  +	  if test -z "$pic_object" || \
         1877  +	     test -z "$non_pic_object" ||
         1878  +	     test "$pic_object" = none && \
         1879  +	     test "$non_pic_object" = none; then
         1880  +	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
         1881  +	    exit $EXIT_FAILURE
         1882  +	  fi
         1883  +
         1884  +	  # Extract subdirectory from the argument.
         1885  +	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
         1886  +	  if test "X$xdir" = "X$arg"; then
         1887  +	    xdir=
         1888  + 	  else
         1889  +	    xdir="$xdir/"
         1890  +	  fi
         1891  +
         1892  +	  if test "$pic_object" != none; then
         1893  +	    # Prepend the subdirectory the object is found in.
         1894  +	    pic_object="$xdir$pic_object"
         1895  +
         1896  +	    if test "$prev" = dlfiles; then
         1897  +	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
         1898  +		dlfiles="$dlfiles $pic_object"
         1899  +		prev=
         1900  +		continue
         1901  +	      else
         1902  +		# If libtool objects are unsupported, then we need to preload.
         1903  +		prev=dlprefiles
         1904  +	      fi
         1905  +	    fi
         1906  +
         1907  +	    # CHECK ME:  I think I busted this.  -Ossama
         1908  +	    if test "$prev" = dlprefiles; then
         1909  +	      # Preload the old-style object.
         1910  +	      dlprefiles="$dlprefiles $pic_object"
         1911  +	      prev=
         1912  +	    fi
         1913  +
         1914  +	    # A PIC object.
         1915  +	    libobjs="$libobjs $pic_object"
         1916  +	    arg="$pic_object"
         1917  +	  fi
         1918  +
         1919  +	  # Non-PIC object.
         1920  +	  if test "$non_pic_object" != none; then
         1921  +	    # Prepend the subdirectory the object is found in.
         1922  +	    non_pic_object="$xdir$non_pic_object"
         1923  +
         1924  +	    # A standard non-PIC object
         1925  +	    non_pic_objects="$non_pic_objects $non_pic_object"
         1926  +	    if test -z "$pic_object" || test "$pic_object" = none ; then
         1927  +	      arg="$non_pic_object"
         1928  +	    fi
         1929  +	  else
         1930  +	    # If the PIC object exists, use it instead.
         1931  +	    # $xdir was prepended to $pic_object above.
         1932  +	    non_pic_object="$pic_object"
         1933  +	    non_pic_objects="$non_pic_objects $non_pic_object"
         1934  +	  fi
         1935  +	else
         1936  +	  # Only an error if not doing a dry-run.
         1937  +	  if test -z "$run"; then
         1938  +	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
         1939  +	    exit $EXIT_FAILURE
         1940  +	  else
         1941  +	    # Dry-run case.
         1942  +
         1943  +	    # Extract subdirectory from the argument.
         1944  +	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
         1945  +	    if test "X$xdir" = "X$arg"; then
         1946  +	      xdir=
         1947  +	    else
         1948  +	      xdir="$xdir/"
         1949  +	    fi
         1950  +
         1951  +	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
         1952  +	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
         1953  +	    libobjs="$libobjs $pic_object"
         1954  +	    non_pic_objects="$non_pic_objects $non_pic_object"
         1955  +	  fi
         1956  +	fi
         1957  +	;;
         1958  +
         1959  +      *.$libext)
         1960  +	# An archive.
         1961  +	deplibs="$deplibs $arg"
         1962  +	old_deplibs="$old_deplibs $arg"
         1963  +	continue
         1964  +	;;
         1965  +
         1966  +      *.la)
         1967  +	# A libtool-controlled library.
         1968  +
         1969  +	if test "$prev" = dlfiles; then
         1970  +	  # This library was specified with -dlopen.
         1971  +	  dlfiles="$dlfiles $arg"
         1972  +	  prev=
         1973  +	elif test "$prev" = dlprefiles; then
         1974  +	  # The library was specified with -dlpreopen.
         1975  +	  dlprefiles="$dlprefiles $arg"
         1976  +	  prev=
         1977  +	else
         1978  +	  deplibs="$deplibs $arg"
         1979  +	fi
         1980  +	continue
         1981  +	;;
         1982  +
         1983  +      # Some other compiler argument.
         1984  +      *)
         1985  +	# Unknown arguments in both finalize_command and compile_command need
         1986  +	# to be aesthetically quoted because they are evaled later.
         1987  +	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
         1988  +	case $arg in
         1989  +	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         1990  +	  arg="\"$arg\""
         1991  +	  ;;
         1992  +	esac
         1993  +	;;
         1994  +      esac # arg
         1995  +
         1996  +      # Now actually substitute the argument into the commands.
         1997  +      if test -n "$arg"; then
         1998  +	compile_command="$compile_command $arg"
         1999  +	finalize_command="$finalize_command $arg"
         2000  +      fi
         2001  +    done # argument parsing loop
         2002  +
         2003  +    if test -n "$prev"; then
         2004  +      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
         2005  +      $echo "$help" 1>&2
         2006  +      exit $EXIT_FAILURE
         2007  +    fi
         2008  +
         2009  +    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
         2010  +      eval arg=\"$export_dynamic_flag_spec\"
         2011  +      compile_command="$compile_command $arg"
         2012  +      finalize_command="$finalize_command $arg"
         2013  +    fi
         2014  +
         2015  +    oldlibs=
         2016  +    # calculate the name of the file, without its directory
         2017  +    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
         2018  +    libobjs_save="$libobjs"
         2019  +
         2020  +    if test -n "$shlibpath_var"; then
         2021  +      # get the directories listed in $shlibpath_var
         2022  +      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
         2023  +    else
         2024  +      shlib_search_path=
         2025  +    fi
         2026  +    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
         2027  +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
         2028  +
         2029  +    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
         2030  +    if test "X$output_objdir" = "X$output"; then
         2031  +      output_objdir="$objdir"
         2032  +    else
         2033  +      output_objdir="$output_objdir/$objdir"
         2034  +    fi
         2035  +    # Create the object directory.
         2036  +    if test ! -d "$output_objdir"; then
         2037  +      $show "$mkdir $output_objdir"
         2038  +      $run $mkdir $output_objdir
         2039  +      exit_status=$?
         2040  +      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
         2041  +	exit $exit_status
         2042  +      fi
         2043  +    fi
         2044  +
         2045  +    # Determine the type of output
         2046  +    case $output in
         2047  +    "")
         2048  +      $echo "$modename: you must specify an output file" 1>&2
         2049  +      $echo "$help" 1>&2
         2050  +      exit $EXIT_FAILURE
         2051  +      ;;
         2052  +    *.$libext) linkmode=oldlib ;;
         2053  +    *.lo | *.$objext) linkmode=obj ;;
         2054  +    *.la) linkmode=lib ;;
         2055  +    *) linkmode=prog ;; # Anything else should be a program.
         2056  +    esac
         2057  +
         2058  +    case $host in
         2059  +    *cygwin* | *mingw* | *pw32*)
         2060  +      # don't eliminate duplications in $postdeps and $predeps
         2061  +      duplicate_compiler_generated_deps=yes
         2062  +      ;;
         2063  +    *)
         2064  +      duplicate_compiler_generated_deps=$duplicate_deps
         2065  +      ;;
         2066  +    esac
         2067  +    specialdeplibs=
         2068  +
         2069  +    libs=
         2070  +    # Find all interdependent deplibs by searching for libraries
         2071  +    # that are linked more than once (e.g. -la -lb -la)
         2072  +    for deplib in $deplibs; do
         2073  +      if test "X$duplicate_deps" = "Xyes" ; then
         2074  +	case "$libs " in
         2075  +	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
         2076  +	esac
         2077  +      fi
         2078  +      libs="$libs $deplib"
         2079  +    done
         2080  +
         2081  +    if test "$linkmode" = lib; then
         2082  +      libs="$predeps $libs $compiler_lib_search_path $postdeps"
         2083  +
         2084  +      # Compute libraries that are listed more than once in $predeps
         2085  +      # $postdeps and mark them as special (i.e., whose duplicates are
         2086  +      # not to be eliminated).
         2087  +      pre_post_deps=
         2088  +      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
         2089  +	for pre_post_dep in $predeps $postdeps; do
         2090  +	  case "$pre_post_deps " in
         2091  +	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
         2092  +	  esac
         2093  +	  pre_post_deps="$pre_post_deps $pre_post_dep"
         2094  +	done
         2095  +      fi
         2096  +      pre_post_deps=
         2097  +    fi
         2098  +
         2099  +    deplibs=
         2100  +    newdependency_libs=
         2101  +    newlib_search_path=
         2102  +    need_relink=no # whether we're linking any uninstalled libtool libraries
         2103  +    notinst_deplibs= # not-installed libtool libraries
         2104  +    case $linkmode in
         2105  +    lib)
         2106  +	passes="conv link"
         2107  +	for file in $dlfiles $dlprefiles; do
         2108  +	  case $file in
         2109  +	  *.la) ;;
         2110  +	  *)
         2111  +	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
         2112  +	    exit $EXIT_FAILURE
         2113  +	    ;;
         2114  +	  esac
         2115  +	done
         2116  +	;;
         2117  +    prog)
         2118  +	compile_deplibs=
         2119  +	finalize_deplibs=
         2120  +	alldeplibs=no
         2121  +	newdlfiles=
         2122  +	newdlprefiles=
         2123  +	passes="conv scan dlopen dlpreopen link"
         2124  +	;;
         2125  +    *)  passes="conv"
         2126  +	;;
         2127  +    esac
         2128  +    for pass in $passes; do
         2129  +      if test "$linkmode,$pass" = "lib,link" ||
         2130  +	 test "$linkmode,$pass" = "prog,scan"; then
         2131  +	libs="$deplibs"
         2132  +	deplibs=
         2133  +      fi
         2134  +      if test "$linkmode" = prog; then
         2135  +	case $pass in
         2136  +	dlopen) libs="$dlfiles" ;;
         2137  +	dlpreopen) libs="$dlprefiles" ;;
         2138  +	link)
         2139  +	  libs="$deplibs %DEPLIBS%"
         2140  +	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
         2141  +	  ;;
         2142  +	esac
         2143  +      fi
         2144  +      if test "$pass" = dlopen; then
         2145  +	# Collect dlpreopened libraries
         2146  +	save_deplibs="$deplibs"
         2147  +	deplibs=
         2148  +      fi
         2149  +      for deplib in $libs; do
         2150  +	lib=
         2151  +	found=no
         2152  +	case $deplib in
         2153  +	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
         2154  +	  if test "$linkmode,$pass" = "prog,link"; then
         2155  +	    compile_deplibs="$deplib $compile_deplibs"
         2156  +	    finalize_deplibs="$deplib $finalize_deplibs"
         2157  +	  else
         2158  +	    compiler_flags="$compiler_flags $deplib"
         2159  +	  fi
         2160  +	  continue
         2161  +	  ;;
         2162  +	-l*)
         2163  +	  if test "$linkmode" != lib && test "$linkmode" != prog; then
         2164  +	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
         2165  +	    continue
         2166  +	  fi
         2167  +	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
         2168  +	  if test "$linkmode" = lib; then
         2169  +	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
         2170  +	  else
         2171  +	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
         2172  +	  fi
         2173  +	  for searchdir in $searchdirs; do
         2174  +	    for search_ext in .la $std_shrext .so .a; do
         2175  +	      # Search the libtool library
         2176  +	      lib="$searchdir/lib${name}${search_ext}"
         2177  +	      if test -f "$lib"; then
         2178  +		if test "$search_ext" = ".la"; then
         2179  +		  found=yes
         2180  +		else
         2181  +		  found=no
         2182  +		fi
         2183  +		break 2
         2184  +	      fi
         2185  +	    done
         2186  +	  done
         2187  +	  if test "$found" != yes; then
         2188  +	    # deplib doesn't seem to be a libtool library
         2189  +	    if test "$linkmode,$pass" = "prog,link"; then
         2190  +	      compile_deplibs="$deplib $compile_deplibs"
         2191  +	      finalize_deplibs="$deplib $finalize_deplibs"
         2192  +	    else
         2193  +	      deplibs="$deplib $deplibs"
         2194  +	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
         2195  +	    fi
         2196  +	    continue
         2197  +	  else # deplib is a libtool library
         2198  +	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
         2199  +	    # We need to do some special things here, and not later.
         2200  +	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
         2201  +	      case " $predeps $postdeps " in
         2202  +	      *" $deplib "*)
         2203  +		if (${SED} -e '2q' $lib |
         2204  +                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         2205  +		  library_names=
         2206  +		  old_library=
         2207  +		  case $lib in
         2208  +		  */* | *\\*) . $lib ;;
         2209  +		  *) . ./$lib ;;
         2210  +		  esac
         2211  +		  for l in $old_library $library_names; do
         2212  +		    ll="$l"
         2213  +		  done
         2214  +		  if test "X$ll" = "X$old_library" ; then # only static version available
         2215  +		    found=no
         2216  +		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
         2217  +		    test "X$ladir" = "X$lib" && ladir="."
         2218  +		    lib=$ladir/$old_library
         2219  +		    if test "$linkmode,$pass" = "prog,link"; then
         2220  +		      compile_deplibs="$deplib $compile_deplibs"
         2221  +		      finalize_deplibs="$deplib $finalize_deplibs"
         2222  +		    else
         2223  +		      deplibs="$deplib $deplibs"
         2224  +		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
         2225  +		    fi
         2226  +		    continue
         2227  +		  fi
         2228  +		fi
         2229  +	        ;;
         2230  +	      *) ;;
         2231  +	      esac
         2232  +	    fi
         2233  +	  fi
         2234  +	  ;; # -l
         2235  +	-L*)
         2236  +	  case $linkmode in
         2237  +	  lib)
         2238  +	    deplibs="$deplib $deplibs"
         2239  +	    test "$pass" = conv && continue
         2240  +	    newdependency_libs="$deplib $newdependency_libs"
         2241  +	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
         2242  +	    ;;
         2243  +	  prog)
         2244  +	    if test "$pass" = conv; then
         2245  +	      deplibs="$deplib $deplibs"
         2246  +	      continue
         2247  +	    fi
         2248  +	    if test "$pass" = scan; then
         2249  +	      deplibs="$deplib $deplibs"
         2250  +	    else
         2251  +	      compile_deplibs="$deplib $compile_deplibs"
         2252  +	      finalize_deplibs="$deplib $finalize_deplibs"
         2253  +	    fi
         2254  +	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
         2255  +	    ;;
         2256  +	  *)
         2257  +	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
         2258  +	    ;;
         2259  +	  esac # linkmode
         2260  +	  continue
         2261  +	  ;; # -L
         2262  +	-R*)
         2263  +	  if test "$pass" = link; then
         2264  +	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
         2265  +	    # Make sure the xrpath contains only unique directories.
         2266  +	    case "$xrpath " in
         2267  +	    *" $dir "*) ;;
         2268  +	    *) xrpath="$xrpath $dir" ;;
         2269  +	    esac
         2270  +	  fi
         2271  +	  deplibs="$deplib $deplibs"
         2272  +	  continue
         2273  +	  ;;
         2274  +	*.la) lib="$deplib" ;;
         2275  +	*.$libext)
         2276  +	  if test "$pass" = conv; then
         2277  +	    deplibs="$deplib $deplibs"
         2278  +	    continue
         2279  +	  fi
         2280  +	  case $linkmode in
         2281  +	  lib)
         2282  +	    valid_a_lib=no
         2283  +	    case $deplibs_check_method in
         2284  +	      match_pattern*)
         2285  +		set dummy $deplibs_check_method
         2286  +	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
         2287  +		if eval $echo \"$deplib\" 2>/dev/null \
         2288  +		    | $SED 10q \
         2289  +		    | $EGREP "$match_pattern_regex" > /dev/null; then
         2290  +		  valid_a_lib=yes
         2291  +		fi
         2292  +		;;
         2293  +	      pass_all)
         2294  +		valid_a_lib=yes
         2295  +		;;
         2296  +            esac
         2297  +	    if test "$valid_a_lib" != yes; then
         2298  +	      $echo
         2299  +	      $echo "*** Warning: Trying to link with static lib archive $deplib."
         2300  +	      $echo "*** I have the capability to make that library automatically link in when"
         2301  +	      $echo "*** you link to this library.  But I can only do this if you have a"
         2302  +	      $echo "*** shared version of the library, which you do not appear to have"
         2303  +	      $echo "*** because the file extensions .$libext of this argument makes me believe"
         2304  +	      $echo "*** that it is just a static archive that I should not used here."
         2305  +	    else
         2306  +	      $echo
         2307  +	      $echo "*** Warning: Linking the shared library $output against the"
         2308  +	      $echo "*** static library $deplib is not portable!"
         2309  +	      deplibs="$deplib $deplibs"
         2310  +	    fi
         2311  +	    continue
         2312  +	    ;;
         2313  +	  prog)
         2314  +	    if test "$pass" != link; then
         2315  +	      deplibs="$deplib $deplibs"
         2316  +	    else
         2317  +	      compile_deplibs="$deplib $compile_deplibs"
         2318  +	      finalize_deplibs="$deplib $finalize_deplibs"
         2319  +	    fi
         2320  +	    continue
         2321  +	    ;;
         2322  +	  esac # linkmode
         2323  +	  ;; # *.$libext
         2324  +	*.lo | *.$objext)
         2325  +	  if test "$pass" = conv; then
         2326  +	    deplibs="$deplib $deplibs"
         2327  +	  elif test "$linkmode" = prog; then
         2328  +	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
         2329  +	      # If there is no dlopen support or we're linking statically,
         2330  +	      # we need to preload.
         2331  +	      newdlprefiles="$newdlprefiles $deplib"
         2332  +	      compile_deplibs="$deplib $compile_deplibs"
         2333  +	      finalize_deplibs="$deplib $finalize_deplibs"
         2334  +	    else
         2335  +	      newdlfiles="$newdlfiles $deplib"
         2336  +	    fi
         2337  +	  fi
         2338  +	  continue
         2339  +	  ;;
         2340  +	%DEPLIBS%)
         2341  +	  alldeplibs=yes
         2342  +	  continue
         2343  +	  ;;
         2344  +	esac # case $deplib
         2345  +	if test "$found" = yes || test -f "$lib"; then :
         2346  +	else
         2347  +	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
         2348  +	  exit $EXIT_FAILURE
         2349  +	fi
         2350  +
         2351  +	# Check to see that this really is a libtool archive.
         2352  +	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
         2353  +	else
         2354  +	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
         2355  +	  exit $EXIT_FAILURE
         2356  +	fi
         2357  +
         2358  +	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
         2359  +	test "X$ladir" = "X$lib" && ladir="."
         2360  +
         2361  +	dlname=
         2362  +	dlopen=
         2363  +	dlpreopen=
         2364  +	libdir=
         2365  +	library_names=
         2366  +	old_library=
         2367  +	# If the library was installed with an old release of libtool,
         2368  +	# it will not redefine variables installed, or shouldnotlink
         2369  +	installed=yes
         2370  +	shouldnotlink=no
         2371  +	avoidtemprpath=
         2372  +
         2373  +
         2374  +	# Read the .la file
         2375  +	case $lib in
         2376  +	*/* | *\\*) . $lib ;;
         2377  +	*) . ./$lib ;;
         2378  +	esac
         2379  +
         2380  +	if test "$linkmode,$pass" = "lib,link" ||
         2381  +	   test "$linkmode,$pass" = "prog,scan" ||
         2382  +	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
         2383  +	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
         2384  +	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
         2385  +	fi
         2386  +
         2387  +	if test "$pass" = conv; then
         2388  +	  # Only check for convenience libraries
         2389  +	  deplibs="$lib $deplibs"
         2390  +	  if test -z "$libdir"; then
         2391  +	    if test -z "$old_library"; then
         2392  +	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
         2393  +	      exit $EXIT_FAILURE
         2394  +	    fi
         2395  +	    # It is a libtool convenience library, so add in its objects.
         2396  +	    convenience="$convenience $ladir/$objdir/$old_library"
         2397  +	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
         2398  +	    tmp_libs=
         2399  +	    for deplib in $dependency_libs; do
         2400  +	      deplibs="$deplib $deplibs"
         2401  +              if test "X$duplicate_deps" = "Xyes" ; then
         2402  +	        case "$tmp_libs " in
         2403  +	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
         2404  +	        esac
         2405  +              fi
         2406  +	      tmp_libs="$tmp_libs $deplib"
         2407  +	    done
         2408  +	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
         2409  +	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
         2410  +	    exit $EXIT_FAILURE
         2411  +	  fi
         2412  +	  continue
         2413  +	fi # $pass = conv
         2414  +
         2415  +
         2416  +	# Get the name of the library we link against.
         2417  +	linklib=
         2418  +	for l in $old_library $library_names; do
         2419  +	  linklib="$l"
         2420  +	done
         2421  +	if test -z "$linklib"; then
         2422  +	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
         2423  +	  exit $EXIT_FAILURE
         2424  +	fi
         2425  +
         2426  +	# This library was specified with -dlopen.
         2427  +	if test "$pass" = dlopen; then
         2428  +	  if test -z "$libdir"; then
         2429  +	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
         2430  +	    exit $EXIT_FAILURE
         2431  +	  fi
         2432  +	  if test -z "$dlname" ||
         2433  +	     test "$dlopen_support" != yes ||
         2434  +	     test "$build_libtool_libs" = no; then
         2435  +	    # If there is no dlname, no dlopen support or we're linking
         2436  +	    # statically, we need to preload.  We also need to preload any
         2437  +	    # dependent libraries so libltdl's deplib preloader doesn't
         2438  +	    # bomb out in the load deplibs phase.
         2439  +	    dlprefiles="$dlprefiles $lib $dependency_libs"
         2440  +	  else
         2441  +	    newdlfiles="$newdlfiles $lib"
         2442  +	  fi
         2443  +	  continue
         2444  +	fi # $pass = dlopen
         2445  +
         2446  +	# We need an absolute path.
         2447  +	case $ladir in
         2448  +	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
         2449  +	*)
         2450  +	  abs_ladir=`cd "$ladir" && pwd`
         2451  +	  if test -z "$abs_ladir"; then
         2452  +	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
         2453  +	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
         2454  +	    abs_ladir="$ladir"
         2455  +	  fi
         2456  +	  ;;
         2457  +	esac
         2458  +	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
         2459  +
         2460  +	# Find the relevant object directory and library name.
         2461  +	if test "X$installed" = Xyes; then
         2462  +	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
         2463  +	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
         2464  +	    dir="$ladir"
         2465  +	    absdir="$abs_ladir"
         2466  +	    libdir="$abs_ladir"
         2467  +	  else
         2468  +	    dir="$libdir"
         2469  +	    absdir="$libdir"
         2470  +	  fi
         2471  +	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
         2472  +	else
         2473  +	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
         2474  +	    dir="$ladir"
         2475  +	    absdir="$abs_ladir"
         2476  +	    # Remove this search path later
         2477  +	    notinst_path="$notinst_path $abs_ladir"
         2478  +	  else
         2479  +	    dir="$ladir/$objdir"
         2480  +	    absdir="$abs_ladir/$objdir"
         2481  +	    # Remove this search path later
         2482  +	    notinst_path="$notinst_path $abs_ladir"
         2483  +	  fi
         2484  +	fi # $installed = yes
         2485  +	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
         2486  +
         2487  +	# This library was specified with -dlpreopen.
         2488  +	if test "$pass" = dlpreopen; then
         2489  +	  if test -z "$libdir"; then
         2490  +	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
         2491  +	    exit $EXIT_FAILURE
         2492  +	  fi
         2493  +	  # Prefer using a static library (so that no silly _DYNAMIC symbols
         2494  +	  # are required to link).
         2495  +	  if test -n "$old_library"; then
         2496  +	    newdlprefiles="$newdlprefiles $dir/$old_library"
         2497  +	  # Otherwise, use the dlname, so that lt_dlopen finds it.
         2498  +	  elif test -n "$dlname"; then
         2499  +	    newdlprefiles="$newdlprefiles $dir/$dlname"
         2500  +	  else
         2501  +	    newdlprefiles="$newdlprefiles $dir/$linklib"
         2502  +	  fi
         2503  +	fi # $pass = dlpreopen
         2504  +
         2505  +	if test -z "$libdir"; then
         2506  +	  # Link the convenience library
         2507  +	  if test "$linkmode" = lib; then
         2508  +	    deplibs="$dir/$old_library $deplibs"
         2509  +	  elif test "$linkmode,$pass" = "prog,link"; then
         2510  +	    compile_deplibs="$dir/$old_library $compile_deplibs"
         2511  +	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
         2512  +	  else
         2513  +	    deplibs="$lib $deplibs" # used for prog,scan pass
         2514  +	  fi
         2515  +	  continue
         2516  +	fi
         2517  +
         2518  +
         2519  +	if test "$linkmode" = prog && test "$pass" != link; then
         2520  +	  newlib_search_path="$newlib_search_path $ladir"
         2521  +	  deplibs="$lib $deplibs"
         2522  +
         2523  +	  linkalldeplibs=no
         2524  +	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
         2525  +	     test "$build_libtool_libs" = no; then
         2526  +	    linkalldeplibs=yes
         2527  +	  fi
         2528  +
         2529  +	  tmp_libs=
         2530  +	  for deplib in $dependency_libs; do
         2531  +	    case $deplib in
         2532  +	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
         2533  +	    esac
         2534  +	    # Need to link against all dependency_libs?
         2535  +	    if test "$linkalldeplibs" = yes; then
         2536  +	      deplibs="$deplib $deplibs"
         2537  +	    else
         2538  +	      # Need to hardcode shared library paths
         2539  +	      # or/and link against static libraries
         2540  +	      newdependency_libs="$deplib $newdependency_libs"
         2541  +	    fi
         2542  +	    if test "X$duplicate_deps" = "Xyes" ; then
         2543  +	      case "$tmp_libs " in
         2544  +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
         2545  +	      esac
         2546  +	    fi
         2547  +	    tmp_libs="$tmp_libs $deplib"
         2548  +	  done # for deplib
         2549  +	  continue
         2550  +	fi # $linkmode = prog...
         2551  +
         2552  +	if test "$linkmode,$pass" = "prog,link"; then
         2553  +	  if test -n "$library_names" &&
         2554  +	     { { test "$prefer_static_libs" = no ||
         2555  +		 test "$prefer_static_libs,$installed" = "built,yes"; } ||
         2556  +	       test -z "$old_library"; }; then
         2557  +	    # We need to hardcode the library path
         2558  +	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
         2559  +	      # Make sure the rpath contains only unique directories.
         2560  +	      case "$temp_rpath " in
         2561  +	      *" $dir "*) ;;
         2562  +	      *" $absdir "*) ;;
         2563  +	      *) temp_rpath="$temp_rpath $absdir" ;;
         2564  +	      esac
         2565  +	    fi
         2566  +
         2567  +	    # Hardcode the library path.
         2568  +	    # Skip directories that are in the system default run-time
         2569  +	    # search path.
         2570  +	    case " $sys_lib_dlsearch_path " in
         2571  +	    *" $absdir "*) ;;
         2572  +	    *)
         2573  +	      case "$compile_rpath " in
         2574  +	      *" $absdir "*) ;;
         2575  +	      *) compile_rpath="$compile_rpath $absdir"
         2576  +	      esac
         2577  +	      ;;
         2578  +	    esac
         2579  +	    case " $sys_lib_dlsearch_path " in
         2580  +	    *" $libdir "*) ;;
         2581  +	    *)
         2582  +	      case "$finalize_rpath " in
         2583  +	      *" $libdir "*) ;;
         2584  +	      *) finalize_rpath="$finalize_rpath $libdir"
         2585  +	      esac
         2586  +	      ;;
         2587  +	    esac
         2588  +	  fi # $linkmode,$pass = prog,link...
         2589  +
         2590  +	  if test "$alldeplibs" = yes &&
         2591  +	     { test "$deplibs_check_method" = pass_all ||
         2592  +	       { test "$build_libtool_libs" = yes &&
         2593  +		 test -n "$library_names"; }; }; then
         2594  +	    # We only need to search for static libraries
         2595  +	    continue
         2596  +	  fi
         2597  +	fi
         2598  +
         2599  +	link_static=no # Whether the deplib will be linked statically
         2600  +	use_static_libs=$prefer_static_libs
         2601  +	if test "$use_static_libs" = built && test "$installed" = yes ; then
         2602  +	  use_static_libs=no
         2603  +	fi
         2604  +	if test -n "$library_names" &&
         2605  +	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
         2606  +	  if test "$installed" = no; then
         2607  +	    notinst_deplibs="$notinst_deplibs $lib"
         2608  +	    need_relink=yes
         2609  +	  fi
         2610  +	  # This is a shared library
         2611  +
         2612  +	  # Warn about portability, can't link against -module's on
         2613  +	  # some systems (darwin)
         2614  +	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
         2615  +	    $echo
         2616  +	    if test "$linkmode" = prog; then
         2617  +	      $echo "*** Warning: Linking the executable $output against the loadable module"
         2618  +	    else
         2619  +	      $echo "*** Warning: Linking the shared library $output against the loadable module"
         2620  +	    fi
         2621  +	    $echo "*** $linklib is not portable!"
         2622  +	  fi
         2623  +	  if test "$linkmode" = lib &&
         2624  +	     test "$hardcode_into_libs" = yes; then
         2625  +	    # Hardcode the library path.
         2626  +	    # Skip directories that are in the system default run-time
         2627  +	    # search path.
         2628  +	    case " $sys_lib_dlsearch_path " in
         2629  +	    *" $absdir "*) ;;
         2630  +	    *)
         2631  +	      case "$compile_rpath " in
         2632  +	      *" $absdir "*) ;;
         2633  +	      *) compile_rpath="$compile_rpath $absdir"
         2634  +	      esac
         2635  +	      ;;
         2636  +	    esac
         2637  +	    case " $sys_lib_dlsearch_path " in
         2638  +	    *" $libdir "*) ;;
         2639  +	    *)
         2640  +	      case "$finalize_rpath " in
         2641  +	      *" $libdir "*) ;;
         2642  +	      *) finalize_rpath="$finalize_rpath $libdir"
         2643  +	      esac
         2644  +	      ;;
         2645  +	    esac
         2646  +	  fi
         2647  +
         2648  +	  if test -n "$old_archive_from_expsyms_cmds"; then
         2649  +	    # figure out the soname
         2650  +	    set dummy $library_names
         2651  +	    realname="$2"
         2652  +	    shift; shift
         2653  +	    libname=`eval \\$echo \"$libname_spec\"`
         2654  +	    # use dlname if we got it. it's perfectly good, no?
         2655  +	    if test -n "$dlname"; then
         2656  +	      soname="$dlname"
         2657  +	    elif test -n "$soname_spec"; then
         2658  +	      # bleh windows
         2659  +	      case $host in
         2660  +	      *cygwin* | mingw*)
         2661  +		major=`expr $current - $age`
         2662  +		versuffix="-$major"
         2663  +		;;
         2664  +	      esac
         2665  +	      eval soname=\"$soname_spec\"
         2666  +	    else
         2667  +	      soname="$realname"
         2668  +	    fi
         2669  +
         2670  +	    # Make a new name for the extract_expsyms_cmds to use
         2671  +	    soroot="$soname"
         2672  +	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
         2673  +	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
         2674  +
         2675  +	    # If the library has no export list, then create one now
         2676  +	    if test -f "$output_objdir/$soname-def"; then :
         2677  +	    else
         2678  +	      $show "extracting exported symbol list from \`$soname'"
         2679  +	      save_ifs="$IFS"; IFS='~'
         2680  +	      cmds=$extract_expsyms_cmds
         2681  +	      for cmd in $cmds; do
         2682  +		IFS="$save_ifs"
         2683  +		eval cmd=\"$cmd\"
         2684  +		$show "$cmd"
         2685  +		$run eval "$cmd" || exit $?
         2686  +	      done
         2687  +	      IFS="$save_ifs"
         2688  +	    fi
         2689  +
         2690  +	    # Create $newlib
         2691  +	    if test -f "$output_objdir/$newlib"; then :; else
         2692  +	      $show "generating import library for \`$soname'"
         2693  +	      save_ifs="$IFS"; IFS='~'
         2694  +	      cmds=$old_archive_from_expsyms_cmds
         2695  +	      for cmd in $cmds; do
         2696  +		IFS="$save_ifs"
         2697  +		eval cmd=\"$cmd\"
         2698  +		$show "$cmd"
         2699  +		$run eval "$cmd" || exit $?
         2700  +	      done
         2701  +	      IFS="$save_ifs"
         2702  +	    fi
         2703  +	    # make sure the library variables are pointing to the new library
         2704  +	    dir=$output_objdir
         2705  +	    linklib=$newlib
         2706  +	  fi # test -n "$old_archive_from_expsyms_cmds"
         2707  +
         2708  +	  if test "$linkmode" = prog || test "$mode" != relink; then
         2709  +	    add_shlibpath=
         2710  +	    add_dir=
         2711  +	    add=
         2712  +	    lib_linked=yes
         2713  +	    case $hardcode_action in
         2714  +	    immediate | unsupported)
         2715  +	      if test "$hardcode_direct" = no; then
         2716  +		add="$dir/$linklib"
         2717  +		case $host in
         2718  +		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
         2719  +		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
         2720  +		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
         2721  +		    *-*-unixware7*) add_dir="-L$dir" ;;
         2722  +		  *-*-darwin* )
         2723  +		    # if the lib is a module then we can not link against
         2724  +		    # it, someone is ignoring the new warnings I added
         2725  +		    if /usr/bin/file -L $add 2> /dev/null |
         2726  +                      $EGREP ": [^:]* bundle" >/dev/null ; then
         2727  +		      $echo "** Warning, lib $linklib is a module, not a shared library"
         2728  +		      if test -z "$old_library" ; then
         2729  +		        $echo
         2730  +		        $echo "** And there doesn't seem to be a static archive available"
         2731  +		        $echo "** The link will probably fail, sorry"
         2732  +		      else
         2733  +		        add="$dir/$old_library"
         2734  +		      fi
         2735  +		    fi
         2736  +		esac
         2737  +	      elif test "$hardcode_minus_L" = no; then
         2738  +		case $host in
         2739  +		*-*-sunos*) add_shlibpath="$dir" ;;
         2740  +		esac
         2741  +		add_dir="-L$dir"
         2742  +		add="-l$name"
         2743  +	      elif test "$hardcode_shlibpath_var" = no; then
         2744  +		add_shlibpath="$dir"
         2745  +		add="-l$name"
         2746  +	      else
         2747  +		lib_linked=no
         2748  +	      fi
         2749  +	      ;;
         2750  +	    relink)
         2751  +	      if test "$hardcode_direct" = yes; then
         2752  +		add="$dir/$linklib"
         2753  +	      elif test "$hardcode_minus_L" = yes; then
         2754  +		add_dir="-L$dir"
         2755  +		# Try looking first in the location we're being installed to.
         2756  +		if test -n "$inst_prefix_dir"; then
         2757  +		  case $libdir in
         2758  +		    [\\/]*)
         2759  +		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
         2760  +		      ;;
         2761  +		  esac
         2762  +		fi
         2763  +		add="-l$name"
         2764  +	      elif test "$hardcode_shlibpath_var" = yes; then
         2765  +		add_shlibpath="$dir"
         2766  +		add="-l$name"
         2767  +	      else
         2768  +		lib_linked=no
         2769  +	      fi
         2770  +	      ;;
         2771  +	    *) lib_linked=no ;;
         2772  +	    esac
         2773  +
         2774  +	    if test "$lib_linked" != yes; then
         2775  +	      $echo "$modename: configuration error: unsupported hardcode properties"
         2776  +	      exit $EXIT_FAILURE
         2777  +	    fi
         2778  +
         2779  +	    if test -n "$add_shlibpath"; then
         2780  +	      case :$compile_shlibpath: in
         2781  +	      *":$add_shlibpath:"*) ;;
         2782  +	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
         2783  +	      esac
         2784  +	    fi
         2785  +	    if test "$linkmode" = prog; then
         2786  +	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
         2787  +	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
         2788  +	    else
         2789  +	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
         2790  +	      test -n "$add" && deplibs="$add $deplibs"
         2791  +	      if test "$hardcode_direct" != yes && \
         2792  +		 test "$hardcode_minus_L" != yes && \
         2793  +		 test "$hardcode_shlibpath_var" = yes; then
         2794  +		case :$finalize_shlibpath: in
         2795  +		*":$libdir:"*) ;;
         2796  +		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
         2797  +		esac
         2798  +	      fi
         2799  +	    fi
         2800  +	  fi
         2801  +
         2802  +	  if test "$linkmode" = prog || test "$mode" = relink; then
         2803  +	    add_shlibpath=
         2804  +	    add_dir=
         2805  +	    add=
         2806  +	    # Finalize command for both is simple: just hardcode it.
         2807  +	    if test "$hardcode_direct" = yes; then
         2808  +	      add="$libdir/$linklib"
         2809  +	    elif test "$hardcode_minus_L" = yes; then
         2810  +	      add_dir="-L$libdir"
         2811  +	      add="-l$name"
         2812  +	    elif test "$hardcode_shlibpath_var" = yes; then
         2813  +	      case :$finalize_shlibpath: in
         2814  +	      *":$libdir:"*) ;;
         2815  +	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
         2816  +	      esac
         2817  +	      add="-l$name"
         2818  +	    elif test "$hardcode_automatic" = yes; then
         2819  +	      if test -n "$inst_prefix_dir" &&
         2820  +		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
         2821  +	        add="$inst_prefix_dir$libdir/$linklib"
         2822  +	      else
         2823  +	        add="$libdir/$linklib"
         2824  +	      fi
         2825  +	    else
         2826  +	      # We cannot seem to hardcode it, guess we'll fake it.
         2827  +	      add_dir="-L$libdir"
         2828  +	      # Try looking first in the location we're being installed to.
         2829  +	      if test -n "$inst_prefix_dir"; then
         2830  +		case $libdir in
         2831  +		  [\\/]*)
         2832  +		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
         2833  +		    ;;
         2834  +		esac
         2835  +	      fi
         2836  +	      add="-l$name"
         2837  +	    fi
         2838  +
         2839  +	    if test "$linkmode" = prog; then
         2840  +	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
         2841  +	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
         2842  +	    else
         2843  +	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
         2844  +	      test -n "$add" && deplibs="$add $deplibs"
         2845  +	    fi
         2846  +	  fi
         2847  +	elif test "$linkmode" = prog; then
         2848  +	  # Here we assume that one of hardcode_direct or hardcode_minus_L
         2849  +	  # is not unsupported.  This is valid on all known static and
         2850  +	  # shared platforms.
         2851  +	  if test "$hardcode_direct" != unsupported; then
         2852  +	    test -n "$old_library" && linklib="$old_library"
         2853  +	    compile_deplibs="$dir/$linklib $compile_deplibs"
         2854  +	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
         2855  +	  else
         2856  +	    compile_deplibs="-l$name -L$dir $compile_deplibs"
         2857  +	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
         2858  +	  fi
         2859  +	elif test "$build_libtool_libs" = yes; then
         2860  +	  # Not a shared library
         2861  +	  if test "$deplibs_check_method" != pass_all; then
         2862  +	    # We're trying link a shared library against a static one
         2863  +	    # but the system doesn't support it.
         2864  +
         2865  +	    # Just print a warning and add the library to dependency_libs so
         2866  +	    # that the program can be linked against the static library.
         2867  +	    $echo
         2868  +	    $echo "*** Warning: This system can not link to static lib archive $lib."
         2869  +	    $echo "*** I have the capability to make that library automatically link in when"
         2870  +	    $echo "*** you link to this library.  But I can only do this if you have a"
         2871  +	    $echo "*** shared version of the library, which you do not appear to have."
         2872  +	    if test "$module" = yes; then
         2873  +	      $echo "*** But as you try to build a module library, libtool will still create "
         2874  +	      $echo "*** a static module, that should work as long as the dlopening application"
         2875  +	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
         2876  +	      if test -z "$global_symbol_pipe"; then
         2877  +		$echo
         2878  +		$echo "*** However, this would only work if libtool was able to extract symbol"
         2879  +		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
         2880  +		$echo "*** not find such a program.  So, this module is probably useless."
         2881  +		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
         2882  +	      fi
         2883  +	      if test "$build_old_libs" = no; then
         2884  +		build_libtool_libs=module
         2885  +		build_old_libs=yes
         2886  +	      else
         2887  +		build_libtool_libs=no
         2888  +	      fi
         2889  +	    fi
         2890  +	  else
         2891  +	    deplibs="$dir/$old_library $deplibs"
         2892  +	    link_static=yes
         2893  +	  fi
         2894  +	fi # link shared/static library?
         2895  +
         2896  +	if test "$linkmode" = lib; then
         2897  +	  if test -n "$dependency_libs" &&
         2898  +	     { test "$hardcode_into_libs" != yes ||
         2899  +	       test "$build_old_libs" = yes ||
         2900  +	       test "$link_static" = yes; }; then
         2901  +	    # Extract -R from dependency_libs
         2902  +	    temp_deplibs=
         2903  +	    for libdir in $dependency_libs; do
         2904  +	      case $libdir in
         2905  +	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
         2906  +		   case " $xrpath " in
         2907  +		   *" $temp_xrpath "*) ;;
         2908  +		   *) xrpath="$xrpath $temp_xrpath";;
         2909  +		   esac;;
         2910  +	      *) temp_deplibs="$temp_deplibs $libdir";;
         2911  +	      esac
         2912  +	    done
         2913  +	    dependency_libs="$temp_deplibs"
         2914  +	  fi
         2915  +
         2916  +	  newlib_search_path="$newlib_search_path $absdir"
         2917  +	  # Link against this library
         2918  +	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
         2919  +	  # ... and its dependency_libs
         2920  +	  tmp_libs=
         2921  +	  for deplib in $dependency_libs; do
         2922  +	    newdependency_libs="$deplib $newdependency_libs"
         2923  +	    if test "X$duplicate_deps" = "Xyes" ; then
         2924  +	      case "$tmp_libs " in
         2925  +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
         2926  +	      esac
         2927  +	    fi
         2928  +	    tmp_libs="$tmp_libs $deplib"
         2929  +	  done
         2930  +
         2931  +	  if test "$link_all_deplibs" != no; then
         2932  +	    # Add the search paths of all dependency libraries
         2933  +	    for deplib in $dependency_libs; do
         2934  +	      case $deplib in
         2935  +	      -L*) path="$deplib" ;;
         2936  +	      *.la)
         2937  +		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
         2938  +		test "X$dir" = "X$deplib" && dir="."
         2939  +		# We need an absolute path.
         2940  +		case $dir in
         2941  +		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
         2942  +		*)
         2943  +		  absdir=`cd "$dir" && pwd`
         2944  +		  if test -z "$absdir"; then
         2945  +		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
         2946  +		    absdir="$dir"
         2947  +		  fi
         2948  +		  ;;
         2949  +		esac
         2950  +		if grep "^installed=no" $deplib > /dev/null; then
         2951  +		  path="$absdir/$objdir"
         2952  +		else
         2953  +		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
         2954  +		  if test -z "$libdir"; then
         2955  +		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
         2956  +		    exit $EXIT_FAILURE
         2957  +		  fi
         2958  +		  if test "$absdir" != "$libdir"; then
         2959  +		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
         2960  +		  fi
         2961  +		  path="$absdir"
         2962  +		fi
         2963  +		depdepl=
         2964  +		case $host in
         2965  +		*-*-darwin*)
         2966  +		  # we do not want to link against static libs,
         2967  +		  # but need to link against shared
         2968  +		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
         2969  +		  eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
         2970  +		  if test -n "$deplibrary_names" ; then
         2971  +		    for tmp in $deplibrary_names ; do
         2972  +		      depdepl=$tmp
         2973  +		    done
         2974  +		    if test -f "$deplibdir/$depdepl" ; then
         2975  +		      depdepl="$deplibdir/$depdepl"
         2976  +	      	    elif test -f "$path/$depdepl" ; then
         2977  +		      depdepl="$path/$depdepl"
         2978  +		    else
         2979  +		      # Can't find it, oh well...
         2980  +		      depdepl=
         2981  +		    fi
         2982  +		    # do not add paths which are already there
         2983  +		    case " $newlib_search_path " in
         2984  +		    *" $path "*) ;;
         2985  +		    *) newlib_search_path="$newlib_search_path $path";;
         2986  +		    esac
         2987  +		  fi
         2988  +		  path=""
         2989  +		  ;;
         2990  +		*)
         2991  +		  path="-L$path"
         2992  +		  ;;
         2993  +		esac
         2994  +		;;
         2995  +	      -l*)
         2996  +		case $host in
         2997  +		*-*-darwin*)
         2998  +		  # Again, we only want to link against shared libraries
         2999  +		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
         3000  +		  for tmp in $newlib_search_path ; do
         3001  +		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
         3002  +		      eval depdepl="$tmp/lib$tmp_libs.dylib"
         3003  +		      break
         3004  +		    fi
         3005  +		  done
         3006  +		  path=""
         3007  +		  ;;
         3008  +		*) continue ;;
         3009  +		esac
         3010  +		;;
         3011  +	      *) continue ;;
         3012  +	      esac
         3013  +	      case " $deplibs " in
         3014  +	      *" $path "*) ;;
         3015  +	      *) deplibs="$path $deplibs" ;;
         3016  +	      esac
         3017  +	      case " $deplibs " in
         3018  +	      *" $depdepl "*) ;;
         3019  +	      *) deplibs="$depdepl $deplibs" ;;
         3020  +	      esac
         3021  +	    done
         3022  +	  fi # link_all_deplibs != no
         3023  +	fi # linkmode = lib
         3024  +      done # for deplib in $libs
         3025  +      dependency_libs="$newdependency_libs"
         3026  +      if test "$pass" = dlpreopen; then
         3027  +	# Link the dlpreopened libraries before other libraries
         3028  +	for deplib in $save_deplibs; do
         3029  +	  deplibs="$deplib $deplibs"
         3030  +	done
         3031  +      fi
         3032  +      if test "$pass" != dlopen; then
         3033  +	if test "$pass" != conv; then
         3034  +	  # Make sure lib_search_path contains only unique directories.
         3035  +	  lib_search_path=
         3036  +	  for dir in $newlib_search_path; do
         3037  +	    case "$lib_search_path " in
         3038  +	    *" $dir "*) ;;
         3039  +	    *) lib_search_path="$lib_search_path $dir" ;;
         3040  +	    esac
         3041  +	  done
         3042  +	  newlib_search_path=
         3043  +	fi
         3044  +
         3045  +	if test "$linkmode,$pass" != "prog,link"; then
         3046  +	  vars="deplibs"
         3047  +	else
         3048  +	  vars="compile_deplibs finalize_deplibs"
         3049  +	fi
         3050  +	for var in $vars dependency_libs; do
         3051  +	  # Add libraries to $var in reverse order
         3052  +	  eval tmp_libs=\"\$$var\"
         3053  +	  new_libs=
         3054  +	  for deplib in $tmp_libs; do
         3055  +	    # FIXME: Pedantically, this is the right thing to do, so
         3056  +	    #        that some nasty dependency loop isn't accidentally
         3057  +	    #        broken:
         3058  +	    #new_libs="$deplib $new_libs"
         3059  +	    # Pragmatically, this seems to cause very few problems in
         3060  +	    # practice:
         3061  +	    case $deplib in
         3062  +	    -L*) new_libs="$deplib $new_libs" ;;
         3063  +	    -R*) ;;
         3064  +	    *)
         3065  +	      # And here is the reason: when a library appears more
         3066  +	      # than once as an explicit dependence of a library, or
         3067  +	      # is implicitly linked in more than once by the
         3068  +	      # compiler, it is considered special, and multiple
         3069  +	      # occurrences thereof are not removed.  Compare this
         3070  +	      # with having the same library being listed as a
         3071  +	      # dependency of multiple other libraries: in this case,
         3072  +	      # we know (pedantically, we assume) the library does not
         3073  +	      # need to be listed more than once, so we keep only the
         3074  +	      # last copy.  This is not always right, but it is rare
         3075  +	      # enough that we require users that really mean to play
         3076  +	      # such unportable linking tricks to link the library
         3077  +	      # using -Wl,-lname, so that libtool does not consider it
         3078  +	      # for duplicate removal.
         3079  +	      case " $specialdeplibs " in
         3080  +	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
         3081  +	      *)
         3082  +		case " $new_libs " in
         3083  +		*" $deplib "*) ;;
         3084  +		*) new_libs="$deplib $new_libs" ;;
         3085  +		esac
         3086  +		;;
         3087  +	      esac
         3088  +	      ;;
         3089  +	    esac
         3090  +	  done
         3091  +	  tmp_libs=
         3092  +	  for deplib in $new_libs; do
         3093  +	    case $deplib in
         3094  +	    -L*)
         3095  +	      case " $tmp_libs " in
         3096  +	      *" $deplib "*) ;;
         3097  +	      *) tmp_libs="$tmp_libs $deplib" ;;
         3098  +	      esac
         3099  +	      ;;
         3100  +	    *) tmp_libs="$tmp_libs $deplib" ;;
         3101  +	    esac
         3102  +	  done
         3103  +	  eval $var=\"$tmp_libs\"
         3104  +	done # for var
         3105  +      fi
         3106  +      # Last step: remove runtime libs from dependency_libs
         3107  +      # (they stay in deplibs)
         3108  +      tmp_libs=
         3109  +      for i in $dependency_libs ; do
         3110  +	case " $predeps $postdeps $compiler_lib_search_path " in
         3111  +	*" $i "*)
         3112  +	  i=""
         3113  +	  ;;
         3114  +	esac
         3115  +	if test -n "$i" ; then
         3116  +	  tmp_libs="$tmp_libs $i"
         3117  +	fi
         3118  +      done
         3119  +      dependency_libs=$tmp_libs
         3120  +    done # for pass
         3121  +    if test "$linkmode" = prog; then
         3122  +      dlfiles="$newdlfiles"
         3123  +      dlprefiles="$newdlprefiles"
         3124  +    fi
         3125  +
         3126  +    case $linkmode in
         3127  +    oldlib)
         3128  +      case " $deplibs" in
         3129  +      *\ -l* | *\ -L*)
         3130  +	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
         3131  +      esac
         3132  +
         3133  +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
         3134  +	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
         3135  +      fi
         3136  +
         3137  +      if test -n "$rpath"; then
         3138  +	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
         3139  +      fi
         3140  +
         3141  +      if test -n "$xrpath"; then
         3142  +	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
         3143  +      fi
         3144  +
         3145  +      if test -n "$vinfo"; then
         3146  +	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
         3147  +      fi
         3148  +
         3149  +      if test -n "$release"; then
         3150  +	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
         3151  +      fi
         3152  +
         3153  +      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
         3154  +	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
         3155  +      fi
         3156  +
         3157  +      # Now set the variables for building old libraries.
         3158  +      build_libtool_libs=no
         3159  +      oldlibs="$output"
         3160  +      objs="$objs$old_deplibs"
         3161  +      ;;
         3162  +
         3163  +    lib)
         3164  +      # Make sure we only generate libraries of the form `libNAME.la'.
         3165  +      case $outputname in
         3166  +      lib*)
         3167  +	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
         3168  +	eval shared_ext=\"$shrext_cmds\"
         3169  +	eval libname=\"$libname_spec\"
         3170  +	;;
         3171  +      *)
         3172  +	if test "$module" = no; then
         3173  +	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
         3174  +	  $echo "$help" 1>&2
         3175  +	  exit $EXIT_FAILURE
         3176  +	fi
         3177  +	if test "$need_lib_prefix" != no; then
         3178  +	  # Add the "lib" prefix for modules if required
         3179  +	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
         3180  +	  eval shared_ext=\"$shrext_cmds\"
         3181  +	  eval libname=\"$libname_spec\"
         3182  +	else
         3183  +	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
         3184  +	fi
         3185  +	;;
         3186  +      esac
         3187  +
         3188  +      if test -n "$objs"; then
         3189  +	if test "$deplibs_check_method" != pass_all; then
         3190  +	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
         3191  +	  exit $EXIT_FAILURE
         3192  +	else
         3193  +	  $echo
         3194  +	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
         3195  +	  $echo "*** objects $objs is not portable!"
         3196  +	  libobjs="$libobjs $objs"
         3197  +	fi
         3198  +      fi
         3199  +
         3200  +      if test "$dlself" != no; then
         3201  +	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
         3202  +      fi
         3203  +
         3204  +      set dummy $rpath
         3205  +      if test "$#" -gt 2; then
         3206  +	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
         3207  +      fi
         3208  +      install_libdir="$2"
         3209  +
         3210  +      oldlibs=
         3211  +      if test -z "$rpath"; then
         3212  +	if test "$build_libtool_libs" = yes; then
         3213  +	  # Building a libtool convenience library.
         3214  +	  # Some compilers have problems with a `.al' extension so
         3215  +	  # convenience libraries should have the same extension an
         3216  +	  # archive normally would.
         3217  +	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
         3218  +	  build_libtool_libs=convenience
         3219  +	  build_old_libs=yes
         3220  +	fi
         3221  +
         3222  +	if test -n "$vinfo"; then
         3223  +	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
         3224  +	fi
         3225  +
         3226  +	if test -n "$release"; then
         3227  +	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
         3228  +	fi
         3229  +      else
         3230  +
         3231  +	# Parse the version information argument.
         3232  +	save_ifs="$IFS"; IFS=':'
         3233  +	set dummy $vinfo 0 0 0
         3234  +	IFS="$save_ifs"
         3235  +
         3236  +	if test -n "$8"; then
         3237  +	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
         3238  +	  $echo "$help" 1>&2
         3239  +	  exit $EXIT_FAILURE
         3240  +	fi
         3241  +
         3242  +	# convert absolute version numbers to libtool ages
         3243  +	# this retains compatibility with .la files and attempts
         3244  +	# to make the code below a bit more comprehensible
         3245  +
         3246  +	case $vinfo_number in
         3247  +	yes)
         3248  +	  number_major="$2"
         3249  +	  number_minor="$3"
         3250  +	  number_revision="$4"
         3251  +	  #
         3252  +	  # There are really only two kinds -- those that
         3253  +	  # use the current revision as the major version
         3254  +	  # and those that subtract age and use age as
         3255  +	  # a minor version.  But, then there is irix
         3256  +	  # which has an extra 1 added just for fun
         3257  +	  #
         3258  +	  case $version_type in
         3259  +	  darwin|linux|osf|windows|none)
         3260  +	    current=`expr $number_major + $number_minor`
         3261  +	    age="$number_minor"
         3262  +	    revision="$number_revision"
         3263  +	    ;;
         3264  +	  freebsd-aout|freebsd-elf|sunos)
         3265  +	    current="$number_major"
         3266  +	    revision="$number_minor"
         3267  +	    age="0"
         3268  +	    ;;
         3269  +	  irix|nonstopux)
         3270  +	    current=`expr $number_major + $number_minor`
         3271  +	    age="$number_minor"
         3272  +	    revision="$number_minor"
         3273  +	    lt_irix_increment=no
         3274  +	    ;;
         3275  +	  *)
         3276  +	    $echo "$modename: unknown library version type \`$version_type'" 1>&2
         3277  +	    $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
         3278  +	    exit $EXIT_FAILURE
         3279  +	    ;;
         3280  +	  esac
         3281  +	  ;;
         3282  +	no)
         3283  +	  current="$2"
         3284  +	  revision="$3"
         3285  +	  age="$4"
         3286  +	  ;;
         3287  +	esac
         3288  +
         3289  +	# Check that each of the things are valid numbers.
         3290  +	case $current in
         3291  +	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
         3292  +	*)
         3293  +	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
         3294  +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
         3295  +	  exit $EXIT_FAILURE
         3296  +	  ;;
         3297  +	esac
         3298  +
         3299  +	case $revision in
         3300  +	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
         3301  +	*)
         3302  +	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
         3303  +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
         3304  +	  exit $EXIT_FAILURE
         3305  +	  ;;
         3306  +	esac
         3307  +
         3308  +	case $age in
         3309  +	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
         3310  +	*)
         3311  +	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
         3312  +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
         3313  +	  exit $EXIT_FAILURE
         3314  +	  ;;
         3315  +	esac
         3316  +
         3317  +	if test "$age" -gt "$current"; then
         3318  +	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
         3319  +	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
         3320  +	  exit $EXIT_FAILURE
         3321  +	fi
         3322  +
         3323  +	# Calculate the version variables.
         3324  +	major=
         3325  +	versuffix=
         3326  +	verstring=
         3327  +	case $version_type in
         3328  +	none) ;;
         3329  +
         3330  +	darwin)
         3331  +	  # Like Linux, but with the current version available in
         3332  +	  # verstring for coding it into the library header
         3333  +	  major=.`expr $current - $age`
         3334  +	  versuffix="$major.$age.$revision"
         3335  +	  # Darwin ld doesn't like 0 for these options...
         3336  +	  minor_current=`expr $current + 1`
         3337  +	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
         3338  +	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
         3339  +	  ;;
         3340  +
         3341  +	freebsd-aout)
         3342  +	  major=".$current"
         3343  +	  versuffix=".$current.$revision";
         3344  +	  ;;
         3345  +
         3346  +	freebsd-elf)
         3347  +	  major=".$current"
         3348  +	  versuffix=".$current";
         3349  +	  ;;
         3350  +
         3351  +	irix | nonstopux)
         3352  +	  if test "X$lt_irix_increment" = "Xno"; then
         3353  +	    major=`expr $current - $age`
         3354  +	  else
         3355  +	    major=`expr $current - $age + 1`
         3356  +	  fi
         3357  +	  case $version_type in
         3358  +	    nonstopux) verstring_prefix=nonstopux ;;
         3359  +	    *)         verstring_prefix=sgi ;;
         3360  +	  esac
         3361  +	  verstring="$verstring_prefix$major.$revision"
         3362  +
         3363  +	  # Add in all the interfaces that we are compatible with.
         3364  +	  loop=$revision
         3365  +	  while test "$loop" -ne 0; do
         3366  +	    iface=`expr $revision - $loop`
         3367  +	    loop=`expr $loop - 1`
         3368  +	    verstring="$verstring_prefix$major.$iface:$verstring"
         3369  +	  done
         3370  +
         3371  +	  # Before this point, $major must not contain `.'.
         3372  +	  major=.$major
         3373  +	  versuffix="$major.$revision"
         3374  +	  ;;
         3375  +
         3376  +	linux)
         3377  +	  major=.`expr $current - $age`
         3378  +	  versuffix="$major.$age.$revision"
         3379  +	  ;;
         3380  +
         3381  +	osf)
         3382  +	  major=.`expr $current - $age`
         3383  +	  versuffix=".$current.$age.$revision"
         3384  +	  verstring="$current.$age.$revision"
         3385  +
         3386  +	  # Add in all the interfaces that we are compatible with.
         3387  +	  loop=$age
         3388  +	  while test "$loop" -ne 0; do
         3389  +	    iface=`expr $current - $loop`
         3390  +	    loop=`expr $loop - 1`
         3391  +	    verstring="$verstring:${iface}.0"
         3392  +	  done
         3393  +
         3394  +	  # Make executables depend on our current version.
         3395  +	  verstring="$verstring:${current}.0"
         3396  +	  ;;
         3397  +
         3398  +	sunos)
         3399  +	  major=".$current"
         3400  +	  versuffix=".$current.$revision"
         3401  +	  ;;
         3402  +
         3403  +	windows)
         3404  +	  # Use '-' rather than '.', since we only want one
         3405  +	  # extension on DOS 8.3 filesystems.
         3406  +	  major=`expr $current - $age`
         3407  +	  versuffix="-$major"
         3408  +	  ;;
         3409  +
         3410  +	*)
         3411  +	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
         3412  +	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
         3413  +	  exit $EXIT_FAILURE
         3414  +	  ;;
         3415  +	esac
         3416  +
         3417  +	# Clear the version info if we defaulted, and they specified a release.
         3418  +	if test -z "$vinfo" && test -n "$release"; then
         3419  +	  major=
         3420  +	  case $version_type in
         3421  +	  darwin)
         3422  +	    # we can't check for "0.0" in archive_cmds due to quoting
         3423  +	    # problems, so we reset it completely
         3424  +	    verstring=
         3425  +	    ;;
         3426  +	  *)
         3427  +	    verstring="0.0"
         3428  +	    ;;
         3429  +	  esac
         3430  +	  if test "$need_version" = no; then
         3431  +	    versuffix=
         3432  +	  else
         3433  +	    versuffix=".0.0"
         3434  +	  fi
         3435  +	fi
         3436  +
         3437  +	# Remove version info from name if versioning should be avoided
         3438  +	if test "$avoid_version" = yes && test "$need_version" = no; then
         3439  +	  major=
         3440  +	  versuffix=
         3441  +	  verstring=""
         3442  +	fi
         3443  +
         3444  +	# Check to see if the archive will have undefined symbols.
         3445  +	if test "$allow_undefined" = yes; then
         3446  +	  if test "$allow_undefined_flag" = unsupported; then
         3447  +	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
         3448  +	    build_libtool_libs=no
         3449  +	    build_old_libs=yes
         3450  +	  fi
         3451  +	else
         3452  +	  # Don't allow undefined symbols.
         3453  +	  allow_undefined_flag="$no_undefined_flag"
         3454  +	fi
         3455  +      fi
         3456  +
         3457  +      if test "$mode" != relink; then
         3458  +	# Remove our outputs, but don't remove object files since they
         3459  +	# may have been created when compiling PIC objects.
         3460  +	removelist=
         3461  +	tempremovelist=`$echo "$output_objdir/*"`
         3462  +	for p in $tempremovelist; do
         3463  +	  case $p in
         3464  +	    *.$objext)
         3465  +	       ;;
         3466  +	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
         3467  +	       if test "X$precious_files_regex" != "X"; then
         3468  +	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
         3469  +	         then
         3470  +		   continue
         3471  +		 fi
         3472  +	       fi
         3473  +	       removelist="$removelist $p"
         3474  +	       ;;
         3475  +	    *) ;;
         3476  +	  esac
         3477  +	done
         3478  +	if test -n "$removelist"; then
         3479  +	  $show "${rm}r $removelist"
         3480  +	  $run ${rm}r $removelist
         3481  +	fi
         3482  +      fi
         3483  +
         3484  +      # Now set the variables for building old libraries.
         3485  +      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
         3486  +	oldlibs="$oldlibs $output_objdir/$libname.$libext"
         3487  +
         3488  +	# Transform .lo files to .o files.
         3489  +	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
         3490  +      fi
         3491  +
         3492  +      # Eliminate all temporary directories.
         3493  +      #for path in $notinst_path; do
         3494  +      #	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
         3495  +      #	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
         3496  +      #	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
         3497  +      #done
         3498  +
         3499  +      if test -n "$xrpath"; then
         3500  +	# If the user specified any rpath flags, then add them.
         3501  +	temp_xrpath=
         3502  +	for libdir in $xrpath; do
         3503  +	  temp_xrpath="$temp_xrpath -R$libdir"
         3504  +	  case "$finalize_rpath " in
         3505  +	  *" $libdir "*) ;;
         3506  +	  *) finalize_rpath="$finalize_rpath $libdir" ;;
         3507  +	  esac
         3508  +	done
         3509  +	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
         3510  +	  dependency_libs="$temp_xrpath $dependency_libs"
         3511  +	fi
         3512  +      fi
         3513  +
         3514  +      # Make sure dlfiles contains only unique files that won't be dlpreopened
         3515  +      old_dlfiles="$dlfiles"
         3516  +      dlfiles=
         3517  +      for lib in $old_dlfiles; do
         3518  +	case " $dlprefiles $dlfiles " in
         3519  +	*" $lib "*) ;;
         3520  +	*) dlfiles="$dlfiles $lib" ;;
         3521  +	esac
         3522  +      done
         3523  +
         3524  +      # Make sure dlprefiles contains only unique files
         3525  +      old_dlprefiles="$dlprefiles"
         3526  +      dlprefiles=
         3527  +      for lib in $old_dlprefiles; do
         3528  +	case "$dlprefiles " in
         3529  +	*" $lib "*) ;;
         3530  +	*) dlprefiles="$dlprefiles $lib" ;;
         3531  +	esac
         3532  +      done
         3533  +
         3534  +      if test "$build_libtool_libs" = yes; then
         3535  +	if test -n "$rpath"; then
         3536  +	  case $host in
         3537  +	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
         3538  +	    # these systems don't actually have a c library (as such)!
         3539  +	    ;;
         3540  +	  *-*-rhapsody* | *-*-darwin1.[012])
         3541  +	    # Rhapsody C library is in the System framework
         3542  +	    deplibs="$deplibs -framework System"
         3543  +	    ;;
         3544  +	  *-*-netbsd*)
         3545  +	    # Don't link with libc until the a.out ld.so is fixed.
         3546  +	    ;;
         3547  +	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
         3548  +	    # Do not include libc due to us having libc/libc_r.
         3549  +	    ;;
         3550  +	  *-*-sco3.2v5* | *-*-sco5v6*)
         3551  +	    # Causes problems with __ctype
         3552  +	    ;;
         3553  +	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
         3554  +	    # Compiler inserts libc in the correct place for threads to work
         3555  +	    ;;
         3556  + 	  *)
         3557  +	    # Add libc to deplibs on all other systems if necessary.
         3558  +	    if test "$build_libtool_need_lc" = "yes"; then
         3559  +	      deplibs="$deplibs -lc"
         3560  +	    fi
         3561  +	    ;;
         3562  +	  esac
         3563  +	fi
         3564  +
         3565  +	# Transform deplibs into only deplibs that can be linked in shared.
         3566  +	name_save=$name
         3567  +	libname_save=$libname
         3568  +	release_save=$release
         3569  +	versuffix_save=$versuffix
         3570  +	major_save=$major
         3571  +	# I'm not sure if I'm treating the release correctly.  I think
         3572  +	# release should show up in the -l (ie -lgmp5) so we don't want to
         3573  +	# add it in twice.  Is that correct?
         3574  +	release=""
         3575  +	versuffix=""
         3576  +	major=""
         3577  +	newdeplibs=
         3578  +	droppeddeps=no
         3579  +	case $deplibs_check_method in
         3580  +	pass_all)
         3581  +	  # Don't check for shared/static.  Everything works.
         3582  +	  # This might be a little naive.  We might want to check
         3583  +	  # whether the library exists or not.  But this is on
         3584  +	  # osf3 & osf4 and I'm not really sure... Just
         3585  +	  # implementing what was already the behavior.
         3586  +	  newdeplibs=$deplibs
         3587  +	  ;;
         3588  +	test_compile)
         3589  +	  # This code stresses the "libraries are programs" paradigm to its
         3590  +	  # limits. Maybe even breaks it.  We compile a program, linking it
         3591  +	  # against the deplibs as a proxy for the library.  Then we can check
         3592  +	  # whether they linked in statically or dynamically with ldd.
         3593  +	  $rm conftest.c
         3594  +	  cat > conftest.c <<EOF
         3595  +	  int main() { return 0; }
         3596  +EOF
         3597  +	  $rm conftest
         3598  +	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
         3599  +	    ldd_output=`ldd conftest`
         3600  +	    for i in $deplibs; do
         3601  +	      name=`expr $i : '-l\(.*\)'`
         3602  +	      # If $name is empty we are operating on a -L argument.
         3603  +              if test "$name" != "" && test "$name" != "0"; then
         3604  +		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
         3605  +		  case " $predeps $postdeps " in
         3606  +		  *" $i "*)
         3607  +		    newdeplibs="$newdeplibs $i"
         3608  +		    i=""
         3609  +		    ;;
         3610  +		  esac
         3611  +	        fi
         3612  +		if test -n "$i" ; then
         3613  +		  libname=`eval \\$echo \"$libname_spec\"`
         3614  +		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
         3615  +		  set dummy $deplib_matches
         3616  +		  deplib_match=$2
         3617  +		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
         3618  +		    newdeplibs="$newdeplibs $i"
         3619  +		  else
         3620  +		    droppeddeps=yes
         3621  +		    $echo
         3622  +		    $echo "*** Warning: dynamic linker does not accept needed library $i."
         3623  +		    $echo "*** I have the capability to make that library automatically link in when"
         3624  +		    $echo "*** you link to this library.  But I can only do this if you have a"
         3625  +		    $echo "*** shared version of the library, which I believe you do not have"
         3626  +		    $echo "*** because a test_compile did reveal that the linker did not use it for"
         3627  +		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
         3628  +		  fi
         3629  +		fi
         3630  +	      else
         3631  +		newdeplibs="$newdeplibs $i"
         3632  +	      fi
         3633  +	    done
         3634  +	  else
         3635  +	    # Error occurred in the first compile.  Let's try to salvage
         3636  +	    # the situation: Compile a separate program for each library.
         3637  +	    for i in $deplibs; do
         3638  +	      name=`expr $i : '-l\(.*\)'`
         3639  +	      # If $name is empty we are operating on a -L argument.
         3640  +              if test "$name" != "" && test "$name" != "0"; then
         3641  +		$rm conftest
         3642  +		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
         3643  +		  ldd_output=`ldd conftest`
         3644  +		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
         3645  +		    case " $predeps $postdeps " in
         3646  +		    *" $i "*)
         3647  +		      newdeplibs="$newdeplibs $i"
         3648  +		      i=""
         3649  +		      ;;
         3650  +		    esac
         3651  +		  fi
         3652  +		  if test -n "$i" ; then
         3653  +		    libname=`eval \\$echo \"$libname_spec\"`
         3654  +		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
         3655  +		    set dummy $deplib_matches
         3656  +		    deplib_match=$2
         3657  +		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
         3658  +		      newdeplibs="$newdeplibs $i"
         3659  +		    else
         3660  +		      droppeddeps=yes
         3661  +		      $echo
         3662  +		      $echo "*** Warning: dynamic linker does not accept needed library $i."
         3663  +		      $echo "*** I have the capability to make that library automatically link in when"
         3664  +		      $echo "*** you link to this library.  But I can only do this if you have a"
         3665  +		      $echo "*** shared version of the library, which you do not appear to have"
         3666  +		      $echo "*** because a test_compile did reveal that the linker did not use this one"
         3667  +		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
         3668  +		    fi
         3669  +		  fi
         3670  +		else
         3671  +		  droppeddeps=yes
         3672  +		  $echo
         3673  +		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
         3674  +		  $echo "*** make it link in!  You will probably need to install it or some"
         3675  +		  $echo "*** library that it depends on before this library will be fully"
         3676  +		  $echo "*** functional.  Installing it before continuing would be even better."
         3677  +		fi
         3678  +	      else
         3679  +		newdeplibs="$newdeplibs $i"
         3680  +	      fi
         3681  +	    done
         3682  +	  fi
         3683  +	  ;;
         3684  +	file_magic*)
         3685  +	  set dummy $deplibs_check_method
         3686  +	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
         3687  +	  for a_deplib in $deplibs; do
         3688  +	    name=`expr $a_deplib : '-l\(.*\)'`
         3689  +	    # If $name is empty we are operating on a -L argument.
         3690  +            if test "$name" != "" && test  "$name" != "0"; then
         3691  +	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
         3692  +		case " $predeps $postdeps " in
         3693  +		*" $a_deplib "*)
         3694  +		  newdeplibs="$newdeplibs $a_deplib"
         3695  +		  a_deplib=""
         3696  +		  ;;
         3697  +		esac
         3698  +	      fi
         3699  +	      if test -n "$a_deplib" ; then
         3700  +		libname=`eval \\$echo \"$libname_spec\"`
         3701  +		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
         3702  +		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
         3703  +		  for potent_lib in $potential_libs; do
         3704  +		      # Follow soft links.
         3705  +		      if ls -lLd "$potent_lib" 2>/dev/null \
         3706  +			 | grep " -> " >/dev/null; then
         3707  +			continue
         3708  +		      fi
         3709  +		      # The statement above tries to avoid entering an
         3710  +		      # endless loop below, in case of cyclic links.
         3711  +		      # We might still enter an endless loop, since a link
         3712  +		      # loop can be closed while we follow links,
         3713  +		      # but so what?
         3714  +		      potlib="$potent_lib"
         3715  +		      while test -h "$potlib" 2>/dev/null; do
         3716  +			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
         3717  +			case $potliblink in
         3718  +			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
         3719  +			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
         3720  +			esac
         3721  +		      done
         3722  +		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
         3723  +			 | ${SED} 10q \
         3724  +			 | $EGREP "$file_magic_regex" > /dev/null; then
         3725  +			newdeplibs="$newdeplibs $a_deplib"
         3726  +			a_deplib=""
         3727  +			break 2
         3728  +		      fi
         3729  +		  done
         3730  +		done
         3731  +	      fi
         3732  +	      if test -n "$a_deplib" ; then
         3733  +		droppeddeps=yes
         3734  +		$echo
         3735  +		$echo "*** Warning: linker path does not have real file for library $a_deplib."
         3736  +		$echo "*** I have the capability to make that library automatically link in when"
         3737  +		$echo "*** you link to this library.  But I can only do this if you have a"
         3738  +		$echo "*** shared version of the library, which you do not appear to have"
         3739  +		$echo "*** because I did check the linker path looking for a file starting"
         3740  +		if test -z "$potlib" ; then
         3741  +		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
         3742  +		else
         3743  +		  $echo "*** with $libname and none of the candidates passed a file format test"
         3744  +		  $echo "*** using a file magic. Last file checked: $potlib"
         3745  +		fi
         3746  +	      fi
         3747  +	    else
         3748  +	      # Add a -L argument.
         3749  +	      newdeplibs="$newdeplibs $a_deplib"
         3750  +	    fi
         3751  +	  done # Gone through all deplibs.
         3752  +	  ;;
         3753  +	match_pattern*)
         3754  +	  set dummy $deplibs_check_method
         3755  +	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
         3756  +	  for a_deplib in $deplibs; do
         3757  +	    name=`expr $a_deplib : '-l\(.*\)'`
         3758  +	    # If $name is empty we are operating on a -L argument.
         3759  +	    if test -n "$name" && test "$name" != "0"; then
         3760  +	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
         3761  +		case " $predeps $postdeps " in
         3762  +		*" $a_deplib "*)
         3763  +		  newdeplibs="$newdeplibs $a_deplib"
         3764  +		  a_deplib=""
         3765  +		  ;;
         3766  +		esac
         3767  +	      fi
         3768  +	      if test -n "$a_deplib" ; then
         3769  +		libname=`eval \\$echo \"$libname_spec\"`
         3770  +		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
         3771  +		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
         3772  +		  for potent_lib in $potential_libs; do
         3773  +		    potlib="$potent_lib" # see symlink-check above in file_magic test
         3774  +		    if eval $echo \"$potent_lib\" 2>/dev/null \
         3775  +		        | ${SED} 10q \
         3776  +		        | $EGREP "$match_pattern_regex" > /dev/null; then
         3777  +		      newdeplibs="$newdeplibs $a_deplib"
         3778  +		      a_deplib=""
         3779  +		      break 2
         3780  +		    fi
         3781  +		  done
         3782  +		done
         3783  +	      fi
         3784  +	      if test -n "$a_deplib" ; then
         3785  +		droppeddeps=yes
         3786  +		$echo
         3787  +		$echo "*** Warning: linker path does not have real file for library $a_deplib."
         3788  +		$echo "*** I have the capability to make that library automatically link in when"
         3789  +		$echo "*** you link to this library.  But I can only do this if you have a"
         3790  +		$echo "*** shared version of the library, which you do not appear to have"
         3791  +		$echo "*** because I did check the linker path looking for a file starting"
         3792  +		if test -z "$potlib" ; then
         3793  +		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
         3794  +		else
         3795  +		  $echo "*** with $libname and none of the candidates passed a file format test"
         3796  +		  $echo "*** using a regex pattern. Last file checked: $potlib"
         3797  +		fi
         3798  +	      fi
         3799  +	    else
         3800  +	      # Add a -L argument.
         3801  +	      newdeplibs="$newdeplibs $a_deplib"
         3802  +	    fi
         3803  +	  done # Gone through all deplibs.
         3804  +	  ;;
         3805  +	none | unknown | *)
         3806  +	  newdeplibs=""
         3807  +	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
         3808  +	    -e 's/ -[LR][^ ]*//g'`
         3809  +	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
         3810  +	    for i in $predeps $postdeps ; do
         3811  +	      # can't use Xsed below, because $i might contain '/'
         3812  +	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
         3813  +	    done
         3814  +	  fi
         3815  +	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
         3816  +	    | grep . >/dev/null; then
         3817  +	    $echo
         3818  +	    if test "X$deplibs_check_method" = "Xnone"; then
         3819  +	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
         3820  +	    else
         3821  +	      $echo "*** Warning: inter-library dependencies are not known to be supported."
         3822  +	    fi
         3823  +	    $echo "*** All declared inter-library dependencies are being dropped."
         3824  +	    droppeddeps=yes
         3825  +	  fi
         3826  +	  ;;
         3827  +	esac
         3828  +	versuffix=$versuffix_save
         3829  +	major=$major_save
         3830  +	release=$release_save
         3831  +	libname=$libname_save
         3832  +	name=$name_save
         3833  +
         3834  +	case $host in
         3835  +	*-*-rhapsody* | *-*-darwin1.[012])
         3836  +	  # On Rhapsody replace the C library is the System framework
         3837  +	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
         3838  +	  ;;
         3839  +	esac
         3840  +
         3841  +	if test "$droppeddeps" = yes; then
         3842  +	  if test "$module" = yes; then
         3843  +	    $echo
         3844  +	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
         3845  +	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
         3846  +	    $echo "*** a static module, that should work as long as the dlopening"
         3847  +	    $echo "*** application is linked with the -dlopen flag."
         3848  +	    if test -z "$global_symbol_pipe"; then
         3849  +	      $echo
         3850  +	      $echo "*** However, this would only work if libtool was able to extract symbol"
         3851  +	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
         3852  +	      $echo "*** not find such a program.  So, this module is probably useless."
         3853  +	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
         3854  +	    fi
         3855  +	    if test "$build_old_libs" = no; then
         3856  +	      oldlibs="$output_objdir/$libname.$libext"
         3857  +	      build_libtool_libs=module
         3858  +	      build_old_libs=yes
         3859  +	    else
         3860  +	      build_libtool_libs=no
         3861  +	    fi
         3862  +	  else
         3863  +	    $echo "*** The inter-library dependencies that have been dropped here will be"
         3864  +	    $echo "*** automatically added whenever a program is linked with this library"
         3865  +	    $echo "*** or is declared to -dlopen it."
         3866  +
         3867  +	    if test "$allow_undefined" = no; then
         3868  +	      $echo
         3869  +	      $echo "*** Since this library must not contain undefined symbols,"
         3870  +	      $echo "*** because either the platform does not support them or"
         3871  +	      $echo "*** it was explicitly requested with -no-undefined,"
         3872  +	      $echo "*** libtool will only create a static version of it."
         3873  +	      if test "$build_old_libs" = no; then
         3874  +		oldlibs="$output_objdir/$libname.$libext"
         3875  +		build_libtool_libs=module
         3876  +		build_old_libs=yes
         3877  +	      else
         3878  +		build_libtool_libs=no
         3879  +	      fi
         3880  +	    fi
         3881  +	  fi
         3882  +	fi
         3883  +	# Done checking deplibs!
         3884  +	deplibs=$newdeplibs
         3885  +      fi
         3886  +
         3887  +
         3888  +      # move library search paths that coincide with paths to not yet
         3889  +      # installed libraries to the beginning of the library search list
         3890  +      new_libs=
         3891  +      for path in $notinst_path; do
         3892  +	case " $new_libs " in
         3893  +	*" -L$path/$objdir "*) ;;
         3894  +	*)
         3895  +	  case " $deplibs " in
         3896  +	  *" -L$path/$objdir "*)
         3897  +	    new_libs="$new_libs -L$path/$objdir" ;;
         3898  +	  esac
         3899  +	  ;;
         3900  +	esac
         3901  +      done
         3902  +      for deplib in $deplibs; do
         3903  +	case $deplib in
         3904  +	-L*)
         3905  +	  case " $new_libs " in
         3906  +	  *" $deplib "*) ;;
         3907  +	  *) new_libs="$new_libs $deplib" ;;
         3908  +	  esac
         3909  +	  ;;
         3910  +	*) new_libs="$new_libs $deplib" ;;
         3911  +	esac
         3912  +      done
         3913  +      deplibs="$new_libs"
         3914  +
         3915  +
         3916  +      # All the library-specific variables (install_libdir is set above).
         3917  +      library_names=
         3918  +      old_library=
         3919  +      dlname=
         3920  +
         3921  +      # Test again, we may have decided not to build it any more
         3922  +      if test "$build_libtool_libs" = yes; then
         3923  +	if test "$hardcode_into_libs" = yes; then
         3924  +	  # Hardcode the library paths
         3925  +	  hardcode_libdirs=
         3926  +	  dep_rpath=
         3927  +	  rpath="$finalize_rpath"
         3928  +	  test "$mode" != relink && rpath="$compile_rpath$rpath"
         3929  +	  for libdir in $rpath; do
         3930  +	    if test -n "$hardcode_libdir_flag_spec"; then
         3931  +	      if test -n "$hardcode_libdir_separator"; then
         3932  +		if test -z "$hardcode_libdirs"; then
         3933  +		  hardcode_libdirs="$libdir"
         3934  +		else
         3935  +		  # Just accumulate the unique libdirs.
         3936  +		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
         3937  +		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
         3938  +		    ;;
         3939  +		  *)
         3940  +		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
         3941  +		    ;;
         3942  +		  esac
         3943  +		fi
         3944  +	      else
         3945  +		eval flag=\"$hardcode_libdir_flag_spec\"
         3946  +		dep_rpath="$dep_rpath $flag"
         3947  +	      fi
         3948  +	    elif test -n "$runpath_var"; then
         3949  +	      case "$perm_rpath " in
         3950  +	      *" $libdir "*) ;;
         3951  +	      *) perm_rpath="$perm_rpath $libdir" ;;
         3952  +	      esac
         3953  +	    fi
         3954  +	  done
         3955  +	  # Substitute the hardcoded libdirs into the rpath.
         3956  +	  if test -n "$hardcode_libdir_separator" &&
         3957  +	     test -n "$hardcode_libdirs"; then
         3958  +	    libdir="$hardcode_libdirs"
         3959  +	    if test -n "$hardcode_libdir_flag_spec_ld"; then
         3960  +	      case $archive_cmds in
         3961  +	      *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
         3962  +	      *)      eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
         3963  +	      esac
         3964  +	    else
         3965  +	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
         3966  +	    fi
         3967  +	  fi
         3968  +	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
         3969  +	    # We should set the runpath_var.
         3970  +	    rpath=
         3971  +	    for dir in $perm_rpath; do
         3972  +	      rpath="$rpath$dir:"
         3973  +	    done
         3974  +	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
         3975  +	  fi
         3976  +	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
         3977  +	fi
         3978  +
         3979  +	shlibpath="$finalize_shlibpath"
         3980  +	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
         3981  +	if test -n "$shlibpath"; then
         3982  +	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
         3983  +	fi
         3984  +
         3985  +	# Get the real and link names of the library.
         3986  +	eval shared_ext=\"$shrext_cmds\"
         3987  +	eval library_names=\"$library_names_spec\"
         3988  +	set dummy $library_names
         3989  +	realname="$2"
         3990  +	shift; shift
         3991  +
         3992  +	if test -n "$soname_spec"; then
         3993  +	  eval soname=\"$soname_spec\"
         3994  +	else
         3995  +	  soname="$realname"
         3996  +	fi
         3997  +	if test -z "$dlname"; then
         3998  +	  dlname=$soname
         3999  +	fi
         4000  +
         4001  +	lib="$output_objdir/$realname"
         4002  +	linknames=
         4003  +	for link
         4004  +	do
         4005  +	  linknames="$linknames $link"
         4006  +	done
         4007  +
         4008  +	# Use standard objects if they are pic
         4009  +	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
         4010  +
         4011  +	# Prepare the list of exported symbols
         4012  +	if test -z "$export_symbols"; then
         4013  +	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
         4014  +	    $show "generating symbol list for \`$libname.la'"
         4015  +	    export_symbols="$output_objdir/$libname.exp"
         4016  +	    $run $rm $export_symbols
         4017  +	    cmds=$export_symbols_cmds
         4018  +	    save_ifs="$IFS"; IFS='~'
         4019  +	    for cmd in $cmds; do
         4020  +	      IFS="$save_ifs"
         4021  +	      eval cmd=\"$cmd\"
         4022  +	      if len=`expr "X$cmd" : ".*"` &&
         4023  +	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
         4024  +	        $show "$cmd"
         4025  +	        $run eval "$cmd" || exit $?
         4026  +	        skipped_export=false
         4027  +	      else
         4028  +	        # The command line is too long to execute in one step.
         4029  +	        $show "using reloadable object file for export list..."
         4030  +	        skipped_export=:
         4031  +		# Break out early, otherwise skipped_export may be
         4032  +		# set to false by a later but shorter cmd.
         4033  +		break
         4034  +	      fi
         4035  +	    done
         4036  +	    IFS="$save_ifs"
         4037  +	    if test -n "$export_symbols_regex"; then
         4038  +	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
         4039  +	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
         4040  +	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
         4041  +	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
         4042  +	    fi
         4043  +	  fi
         4044  +	fi
         4045  +
         4046  +	if test -n "$export_symbols" && test -n "$include_expsyms"; then
         4047  +	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
         4048  +	fi
         4049  +
         4050  +	tmp_deplibs=
         4051  +	for test_deplib in $deplibs; do
         4052  +		case " $convenience " in
         4053  +		*" $test_deplib "*) ;;
         4054  +		*)
         4055  +			tmp_deplibs="$tmp_deplibs $test_deplib"
         4056  +			;;
         4057  +		esac
         4058  +	done
         4059  +	deplibs="$tmp_deplibs"
         4060  +
         4061  +	if test -n "$convenience"; then
         4062  +	  if test -n "$whole_archive_flag_spec"; then
         4063  +	    save_libobjs=$libobjs
         4064  +	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
         4065  +	  else
         4066  +	    gentop="$output_objdir/${outputname}x"
         4067  +	    generated="$generated $gentop"
         4068  +
         4069  +	    func_extract_archives $gentop $convenience
         4070  +	    libobjs="$libobjs $func_extract_archives_result"
         4071  +	  fi
         4072  +	fi
         4073  +	
         4074  +	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
         4075  +	  eval flag=\"$thread_safe_flag_spec\"
         4076  +	  linker_flags="$linker_flags $flag"
         4077  +	fi
         4078  +
         4079  +	# Make a backup of the uninstalled library when relinking
         4080  +	if test "$mode" = relink; then
         4081  +	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
         4082  +	fi
         4083  +
         4084  +	# Do each of the archive commands.
         4085  +	if test "$module" = yes && test -n "$module_cmds" ; then
         4086  +	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
         4087  +	    eval test_cmds=\"$module_expsym_cmds\"
         4088  +	    cmds=$module_expsym_cmds
         4089  +	  else
         4090  +	    eval test_cmds=\"$module_cmds\"
         4091  +	    cmds=$module_cmds
         4092  +	  fi
         4093  +	else
         4094  +	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
         4095  +	  eval test_cmds=\"$archive_expsym_cmds\"
         4096  +	  cmds=$archive_expsym_cmds
         4097  +	else
         4098  +	  eval test_cmds=\"$archive_cmds\"
         4099  +	  cmds=$archive_cmds
         4100  +	  fi
         4101  +	fi
         4102  +
         4103  +	if test "X$skipped_export" != "X:" &&
         4104  +	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
         4105  +	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
         4106  +	  :
         4107  +	else
         4108  +	  # The command line is too long to link in one step, link piecewise.
         4109  +	  $echo "creating reloadable object files..."
         4110  +
         4111  +	  # Save the value of $output and $libobjs because we want to
         4112  +	  # use them later.  If we have whole_archive_flag_spec, we
         4113  +	  # want to use save_libobjs as it was before
         4114  +	  # whole_archive_flag_spec was expanded, because we can't
         4115  +	  # assume the linker understands whole_archive_flag_spec.
         4116  +	  # This may have to be revisited, in case too many
         4117  +	  # convenience libraries get linked in and end up exceeding
         4118  +	  # the spec.
         4119  +	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
         4120  +	    save_libobjs=$libobjs
         4121  +	  fi
         4122  +	  save_output=$output
         4123  +	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
         4124  +
         4125  +	  # Clear the reloadable object creation command queue and
         4126  +	  # initialize k to one.
         4127  +	  test_cmds=
         4128  +	  concat_cmds=
         4129  +	  objlist=
         4130  +	  delfiles=
         4131  +	  last_robj=
         4132  +	  k=1
         4133  +	  output=$output_objdir/$output_la-${k}.$objext
         4134  +	  # Loop over the list of objects to be linked.
         4135  +	  for obj in $save_libobjs
         4136  +	  do
         4137  +	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
         4138  +	    if test "X$objlist" = X ||
         4139  +	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
         4140  +		 test "$len" -le "$max_cmd_len"; }; then
         4141  +	      objlist="$objlist $obj"
         4142  +	    else
         4143  +	      # The command $test_cmds is almost too long, add a
         4144  +	      # command to the queue.
         4145  +	      if test "$k" -eq 1 ; then
         4146  +		# The first file doesn't have a previous command to add.
         4147  +		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
         4148  +	      else
         4149  +		# All subsequent reloadable object files will link in
         4150  +		# the last one created.
         4151  +		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
         4152  +	      fi
         4153  +	      last_robj=$output_objdir/$output_la-${k}.$objext
         4154  +	      k=`expr $k + 1`
         4155  +	      output=$output_objdir/$output_la-${k}.$objext
         4156  +	      objlist=$obj
         4157  +	      len=1
         4158  +	    fi
         4159  +	  done
         4160  +	  # Handle the remaining objects by creating one last
         4161  +	  # reloadable object file.  All subsequent reloadable object
         4162  +	  # files will link in the last one created.
         4163  +	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
         4164  +	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
         4165  +
         4166  +	  if ${skipped_export-false}; then
         4167  +	    $show "generating symbol list for \`$libname.la'"
         4168  +	    export_symbols="$output_objdir/$libname.exp"
         4169  +	    $run $rm $export_symbols
         4170  +	    libobjs=$output
         4171  +	    # Append the command to create the export file.
         4172  +	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
         4173  +          fi
         4174  +
         4175  +	  # Set up a command to remove the reloadable object files
         4176  +	  # after they are used.
         4177  +	  i=0
         4178  +	  while test "$i" -lt "$k"
         4179  +	  do
         4180  +	    i=`expr $i + 1`
         4181  +	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
         4182  +	  done
         4183  +
         4184  +	  $echo "creating a temporary reloadable object file: $output"
         4185  +
         4186  +	  # Loop through the commands generated above and execute them.
         4187  +	  save_ifs="$IFS"; IFS='~'
         4188  +	  for cmd in $concat_cmds; do
         4189  +	    IFS="$save_ifs"
         4190  +	    $show "$cmd"
         4191  +	    $run eval "$cmd" || exit $?
         4192  +	  done
         4193  +	  IFS="$save_ifs"
         4194  +
         4195  +	  libobjs=$output
         4196  +	  # Restore the value of output.
         4197  +	  output=$save_output
         4198  +
         4199  +	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
         4200  +	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
         4201  +	  fi
         4202  +	  # Expand the library linking commands again to reset the
         4203  +	  # value of $libobjs for piecewise linking.
         4204  +
         4205  +	  # Do each of the archive commands.
         4206  +	  if test "$module" = yes && test -n "$module_cmds" ; then
         4207  +	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
         4208  +	      cmds=$module_expsym_cmds
         4209  +	    else
         4210  +	      cmds=$module_cmds
         4211  +	    fi
         4212  +	  else
         4213  +	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
         4214  +	    cmds=$archive_expsym_cmds
         4215  +	  else
         4216  +	    cmds=$archive_cmds
         4217  +	    fi
         4218  +	  fi
         4219  +
         4220  +	  # Append the command to remove the reloadable object files
         4221  +	  # to the just-reset $cmds.
         4222  +	  eval cmds=\"\$cmds~\$rm $delfiles\"
         4223  +	fi
         4224  +	save_ifs="$IFS"; IFS='~'
         4225  +	for cmd in $cmds; do
         4226  +	  IFS="$save_ifs"
         4227  +	  eval cmd=\"$cmd\"
         4228  +	  $show "$cmd"
         4229  +	  $run eval "$cmd" || {
         4230  +	    lt_exit=$?
         4231  +
         4232  +	    # Restore the uninstalled library and exit
         4233  +	    if test "$mode" = relink; then
         4234  +	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
         4235  +	    fi
         4236  +
         4237  +	    exit $lt_exit
         4238  +	  }
         4239  +	done
         4240  +	IFS="$save_ifs"
         4241  +
         4242  +	# Restore the uninstalled library and exit
         4243  +	if test "$mode" = relink; then
         4244  +	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
         4245  +
         4246  +	  if test -n "$convenience"; then
         4247  +	    if test -z "$whole_archive_flag_spec"; then
         4248  +	      $show "${rm}r $gentop"
         4249  +	      $run ${rm}r "$gentop"
         4250  +	    fi
         4251  +	  fi
         4252  +
         4253  +	  exit $EXIT_SUCCESS
         4254  +	fi
         4255  +
         4256  +	# Create links to the real library.
         4257  +	for linkname in $linknames; do
         4258  +	  if test "$realname" != "$linkname"; then
         4259  +	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
         4260  +	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
         4261  +	  fi
         4262  +	done
         4263  +
         4264  +	# If -module or -export-dynamic was specified, set the dlname.
         4265  +	if test "$module" = yes || test "$export_dynamic" = yes; then
         4266  +	  # On all known operating systems, these are identical.
         4267  +	  dlname="$soname"
         4268  +	fi
         4269  +      fi
         4270  +      ;;
         4271  +
         4272  +    obj)
         4273  +      case " $deplibs" in
         4274  +      *\ -l* | *\ -L*)
         4275  +	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
         4276  +      esac
         4277  +
         4278  +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
         4279  +	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
         4280  +      fi
         4281  +
         4282  +      if test -n "$rpath"; then
         4283  +	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
         4284  +      fi
         4285  +
         4286  +      if test -n "$xrpath"; then
         4287  +	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
         4288  +      fi
         4289  +
         4290  +      if test -n "$vinfo"; then
         4291  +	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
         4292  +      fi
         4293  +
         4294  +      if test -n "$release"; then
         4295  +	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
         4296  +      fi
         4297  +
         4298  +      case $output in
         4299  +      *.lo)
         4300  +	if test -n "$objs$old_deplibs"; then
         4301  +	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
         4302  +	  exit $EXIT_FAILURE
         4303  +	fi
         4304  +	libobj="$output"
         4305  +	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
         4306  +	;;
         4307  +      *)
         4308  +	libobj=
         4309  +	obj="$output"
         4310  +	;;
         4311  +      esac
         4312  +
         4313  +      # Delete the old objects.
         4314  +      $run $rm $obj $libobj
         4315  +
         4316  +      # Objects from convenience libraries.  This assumes
         4317  +      # single-version convenience libraries.  Whenever we create
         4318  +      # different ones for PIC/non-PIC, this we'll have to duplicate
         4319  +      # the extraction.
         4320  +      reload_conv_objs=
         4321  +      gentop=
         4322  +      # reload_cmds runs $LD directly, so let us get rid of
         4323  +      # -Wl from whole_archive_flag_spec and hope we can get by with
         4324  +      # turning comma into space..
         4325  +      wl=
         4326  +
         4327  +      if test -n "$convenience"; then
         4328  +	if test -n "$whole_archive_flag_spec"; then
         4329  +	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
         4330  +	  reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
         4331  +	else
         4332  +	  gentop="$output_objdir/${obj}x"
         4333  +	  generated="$generated $gentop"
         4334  +
         4335  +	  func_extract_archives $gentop $convenience
         4336  +	  reload_conv_objs="$reload_objs $func_extract_archives_result"
         4337  +	fi
         4338  +      fi
         4339  +
         4340  +      # Create the old-style object.
         4341  +      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
         4342  +
         4343  +      output="$obj"
         4344  +      cmds=$reload_cmds
         4345  +      save_ifs="$IFS"; IFS='~'
         4346  +      for cmd in $cmds; do
         4347  +	IFS="$save_ifs"
         4348  +	eval cmd=\"$cmd\"
         4349  +	$show "$cmd"
         4350  +	$run eval "$cmd" || exit $?
         4351  +      done
         4352  +      IFS="$save_ifs"
         4353  +
         4354  +      # Exit if we aren't doing a library object file.
         4355  +      if test -z "$libobj"; then
         4356  +	if test -n "$gentop"; then
         4357  +	  $show "${rm}r $gentop"
         4358  +	  $run ${rm}r $gentop
         4359  +	fi
         4360  +
         4361  +	exit $EXIT_SUCCESS
         4362  +      fi
         4363  +
         4364  +      if test "$build_libtool_libs" != yes; then
         4365  +	if test -n "$gentop"; then
         4366  +	  $show "${rm}r $gentop"
         4367  +	  $run ${rm}r $gentop
         4368  +	fi
         4369  +
         4370  +	# Create an invalid libtool object if no PIC, so that we don't
         4371  +	# accidentally link it into a program.
         4372  +	# $show "echo timestamp > $libobj"
         4373  +	# $run eval "echo timestamp > $libobj" || exit $?
         4374  +	exit $EXIT_SUCCESS
         4375  +      fi
         4376  +
         4377  +      if test -n "$pic_flag" || test "$pic_mode" != default; then
         4378  +	# Only do commands if we really have different PIC objects.
         4379  +	reload_objs="$libobjs $reload_conv_objs"
         4380  +	output="$libobj"
         4381  +	cmds=$reload_cmds
         4382  +	save_ifs="$IFS"; IFS='~'
         4383  +	for cmd in $cmds; do
         4384  +	  IFS="$save_ifs"
         4385  +	  eval cmd=\"$cmd\"
         4386  +	  $show "$cmd"
         4387  +	  $run eval "$cmd" || exit $?
         4388  +	done
         4389  +	IFS="$save_ifs"
         4390  +      fi
         4391  +
         4392  +      if test -n "$gentop"; then
         4393  +	$show "${rm}r $gentop"
         4394  +	$run ${rm}r $gentop
         4395  +      fi
         4396  +
         4397  +      exit $EXIT_SUCCESS
         4398  +      ;;
         4399  +
         4400  +    prog)
         4401  +      case $host in
         4402  +	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
         4403  +      esac
         4404  +      if test -n "$vinfo"; then
         4405  +	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
         4406  +      fi
         4407  +
         4408  +      if test -n "$release"; then
         4409  +	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
         4410  +      fi
         4411  +
         4412  +      if test "$preload" = yes; then
         4413  +	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
         4414  +	   test "$dlopen_self_static" = unknown; then
         4415  +	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
         4416  +	fi
         4417  +      fi
         4418  +
         4419  +      case $host in
         4420  +      *-*-rhapsody* | *-*-darwin1.[012])
         4421  +	# On Rhapsody replace the C library is the System framework
         4422  +	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
         4423  +	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
         4424  +	;;
         4425  +      esac
         4426  +
         4427  +      case $host in
         4428  +      *darwin*)
         4429  +        # Don't allow lazy linking, it breaks C++ global constructors
         4430  +        if test "$tagname" = CXX ; then
         4431  +        compile_command="$compile_command ${wl}-bind_at_load"
         4432  +        finalize_command="$finalize_command ${wl}-bind_at_load"
         4433  +        fi
         4434  +        ;;
         4435  +      esac
         4436  +
         4437  +
         4438  +      # move library search paths that coincide with paths to not yet
         4439  +      # installed libraries to the beginning of the library search list
         4440  +      new_libs=
         4441  +      for path in $notinst_path; do
         4442  +	case " $new_libs " in
         4443  +	*" -L$path/$objdir "*) ;;
         4444  +	*)
         4445  +	  case " $compile_deplibs " in
         4446  +	  *" -L$path/$objdir "*)
         4447  +	    new_libs="$new_libs -L$path/$objdir" ;;
         4448  +	  esac
         4449  +	  ;;
         4450  +	esac
         4451  +      done
         4452  +      for deplib in $compile_deplibs; do
         4453  +	case $deplib in
         4454  +	-L*)
         4455  +	  case " $new_libs " in
         4456  +	  *" $deplib "*) ;;
         4457  +	  *) new_libs="$new_libs $deplib" ;;
         4458  +	  esac
         4459  +	  ;;
         4460  +	*) new_libs="$new_libs $deplib" ;;
         4461  +	esac
         4462  +      done
         4463  +      compile_deplibs="$new_libs"
         4464  +
         4465  +
         4466  +      compile_command="$compile_command $compile_deplibs"
         4467  +      finalize_command="$finalize_command $finalize_deplibs"
         4468  +
         4469  +      if test -n "$rpath$xrpath"; then
         4470  +	# If the user specified any rpath flags, then add them.
         4471  +	for libdir in $rpath $xrpath; do
         4472  +	  # This is the magic to use -rpath.
         4473  +	  case "$finalize_rpath " in
         4474  +	  *" $libdir "*) ;;
         4475  +	  *) finalize_rpath="$finalize_rpath $libdir" ;;
         4476  +	  esac
         4477  +	done
         4478  +      fi
         4479  +
         4480  +      # Now hardcode the library paths
         4481  +      rpath=
         4482  +      hardcode_libdirs=
         4483  +      for libdir in $compile_rpath $finalize_rpath; do
         4484  +	if test -n "$hardcode_libdir_flag_spec"; then
         4485  +	  if test -n "$hardcode_libdir_separator"; then
         4486  +	    if test -z "$hardcode_libdirs"; then
         4487  +	      hardcode_libdirs="$libdir"
         4488  +	    else
         4489  +	      # Just accumulate the unique libdirs.
         4490  +	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
         4491  +	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
         4492  +		;;
         4493  +	      *)
         4494  +		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
         4495  +		;;
         4496  +	      esac
         4497  +	    fi
         4498  +	  else
         4499  +	    eval flag=\"$hardcode_libdir_flag_spec\"
         4500  +	    rpath="$rpath $flag"
         4501  +	  fi
         4502  +	elif test -n "$runpath_var"; then
         4503  +	  case "$perm_rpath " in
         4504  +	  *" $libdir "*) ;;
         4505  +	  *) perm_rpath="$perm_rpath $libdir" ;;
         4506  +	  esac
         4507  +	fi
         4508  +	case $host in
         4509  +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
         4510  +	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
         4511  +	  case :$dllsearchpath: in
         4512  +	  *":$libdir:"*) ;;
         4513  +	  *) dllsearchpath="$dllsearchpath:$libdir";;
         4514  +	  esac
         4515  +	  case :$dllsearchpath: in
         4516  +	  *":$testbindir:"*) ;;
         4517  +	  *) dllsearchpath="$dllsearchpath:$testbindir";;
         4518  +	  esac
         4519  +	  ;;
         4520  +	esac
         4521  +      done
         4522  +      # Substitute the hardcoded libdirs into the rpath.
         4523  +      if test -n "$hardcode_libdir_separator" &&
         4524  +	 test -n "$hardcode_libdirs"; then
         4525  +	libdir="$hardcode_libdirs"
         4526  +	eval rpath=\" $hardcode_libdir_flag_spec\"
         4527  +      fi
         4528  +      compile_rpath="$rpath"
         4529  +
         4530  +      rpath=
         4531  +      hardcode_libdirs=
         4532  +      for libdir in $finalize_rpath; do
         4533  +	if test -n "$hardcode_libdir_flag_spec"; then
         4534  +	  if test -n "$hardcode_libdir_separator"; then
         4535  +	    if test -z "$hardcode_libdirs"; then
         4536  +	      hardcode_libdirs="$libdir"
         4537  +	    else
         4538  +	      # Just accumulate the unique libdirs.
         4539  +	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
         4540  +	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
         4541  +		;;
         4542  +	      *)
         4543  +		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
         4544  +		;;
         4545  +	      esac
         4546  +	    fi
         4547  +	  else
         4548  +	    eval flag=\"$hardcode_libdir_flag_spec\"
         4549  +	    rpath="$rpath $flag"
         4550  +	  fi
         4551  +	elif test -n "$runpath_var"; then
         4552  +	  case "$finalize_perm_rpath " in
         4553  +	  *" $libdir "*) ;;
         4554  +	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
         4555  +	  esac
         4556  +	fi
         4557  +      done
         4558  +      # Substitute the hardcoded libdirs into the rpath.
         4559  +      if test -n "$hardcode_libdir_separator" &&
         4560  +	 test -n "$hardcode_libdirs"; then
         4561  +	libdir="$hardcode_libdirs"
         4562  +	eval rpath=\" $hardcode_libdir_flag_spec\"
         4563  +      fi
         4564  +      finalize_rpath="$rpath"
         4565  +
         4566  +      if test -n "$libobjs" && test "$build_old_libs" = yes; then
         4567  +	# Transform all the library objects into standard objects.
         4568  +	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
         4569  +	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
         4570  +      fi
         4571  +
         4572  +      dlsyms=
         4573  +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
         4574  +	if test -n "$NM" && test -n "$global_symbol_pipe"; then
         4575  +	  dlsyms="${outputname}S.c"
         4576  +	else
         4577  +	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
         4578  +	fi
         4579  +      fi
         4580  +
         4581  +      if test -n "$dlsyms"; then
         4582  +	case $dlsyms in
         4583  +	"") ;;
         4584  +	*.c)
         4585  +	  # Discover the nlist of each of the dlfiles.
         4586  +	  nlist="$output_objdir/${outputname}.nm"
         4587  +
         4588  +	  $show "$rm $nlist ${nlist}S ${nlist}T"
         4589  +	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
         4590  +
         4591  +	  # Parse the name list into a source file.
         4592  +	  $show "creating $output_objdir/$dlsyms"
         4593  +
         4594  +	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
         4595  +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
         4596  +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
         4597  +
         4598  +#ifdef __cplusplus
         4599  +extern \"C\" {
         4600  +#endif
         4601  +
         4602  +/* Prevent the only kind of declaration conflicts we can make. */
         4603  +#define lt_preloaded_symbols some_other_symbol
         4604  +
         4605  +/* External symbol declarations for the compiler. */\
         4606  +"
         4607  +
         4608  +	  if test "$dlself" = yes; then
         4609  +	    $show "generating symbol list for \`$output'"
         4610  +
         4611  +	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
         4612  +
         4613  +	    # Add our own program objects to the symbol list.
         4614  +	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
         4615  +	    for arg in $progfiles; do
         4616  +	      $show "extracting global C symbols from \`$arg'"
         4617  +	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
         4618  +	    done
         4619  +
         4620  +	    if test -n "$exclude_expsyms"; then
         4621  +	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
         4622  +	      $run eval '$mv "$nlist"T "$nlist"'
         4623  +	    fi
         4624  +
         4625  +	    if test -n "$export_symbols_regex"; then
         4626  +	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
         4627  +	      $run eval '$mv "$nlist"T "$nlist"'
         4628  +	    fi
         4629  +
         4630  +	    # Prepare the list of exported symbols
         4631  +	    if test -z "$export_symbols"; then
         4632  +	      export_symbols="$output_objdir/$outputname.exp"
         4633  +	      $run $rm $export_symbols
         4634  +	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
         4635  +              case $host in
         4636  +              *cygwin* | *mingw* )
         4637  +	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
         4638  +		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
         4639  +                ;;
         4640  +              esac
         4641  +	    else
         4642  +	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
         4643  +	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
         4644  +	      $run eval 'mv "$nlist"T "$nlist"'
         4645  +              case $host in
         4646  +              *cygwin* | *mingw* )
         4647  +	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
         4648  +		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
         4649  +                ;;
         4650  +              esac
         4651  +	    fi
         4652  +	  fi
         4653  +
         4654  +	  for arg in $dlprefiles; do
         4655  +	    $show "extracting global C symbols from \`$arg'"
         4656  +	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
         4657  +	    $run eval '$echo ": $name " >> "$nlist"'
         4658  +	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
         4659  +	  done
         4660  +
         4661  +	  if test -z "$run"; then
         4662  +	    # Make sure we have at least an empty file.
         4663  +	    test -f "$nlist" || : > "$nlist"
         4664  +
         4665  +	    if test -n "$exclude_expsyms"; then
         4666  +	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
         4667  +	      $mv "$nlist"T "$nlist"
         4668  +	    fi
         4669  +
         4670  +	    # Try sorting and uniquifying the output.
         4671  +	    if grep -v "^: " < "$nlist" |
         4672  +		if sort -k 3 </dev/null >/dev/null 2>&1; then
         4673  +		  sort -k 3
         4674  +		else
         4675  +		  sort +2
         4676  +		fi |
         4677  +		uniq > "$nlist"S; then
         4678  +	      :
         4679  +	    else
         4680  +	      grep -v "^: " < "$nlist" > "$nlist"S
         4681  +	    fi
         4682  +
         4683  +	    if test -f "$nlist"S; then
         4684  +	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
         4685  +	    else
         4686  +	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
         4687  +	    fi
         4688  +
         4689  +	    $echo >> "$output_objdir/$dlsyms" "\
         4690  +
         4691  +#undef lt_preloaded_symbols
         4692  +
         4693  +#if defined (__STDC__) && __STDC__
         4694  +# define lt_ptr void *
         4695  +#else
         4696  +# define lt_ptr char *
         4697  +# define const
         4698  +#endif
         4699  +
         4700  +/* The mapping between symbol names and symbols. */
         4701  +"
         4702  +
         4703  +	    case $host in
         4704  +	    *cygwin* | *mingw* )
         4705  +	  $echo >> "$output_objdir/$dlsyms" "\
         4706  +/* DATA imports from DLLs on WIN32 can't be const, because
         4707  +   runtime relocations are performed -- see ld's documentation
         4708  +   on pseudo-relocs */
         4709  +struct {
         4710  +"
         4711  +	      ;;
         4712  +	    * )
         4713  +	  $echo >> "$output_objdir/$dlsyms" "\
         4714  +const struct {
         4715  +"
         4716  +	      ;;
         4717  +	    esac
         4718  +
         4719  +
         4720  +	  $echo >> "$output_objdir/$dlsyms" "\
         4721  +  const char *name;
         4722  +  lt_ptr address;
         4723  +}
         4724  +lt_preloaded_symbols[] =
         4725  +{\
         4726  +"
         4727  +
         4728  +	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
         4729  +
         4730  +	    $echo >> "$output_objdir/$dlsyms" "\
         4731  +  {0, (lt_ptr) 0}
         4732  +};
         4733  +
         4734  +/* This works around a problem in FreeBSD linker */
         4735  +#ifdef FREEBSD_WORKAROUND
         4736  +static const void *lt_preloaded_setup() {
         4737  +  return lt_preloaded_symbols;
         4738  +}
         4739  +#endif
         4740  +
         4741  +#ifdef __cplusplus
         4742  +}
         4743  +#endif\
         4744  +"
         4745  +	  fi
         4746  +
         4747  +	  pic_flag_for_symtable=
         4748  +	  case $host in
         4749  +	  # compiling the symbol table file with pic_flag works around
         4750  +	  # a FreeBSD bug that causes programs to crash when -lm is
         4751  +	  # linked before any other PIC object.  But we must not use
         4752  +	  # pic_flag when linking with -static.  The problem exists in
         4753  +	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
         4754  +	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
         4755  +	    case "$compile_command " in
         4756  +	    *" -static "*) ;;
         4757  +	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
         4758  +	    esac;;
         4759  +	  *-*-hpux*)
         4760  +	    case "$compile_command " in
         4761  +	    *" -static "*) ;;
         4762  +	    *) pic_flag_for_symtable=" $pic_flag";;
         4763  +	    esac
         4764  +	  esac
         4765  +
         4766  +	  # Now compile the dynamic symbol file.
         4767  +	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
         4768  +	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
         4769  +
         4770  +	  # Clean up the generated files.
         4771  +	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
         4772  +	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
         4773  +
         4774  +	  # Transform the symbol file into the correct name.
         4775  +          case $host in
         4776  +          *cygwin* | *mingw* )
         4777  +            if test -f "$output_objdir/${outputname}.def" ; then
         4778  +              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
         4779  +              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
         4780  +            else
         4781  +              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
         4782  +              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
         4783  +             fi
         4784  +            ;;
         4785  +          * )
         4786  +            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
         4787  +            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
         4788  +            ;;
         4789  +          esac
         4790  +	  ;;
         4791  +	*)
         4792  +	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
         4793  +	  exit $EXIT_FAILURE
         4794  +	  ;;
         4795  +	esac
         4796  +      else
         4797  +	# We keep going just in case the user didn't refer to
         4798  +	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
         4799  +	# really was required.
         4800  +
         4801  +	# Nullify the symbol file.
         4802  +	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
         4803  +	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
         4804  +      fi
         4805  +
         4806  +      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
         4807  +	# Replace the output file specification.
         4808  +	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
         4809  +	link_command="$compile_command$compile_rpath"
         4810  +
         4811  +	# We have no uninstalled library dependencies, so finalize right now.
         4812  +	$show "$link_command"
         4813  +	$run eval "$link_command"
         4814  +	exit_status=$?
         4815  +
         4816  +	# Delete the generated files.
         4817  +	if test -n "$dlsyms"; then
         4818  +	  $show "$rm $output_objdir/${outputname}S.${objext}"
         4819  +	  $run $rm "$output_objdir/${outputname}S.${objext}"
         4820  +	fi
         4821  +
         4822  +	exit $exit_status
         4823  +      fi
         4824  +
         4825  +      if test -n "$shlibpath_var"; then
         4826  +	# We should set the shlibpath_var
         4827  +	rpath=
         4828  +	for dir in $temp_rpath; do
         4829  +	  case $dir in
         4830  +	  [\\/]* | [A-Za-z]:[\\/]*)
         4831  +	    # Absolute path.
         4832  +	    rpath="$rpath$dir:"
         4833  +	    ;;
         4834  +	  *)
         4835  +	    # Relative path: add a thisdir entry.
         4836  +	    rpath="$rpath\$thisdir/$dir:"
         4837  +	    ;;
         4838  +	  esac
         4839  +	done
         4840  +	temp_rpath="$rpath"
         4841  +      fi
         4842  +
         4843  +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
         4844  +	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
         4845  +      fi
         4846  +      if test -n "$finalize_shlibpath"; then
         4847  +	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
         4848  +      fi
         4849  +
         4850  +      compile_var=
         4851  +      finalize_var=
         4852  +      if test -n "$runpath_var"; then
         4853  +	if test -n "$perm_rpath"; then
         4854  +	  # We should set the runpath_var.
         4855  +	  rpath=
         4856  +	  for dir in $perm_rpath; do
         4857  +	    rpath="$rpath$dir:"
         4858  +	  done
         4859  +	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
         4860  +	fi
         4861  +	if test -n "$finalize_perm_rpath"; then
         4862  +	  # We should set the runpath_var.
         4863  +	  rpath=
         4864  +	  for dir in $finalize_perm_rpath; do
         4865  +	    rpath="$rpath$dir:"
         4866  +	  done
         4867  +	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
         4868  +	fi
         4869  +      fi
         4870  +
         4871  +      if test "$no_install" = yes; then
         4872  +	# We don't need to create a wrapper script.
         4873  +	link_command="$compile_var$compile_command$compile_rpath"
         4874  +	# Replace the output file specification.
         4875  +	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
         4876  +	# Delete the old output file.
         4877  +	$run $rm $output
         4878  +	# Link the executable and exit
         4879  +	$show "$link_command"
         4880  +	$run eval "$link_command" || exit $?
         4881  +	exit $EXIT_SUCCESS
         4882  +      fi
         4883  +
         4884  +      if test "$hardcode_action" = relink; then
         4885  +	# Fast installation is not supported
         4886  +	link_command="$compile_var$compile_command$compile_rpath"
         4887  +	relink_command="$finalize_var$finalize_command$finalize_rpath"
         4888  +
         4889  +	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
         4890  +	$echo "$modename: \`$output' will be relinked during installation" 1>&2
         4891  +      else
         4892  +	if test "$fast_install" != no; then
         4893  +	  link_command="$finalize_var$compile_command$finalize_rpath"
         4894  +	  if test "$fast_install" = yes; then
         4895  +	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
         4896  +	  else
         4897  +	    # fast_install is set to needless
         4898  +	    relink_command=
         4899  +	  fi
         4900  +	else
         4901  +	  link_command="$compile_var$compile_command$compile_rpath"
         4902  +	  relink_command="$finalize_var$finalize_command$finalize_rpath"
         4903  +	fi
         4904  +      fi
         4905  +
         4906  +      # Replace the output file specification.
         4907  +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
         4908  +
         4909  +      # Delete the old output files.
         4910  +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
         4911  +
         4912  +      $show "$link_command"
         4913  +      $run eval "$link_command" || exit $?
         4914  +
         4915  +      # Now create the wrapper script.
         4916  +      $show "creating $output"
         4917  +
         4918  +      # Quote the relink command for shipping.
         4919  +      if test -n "$relink_command"; then
         4920  +	# Preserve any variables that may affect compiler behavior
         4921  +	for var in $variables_saved_for_relink; do
         4922  +	  if eval test -z \"\${$var+set}\"; then
         4923  +	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
         4924  +	  elif eval var_value=\$$var; test -z "$var_value"; then
         4925  +	    relink_command="$var=; export $var; $relink_command"
         4926  +	  else
         4927  +	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
         4928  +	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
         4929  +	  fi
         4930  +	done
         4931  +	relink_command="(cd `pwd`; $relink_command)"
         4932  +	relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
         4933  +      fi
         4934  +
         4935  +      # Quote $echo for shipping.
         4936  +      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
         4937  +	case $progpath in
         4938  +	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
         4939  +	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
         4940  +	esac
         4941  +	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
         4942  +      else
         4943  +	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
         4944  +      fi
         4945  +
         4946  +      # Only actually do things if our run command is non-null.
         4947  +      if test -z "$run"; then
         4948  +	# win32 will think the script is a binary if it has
         4949  +	# a .exe suffix, so we strip it off here.
         4950  +	case $output in
         4951  +	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
         4952  +	esac
         4953  +	# test for cygwin because mv fails w/o .exe extensions
         4954  +	case $host in
         4955  +	  *cygwin*)
         4956  +	    exeext=.exe
         4957  +	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
         4958  +	  *) exeext= ;;
         4959  +	esac
         4960  +	case $host in
         4961  +	  *cygwin* | *mingw* )
         4962  +            output_name=`basename $output`
         4963  +            output_path=`dirname $output`
         4964  +            cwrappersource="$output_path/$objdir/lt-$output_name.c"
         4965  +            cwrapper="$output_path/$output_name.exe"
         4966  +            $rm $cwrappersource $cwrapper
         4967  +            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
         4968  +
         4969  +	    cat > $cwrappersource <<EOF
         4970  +
         4971  +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
         4972  +   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
         4973  +
         4974  +   The $output program cannot be directly executed until all the libtool
         4975  +   libraries that it depends on are installed.
         4976  +
         4977  +   This wrapper executable should never be moved out of the build directory.
         4978  +   If it is, it will not operate correctly.
         4979  +
         4980  +   Currently, it simply execs the wrapper *script* "/bin/sh $output",
         4981  +   but could eventually absorb all of the scripts functionality and
         4982  +   exec $objdir/$outputname directly.
         4983  +*/
         4984  +EOF
         4985  +	    cat >> $cwrappersource<<"EOF"
         4986  +#include <stdio.h>
         4987  +#include <stdlib.h>
         4988  +#include <unistd.h>
         4989  +#include <malloc.h>
         4990  +#include <stdarg.h>
         4991  +#include <assert.h>
         4992  +#include <string.h>
         4993  +#include <ctype.h>
         4994  +#include <sys/stat.h>
         4995  +
         4996  +#if defined(PATH_MAX)
         4997  +# define LT_PATHMAX PATH_MAX
         4998  +#elif defined(MAXPATHLEN)
         4999  +# define LT_PATHMAX MAXPATHLEN
         5000  +#else
         5001  +# define LT_PATHMAX 1024
         5002  +#endif
         5003  +
         5004  +#ifndef DIR_SEPARATOR
         5005  +# define DIR_SEPARATOR '/'
         5006  +# define PATH_SEPARATOR ':'
         5007  +#endif
         5008  +
         5009  +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
         5010  +  defined (__OS2__)
         5011  +# define HAVE_DOS_BASED_FILE_SYSTEM
         5012  +# ifndef DIR_SEPARATOR_2
         5013  +#  define DIR_SEPARATOR_2 '\\'
         5014  +# endif
         5015  +# ifndef PATH_SEPARATOR_2
         5016  +#  define PATH_SEPARATOR_2 ';'
         5017  +# endif
         5018  +#endif
         5019  +
         5020  +#ifndef DIR_SEPARATOR_2
         5021  +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
         5022  +#else /* DIR_SEPARATOR_2 */
         5023  +# define IS_DIR_SEPARATOR(ch) \
         5024  +        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
         5025  +#endif /* DIR_SEPARATOR_2 */
         5026  +
         5027  +#ifndef PATH_SEPARATOR_2
         5028  +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
         5029  +#else /* PATH_SEPARATOR_2 */
         5030  +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
         5031  +#endif /* PATH_SEPARATOR_2 */
         5032  +
         5033  +#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
         5034  +#define XFREE(stale) do { \
         5035  +  if (stale) { free ((void *) stale); stale = 0; } \
         5036  +} while (0)
         5037  +
         5038  +/* -DDEBUG is fairly common in CFLAGS.  */
         5039  +#undef DEBUG
         5040  +#if defined DEBUGWRAPPER
         5041  +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
         5042  +#else
         5043  +# define DEBUG(format, ...)
         5044  +#endif
         5045  +
         5046  +const char *program_name = NULL;
         5047  +
         5048  +void * xmalloc (size_t num);
         5049  +char * xstrdup (const char *string);
         5050  +const char * base_name (const char *name);
         5051  +char * find_executable(const char *wrapper);
         5052  +int    check_executable(const char *path);
         5053  +char * strendzap(char *str, const char *pat);
         5054  +void lt_fatal (const char *message, ...);
         5055  +
         5056  +int
         5057  +main (int argc, char *argv[])
         5058  +{
         5059  +  char **newargz;
         5060  +  int i;
         5061  +
         5062  +  program_name = (char *) xstrdup (base_name (argv[0]));
         5063  +  DEBUG("(main) argv[0]      : %s\n",argv[0]);
         5064  +  DEBUG("(main) program_name : %s\n",program_name);
         5065  +  newargz = XMALLOC(char *, argc+2);
         5066  +EOF
         5067  +
         5068  +            cat >> $cwrappersource <<EOF
         5069  +  newargz[0] = (char *) xstrdup("$SHELL");
         5070  +EOF
         5071  +
         5072  +            cat >> $cwrappersource <<"EOF"
         5073  +  newargz[1] = find_executable(argv[0]);
         5074  +  if (newargz[1] == NULL)
         5075  +    lt_fatal("Couldn't find %s", argv[0]);
         5076  +  DEBUG("(main) found exe at : %s\n",newargz[1]);
         5077  +  /* we know the script has the same name, without the .exe */
         5078  +  /* so make sure newargz[1] doesn't end in .exe */
         5079  +  strendzap(newargz[1],".exe");
         5080  +  for (i = 1; i < argc; i++)
         5081  +    newargz[i+1] = xstrdup(argv[i]);
         5082  +  newargz[argc+1] = NULL;
         5083  +
         5084  +  for (i=0; i<argc+1; i++)
         5085  +  {
         5086  +    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
         5087  +    ;
         5088  +  }
         5089  +
         5090  +EOF
         5091  +
         5092  +            case $host_os in
         5093  +              mingw*)
         5094  +                cat >> $cwrappersource <<EOF
         5095  +  execv("$SHELL",(char const **)newargz);
         5096  +EOF
         5097  +              ;;
         5098  +              *)
         5099  +                cat >> $cwrappersource <<EOF
         5100  +  execv("$SHELL",newargz);
         5101  +EOF
         5102  +              ;;
         5103  +            esac
         5104  +
         5105  +            cat >> $cwrappersource <<"EOF"
         5106  +  return 127;
         5107  +}
         5108  +
         5109  +void *
         5110  +xmalloc (size_t num)
         5111  +{
         5112  +  void * p = (void *) malloc (num);
         5113  +  if (!p)
         5114  +    lt_fatal ("Memory exhausted");
         5115  +
         5116  +  return p;
         5117  +}
         5118  +
         5119  +char *
         5120  +xstrdup (const char *string)
         5121  +{
         5122  +  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
         5123  +;
         5124  +}
         5125  +
         5126  +const char *
         5127  +base_name (const char *name)
         5128  +{
         5129  +  const char *base;
         5130  +
         5131  +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
         5132  +  /* Skip over the disk name in MSDOS pathnames. */
         5133  +  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
         5134  +    name += 2;
         5135  +#endif
         5136  +
         5137  +  for (base = name; *name; name++)
         5138  +    if (IS_DIR_SEPARATOR (*name))
         5139  +      base = name + 1;
         5140  +  return base;
         5141  +}
         5142  +
         5143  +int
         5144  +check_executable(const char * path)
         5145  +{
         5146  +  struct stat st;
         5147  +
         5148  +  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
         5149  +  if ((!path) || (!*path))
         5150  +    return 0;
         5151  +
         5152  +  if ((stat (path, &st) >= 0) &&
         5153  +      (
         5154  +        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
         5155  +#if defined (S_IXOTH)
         5156  +       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
         5157  +#endif
         5158  +#if defined (S_IXGRP)
         5159  +       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
         5160  +#endif
         5161  +       ((st.st_mode & S_IXUSR) == S_IXUSR))
         5162  +      )
         5163  +    return 1;
         5164  +  else
         5165  +    return 0;
         5166  +}
         5167  +
         5168  +/* Searches for the full path of the wrapper.  Returns
         5169  +   newly allocated full path name if found, NULL otherwise */
         5170  +char *
         5171  +find_executable (const char* wrapper)
         5172  +{
         5173  +  int has_slash = 0;
         5174  +  const char* p;
         5175  +  const char* p_next;
         5176  +  /* static buffer for getcwd */
         5177  +  char tmp[LT_PATHMAX + 1];
         5178  +  int tmp_len;
         5179  +  char* concat_name;
         5180  +
         5181  +  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
         5182  +
         5183  +  if ((wrapper == NULL) || (*wrapper == '\0'))
         5184  +    return NULL;
         5185  +
         5186  +  /* Absolute path? */
         5187  +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
         5188  +  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
         5189  +  {
         5190  +    concat_name = xstrdup (wrapper);
         5191  +    if (check_executable(concat_name))
         5192  +      return concat_name;
         5193  +    XFREE(concat_name);
         5194  +  }
         5195  +  else
         5196  +  {
         5197  +#endif
         5198  +    if (IS_DIR_SEPARATOR (wrapper[0]))
         5199  +    {
         5200  +      concat_name = xstrdup (wrapper);
         5201  +      if (check_executable(concat_name))
         5202  +        return concat_name;
         5203  +      XFREE(concat_name);
         5204  +    }
         5205  +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
         5206  +  }
         5207  +#endif
         5208  +
         5209  +  for (p = wrapper; *p; p++)
         5210  +    if (*p == '/')
         5211  +    {
         5212  +      has_slash = 1;
         5213  +      break;
         5214  +    }
         5215  +  if (!has_slash)
         5216  +  {
         5217  +    /* no slashes; search PATH */
         5218  +    const char* path = getenv ("PATH");
         5219  +    if (path != NULL)
         5220  +    {
         5221  +      for (p = path; *p; p = p_next)
         5222  +      {
         5223  +        const char* q;
         5224  +        size_t p_len;
         5225  +        for (q = p; *q; q++)
         5226  +          if (IS_PATH_SEPARATOR(*q))
         5227  +            break;
         5228  +        p_len = q - p;
         5229  +        p_next = (*q == '\0' ? q : q + 1);
         5230  +        if (p_len == 0)
         5231  +        {
         5232  +          /* empty path: current directory */
         5233  +          if (getcwd (tmp, LT_PATHMAX) == NULL)
         5234  +            lt_fatal ("getcwd failed");
         5235  +          tmp_len = strlen(tmp);
         5236  +          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
         5237  +          memcpy (concat_name, tmp, tmp_len);
         5238  +          concat_name[tmp_len] = '/';
         5239  +          strcpy (concat_name + tmp_len + 1, wrapper);
         5240  +        }
         5241  +        else
         5242  +        {
         5243  +          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
         5244  +          memcpy (concat_name, p, p_len);
         5245  +          concat_name[p_len] = '/';
         5246  +          strcpy (concat_name + p_len + 1, wrapper);
         5247  +        }
         5248  +        if (check_executable(concat_name))
         5249  +          return concat_name;
         5250  +        XFREE(concat_name);
         5251  +      }
         5252  +    }
         5253  +    /* not found in PATH; assume curdir */
         5254  +  }
         5255  +  /* Relative path | not found in path: prepend cwd */
         5256  +  if (getcwd (tmp, LT_PATHMAX) == NULL)
         5257  +    lt_fatal ("getcwd failed");
         5258  +  tmp_len = strlen(tmp);
         5259  +  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
         5260  +  memcpy (concat_name, tmp, tmp_len);
         5261  +  concat_name[tmp_len] = '/';
         5262  +  strcpy (concat_name + tmp_len + 1, wrapper);
         5263  +
         5264  +  if (check_executable(concat_name))
         5265  +    return concat_name;
         5266  +  XFREE(concat_name);
         5267  +  return NULL;
         5268  +}
         5269  +
         5270  +char *
         5271  +strendzap(char *str, const char *pat)
         5272  +{
         5273  +  size_t len, patlen;
         5274  +
         5275  +  assert(str != NULL);
         5276  +  assert(pat != NULL);
         5277  +
         5278  +  len = strlen(str);
         5279  +  patlen = strlen(pat);
         5280  +
         5281  +  if (patlen <= len)
         5282  +  {
         5283  +    str += len - patlen;
         5284  +    if (strcmp(str, pat) == 0)
         5285  +      *str = '\0';
         5286  +  }
         5287  +  return str;
         5288  +}
         5289  +
         5290  +static void
         5291  +lt_error_core (int exit_status, const char * mode,
         5292  +          const char * message, va_list ap)
         5293  +{
         5294  +  fprintf (stderr, "%s: %s: ", program_name, mode);
         5295  +  vfprintf (stderr, message, ap);
         5296  +  fprintf (stderr, ".\n");
         5297  +
         5298  +  if (exit_status >= 0)
         5299  +    exit (exit_status);
         5300  +}
         5301  +
         5302  +void
         5303  +lt_fatal (const char *message, ...)
         5304  +{
         5305  +  va_list ap;
         5306  +  va_start (ap, message);
         5307  +  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
         5308  +  va_end (ap);
         5309  +}
         5310  +EOF
         5311  +          # we should really use a build-platform specific compiler
         5312  +          # here, but OTOH, the wrappers (shell script and this C one)
         5313  +          # are only useful if you want to execute the "real" binary.
         5314  +          # Since the "real" binary is built for $host, then this
         5315  +          # wrapper might as well be built for $host, too.
         5316  +          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
         5317  +          ;;
         5318  +        esac
         5319  +        $rm $output
         5320  +        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
         5321  +
         5322  +	$echo > $output "\
         5323  +#! $SHELL
         5324  +
         5325  +# $output - temporary wrapper script for $objdir/$outputname
         5326  +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
         5327  +#
         5328  +# The $output program cannot be directly executed until all the libtool
         5329  +# libraries that it depends on are installed.
         5330  +#
         5331  +# This wrapper script should never be moved out of the build directory.
         5332  +# If it is, it will not operate correctly.
         5333  +
         5334  +# Sed substitution that helps us do robust quoting.  It backslashifies
         5335  +# metacharacters that are still active within double-quoted strings.
         5336  +Xsed='${SED} -e 1s/^X//'
         5337  +sed_quote_subst='$sed_quote_subst'
         5338  +
         5339  +# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
         5340  +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
         5341  +  emulate sh
         5342  +  NULLCMD=:
         5343  +  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
         5344  +  # is contrary to our usage.  Disable this feature.
         5345  +  alias -g '\${1+\"\$@\"}'='\"\$@\"'
         5346  +  setopt NO_GLOB_SUBST
         5347  +else
         5348  +  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
         5349  +fi
         5350  +BIN_SH=xpg4; export BIN_SH # for Tru64
         5351  +DUALCASE=1; export DUALCASE # for MKS sh
         5352  +
         5353  +# The HP-UX ksh and POSIX shell print the target directory to stdout
         5354  +# if CDPATH is set.
         5355  +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
         5356  +
         5357  +relink_command=\"$relink_command\"
         5358  +
         5359  +# This environment variable determines our operation mode.
         5360  +if test \"\$libtool_install_magic\" = \"$magic\"; then
         5361  +  # install mode needs the following variable:
         5362  +  notinst_deplibs='$notinst_deplibs'
         5363  +else
         5364  +  # When we are sourced in execute mode, \$file and \$echo are already set.
         5365  +  if test \"\$libtool_execute_magic\" != \"$magic\"; then
         5366  +    echo=\"$qecho\"
         5367  +    file=\"\$0\"
         5368  +    # Make sure echo works.
         5369  +    if test \"X\$1\" = X--no-reexec; then
         5370  +      # Discard the --no-reexec flag, and continue.
         5371  +      shift
         5372  +    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
         5373  +      # Yippee, \$echo works!
         5374  +      :
         5375  +    else
         5376  +      # Restart under the correct shell, and then maybe \$echo will work.
         5377  +      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
         5378  +    fi
         5379  +  fi\
         5380  +"
         5381  +	$echo >> $output "\
         5382  +
         5383  +  # Find the directory that this script lives in.
         5384  +  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
         5385  +  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
         5386  +
         5387  +  # Follow symbolic links until we get to the real thisdir.
         5388  +  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
         5389  +  while test -n \"\$file\"; do
         5390  +    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
         5391  +
         5392  +    # If there was a directory component, then change thisdir.
         5393  +    if test \"x\$destdir\" != \"x\$file\"; then
         5394  +      case \"\$destdir\" in
         5395  +      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
         5396  +      *) thisdir=\"\$thisdir/\$destdir\" ;;
         5397  +      esac
         5398  +    fi
         5399  +
         5400  +    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
         5401  +    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
         5402  +  done
         5403  +
         5404  +  # Try to get the absolute directory name.
         5405  +  absdir=\`cd \"\$thisdir\" && pwd\`
         5406  +  test -n \"\$absdir\" && thisdir=\"\$absdir\"
         5407  +"
         5408  +
         5409  +	if test "$fast_install" = yes; then
         5410  +	  $echo >> $output "\
         5411  +  program=lt-'$outputname'$exeext
         5412  +  progdir=\"\$thisdir/$objdir\"
         5413  +
         5414  +  if test ! -f \"\$progdir/\$program\" || \\
         5415  +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
         5416  +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
         5417  +
         5418  +    file=\"\$\$-\$program\"
         5419  +
         5420  +    if test ! -d \"\$progdir\"; then
         5421  +      $mkdir \"\$progdir\"
         5422  +    else
         5423  +      $rm \"\$progdir/\$file\"
         5424  +    fi"
         5425  +
         5426  +	  $echo >> $output "\
         5427  +
         5428  +    # relink executable if necessary
         5429  +    if test -n \"\$relink_command\"; then
         5430  +      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
         5431  +      else
         5432  +	$echo \"\$relink_command_output\" >&2
         5433  +	$rm \"\$progdir/\$file\"
         5434  +	exit $EXIT_FAILURE
         5435  +      fi
         5436  +    fi
         5437  +
         5438  +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
         5439  +    { $rm \"\$progdir/\$program\";
         5440  +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
         5441  +    $rm \"\$progdir/\$file\"
         5442  +  fi"
         5443  +	else
         5444  +	  $echo >> $output "\
         5445  +  program='$outputname'
         5446  +  progdir=\"\$thisdir/$objdir\"
         5447  +"
         5448  +	fi
         5449  +
         5450  +	$echo >> $output "\
         5451  +
         5452  +  if test -f \"\$progdir/\$program\"; then"
         5453  +
         5454  +	# Export our shlibpath_var if we have one.
         5455  +	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
         5456  +	  $echo >> $output "\
         5457  +    # Add our own library path to $shlibpath_var
         5458  +    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
         5459  +
         5460  +    # Some systems cannot cope with colon-terminated $shlibpath_var
         5461  +    # The second colon is a workaround for a bug in BeOS R4 sed
         5462  +    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
         5463  +
         5464  +    export $shlibpath_var
         5465  +"
         5466  +	fi
         5467  +
         5468  +	# fixup the dll searchpath if we need to.
         5469  +	if test -n "$dllsearchpath"; then
         5470  +	  $echo >> $output "\
         5471  +    # Add the dll search path components to the executable PATH
         5472  +    PATH=$dllsearchpath:\$PATH
         5473  +"
         5474  +	fi
         5475  +
         5476  +	$echo >> $output "\
         5477  +    if test \"\$libtool_execute_magic\" != \"$magic\"; then
         5478  +      # Run the actual program with our arguments.
         5479  +"
         5480  +	case $host in
         5481  +	# Backslashes separate directories on plain windows
         5482  +	*-*-mingw | *-*-os2*)
         5483  +	  $echo >> $output "\
         5484  +      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
         5485  +"
         5486  +	  ;;
         5487  +
         5488  +	*)
         5489  +	  $echo >> $output "\
         5490  +      exec \"\$progdir/\$program\" \${1+\"\$@\"}
         5491  +"
         5492  +	  ;;
         5493  +	esac
         5494  +	$echo >> $output "\
         5495  +      \$echo \"\$0: cannot exec \$program \$*\"
         5496  +      exit $EXIT_FAILURE
         5497  +    fi
         5498  +  else
         5499  +    # The program doesn't exist.
         5500  +    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
         5501  +    \$echo \"This script is just a wrapper for \$program.\" 1>&2
         5502  +    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
         5503  +    exit $EXIT_FAILURE
         5504  +  fi
         5505  +fi\
         5506  +"
         5507  +	chmod +x $output
         5508  +      fi
         5509  +      exit $EXIT_SUCCESS
         5510  +      ;;
         5511  +    esac
         5512  +
         5513  +    # See if we need to build an old-fashioned archive.
         5514  +    for oldlib in $oldlibs; do
         5515  +
         5516  +      if test "$build_libtool_libs" = convenience; then
         5517  +	oldobjs="$libobjs_save"
         5518  +	addlibs="$convenience"
         5519  +	build_libtool_libs=no
         5520  +      else
         5521  +	if test "$build_libtool_libs" = module; then
         5522  +	  oldobjs="$libobjs_save"
         5523  +	  build_libtool_libs=no
         5524  +	else
         5525  +	  oldobjs="$old_deplibs $non_pic_objects"
         5526  +	fi
         5527  +	addlibs="$old_convenience"
         5528  +      fi
         5529  +
         5530  +      if test -n "$addlibs"; then
         5531  +	gentop="$output_objdir/${outputname}x"
         5532  +	generated="$generated $gentop"
         5533  +
         5534  +	func_extract_archives $gentop $addlibs
         5535  +	oldobjs="$oldobjs $func_extract_archives_result"
         5536  +      fi
         5537  +
         5538  +      # Do each command in the archive commands.
         5539  +      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
         5540  +       cmds=$old_archive_from_new_cmds
         5541  +      else
         5542  +	# POSIX demands no paths to be encoded in archives.  We have
         5543  +	# to avoid creating archives with duplicate basenames if we
         5544  +	# might have to extract them afterwards, e.g., when creating a
         5545  +	# static archive out of a convenience library, or when linking
         5546  +	# the entirety of a libtool archive into another (currently
         5547  +	# not supported by libtool).
         5548  +	if (for obj in $oldobjs
         5549  +	    do
         5550  +	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
         5551  +	    done | sort | sort -uc >/dev/null 2>&1); then
         5552  +	  :
         5553  +	else
         5554  +	  $echo "copying selected object files to avoid basename conflicts..."
         5555  +
         5556  +	  if test -z "$gentop"; then
         5557  +	    gentop="$output_objdir/${outputname}x"
         5558  +	    generated="$generated $gentop"
         5559  +
         5560  +	    $show "${rm}r $gentop"
         5561  +	    $run ${rm}r "$gentop"
         5562  +	    $show "$mkdir $gentop"
         5563  +	    $run $mkdir "$gentop"
         5564  +	    exit_status=$?
         5565  +	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
         5566  +	      exit $exit_status
         5567  +	    fi
         5568  +	  fi
         5569  +
         5570  +	  save_oldobjs=$oldobjs
         5571  +	  oldobjs=
         5572  +	  counter=1
         5573  +	  for obj in $save_oldobjs
         5574  +	  do
         5575  +	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
         5576  +	    case " $oldobjs " in
         5577  +	    " ") oldobjs=$obj ;;
         5578  +	    *[\ /]"$objbase "*)
         5579  +	      while :; do
         5580  +		# Make sure we don't pick an alternate name that also
         5581  +		# overlaps.
         5582  +		newobj=lt$counter-$objbase
         5583  +		counter=`expr $counter + 1`
         5584  +		case " $oldobjs " in
         5585  +		*[\ /]"$newobj "*) ;;
         5586  +		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
         5587  +		esac
         5588  +	      done
         5589  +	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
         5590  +	      $run ln "$obj" "$gentop/$newobj" ||
         5591  +	      $run cp "$obj" "$gentop/$newobj"
         5592  +	      oldobjs="$oldobjs $gentop/$newobj"
         5593  +	      ;;
         5594  +	    *) oldobjs="$oldobjs $obj" ;;
         5595  +	    esac
         5596  +	  done
         5597  +	fi
         5598  +
         5599  +	eval cmds=\"$old_archive_cmds\"
         5600  +
         5601  +	if len=`expr "X$cmds" : ".*"` &&
         5602  +	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
         5603  +	  cmds=$old_archive_cmds
         5604  +	else
         5605  +	  # the command line is too long to link in one step, link in parts
         5606  +	  $echo "using piecewise archive linking..."
         5607  +	  save_RANLIB=$RANLIB
         5608  +	  RANLIB=:
         5609  +	  objlist=
         5610  +	  concat_cmds=
         5611  +	  save_oldobjs=$oldobjs
         5612  +
         5613  +	  # Is there a better way of finding the last object in the list?
         5614  +	  for obj in $save_oldobjs
         5615  +	  do
         5616  +	    last_oldobj=$obj
         5617  +	  done
         5618  +	  for obj in $save_oldobjs
         5619  +	  do
         5620  +	    oldobjs="$objlist $obj"
         5621  +	    objlist="$objlist $obj"
         5622  +	    eval test_cmds=\"$old_archive_cmds\"
         5623  +	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
         5624  +	       test "$len" -le "$max_cmd_len"; then
         5625  +	      :
         5626  +	    else
         5627  +	      # the above command should be used before it gets too long
         5628  +	      oldobjs=$objlist
         5629  +	      if test "$obj" = "$last_oldobj" ; then
         5630  +	        RANLIB=$save_RANLIB
         5631  +	      fi
         5632  +	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
         5633  +	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
         5634  +	      objlist=
         5635  +	    fi
         5636  +	  done
         5637  +	  RANLIB=$save_RANLIB
         5638  +	  oldobjs=$objlist
         5639  +	  if test "X$oldobjs" = "X" ; then
         5640  +	    eval cmds=\"\$concat_cmds\"
         5641  +	  else
         5642  +	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
         5643  +	  fi
         5644  +	fi
         5645  +      fi
         5646  +      save_ifs="$IFS"; IFS='~'
         5647  +      for cmd in $cmds; do
         5648  +        eval cmd=\"$cmd\"
         5649  +	IFS="$save_ifs"
         5650  +	$show "$cmd"
         5651  +	$run eval "$cmd" || exit $?
         5652  +      done
         5653  +      IFS="$save_ifs"
         5654  +    done
         5655  +
         5656  +    if test -n "$generated"; then
         5657  +      $show "${rm}r$generated"
         5658  +      $run ${rm}r$generated
         5659  +    fi
         5660  +
         5661  +    # Now create the libtool archive.
         5662  +    case $output in
         5663  +    *.la)
         5664  +      old_library=
         5665  +      test "$build_old_libs" = yes && old_library="$libname.$libext"
         5666  +      $show "creating $output"
         5667  +
         5668  +      # Preserve any variables that may affect compiler behavior
         5669  +      for var in $variables_saved_for_relink; do
         5670  +	if eval test -z \"\${$var+set}\"; then
         5671  +	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
         5672  +	elif eval var_value=\$$var; test -z "$var_value"; then
         5673  +	  relink_command="$var=; export $var; $relink_command"
         5674  +	else
         5675  +	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
         5676  +	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
         5677  +	fi
         5678  +      done
         5679  +      # Quote the link command for shipping.
         5680  +      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
         5681  +      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
         5682  +      if test "$hardcode_automatic" = yes ; then
         5683  +	relink_command=
         5684  +      fi
         5685  +
         5686  +
         5687  +      # Only create the output if not a dry run.
         5688  +      if test -z "$run"; then
         5689  +	for installed in no yes; do
         5690  +	  if test "$installed" = yes; then
         5691  +	    if test -z "$install_libdir"; then
         5692  +	      break
         5693  +	    fi
         5694  +	    output="$output_objdir/$outputname"i
         5695  +	    # Replace all uninstalled libtool libraries with the installed ones
         5696  +	    newdependency_libs=
         5697  +	    for deplib in $dependency_libs; do
         5698  +	      case $deplib in
         5699  +	      *.la)
         5700  +		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
         5701  +		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
         5702  +		if test -z "$libdir"; then
         5703  +		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
         5704  +		  exit $EXIT_FAILURE
         5705  +		fi
         5706  +		newdependency_libs="$newdependency_libs $libdir/$name"
         5707  +		;;
         5708  +	      *) newdependency_libs="$newdependency_libs $deplib" ;;
         5709  +	      esac
         5710  +	    done
         5711  +	    dependency_libs="$newdependency_libs"
         5712  +	    newdlfiles=
         5713  +	    for lib in $dlfiles; do
         5714  +	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
         5715  +	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
         5716  +	      if test -z "$libdir"; then
         5717  +		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
         5718  +		exit $EXIT_FAILURE
         5719  +	      fi
         5720  +	      newdlfiles="$newdlfiles $libdir/$name"
         5721  +	    done
         5722  +	    dlfiles="$newdlfiles"
         5723  +	    newdlprefiles=
         5724  +	    for lib in $dlprefiles; do
         5725  +	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
         5726  +	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
         5727  +	      if test -z "$libdir"; then
         5728  +		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
         5729  +		exit $EXIT_FAILURE
         5730  +	      fi
         5731  +	      newdlprefiles="$newdlprefiles $libdir/$name"
         5732  +	    done
         5733  +	    dlprefiles="$newdlprefiles"
         5734  +	  else
         5735  +	    newdlfiles=
         5736  +	    for lib in $dlfiles; do
         5737  +	      case $lib in
         5738  +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
         5739  +		*) abs=`pwd`"/$lib" ;;
         5740  +	      esac
         5741  +	      newdlfiles="$newdlfiles $abs"
         5742  +	    done
         5743  +	    dlfiles="$newdlfiles"
         5744  +	    newdlprefiles=
         5745  +	    for lib in $dlprefiles; do
         5746  +	      case $lib in
         5747  +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
         5748  +		*) abs=`pwd`"/$lib" ;;
         5749  +	      esac
         5750  +	      newdlprefiles="$newdlprefiles $abs"
         5751  +	    done
         5752  +	    dlprefiles="$newdlprefiles"
         5753  +	  fi
         5754  +	  $rm $output
         5755  +	  # place dlname in correct position for cygwin
         5756  +	  tdlname=$dlname
         5757  +	  case $host,$output,$installed,$module,$dlname in
         5758  +	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
         5759  +	  esac
         5760  +	  $echo > $output "\
         5761  +# $outputname - a libtool library file
         5762  +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
         5763  +#
         5764  +# Please DO NOT delete this file!
         5765  +# It is necessary for linking the library.
         5766  +
         5767  +# The name that we can dlopen(3).
         5768  +dlname='$tdlname'
         5769  +
         5770  +# Names of this library.
         5771  +library_names='$library_names'
         5772  +
         5773  +# The name of the static archive.
         5774  +old_library='$old_library'
         5775  +
         5776  +# Libraries that this one depends upon.
         5777  +dependency_libs='$dependency_libs'
         5778  +
         5779  +# Version information for $libname.
         5780  +current=$current
         5781  +age=$age
         5782  +revision=$revision
         5783  +
         5784  +# Is this an already installed library?
         5785  +installed=$installed
         5786  +
         5787  +# Should we warn about portability when linking against -modules?
         5788  +shouldnotlink=$module
         5789  +
         5790  +# Files to dlopen/dlpreopen
         5791  +dlopen='$dlfiles'
         5792  +dlpreopen='$dlprefiles'
         5793  +
         5794  +# Directory that this library needs to be installed in:
         5795  +libdir='$install_libdir'"
         5796  +	  if test "$installed" = no && test "$need_relink" = yes; then
         5797  +	    $echo >> $output "\
         5798  +relink_command=\"$relink_command\""
         5799  +	  fi
         5800  +	done
         5801  +      fi
         5802  +
         5803  +      # Do a symbolic link so that the libtool archive can be found in
         5804  +      # LD_LIBRARY_PATH before the program is installed.
         5805  +      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
         5806  +      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
         5807  +      ;;
         5808  +    esac
         5809  +    exit $EXIT_SUCCESS
         5810  +    ;;
         5811  +
         5812  +  # libtool install mode
         5813  +  install)
         5814  +    modename="$modename: install"
         5815  +
         5816  +    # There may be an optional sh(1) argument at the beginning of
         5817  +    # install_prog (especially on Windows NT).
         5818  +    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
         5819  +       # Allow the use of GNU shtool's install command.
         5820  +       $echo "X$nonopt" | grep shtool > /dev/null; then
         5821  +      # Aesthetically quote it.
         5822  +      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
         5823  +      case $arg in
         5824  +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         5825  +	arg="\"$arg\""
         5826  +	;;
         5827  +      esac
         5828  +      install_prog="$arg "
         5829  +      arg="$1"
         5830  +      shift
         5831  +    else
         5832  +      install_prog=
         5833  +      arg=$nonopt
         5834  +    fi
         5835  +
         5836  +    # The real first argument should be the name of the installation program.
         5837  +    # Aesthetically quote it.
         5838  +    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
         5839  +    case $arg in
         5840  +    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         5841  +      arg="\"$arg\""
         5842  +      ;;
         5843  +    esac
         5844  +    install_prog="$install_prog$arg"
         5845  +
         5846  +    # We need to accept at least all the BSD install flags.
         5847  +    dest=
         5848  +    files=
         5849  +    opts=
         5850  +    prev=
         5851  +    install_type=
         5852  +    isdir=no
         5853  +    stripme=
         5854  +    for arg
         5855  +    do
         5856  +      if test -n "$dest"; then
         5857  +	files="$files $dest"
         5858  +	dest=$arg
         5859  +	continue
         5860  +      fi
         5861  +
         5862  +      case $arg in
         5863  +      -d) isdir=yes ;;
         5864  +      -f) 
         5865  +      	case " $install_prog " in
         5866  +	*[\\\ /]cp\ *) ;;
         5867  +	*) prev=$arg ;;
         5868  +	esac
         5869  +	;;
         5870  +      -g | -m | -o) prev=$arg ;;
         5871  +      -s)
         5872  +	stripme=" -s"
         5873  +	continue
         5874  +	;;
         5875  +      -*)
         5876  +	;;
         5877  +      *)
         5878  +	# If the previous option needed an argument, then skip it.
         5879  +	if test -n "$prev"; then
         5880  +	  prev=
         5881  +	else
         5882  +	  dest=$arg
         5883  +	  continue
         5884  +	fi
         5885  +	;;
         5886  +      esac
         5887  +
         5888  +      # Aesthetically quote the argument.
         5889  +      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
         5890  +      case $arg in
         5891  +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
         5892  +	arg="\"$arg\""
         5893  +	;;
         5894  +      esac
         5895  +      install_prog="$install_prog $arg"
         5896  +    done
         5897  +
         5898  +    if test -z "$install_prog"; then
         5899  +      $echo "$modename: you must specify an install program" 1>&2
         5900  +      $echo "$help" 1>&2
         5901  +      exit $EXIT_FAILURE
         5902  +    fi
         5903  +
         5904  +    if test -n "$prev"; then
         5905  +      $echo "$modename: the \`$prev' option requires an argument" 1>&2
         5906  +      $echo "$help" 1>&2
         5907  +      exit $EXIT_FAILURE
         5908  +    fi
         5909  +
         5910  +    if test -z "$files"; then
         5911  +      if test -z "$dest"; then
         5912  +	$echo "$modename: no file or destination specified" 1>&2
         5913  +      else
         5914  +	$echo "$modename: you must specify a destination" 1>&2
         5915  +      fi
         5916  +      $echo "$help" 1>&2
         5917  +      exit $EXIT_FAILURE
         5918  +    fi
         5919  +
         5920  +    # Strip any trailing slash from the destination.
         5921  +    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
         5922  +
         5923  +    # Check to see that the destination is a directory.
         5924  +    test -d "$dest" && isdir=yes
         5925  +    if test "$isdir" = yes; then
         5926  +      destdir="$dest"
         5927  +      destname=
         5928  +    else
         5929  +      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
         5930  +      test "X$destdir" = "X$dest" && destdir=.
         5931  +      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
         5932  +
         5933  +      # Not a directory, so check to see that there is only one file specified.
         5934  +      set dummy $files
         5935  +      if test "$#" -gt 2; then
         5936  +	$echo "$modename: \`$dest' is not a directory" 1>&2
         5937  +	$echo "$help" 1>&2
         5938  +	exit $EXIT_FAILURE
         5939  +      fi
         5940  +    fi
         5941  +    case $destdir in
         5942  +    [\\/]* | [A-Za-z]:[\\/]*) ;;
         5943  +    *)
         5944  +      for file in $files; do
         5945  +	case $file in
         5946  +	*.lo) ;;
         5947  +	*)
         5948  +	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
         5949  +	  $echo "$help" 1>&2
         5950  +	  exit $EXIT_FAILURE
         5951  +	  ;;
         5952  +	esac
         5953  +      done
         5954  +      ;;
         5955  +    esac
         5956  +
         5957  +    # This variable tells wrapper scripts just to set variables rather
         5958  +    # than running their programs.
         5959  +    libtool_install_magic="$magic"
         5960  +
         5961  +    staticlibs=
         5962  +    future_libdirs=
         5963  +    current_libdirs=
         5964  +    for file in $files; do
         5965  +
         5966  +      # Do each installation.
         5967  +      case $file in
         5968  +      *.$libext)
         5969  +	# Do the static libraries later.
         5970  +	staticlibs="$staticlibs $file"
         5971  +	;;
         5972  +
         5973  +      *.la)
         5974  +	# Check to see that this really is a libtool archive.
         5975  +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
         5976  +	else
         5977  +	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
         5978  +	  $echo "$help" 1>&2
         5979  +	  exit $EXIT_FAILURE
         5980  +	fi
         5981  +
         5982  +	library_names=
         5983  +	old_library=
         5984  +	relink_command=
         5985  +	# If there is no directory component, then add one.
         5986  +	case $file in
         5987  +	*/* | *\\*) . $file ;;
         5988  +	*) . ./$file ;;
         5989  +	esac
         5990  +
         5991  +	# Add the libdir to current_libdirs if it is the destination.
         5992  +	if test "X$destdir" = "X$libdir"; then
         5993  +	  case "$current_libdirs " in
         5994  +	  *" $libdir "*) ;;
         5995  +	  *) current_libdirs="$current_libdirs $libdir" ;;
         5996  +	  esac
         5997  +	else
         5998  +	  # Note the libdir as a future libdir.
         5999  +	  case "$future_libdirs " in
         6000  +	  *" $libdir "*) ;;
         6001  +	  *) future_libdirs="$future_libdirs $libdir" ;;
         6002  +	  esac
         6003  +	fi
         6004  +
         6005  +	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
         6006  +	test "X$dir" = "X$file/" && dir=
         6007  +	dir="$dir$objdir"
         6008  +
         6009  +	if test -n "$relink_command"; then
         6010  +	  # Determine the prefix the user has applied to our future dir.
         6011  +	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
         6012  +
         6013  +	  # Don't allow the user to place us outside of our expected
         6014  +	  # location b/c this prevents finding dependent libraries that
         6015  +	  # are installed to the same prefix.
         6016  +	  # At present, this check doesn't affect windows .dll's that
         6017  +	  # are installed into $libdir/../bin (currently, that works fine)
         6018  +	  # but it's something to keep an eye on.
         6019  +	  if test "$inst_prefix_dir" = "$destdir"; then
         6020  +	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
         6021  +	    exit $EXIT_FAILURE
         6022  +	  fi
         6023  +
         6024  +	  if test -n "$inst_prefix_dir"; then
         6025  +	    # Stick the inst_prefix_dir data into the link command.
         6026  +	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
         6027  +	  else
         6028  +	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
         6029  +	  fi
         6030  +
         6031  +	  $echo "$modename: warning: relinking \`$file'" 1>&2
         6032  +	  $show "$relink_command"
         6033  +	  if $run eval "$relink_command"; then :
         6034  +	  else
         6035  +	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
         6036  +	    exit $EXIT_FAILURE
         6037  +	  fi
         6038  +	fi
         6039  +
         6040  +	# See the names of the shared library.
         6041  +	set dummy $library_names
         6042  +	if test -n "$2"; then
         6043  +	  realname="$2"
         6044  +	  shift
         6045  +	  shift
         6046  +
         6047  +	  srcname="$realname"
         6048  +	  test -n "$relink_command" && srcname="$realname"T
         6049  +
         6050  +	  # Install the shared library and build the symlinks.
         6051  +	  $show "$install_prog $dir/$srcname $destdir/$realname"
         6052  +	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
         6053  +	  if test -n "$stripme" && test -n "$striplib"; then
         6054  +	    $show "$striplib $destdir/$realname"
         6055  +	    $run eval "$striplib $destdir/$realname" || exit $?
         6056  +	  fi
         6057  +
         6058  +	  if test "$#" -gt 0; then
         6059  +	    # Delete the old symlinks, and create new ones.
         6060  +	    # Try `ln -sf' first, because the `ln' binary might depend on
         6061  +	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
         6062  +	    # so we also need to try rm && ln -s.
         6063  +	    for linkname
         6064  +	    do
         6065  +	      if test "$linkname" != "$realname"; then
         6066  +                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
         6067  +                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
         6068  +	      fi
         6069  +	    done
         6070  +	  fi
         6071  +
         6072  +	  # Do each command in the postinstall commands.
         6073  +	  lib="$destdir/$realname"
         6074  +	  cmds=$postinstall_cmds
         6075  +	  save_ifs="$IFS"; IFS='~'
         6076  +	  for cmd in $cmds; do
         6077  +	    IFS="$save_ifs"
         6078  +	    eval cmd=\"$cmd\"
         6079  +	    $show "$cmd"
         6080  +	    $run eval "$cmd" || {
         6081  +	      lt_exit=$?
         6082  +
         6083  +	      # Restore the uninstalled library and exit
         6084  +	      if test "$mode" = relink; then
         6085  +		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
         6086  +	      fi
         6087  +
         6088  +	      exit $lt_exit
         6089  +	    }
         6090  +	  done
         6091  +	  IFS="$save_ifs"
         6092  +	fi
         6093  +
         6094  +	# Install the pseudo-library for information purposes.
         6095  +	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
         6096  +	instname="$dir/$name"i
         6097  +	$show "$install_prog $instname $destdir/$name"
         6098  +	$run eval "$install_prog $instname $destdir/$name" || exit $?
         6099  +
         6100  +	# Maybe install the static library, too.
         6101  +	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
         6102  +	;;
         6103  +
         6104  +      *.lo)
         6105  +	# Install (i.e. copy) a libtool object.
         6106  +
         6107  +	# Figure out destination file name, if it wasn't already specified.
         6108  +	if test -n "$destname"; then
         6109  +	  destfile="$destdir/$destname"
         6110  +	else
         6111  +	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
         6112  +	  destfile="$destdir/$destfile"
         6113  +	fi
         6114  +
         6115  +	# Deduce the name of the destination old-style object file.
         6116  +	case $destfile in
         6117  +	*.lo)
         6118  +	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
         6119  +	  ;;
         6120  +	*.$objext)
         6121  +	  staticdest="$destfile"
         6122  +	  destfile=
         6123  +	  ;;
         6124  +	*)
         6125  +	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
         6126  +	  $echo "$help" 1>&2
         6127  +	  exit $EXIT_FAILURE
         6128  +	  ;;
         6129  +	esac
         6130  +
         6131  +	# Install the libtool object if requested.
         6132  +	if test -n "$destfile"; then
         6133  +	  $show "$install_prog $file $destfile"
         6134  +	  $run eval "$install_prog $file $destfile" || exit $?
         6135  +	fi
         6136  +
         6137  +	# Install the old object if enabled.
         6138  +	if test "$build_old_libs" = yes; then
         6139  +	  # Deduce the name of the old-style object file.
         6140  +	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
         6141  +
         6142  +	  $show "$install_prog $staticobj $staticdest"
         6143  +	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
         6144  +	fi
         6145  +	exit $EXIT_SUCCESS
         6146  +	;;
         6147  +
         6148  +      *)
         6149  +	# Figure out destination file name, if it wasn't already specified.
         6150  +	if test -n "$destname"; then
         6151  +	  destfile="$destdir/$destname"
         6152  +	else
         6153  +	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
         6154  +	  destfile="$destdir/$destfile"
         6155  +	fi
         6156  +
         6157  +	# If the file is missing, and there is a .exe on the end, strip it
         6158  +	# because it is most likely a libtool script we actually want to
         6159  +	# install
         6160  +	stripped_ext=""
         6161  +	case $file in
         6162  +	  *.exe)
         6163  +	    if test ! -f "$file"; then
         6164  +	      file=`$echo $file|${SED} 's,.exe$,,'`
         6165  +	      stripped_ext=".exe"
         6166  +	    fi
         6167  +	    ;;
         6168  +	esac
         6169  +
         6170  +	# Do a test to see if this is really a libtool program.
         6171  +	case $host in
         6172  +	*cygwin*|*mingw*)
         6173  +	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
         6174  +	    ;;
         6175  +	*)
         6176  +	    wrapper=$file
         6177  +	    ;;
         6178  +	esac
         6179  +	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
         6180  +	  notinst_deplibs=
         6181  +	  relink_command=
         6182  +
         6183  +	  # Note that it is not necessary on cygwin/mingw to append a dot to
         6184  +	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
         6185  +	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
         6186  +	  # `FILE.' does not work on cygwin managed mounts.
         6187  +	  #
         6188  +	  # If there is no directory component, then add one.
         6189  +	  case $wrapper in
         6190  +	  */* | *\\*) . ${wrapper} ;;
         6191  +	  *) . ./${wrapper} ;;
         6192  +	  esac
         6193  +
         6194  +	  # Check the variables that should have been set.
         6195  +	  if test -z "$notinst_deplibs"; then
         6196  +	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
         6197  +	    exit $EXIT_FAILURE
         6198  +	  fi
         6199  +
         6200  +	  finalize=yes
         6201  +	  for lib in $notinst_deplibs; do
         6202  +	    # Check to see that each library is installed.
         6203  +	    libdir=
         6204  +	    if test -f "$lib"; then
         6205  +	      # If there is no directory component, then add one.
         6206  +	      case $lib in
         6207  +	      */* | *\\*) . $lib ;;
         6208  +	      *) . ./$lib ;;
         6209  +	      esac
         6210  +	    fi
         6211  +	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
         6212  +	    if test -n "$libdir" && test ! -f "$libfile"; then
         6213  +	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
         6214  +	      finalize=no
         6215  +	    fi
         6216  +	  done
         6217  +
         6218  +	  relink_command=
         6219  +	  # Note that it is not necessary on cygwin/mingw to append a dot to
         6220  +	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
         6221  +	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
         6222  +	  # `FILE.' does not work on cygwin managed mounts.
         6223  +	  #
         6224  +	  # If there is no directory component, then add one.
         6225  +	  case $wrapper in
         6226  +	  */* | *\\*) . ${wrapper} ;;
         6227  +	  *) . ./${wrapper} ;;
         6228  +	  esac
         6229  +
         6230  +	  outputname=
         6231  +	  if test "$fast_install" = no && test -n "$relink_command"; then
         6232  +	    if test "$finalize" = yes && test -z "$run"; then
         6233  +	      tmpdir=`func_mktempdir`
         6234  +	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
         6235  +	      outputname="$tmpdir/$file"
         6236  +	      # Replace the output file specification.
         6237  +	      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
         6238  +
         6239  +	      $show "$relink_command"
         6240  +	      if $run eval "$relink_command"; then :
         6241  +	      else
         6242  +		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
         6243  +		${rm}r "$tmpdir"
         6244  +		continue
         6245  +	      fi
         6246  +	      file="$outputname"
         6247  +	    else
         6248  +	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
         6249  +	    fi
         6250  +	  else
         6251  +	    # Install the binary that we compiled earlier.
         6252  +	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
         6253  +	  fi
         6254  +	fi
         6255  +
         6256  +	# remove .exe since cygwin /usr/bin/install will append another
         6257  +	# one anyway 
         6258  +	case $install_prog,$host in
         6259  +	*/usr/bin/install*,*cygwin*)
         6260  +	  case $file:$destfile in
         6261  +	  *.exe:*.exe)
         6262  +	    # this is ok
         6263  +	    ;;
         6264  +	  *.exe:*)
         6265  +	    destfile=$destfile.exe
         6266  +	    ;;
         6267  +	  *:*.exe)
         6268  +	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
         6269  +	    ;;
         6270  +	  esac
         6271  +	  ;;
         6272  +	esac
         6273  +	$show "$install_prog$stripme $file $destfile"
         6274  +	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
         6275  +	test -n "$outputname" && ${rm}r "$tmpdir"
         6276  +	;;
         6277  +      esac
         6278  +    done
         6279  +
         6280  +    for file in $staticlibs; do
         6281  +      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
         6282  +
         6283  +      # Set up the ranlib parameters.
         6284  +      oldlib="$destdir/$name"
         6285  +
         6286  +      $show "$install_prog $file $oldlib"
         6287  +      $run eval "$install_prog \$file \$oldlib" || exit $?
         6288  +
         6289  +      if test -n "$stripme" && test -n "$old_striplib"; then
         6290  +	$show "$old_striplib $oldlib"
         6291  +	$run eval "$old_striplib $oldlib" || exit $?
         6292  +      fi
         6293  +
         6294  +      # Do each command in the postinstall commands.
         6295  +      cmds=$old_postinstall_cmds
         6296  +      save_ifs="$IFS"; IFS='~'
         6297  +      for cmd in $cmds; do
         6298  +	IFS="$save_ifs"
         6299  +	eval cmd=\"$cmd\"
         6300  +	$show "$cmd"
         6301  +	$run eval "$cmd" || exit $?
         6302  +      done
         6303  +      IFS="$save_ifs"
         6304  +    done
         6305  +
         6306  +    if test -n "$future_libdirs"; then
         6307  +      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
         6308  +    fi
         6309  +
         6310  +    if test -n "$current_libdirs"; then
         6311  +      # Maybe just do a dry run.
         6312  +      test -n "$run" && current_libdirs=" -n$current_libdirs"
         6313  +      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
         6314  +    else
         6315  +      exit $EXIT_SUCCESS
         6316  +    fi
         6317  +    ;;
         6318  +
         6319  +  # libtool finish mode
         6320  +  finish)
         6321  +    modename="$modename: finish"
         6322  +    libdirs="$nonopt"
         6323  +    admincmds=
         6324  +
         6325  +    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
         6326  +      for dir
         6327  +      do
         6328  +	libdirs="$libdirs $dir"
         6329  +      done
         6330  +
         6331  +      for libdir in $libdirs; do
         6332  +	if test -n "$finish_cmds"; then
         6333  +	  # Do each command in the finish commands.
         6334  +	  cmds=$finish_cmds
         6335  +	  save_ifs="$IFS"; IFS='~'
         6336  +	  for cmd in $cmds; do
         6337  +	    IFS="$save_ifs"
         6338  +	    eval cmd=\"$cmd\"
         6339  +	    $show "$cmd"
         6340  +	    $run eval "$cmd" || admincmds="$admincmds
         6341  +       $cmd"
         6342  +	  done
         6343  +	  IFS="$save_ifs"
         6344  +	fi
         6345  +	if test -n "$finish_eval"; then
         6346  +	  # Do the single finish_eval.
         6347  +	  eval cmds=\"$finish_eval\"
         6348  +	  $run eval "$cmds" || admincmds="$admincmds
         6349  +       $cmds"
         6350  +	fi
         6351  +      done
         6352  +    fi
         6353  +
         6354  +    # Exit here if they wanted silent mode.
         6355  +    test "$show" = : && exit $EXIT_SUCCESS
         6356  +
         6357  +    $echo "X----------------------------------------------------------------------" | $Xsed
         6358  +    $echo "Libraries have been installed in:"
         6359  +    for libdir in $libdirs; do
         6360  +      $echo "   $libdir"
         6361  +    done
         6362  +    $echo
         6363  +    $echo "If you ever happen to want to link against installed libraries"
         6364  +    $echo "in a given directory, LIBDIR, you must either use libtool, and"
         6365  +    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
         6366  +    $echo "flag during linking and do at least one of the following:"
         6367  +    if test -n "$shlibpath_var"; then
         6368  +      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
         6369  +      $echo "     during execution"
         6370  +    fi
         6371  +    if test -n "$runpath_var"; then
         6372  +      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
         6373  +      $echo "     during linking"
         6374  +    fi
         6375  +    if test -n "$hardcode_libdir_flag_spec"; then
         6376  +      libdir=LIBDIR
         6377  +      eval flag=\"$hardcode_libdir_flag_spec\"
         6378  +
         6379  +      $echo "   - use the \`$flag' linker flag"
         6380  +    fi
         6381  +    if test -n "$admincmds"; then
         6382  +      $echo "   - have your system administrator run these commands:$admincmds"
         6383  +    fi
         6384  +    if test -f /etc/ld.so.conf; then
         6385  +      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
         6386  +    fi
         6387  +    $echo
         6388  +    $echo "See any operating system documentation about shared libraries for"
         6389  +    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
         6390  +    $echo "X----------------------------------------------------------------------" | $Xsed
         6391  +    exit $EXIT_SUCCESS
         6392  +    ;;
         6393  +
         6394  +  # libtool execute mode
         6395  +  execute)
         6396  +    modename="$modename: execute"
         6397  +
         6398  +    # The first argument is the command name.
         6399  +    cmd="$nonopt"
         6400  +    if test -z "$cmd"; then
         6401  +      $echo "$modename: you must specify a COMMAND" 1>&2
         6402  +      $echo "$help"
         6403  +      exit $EXIT_FAILURE
         6404  +    fi
         6405  +
         6406  +    # Handle -dlopen flags immediately.
         6407  +    for file in $execute_dlfiles; do
         6408  +      if test ! -f "$file"; then
         6409  +	$echo "$modename: \`$file' is not a file" 1>&2
         6410  +	$echo "$help" 1>&2
         6411  +	exit $EXIT_FAILURE
         6412  +      fi
         6413  +
         6414  +      dir=
         6415  +      case $file in
         6416  +      *.la)
         6417  +	# Check to see that this really is a libtool archive.
         6418  +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
         6419  +	else
         6420  +	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
         6421  +	  $echo "$help" 1>&2
         6422  +	  exit $EXIT_FAILURE
         6423  +	fi
         6424  +
         6425  +	# Read the libtool library.
         6426  +	dlname=
         6427  +	library_names=
         6428  +
         6429  +	# If there is no directory component, then add one.
         6430  +	case $file in
         6431  +	*/* | *\\*) . $file ;;
         6432  +	*) . ./$file ;;
         6433  +	esac
         6434  +
         6435  +	# Skip this library if it cannot be dlopened.
         6436  +	if test -z "$dlname"; then
         6437  +	  # Warn if it was a shared library.
         6438  +	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
         6439  +	  continue
         6440  +	fi
         6441  +
         6442  +	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
         6443  +	test "X$dir" = "X$file" && dir=.
         6444  +
         6445  +	if test -f "$dir/$objdir/$dlname"; then
         6446  +	  dir="$dir/$objdir"
         6447  +	else
         6448  +	  if test ! -f "$dir/$dlname"; then
         6449  +	    $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
         6450  +	    exit $EXIT_FAILURE
         6451  +	  fi
         6452  +	fi
         6453  +	;;
         6454  +
         6455  +      *.lo)
         6456  +	# Just add the directory containing the .lo file.
         6457  +	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
         6458  +	test "X$dir" = "X$file" && dir=.
         6459  +	;;
         6460  +
         6461  +      *)
         6462  +	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
         6463  +	continue
         6464  +	;;
         6465  +      esac
         6466  +
         6467  +      # Get the absolute pathname.
         6468  +      absdir=`cd "$dir" && pwd`
         6469  +      test -n "$absdir" && dir="$absdir"
         6470  +
         6471  +      # Now add the directory to shlibpath_var.
         6472  +      if eval "test -z \"\$$shlibpath_var\""; then
         6473  +	eval "$shlibpath_var=\"\$dir\""
         6474  +      else
         6475  +	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
         6476  +      fi
         6477  +    done
         6478  +
         6479  +    # This variable tells wrapper scripts just to set shlibpath_var
         6480  +    # rather than running their programs.
         6481  +    libtool_execute_magic="$magic"
         6482  +
         6483  +    # Check if any of the arguments is a wrapper script.
         6484  +    args=
         6485  +    for file
         6486  +    do
         6487  +      case $file in
         6488  +      -*) ;;
         6489  +      *)
         6490  +	# Do a test to see if this is really a libtool program.
         6491  +	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         6492  +	  # If there is no directory component, then add one.
         6493  +	  case $file in
         6494  +	  */* | *\\*) . $file ;;
         6495  +	  *) . ./$file ;;
         6496  +	  esac
         6497  +
         6498  +	  # Transform arg to wrapped name.
         6499  +	  file="$progdir/$program"
         6500  +	fi
         6501  +	;;
         6502  +      esac
         6503  +      # Quote arguments (to preserve shell metacharacters).
         6504  +      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
         6505  +      args="$args \"$file\""
         6506  +    done
         6507  +
         6508  +    if test -z "$run"; then
         6509  +      if test -n "$shlibpath_var"; then
         6510  +	# Export the shlibpath_var.
         6511  +	eval "export $shlibpath_var"
         6512  +      fi
         6513  +
         6514  +      # Restore saved environment variables
         6515  +      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
         6516  +      do
         6517  +	eval "if test \"\${save_$lt_var+set}\" = set; then
         6518  +		$lt_var=\$save_$lt_var; export $lt_var
         6519  +	      fi"
         6520  +      done
         6521  +
         6522  +      # Now prepare to actually exec the command.
         6523  +      exec_cmd="\$cmd$args"
         6524  +    else
         6525  +      # Display what would be done.
         6526  +      if test -n "$shlibpath_var"; then
         6527  +	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
         6528  +	$echo "export $shlibpath_var"
         6529  +      fi
         6530  +      $echo "$cmd$args"
         6531  +      exit $EXIT_SUCCESS
         6532  +    fi
         6533  +    ;;
         6534  +
         6535  +  # libtool clean and uninstall mode
         6536  +  clean | uninstall)
         6537  +    modename="$modename: $mode"
         6538  +    rm="$nonopt"
         6539  +    files=
         6540  +    rmforce=
         6541  +    exit_status=0
         6542  +
         6543  +    # This variable tells wrapper scripts just to set variables rather
         6544  +    # than running their programs.
         6545  +    libtool_install_magic="$magic"
         6546  +
         6547  +    for arg
         6548  +    do
         6549  +      case $arg in
         6550  +      -f) rm="$rm $arg"; rmforce=yes ;;
         6551  +      -*) rm="$rm $arg" ;;
         6552  +      *) files="$files $arg" ;;
         6553  +      esac
         6554  +    done
         6555  +
         6556  +    if test -z "$rm"; then
         6557  +      $echo "$modename: you must specify an RM program" 1>&2
         6558  +      $echo "$help" 1>&2
         6559  +      exit $EXIT_FAILURE
         6560  +    fi
         6561  +
         6562  +    rmdirs=
         6563  +
         6564  +    origobjdir="$objdir"
         6565  +    for file in $files; do
         6566  +      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
         6567  +      if test "X$dir" = "X$file"; then
         6568  +	dir=.
         6569  +	objdir="$origobjdir"
         6570  +      else
         6571  +	objdir="$dir/$origobjdir"
         6572  +      fi
         6573  +      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
         6574  +      test "$mode" = uninstall && objdir="$dir"
         6575  +
         6576  +      # Remember objdir for removal later, being careful to avoid duplicates
         6577  +      if test "$mode" = clean; then
         6578  +	case " $rmdirs " in
         6579  +	  *" $objdir "*) ;;
         6580  +	  *) rmdirs="$rmdirs $objdir" ;;
         6581  +	esac
         6582  +      fi
         6583  +
         6584  +      # Don't error if the file doesn't exist and rm -f was used.
         6585  +      if (test -L "$file") >/dev/null 2>&1 \
         6586  +	|| (test -h "$file") >/dev/null 2>&1 \
         6587  +	|| test -f "$file"; then
         6588  +	:
         6589  +      elif test -d "$file"; then
         6590  +	exit_status=1
         6591  +	continue
         6592  +      elif test "$rmforce" = yes; then
         6593  +	continue
         6594  +      fi
         6595  +
         6596  +      rmfiles="$file"
         6597  +
         6598  +      case $name in
         6599  +      *.la)
         6600  +	# Possibly a libtool archive, so verify it.
         6601  +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         6602  +	  . $dir/$name
         6603  +
         6604  +	  # Delete the libtool libraries and symlinks.
         6605  +	  for n in $library_names; do
         6606  +	    rmfiles="$rmfiles $objdir/$n"
         6607  +	  done
         6608  +	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
         6609  +
         6610  +	  case "$mode" in
         6611  +	  clean)
         6612  +	    case "  $library_names " in
         6613  +	    # "  " in the beginning catches empty $dlname
         6614  +	    *" $dlname "*) ;;
         6615  +	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
         6616  +	    esac
         6617  +	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
         6618  +	    ;;
         6619  +	  uninstall)
         6620  +	    if test -n "$library_names"; then
         6621  +	      # Do each command in the postuninstall commands.
         6622  +	      cmds=$postuninstall_cmds
         6623  +	      save_ifs="$IFS"; IFS='~'
         6624  +	      for cmd in $cmds; do
         6625  +		IFS="$save_ifs"
         6626  +		eval cmd=\"$cmd\"
         6627  +		$show "$cmd"
         6628  +		$run eval "$cmd"
         6629  +		if test "$?" -ne 0 && test "$rmforce" != yes; then
         6630  +		  exit_status=1
         6631  +		fi
         6632  +	      done
         6633  +	      IFS="$save_ifs"
         6634  +	    fi
         6635  +
         6636  +	    if test -n "$old_library"; then
         6637  +	      # Do each command in the old_postuninstall commands.
         6638  +	      cmds=$old_postuninstall_cmds
         6639  +	      save_ifs="$IFS"; IFS='~'
         6640  +	      for cmd in $cmds; do
         6641  +		IFS="$save_ifs"
         6642  +		eval cmd=\"$cmd\"
         6643  +		$show "$cmd"
         6644  +		$run eval "$cmd"
         6645  +		if test "$?" -ne 0 && test "$rmforce" != yes; then
         6646  +		  exit_status=1
         6647  +		fi
         6648  +	      done
         6649  +	      IFS="$save_ifs"
         6650  +	    fi
         6651  +	    # FIXME: should reinstall the best remaining shared library.
         6652  +	    ;;
         6653  +	  esac
         6654  +	fi
         6655  +	;;
         6656  +
         6657  +      *.lo)
         6658  +	# Possibly a libtool object, so verify it.
         6659  +	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         6660  +
         6661  +	  # Read the .lo file
         6662  +	  . $dir/$name
         6663  +
         6664  +	  # Add PIC object to the list of files to remove.
         6665  +	  if test -n "$pic_object" \
         6666  +	     && test "$pic_object" != none; then
         6667  +	    rmfiles="$rmfiles $dir/$pic_object"
         6668  +	  fi
         6669  +
         6670  +	  # Add non-PIC object to the list of files to remove.
         6671  +	  if test -n "$non_pic_object" \
         6672  +	     && test "$non_pic_object" != none; then
         6673  +	    rmfiles="$rmfiles $dir/$non_pic_object"
         6674  +	  fi
         6675  +	fi
         6676  +	;;
         6677  +
         6678  +      *)
         6679  +	if test "$mode" = clean ; then
         6680  +	  noexename=$name
         6681  +	  case $file in
         6682  +	  *.exe)
         6683  +	    file=`$echo $file|${SED} 's,.exe$,,'`
         6684  +	    noexename=`$echo $name|${SED} 's,.exe$,,'`
         6685  +	    # $file with .exe has already been added to rmfiles,
         6686  +	    # add $file without .exe
         6687  +	    rmfiles="$rmfiles $file"
         6688  +	    ;;
         6689  +	  esac
         6690  +	  # Do a test to see if this is a libtool program.
         6691  +	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
         6692  +	    relink_command=
         6693  +	    . $dir/$noexename
         6694  +
         6695  +	    # note $name still contains .exe if it was in $file originally
         6696  +	    # as does the version of $file that was added into $rmfiles
         6697  +	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
         6698  +	    if test "$fast_install" = yes && test -n "$relink_command"; then
         6699  +	      rmfiles="$rmfiles $objdir/lt-$name"
         6700  +	    fi
         6701  +	    if test "X$noexename" != "X$name" ; then
         6702  +	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
         6703  +	    fi
         6704  +	  fi
         6705  +	fi
         6706  +	;;
         6707  +      esac
         6708  +      $show "$rm $rmfiles"
         6709  +      $run $rm $rmfiles || exit_status=1
         6710  +    done
         6711  +    objdir="$origobjdir"
         6712  +
         6713  +    # Try to remove the ${objdir}s in the directories where we deleted files
         6714  +    for dir in $rmdirs; do
         6715  +      if test -d "$dir"; then
         6716  +	$show "rmdir $dir"
         6717  +	$run rmdir $dir >/dev/null 2>&1
         6718  +      fi
         6719  +    done
         6720  +
         6721  +    exit $exit_status
         6722  +    ;;
         6723  +
         6724  +  "")
         6725  +    $echo "$modename: you must specify a MODE" 1>&2
         6726  +    $echo "$generic_help" 1>&2
         6727  +    exit $EXIT_FAILURE
         6728  +    ;;
         6729  +  esac
         6730  +
         6731  +  if test -z "$exec_cmd"; then
         6732  +    $echo "$modename: invalid operation mode \`$mode'" 1>&2
         6733  +    $echo "$generic_help" 1>&2
         6734  +    exit $EXIT_FAILURE
         6735  +  fi
         6736  +fi # test -z "$show_help"
         6737  +
         6738  +if test -n "$exec_cmd"; then
         6739  +  eval exec $exec_cmd
         6740  +  exit $EXIT_FAILURE
         6741  +fi
         6742  +
         6743  +# We need to display help for each of the modes.
         6744  +case $mode in
         6745  +"") $echo \
         6746  +"Usage: $modename [OPTION]... [MODE-ARG]...
         6747  +
         6748  +Provide generalized library-building support services.
         6749  +
         6750  +    --config          show all configuration variables
         6751  +    --debug           enable verbose shell tracing
         6752  +-n, --dry-run         display commands without modifying any files
         6753  +    --features        display basic configuration information and exit
         6754  +    --finish          same as \`--mode=finish'
         6755  +    --help            display this help message and exit
         6756  +    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
         6757  +    --quiet           same as \`--silent'
         6758  +    --silent          don't print informational messages
         6759  +    --tag=TAG         use configuration variables from tag TAG
         6760  +    --version         print version information
         6761  +
         6762  +MODE must be one of the following:
         6763  +
         6764  +      clean           remove files from the build directory
         6765  +      compile         compile a source file into a libtool object
         6766  +      execute         automatically set library path, then run a program
         6767  +      finish          complete the installation of libtool libraries
         6768  +      install         install libraries or executables
         6769  +      link            create a library or an executable
         6770  +      uninstall       remove libraries from an installed directory
         6771  +
         6772  +MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
         6773  +a more detailed description of MODE.
         6774  +
         6775  +Report bugs to <bug-libtool@gnu.org>."
         6776  +  exit $EXIT_SUCCESS
         6777  +  ;;
         6778  +
         6779  +clean)
         6780  +  $echo \
         6781  +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
         6782  +
         6783  +Remove files from the build directory.
         6784  +
         6785  +RM is the name of the program to use to delete files associated with each FILE
         6786  +(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
         6787  +to RM.
         6788  +
         6789  +If FILE is a libtool library, object or program, all the files associated
         6790  +with it are deleted. Otherwise, only FILE itself is deleted using RM."
         6791  +  ;;
         6792  +
         6793  +compile)
         6794  +  $echo \
         6795  +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
         6796  +
         6797  +Compile a source file into a libtool library object.
         6798  +
         6799  +This mode accepts the following additional options:
         6800  +
         6801  +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
         6802  +  -prefer-pic       try to building PIC objects only
         6803  +  -prefer-non-pic   try to building non-PIC objects only
         6804  +  -static           always build a \`.o' file suitable for static linking
         6805  +
         6806  +COMPILE-COMMAND is a command to be used in creating a \`standard' object file
         6807  +from the given SOURCEFILE.
         6808  +
         6809  +The output file name is determined by removing the directory component from
         6810  +SOURCEFILE, then substituting the C source code suffix \`.c' with the
         6811  +library object suffix, \`.lo'."
         6812  +  ;;
         6813  +
         6814  +execute)
         6815  +  $echo \
         6816  +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
         6817  +
         6818  +Automatically set library path, then run a program.
         6819  +
         6820  +This mode accepts the following additional options:
         6821  +
         6822  +  -dlopen FILE      add the directory containing FILE to the library path
         6823  +
         6824  +This mode sets the library path environment variable according to \`-dlopen'
         6825  +flags.
         6826  +
         6827  +If any of the ARGS are libtool executable wrappers, then they are translated
         6828  +into their corresponding uninstalled binary, and any of their required library
         6829  +directories are added to the library path.
         6830  +
         6831  +Then, COMMAND is executed, with ARGS as arguments."
         6832  +  ;;
         6833  +
         6834  +finish)
         6835  +  $echo \
         6836  +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
         6837  +
         6838  +Complete the installation of libtool libraries.
         6839  +
         6840  +Each LIBDIR is a directory that contains libtool libraries.
         6841  +
         6842  +The commands that this mode executes may require superuser privileges.  Use
         6843  +the \`--dry-run' option if you just want to see what would be executed."
         6844  +  ;;
         6845  +
         6846  +install)
         6847  +  $echo \
         6848  +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
         6849  +
         6850  +Install executables or libraries.
         6851  +
         6852  +INSTALL-COMMAND is the installation command.  The first component should be
         6853  +either the \`install' or \`cp' program.
         6854  +
         6855  +The rest of the components are interpreted as arguments to that command (only
         6856  +BSD-compatible install options are recognized)."
         6857  +  ;;
         6858  +
         6859  +link)
         6860  +  $echo \
         6861  +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
         6862  +
         6863  +Link object files or libraries together to form another library, or to
         6864  +create an executable program.
         6865  +
         6866  +LINK-COMMAND is a command using the C compiler that you would use to create
         6867  +a program from several object files.
         6868  +
         6869  +The following components of LINK-COMMAND are treated specially:
         6870  +
         6871  +  -all-static       do not do any dynamic linking at all
         6872  +  -avoid-version    do not add a version suffix if possible
         6873  +  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
         6874  +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
         6875  +  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
         6876  +  -export-symbols SYMFILE
         6877  +                    try to export only the symbols listed in SYMFILE
         6878  +  -export-symbols-regex REGEX
         6879  +                    try to export only the symbols matching REGEX
         6880  +  -LLIBDIR          search LIBDIR for required installed libraries
         6881  +  -lNAME            OUTPUT-FILE requires the installed library libNAME
         6882  +  -module           build a library that can dlopened
         6883  +  -no-fast-install  disable the fast-install mode
         6884  +  -no-install       link a not-installable executable
         6885  +  -no-undefined     declare that a library does not refer to external symbols
         6886  +  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
         6887  +  -objectlist FILE  Use a list of object files found in FILE to specify objects
         6888  +  -precious-files-regex REGEX
         6889  +                    don't remove output files matching REGEX
         6890  +  -release RELEASE  specify package release information
         6891  +  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
         6892  +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
         6893  +  -static           do not do any dynamic linking of uninstalled libtool libraries
         6894  +  -static-libtool-libs
         6895  +                    do not do any dynamic linking of libtool libraries
         6896  +  -version-info CURRENT[:REVISION[:AGE]]
         6897  +                    specify library version info [each variable defaults to 0]
         6898  +
         6899  +All other options (arguments beginning with \`-') are ignored.
         6900  +
         6901  +Every other argument is treated as a filename.  Files ending in \`.la' are
         6902  +treated as uninstalled libtool libraries, other files are standard or library
         6903  +object files.
         6904  +
         6905  +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
         6906  +only library objects (\`.lo' files) may be specified, and \`-rpath' is
         6907  +required, except when creating a convenience library.
         6908  +
         6909  +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
         6910  +using \`ar' and \`ranlib', or on Windows using \`lib'.
         6911  +
         6912  +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
         6913  +is created, otherwise an executable program is created."
         6914  +  ;;
         6915  +
         6916  +uninstall)
         6917  +  $echo \
         6918  +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
         6919  +
         6920  +Remove libraries from an installation directory.
         6921  +
         6922  +RM is the name of the program to use to delete files associated with each FILE
         6923  +(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
         6924  +to RM.
         6925  +
         6926  +If FILE is a libtool library, all the files associated with it are deleted.
         6927  +Otherwise, only FILE itself is deleted using RM."
         6928  +  ;;
         6929  +
         6930  +*)
         6931  +  $echo "$modename: invalid operation mode \`$mode'" 1>&2
         6932  +  $echo "$help" 1>&2
         6933  +  exit $EXIT_FAILURE
         6934  +  ;;
         6935  +esac
         6936  +
         6937  +$echo
         6938  +$echo "Try \`$modename --help' for more information about other modes."
         6939  +
         6940  +exit $?
         6941  +
         6942  +# The TAGs below are defined such that we never get into a situation
         6943  +# in which we disable both kinds of libraries.  Given conflicting
         6944  +# choices, we go for a static library, that is the most portable,
         6945  +# since we can't tell whether shared libraries were disabled because
         6946  +# the user asked for that or because the platform doesn't support
         6947  +# them.  This is particularly important on AIX, because we don't
         6948  +# support having both static and shared libraries enabled at the same
         6949  +# time on that platform, so we default to a shared-only configuration.
         6950  +# If a disable-shared tag is given, we'll fallback to a static-only
         6951  +# configuration.  But we'll never go from static-only to shared-only.
         6952  +
         6953  +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
         6954  +disable_libs=shared
         6955  +# ### END LIBTOOL TAG CONFIG: disable-shared
         6956  +
         6957  +# ### BEGIN LIBTOOL TAG CONFIG: disable-static
         6958  +disable_libs=static
         6959  +# ### END LIBTOOL TAG CONFIG: disable-static
         6960  +
         6961  +# Local Variables:
         6962  +# mode:shell-script
         6963  +# sh-indentation:2
         6964  +# End:

Changes to missing.

     1         -/usr/share/automake-1.11/missing
            1  +#! /bin/sh
            2  +# Common stub for a few missing GNU programs while installing.
            3  +
            4  +scriptversion=2006-05-10.23
            5  +
            6  +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
            7  +#   Free Software Foundation, Inc.
            8  +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
            9  +
           10  +# This program is free software; you can redistribute it and/or modify
           11  +# it under the terms of the GNU General Public License as published by
           12  +# the Free Software Foundation; either version 2, or (at your option)
           13  +# any later version.
           14  +
           15  +# This program is distributed in the hope that it will be useful,
           16  +# but WITHOUT ANY WARRANTY; without even the implied warranty of
           17  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           18  +# GNU General Public License for more details.
           19  +
           20  +# You should have received a copy of the GNU General Public License
           21  +# along with this program; if not, write to the Free Software
           22  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
           23  +# 02110-1301, USA.
           24  +
           25  +# As a special exception to the GNU General Public License, if you
           26  +# distribute this file as part of a program that contains a
           27  +# configuration script generated by Autoconf, you may include it under
           28  +# the same distribution terms that you use for the rest of that program.
           29  +
           30  +if test $# -eq 0; then
           31  +  echo 1>&2 "Try \`$0 --help' for more information"
           32  +  exit 1
           33  +fi
           34  +
           35  +run=:
           36  +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
           37  +sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
           38  +
           39  +# In the cases where this matters, `missing' is being run in the
           40  +# srcdir already.
           41  +if test -f configure.ac; then
           42  +  configure_ac=configure.ac
           43  +else
           44  +  configure_ac=configure.in
           45  +fi
           46  +
           47  +msg="missing on your system"
           48  +
           49  +case $1 in
           50  +--run)
           51  +  # Try to run requested program, and just exit if it succeeds.
           52  +  run=
           53  +  shift
           54  +  "$@" && exit 0
           55  +  # Exit code 63 means version mismatch.  This often happens
           56  +  # when the user try to use an ancient version of a tool on
           57  +  # a file that requires a minimum version.  In this case we
           58  +  # we should proceed has if the program had been absent, or
           59  +  # if --run hadn't been passed.
           60  +  if test $? = 63; then
           61  +    run=:
           62  +    msg="probably too old"
           63  +  fi
           64  +  ;;
           65  +
           66  +  -h|--h|--he|--hel|--help)
           67  +    echo "\
           68  +$0 [OPTION]... PROGRAM [ARGUMENT]...
           69  +
           70  +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
           71  +error status if there is no known handling for PROGRAM.
           72  +
           73  +Options:
           74  +  -h, --help      display this help and exit
           75  +  -v, --version   output version information and exit
           76  +  --run           try to run the given command, and emulate it if it fails
           77  +
           78  +Supported PROGRAM values:
           79  +  aclocal      touch file \`aclocal.m4'
           80  +  autoconf     touch file \`configure'
           81  +  autoheader   touch file \`config.h.in'
           82  +  autom4te     touch the output file, or create a stub one
           83  +  automake     touch all \`Makefile.in' files
           84  +  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
           85  +  flex         create \`lex.yy.c', if possible, from existing .c
           86  +  help2man     touch the output file
           87  +  lex          create \`lex.yy.c', if possible, from existing .c
           88  +  makeinfo     touch the output file
           89  +  tar          try tar, gnutar, gtar, then tar without non-portable flags
           90  +  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
           91  +
           92  +Send bug reports to <bug-automake@gnu.org>."
           93  +    exit $?
           94  +    ;;
           95  +
           96  +  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
           97  +    echo "missing $scriptversion (GNU Automake)"
           98  +    exit $?
           99  +    ;;
          100  +
          101  +  -*)
          102  +    echo 1>&2 "$0: Unknown \`$1' option"
          103  +    echo 1>&2 "Try \`$0 --help' for more information"
          104  +    exit 1
          105  +    ;;
          106  +
          107  +esac
          108  +
          109  +# Now exit if we have it, but it failed.  Also exit now if we
          110  +# don't have it and --version was passed (most likely to detect
          111  +# the program).
          112  +case $1 in
          113  +  lex|yacc)
          114  +    # Not GNU programs, they don't have --version.
          115  +    ;;
          116  +
          117  +  tar)
          118  +    if test -n "$run"; then
          119  +       echo 1>&2 "ERROR: \`tar' requires --run"
          120  +       exit 1
          121  +    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
          122  +       exit 1
          123  +    fi
          124  +    ;;
          125  +
          126  +  *)
          127  +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
          128  +       # We have it, but it failed.
          129  +       exit 1
          130  +    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
          131  +       # Could not run --version or --help.  This is probably someone
          132  +       # running `$TOOL --version' or `$TOOL --help' to check whether
          133  +       # $TOOL exists and not knowing $TOOL uses missing.
          134  +       exit 1
          135  +    fi
          136  +    ;;
          137  +esac
          138  +
          139  +# If it does not exist, or fails to run (possibly an outdated version),
          140  +# try to emulate it.
          141  +case $1 in
          142  +  aclocal*)
          143  +    echo 1>&2 "\
          144  +WARNING: \`$1' is $msg.  You should only need it if
          145  +         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
          146  +         to install the \`Automake' and \`Perl' packages.  Grab them from
          147  +         any GNU archive site."
          148  +    touch aclocal.m4
          149  +    ;;
          150  +
          151  +  autoconf)
          152  +    echo 1>&2 "\
          153  +WARNING: \`$1' is $msg.  You should only need it if
          154  +         you modified \`${configure_ac}'.  You might want to install the
          155  +         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
          156  +         archive site."
          157  +    touch configure
          158  +    ;;
          159  +
          160  +  autoheader)
          161  +    echo 1>&2 "\
          162  +WARNING: \`$1' is $msg.  You should only need it if
          163  +         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
          164  +         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
          165  +         from any GNU archive site."
          166  +    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
          167  +    test -z "$files" && files="config.h"
          168  +    touch_files=
          169  +    for f in $files; do
          170  +      case $f in
          171  +      *:*) touch_files="$touch_files "`echo "$f" |
          172  +				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
          173  +      *) touch_files="$touch_files $f.in";;
          174  +      esac
          175  +    done
          176  +    touch $touch_files
          177  +    ;;
          178  +
          179  +  automake*)
          180  +    echo 1>&2 "\
          181  +WARNING: \`$1' is $msg.  You should only need it if
          182  +         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
          183  +         You might want to install the \`Automake' and \`Perl' packages.
          184  +         Grab them from any GNU archive site."
          185  +    find . -type f -name Makefile.am -print |
          186  +	   sed 's/\.am$/.in/' |
          187  +	   while read f; do touch "$f"; done
          188  +    ;;
          189  +
          190  +  autom4te)
          191  +    echo 1>&2 "\
          192  +WARNING: \`$1' is needed, but is $msg.
          193  +         You might have modified some files without having the
          194  +         proper tools for further handling them.
          195  +         You can get \`$1' as part of \`Autoconf' from any GNU
          196  +         archive site."
          197  +
          198  +    file=`echo "$*" | sed -n "$sed_output"`
          199  +    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
          200  +    if test -f "$file"; then
          201  +	touch $file
          202  +    else
          203  +	test -z "$file" || exec >$file
          204  +	echo "#! /bin/sh"
          205  +	echo "# Created by GNU Automake missing as a replacement of"
          206  +	echo "#  $ $@"
          207  +	echo "exit 0"
          208  +	chmod +x $file
          209  +	exit 1
          210  +    fi
          211  +    ;;
          212  +
          213  +  bison|yacc)
          214  +    echo 1>&2 "\
          215  +WARNING: \`$1' $msg.  You should only need it if
          216  +         you modified a \`.y' file.  You may need the \`Bison' package
          217  +         in order for those modifications to take effect.  You can get
          218  +         \`Bison' from any GNU archive site."
          219  +    rm -f y.tab.c y.tab.h
          220  +    if test $# -ne 1; then
          221  +        eval LASTARG="\${$#}"
          222  +	case $LASTARG in
          223  +	*.y)
          224  +	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
          225  +	    if test -f "$SRCFILE"; then
          226  +	         cp "$SRCFILE" y.tab.c
          227  +	    fi
          228  +	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
          229  +	    if test -f "$SRCFILE"; then
          230  +	         cp "$SRCFILE" y.tab.h
          231  +	    fi
          232  +	  ;;
          233  +	esac
          234  +    fi
          235  +    if test ! -f y.tab.h; then
          236  +	echo >y.tab.h
          237  +    fi
          238  +    if test ! -f y.tab.c; then
          239  +	echo 'main() { return 0; }' >y.tab.c
          240  +    fi
          241  +    ;;
          242  +
          243  +  lex|flex)
          244  +    echo 1>&2 "\
          245  +WARNING: \`$1' is $msg.  You should only need it if
          246  +         you modified a \`.l' file.  You may need the \`Flex' package
          247  +         in order for those modifications to take effect.  You can get
          248  +         \`Flex' from any GNU archive site."
          249  +    rm -f lex.yy.c
          250  +    if test $# -ne 1; then
          251  +        eval LASTARG="\${$#}"
          252  +	case $LASTARG in
          253  +	*.l)
          254  +	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
          255  +	    if test -f "$SRCFILE"; then
          256  +	         cp "$SRCFILE" lex.yy.c
          257  +	    fi
          258  +	  ;;
          259  +	esac
          260  +    fi
          261  +    if test ! -f lex.yy.c; then
          262  +	echo 'main() { return 0; }' >lex.yy.c
          263  +    fi
          264  +    ;;
          265  +
          266  +  help2man)
          267  +    echo 1>&2 "\
          268  +WARNING: \`$1' is $msg.  You should only need it if
          269  +	 you modified a dependency of a manual page.  You may need the
          270  +	 \`Help2man' package in order for those modifications to take
          271  +	 effect.  You can get \`Help2man' from any GNU archive site."
          272  +
          273  +    file=`echo "$*" | sed -n "$sed_output"`
          274  +    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
          275  +    if test -f "$file"; then
          276  +	touch $file
          277  +    else
          278  +	test -z "$file" || exec >$file
          279  +	echo ".ab help2man is required to generate this page"
          280  +	exit 1
          281  +    fi
          282  +    ;;
          283  +
          284  +  makeinfo)
          285  +    echo 1>&2 "\
          286  +WARNING: \`$1' is $msg.  You should only need it if
          287  +         you modified a \`.texi' or \`.texinfo' file, or any other file
          288  +         indirectly affecting the aspect of the manual.  The spurious
          289  +         call might also be the consequence of using a buggy \`make' (AIX,
          290  +         DU, IRIX).  You might want to install the \`Texinfo' package or
          291  +         the \`GNU make' package.  Grab either from any GNU archive site."
          292  +    # The file to touch is that specified with -o ...
          293  +    file=`echo "$*" | sed -n "$sed_output"`
          294  +    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
          295  +    if test -z "$file"; then
          296  +      # ... or it is the one specified with @setfilename ...
          297  +      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
          298  +      file=`sed -n '
          299  +	/^@setfilename/{
          300  +	  s/.* \([^ ]*\) *$/\1/
          301  +	  p
          302  +	  q
          303  +	}' $infile`
          304  +      # ... or it is derived from the source name (dir/f.texi becomes f.info)
          305  +      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
          306  +    fi
          307  +    # If the file does not exist, the user really needs makeinfo;
          308  +    # let's fail without touching anything.
          309  +    test -f $file || exit 1
          310  +    touch $file
          311  +    ;;
          312  +
          313  +  tar)
          314  +    shift
          315  +
          316  +    # We have already tried tar in the generic part.
          317  +    # Look for gnutar/gtar before invocation to avoid ugly error
          318  +    # messages.
          319  +    if (gnutar --version > /dev/null 2>&1); then
          320  +       gnutar "$@" && exit 0
          321  +    fi
          322  +    if (gtar --version > /dev/null 2>&1); then
          323  +       gtar "$@" && exit 0
          324  +    fi
          325  +    firstarg="$1"
          326  +    if shift; then
          327  +	case $firstarg in
          328  +	*o*)
          329  +	    firstarg=`echo "$firstarg" | sed s/o//`
          330  +	    tar "$firstarg" "$@" && exit 0
          331  +	    ;;
          332  +	esac
          333  +	case $firstarg in
          334  +	*h*)
          335  +	    firstarg=`echo "$firstarg" | sed s/h//`
          336  +	    tar "$firstarg" "$@" && exit 0
          337  +	    ;;
          338  +	esac
          339  +    fi
          340  +
          341  +    echo 1>&2 "\
          342  +WARNING: I can't seem to be able to run \`tar' with the given arguments.
          343  +         You may want to install GNU tar or Free paxutils, or check the
          344  +         command line arguments."
          345  +    exit 1
          346  +    ;;
          347  +
          348  +  *)
          349  +    echo 1>&2 "\
          350  +WARNING: \`$1' is needed, and is $msg.
          351  +         You might have modified some files without having the
          352  +         proper tools for further handling them.  Check the \`README' file,
          353  +         it often tells you about the needed prerequisites for installing
          354  +         this package.  You may also peek at any GNU archive site, in case
          355  +         some other package would contain this missing \`$1' program."
          356  +    exit 1
          357  +    ;;
          358  +esac
          359  +
          360  +exit 0
          361  +
          362  +# Local variables:
          363  +# eval: (add-hook 'write-file-hooks 'time-stamp)
          364  +# time-stamp-start: "scriptversion="
          365  +# time-stamp-format: "%:y-%02m-%02d.%02H"
          366  +# time-stamp-end: "$"
          367  +# End:

Changes to src/Makefile.am.

     1      1   
     2         -AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 \
     3         -	@LIBSPATIALITE_CFLAGS@
            2  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
     4      3   
     5      4   bin_PROGRAMS =rasterlite_load \
     6      5   	rasterlite_pyramid \
     7      6   	rasterlite_topmost \
     8      7   	rasterlite_grid \
     9      8   	rasterlite_tool
    10      9   
    11     10   INCLUDES = @CFLAGS@
    12     11   INCLUDES += -I$(top_srcdir)/headers
           12  +INCLUDES += -I$(top_srcdir)/epsilon
    13     13   
    14     14   rasterlite_load_SOURCES = rasterlite_load.c
    15     15   rasterlite_pyramid_SOURCES = rasterlite_pyramid.c
    16     16   rasterlite_topmost_SOURCES = rasterlite_topmost.c
    17     17   rasterlite_grid_SOURCES = rasterlite_grid.c
    18     18   rasterlite_tool_SOURCES = rasterlite_tool.c
    19     19   
    20     20   LDADD = ../lib/.libs/librasterlite.a \
    21         -	@LIBSPATIALITE_LIBS@ \
    22     21           -lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
    23     22   

Changes to src/Makefile.in.

     1         -# Makefile.in generated by automake 1.11.1 from Makefile.am.
            1  +# Makefile.in generated by automake 1.10.1 from Makefile.am.
     2      2   # @configure_input@
     3      3   
     4      4   # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5         -# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
     6         -# Inc.
            5  +# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
     7      6   # This Makefile.in is free software; the Free Software Foundation
     8      7   # gives unlimited permission to copy and/or distribute it,
     9      8   # with or without modifications, as long as this notice is preserved.
    10      9   
    11     10   # This program is distributed in the hope that it will be useful,
    12     11   # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    13     12   # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    14     13   # PARTICULAR PURPOSE.
    15     14   
    16     15   @SET_MAKE@
    17     16   
    18     17   VPATH = @srcdir@
    19     18   pkgdatadir = $(datadir)/@PACKAGE@
    20         -pkgincludedir = $(includedir)/@PACKAGE@
    21     19   pkglibdir = $(libdir)/@PACKAGE@
    22         -pkglibexecdir = $(libexecdir)/@PACKAGE@
           20  +pkgincludedir = $(includedir)/@PACKAGE@
    23     21   am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    24     22   install_sh_DATA = $(install_sh) -c -m 644
    25     23   install_sh_PROGRAM = $(install_sh) -c
    26     24   install_sh_SCRIPT = $(install_sh) -c
    27     25   INSTALL_HEADER = $(INSTALL_DATA)
    28     26   transform = $(program_transform_name)
    29     27   NORMAL_INSTALL = :
................................................................................
    41     39   DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    42     40   ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    43     41   am__aclocal_m4_deps = $(top_srcdir)/configure.ac
    44     42   am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    45     43   	$(ACLOCAL_M4)
    46     44   mkinstalldirs = $(install_sh) -d
    47     45   CONFIG_CLEAN_FILES =
    48         -CONFIG_CLEAN_VPATH_FILES =
    49     46   am__installdirs = "$(DESTDIR)$(bindir)"
           47  +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    50     48   PROGRAMS = $(bin_PROGRAMS)
    51     49   am_rasterlite_grid_OBJECTS = rasterlite_grid.$(OBJEXT)
    52     50   rasterlite_grid_OBJECTS = $(am_rasterlite_grid_OBJECTS)
    53     51   rasterlite_grid_LDADD = $(LDADD)
    54     52   rasterlite_grid_DEPENDENCIES = ../lib/.libs/librasterlite.a
    55     53   am_rasterlite_load_OBJECTS = rasterlite_load.$(OBJEXT)
    56     54   rasterlite_load_OBJECTS = $(am_rasterlite_load_OBJECTS)
................................................................................
    67     65   am_rasterlite_topmost_OBJECTS = rasterlite_topmost.$(OBJEXT)
    68     66   rasterlite_topmost_OBJECTS = $(am_rasterlite_topmost_OBJECTS)
    69     67   rasterlite_topmost_LDADD = $(LDADD)
    70     68   rasterlite_topmost_DEPENDENCIES = ../lib/.libs/librasterlite.a
    71     69   DEFAULT_INCLUDES = -I.@am__isrc@
    72     70   depcomp = $(SHELL) $(top_srcdir)/depcomp
    73     71   am__depfiles_maybe = depfiles
    74         -am__mv = mv -f
    75     72   COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    76     73   	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    77     74   LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
    78     75   	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    79     76   	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    80     77   CCLD = $(CC)
    81     78   LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
................................................................................
   108    105   CXXDEPMODE = @CXXDEPMODE@
   109    106   CXXFLAGS = @CXXFLAGS@
   110    107   CYGPATH_W = @CYGPATH_W@
   111    108   DEFS = @DEFS@
   112    109   DEPDIR = @DEPDIR@
   113    110   DLLTOOL = @DLLTOOL@
   114    111   DSYMUTIL = @DSYMUTIL@
   115         -DUMPBIN = @DUMPBIN@
          112  +ECHO = @ECHO@
   116    113   ECHO_C = @ECHO_C@
   117    114   ECHO_N = @ECHO_N@
   118    115   ECHO_T = @ECHO_T@
   119    116   EGREP = @EGREP@
   120    117   EXEEXT = @EXEEXT@
   121         -FGREP = @FGREP@
          118  +F77 = @F77@
          119  +FFLAGS = @FFLAGS@
   122    120   GREP = @GREP@
   123    121   INSTALL = @INSTALL@
   124    122   INSTALL_DATA = @INSTALL_DATA@
   125    123   INSTALL_PROGRAM = @INSTALL_PROGRAM@
   126    124   INSTALL_SCRIPT = @INSTALL_SCRIPT@
   127    125   INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   128         -LD = @LD@
   129    126   LDFLAGS = @LDFLAGS@
   130    127   LIBOBJS = @LIBOBJS@
   131    128   LIBS = @LIBS@
   132         -LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
   133         -LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
   134    129   LIBTOOL = @LIBTOOL@
   135         -LIPO = @LIPO@
   136    130   LN_S = @LN_S@
   137    131   LTLIBOBJS = @LTLIBOBJS@
   138    132   MAINT = @MAINT@
   139    133   MAKEINFO = @MAKEINFO@
   140    134   MKDIR_P = @MKDIR_P@
   141         -NM = @NM@
   142    135   NMEDIT = @NMEDIT@
   143    136   OBJDUMP = @OBJDUMP@
   144    137   OBJEXT = @OBJEXT@
   145         -OTOOL = @OTOOL@
   146         -OTOOL64 = @OTOOL64@
   147    138   PACKAGE = @PACKAGE@
   148    139   PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   149    140   PACKAGE_NAME = @PACKAGE_NAME@
   150    141   PACKAGE_STRING = @PACKAGE_STRING@
   151    142   PACKAGE_TARNAME = @PACKAGE_TARNAME@
   152         -PACKAGE_URL = @PACKAGE_URL@
   153    143   PACKAGE_VERSION = @PACKAGE_VERSION@
   154    144   PATH_SEPARATOR = @PATH_SEPARATOR@
   155         -PKG_CONFIG = @PKG_CONFIG@
   156         -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
   157         -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
   158    145   RANLIB = @RANLIB@
   159    146   SED = @SED@
   160    147   SET_MAKE = @SET_MAKE@
   161    148   SHELL = @SHELL@
   162    149   STRIP = @STRIP@
   163    150   VERSION = @VERSION@
   164    151   abs_builddir = @abs_builddir@
   165    152   abs_srcdir = @abs_srcdir@
   166    153   abs_top_builddir = @abs_top_builddir@
   167    154   abs_top_srcdir = @abs_top_srcdir@
   168    155   ac_ct_CC = @ac_ct_CC@
   169    156   ac_ct_CXX = @ac_ct_CXX@
   170         -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
          157  +ac_ct_F77 = @ac_ct_F77@
   171    158   am__include = @am__include@
   172    159   am__leading_dot = @am__leading_dot@
   173    160   am__quote = @am__quote@
   174    161   am__tar = @am__tar@
   175    162   am__untar = @am__untar@
   176    163   bindir = @bindir@
   177    164   build = @build@
................................................................................
   194    181   includedir = @includedir@
   195    182   infodir = @infodir@
   196    183   install_sh = @install_sh@
   197    184   libdir = @libdir@
   198    185   libexecdir = @libexecdir@
   199    186   localedir = @localedir@
   200    187   localstatedir = @localstatedir@
   201         -lt_ECHO = @lt_ECHO@
   202    188   mandir = @mandir@
   203    189   mkdir_p = @mkdir_p@
   204    190   oldincludedir = @oldincludedir@
   205    191   pdfdir = @pdfdir@
   206    192   prefix = @prefix@
   207    193   program_transform_name = @program_transform_name@
   208    194   psdir = @psdir@
   209    195   sbindir = @sbindir@
   210    196   sharedstatedir = @sharedstatedir@
   211    197   srcdir = @srcdir@
   212    198   sysconfdir = @sysconfdir@
   213    199   target_alias = @target_alias@
   214         -top_build_prefix = @top_build_prefix@
   215    200   top_builddir = @top_builddir@
   216    201   top_srcdir = @top_srcdir@
   217         -AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 \
   218         -	@LIBSPATIALITE_CFLAGS@
   219         -
   220         -INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers
          202  +AM_CFLAGS = -D_LARGE_FILE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
          203  +INCLUDES = @CFLAGS@ -I$(top_srcdir)/headers -I$(top_srcdir)/epsilon
   221    204   rasterlite_load_SOURCES = rasterlite_load.c
   222    205   rasterlite_pyramid_SOURCES = rasterlite_pyramid.c
   223    206   rasterlite_topmost_SOURCES = rasterlite_topmost.c
   224    207   rasterlite_grid_SOURCES = rasterlite_grid.c
   225    208   rasterlite_tool_SOURCES = rasterlite_tool.c
   226    209   LDADD = ../lib/.libs/librasterlite.a \
   227         -	@LIBSPATIALITE_LIBS@ \
   228    210           -lgeotiff -ltiff -ljpeg -lpng -lspatialite -lproj
   229    211   
   230    212   all: all-am
   231    213   
   232    214   .SUFFIXES:
   233    215   .SUFFIXES: .c .lo .o .obj
   234    216   $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   235    217   	@for dep in $?; do \
   236    218   	  case '$(am__configure_deps)' in \
   237    219   	    *$$dep*) \
   238         -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   239         -	        && { if test -f $@; then exit 0; else break; fi; }; \
          220  +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
          221  +		&& exit 0; \
   240    222   	      exit 1;; \
   241    223   	  esac; \
   242    224   	done; \
   243         -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
   244         -	$(am__cd) $(top_srcdir) && \
   245         -	  $(AUTOMAKE) --foreign src/Makefile
          225  +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
          226  +	cd $(top_srcdir) && \
          227  +	  $(AUTOMAKE) --foreign  src/Makefile
   246    228   .PRECIOUS: Makefile
   247    229   Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   248    230   	@case '$?' in \
   249    231   	  *config.status*) \
   250    232   	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   251    233   	  *) \
   252    234   	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
................................................................................
   256    238   $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   257    239   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   258    240   
   259    241   $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   260    242   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   261    243   $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   262    244   	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   263         -$(am__aclocal_m4_deps):
   264    245   install-binPROGRAMS: $(bin_PROGRAMS)
   265    246   	@$(NORMAL_INSTALL)
   266    247   	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
   267         -	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
   268         -	for p in $$list; do echo "$$p $$p"; done | \
   269         -	sed 's/$(EXEEXT)$$//' | \
   270         -	while read p p1; do if test -f $$p || test -f $$p1; \
   271         -	  then echo "$$p"; echo "$$p"; else :; fi; \
   272         -	done | \
   273         -	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
   274         -	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
   275         -	sed 'N;N;N;s,\n, ,g' | \
   276         -	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
   277         -	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
   278         -	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
   279         -	    else { print "f", $$3 "/" $$4, $$1; } } \
   280         -	  END { for (d in files) print "f", d, files[d] }' | \
   281         -	while read type dir files; do \
   282         -	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
   283         -	    test -z "$$files" || { \
   284         -	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
   285         -	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
   286         -	    } \
   287         -	; done
          248  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
          249  +	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          250  +	  if test -f $$p \
          251  +	     || test -f $$p1 \
          252  +	  ; then \
          253  +	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
          254  +	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
          255  +	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
          256  +	  else :; fi; \
          257  +	done
   288    258   
   289    259   uninstall-binPROGRAMS:
   290    260   	@$(NORMAL_UNINSTALL)
   291         -	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
   292         -	files=`for p in $$list; do echo "$$p"; done | \
   293         -	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
   294         -	      -e 's/$$/$(EXEEXT)/' `; \
   295         -	test -n "$$list" || exit 0; \
   296         -	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
   297         -	cd "$(DESTDIR)$(bindir)" && rm -f $$files
          261  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
          262  +	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
          263  +	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
          264  +	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
          265  +	done
   298    266   
   299    267   clean-binPROGRAMS:
   300         -	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
   301         -	echo " rm -f" $$list; \
   302         -	rm -f $$list || exit $$?; \
   303         -	test -n "$(EXEEXT)" || exit 0; \
   304         -	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
   305         -	echo " rm -f" $$list; \
   306         -	rm -f $$list
          268  +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
          269  +	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
          270  +	  echo " rm -f $$p $$f"; \
          271  +	  rm -f $$p $$f ; \
          272  +	done
   307    273   rasterlite_grid$(EXEEXT): $(rasterlite_grid_OBJECTS) $(rasterlite_grid_DEPENDENCIES) 
   308    274   	@rm -f rasterlite_grid$(EXEEXT)
   309    275   	$(LINK) $(rasterlite_grid_OBJECTS) $(rasterlite_grid_LDADD) $(LIBS)
   310    276   rasterlite_load$(EXEEXT): $(rasterlite_load_OBJECTS) $(rasterlite_load_DEPENDENCIES) 
   311    277   	@rm -f rasterlite_load$(EXEEXT)
   312    278   	$(LINK) $(rasterlite_load_OBJECTS) $(rasterlite_load_LDADD) $(LIBS)
   313    279   rasterlite_pyramid$(EXEEXT): $(rasterlite_pyramid_OBJECTS) $(rasterlite_pyramid_DEPENDENCIES) 
................................................................................
   330    296   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_load.Po@am__quote@
   331    297   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_pyramid.Po@am__quote@
   332    298   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_tool.Po@am__quote@
   333    299   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterlite_topmost.Po@am__quote@
   334    300   
   335    301   .c.o:
   336    302   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   337         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          303  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   338    304   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   339    305   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   340    306   @am__fastdepCC_FALSE@	$(COMPILE) -c $<
   341    307   
   342    308   .c.obj:
   343    309   @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
   344         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
          310  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
   345    311   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   346    312   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   347    313   @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   348    314   
   349    315   .c.lo:
   350    316   @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
   351         -@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
          317  +@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
   352    318   @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
   353    319   @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   354    320   @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
   355    321   
   356    322   mostlyclean-libtool:
   357    323   	-rm -f *.lo
   358    324   
................................................................................
   360    326   	-rm -rf .libs _libs
   361    327   
   362    328   ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   363    329   	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   364    330   	unique=`for i in $$list; do \
   365    331   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   366    332   	  done | \
   367         -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
          333  +	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
   368    334   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   369    335   	mkid -fID $$unique
   370    336   tags: TAGS
   371    337   
   372    338   TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   373    339   		$(TAGS_FILES) $(LISP)
   374         -	set x; \
          340  +	tags=; \
   375    341   	here=`pwd`; \
   376    342   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   377    343   	unique=`for i in $$list; do \
   378    344   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   379    345   	  done | \
   380    346   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   381    347   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   382         -	shift; \
   383         -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
          348  +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   384    349   	  test -n "$$unique" || unique=$$empty_fix; \
   385         -	  if test $$# -gt 0; then \
   386         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   387         -	      "$$@" $$unique; \
   388         -	  else \
   389         -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   390         -	      $$unique; \
   391         -	  fi; \
          350  +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          351  +	    $$tags $$unique; \
   392    352   	fi
   393    353   ctags: CTAGS
   394    354   CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   395    355   		$(TAGS_FILES) $(LISP)
          356  +	tags=; \
   396    357   	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   397    358   	unique=`for i in $$list; do \
   398    359   	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   399    360   	  done | \
   400    361   	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   401    362   	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   402         -	test -z "$(CTAGS_ARGS)$$unique" \
          363  +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   403    364   	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   404         -	     $$unique
          365  +	     $$tags $$unique
   405    366   
   406    367   GTAGS:
   407    368   	here=`$(am__cd) $(top_builddir) && pwd` \
   408         -	  && $(am__cd) $(top_srcdir) \
   409         -	  && gtags -i $(GTAGS_ARGS) "$$here"
          369  +	  && cd $(top_srcdir) \
          370  +	  && gtags -i $(GTAGS_ARGS) $$here
   410    371   
   411    372   distclean-tags:
   412    373   	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   413    374   
   414    375   distdir: $(DISTFILES)
   415    376   	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
   416    377   	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
................................................................................
   423    384   			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
   424    385   			   sort -u` ;; \
   425    386   	esac; \
   426    387   	for file in $$dist_files; do \
   427    388   	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   428    389   	  if test -d $$d/$$file; then \
   429    390   	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
   430         -	    if test -d "$(distdir)/$$file"; then \
   431         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
          391  +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          392  +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   432    393   	    fi; \
   433         -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   434         -	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
   435         -	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
   436         -	    fi; \
   437         -	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
          394  +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   438    395   	  else \
   439         -	    test -f "$(distdir)/$$file" \
   440         -	    || cp -p $$d/$$file "$(distdir)/$$file" \
          396  +	    test -f $(distdir)/$$file \
          397  +	    || cp -p $$d/$$file $(distdir)/$$file \
   441    398   	    || exit 1; \
   442    399   	  fi; \
   443    400   	done
   444    401   check-am: all-am
   445    402   check: check-am
   446    403   all-am: Makefile $(PROGRAMS)
   447    404   installdirs:
................................................................................
   464    421   	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   465    422   mostlyclean-generic:
   466    423   
   467    424   clean-generic:
   468    425   
   469    426   distclean-generic:
   470    427   	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   471         -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   472    428   
   473    429   maintainer-clean-generic:
   474    430   	@echo "This command is intended for maintainers to use"
   475    431   	@echo "it deletes files that may require special tools to rebuild."
   476    432   clean: clean-am
   477    433   
   478    434   clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
................................................................................
   485    441   
   486    442   dvi: dvi-am
   487    443   
   488    444   dvi-am:
   489    445   
   490    446   html: html-am
   491    447   
   492         -html-am:
   493         -
   494    448   info: info-am
   495    449   
   496    450   info-am:
   497    451   
   498    452   install-data-am:
   499    453   
   500    454   install-dvi: install-dvi-am
   501    455   
   502         -install-dvi-am:
   503         -
   504    456   install-exec-am: install-binPROGRAMS
   505    457   
   506    458   install-html: install-html-am
   507    459   
   508         -install-html-am:
   509         -
   510    460   install-info: install-info-am
   511    461   
   512         -install-info-am:
   513         -
   514    462   install-man:
   515    463   
   516    464   install-pdf: install-pdf-am
   517    465   
   518         -install-pdf-am:
   519         -
   520    466   install-ps: install-ps-am
   521    467   
   522         -install-ps-am:
   523         -
   524    468   installcheck-am:
   525    469   
   526    470   maintainer-clean: maintainer-clean-am
   527    471   	-rm -rf ./$(DEPDIR)
   528    472   	-rm -f Makefile
   529    473   maintainer-clean-am: distclean-am maintainer-clean-generic
   530    474   
................................................................................
   554    498   	install-html-am install-info install-info-am install-man \
   555    499   	install-pdf install-pdf-am install-ps install-ps-am \
   556    500   	install-strip installcheck installcheck-am installdirs \
   557    501   	maintainer-clean maintainer-clean-generic mostlyclean \
   558    502   	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
   559    503   	pdf pdf-am ps ps-am tags uninstall uninstall-am \
   560    504   	uninstall-binPROGRAMS
   561         -
   562    505   
   563    506   # Tell versions [3.59,3.63) of GNU make to not export all variables.
   564    507   # Otherwise a system limit (for SysV at least) may be exceeded.
   565    508   .NOEXPORT:

Changes to src/rasterlite_grid.c.

     1      1   /* 
     2      2   / rasterlite_grid.c
     3      3   /
     4      4   / a tool generating a GeoTIFF from am ASCII or BINARY Grid 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 28
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13     13   /    it under the terms of the GNU General Public License as published by
................................................................................
    27     27   #include <stdlib.h>
    28     28   #include <stdio.h>
    29     29   #include <string.h>
    30     30   #include <float.h>
    31     31   #include <errno.h>
    32     32   #include <sys/types.h>
    33     33   
    34         -#include "rasterlite_tiff_hdrs.h"
           34  +#include <geotiff.h>
           35  +#include <xtiffio.h>
           36  +#include <geo_tiffp.h>
           37  +#include <geo_keyp.h>
           38  +#include <geovalues.h>
           39  +#include <geo_normalize.h>
    35     40   
    36     41   #if defined(_WIN32) && !defined(__MINGW32__)
    37     42   #include <io.h>
    38     43   #include <direct.h>
    39     44   #else
    40     45   #include <dirent.h>
    41     46   #endif
................................................................................
    48     53   #define ARG_GRID_PATH		1
    49     54   #define ARG_COLOR_PATH		2
    50     55   #define ARG_TIFF_PATH		3
    51     56   #define ARG_GRID_TYPE		4
    52     57   #define ARG_EPSG_CODE		5
    53     58   #define ARG_NODATA_COLOR	6
    54     59   #define ARG_PROJ4TEXT		7
    55         -#define ARG_MONO_COLOR		9
    56         -#define ARG_Z_FACTOR		10
    57         -#define ARG_SCALE			11
    58         -#define ARG_AZIMUTH			12
    59         -#define ARG_ALTITUDE		13
    60     60   
    61     61   #define ASCII_GRID	100
    62     62   #define FLOAT_GRID	101
    63     63   
    64     64   #define BYTE_ORDER_NONE	0
    65     65   #define BYTE_ORDER_BIG	1
    66     66   #define BYTE_ORDER_LITTLE	2
    67     67   
    68     68   struct colorTable
    69     69   {
    70         -/* a color table value range */
    71     70       double min;
    72     71       double max;
    73     72       unsigned char red;
    74     73       unsigned char green;
    75     74       unsigned char blue;
    76     75   };
    77     76   
    78         -struct triple_scan
    79         -{
    80         -/* the 3-scanlines object for Shaded Relief */
    81         -    int ncols;
    82         -    double z_factor;
    83         -    double scale_factor;
    84         -    double altitude;
    85         -    double azimuth;
    86         -    int mono_color;
    87         -    unsigned char mono_red;
    88         -    unsigned char mono_green;
    89         -    unsigned char mono_blue;
    90         -    float no_data_value;
    91         -    unsigned char no_red;
    92         -    unsigned char no_green;
    93         -    unsigned char no_blue;
    94         -    float *row1;
    95         -    float *row2;
    96         -    float *row3;
    97         -    float *current_row;
    98         -};
    99         -
   100         -static int
   101         -cmp_color_qsort (const void *p1, const void *p2)
   102         -{
   103         -/* compares two colorTable entries [for QSORT] */
   104         -    struct colorTable *pc1 = (struct colorTable *) p1;
   105         -    struct colorTable *pc2 = (struct colorTable *) p2;
   106         -    if (pc1->min > pc2->min)
   107         -	return 1;
   108         -    if (pc1->min < pc2->min)
   109         -	return -1;
   110         -    if (pc1->max > pc2->max)
   111         -	return 1;
   112         -    if (pc1->max < pc2->max)
   113         -	return -1;
   114         -    return 0;
   115         -}
   116         -
   117         -static int
   118         -cmp_color_bsearch (const void *p1, const void *p2)
   119         -{
   120         -/* compares two colorTable entries [for BSEARCH] */
   121         -    struct colorTable *pc1 = (struct colorTable *) p1;
   122         -    struct colorTable *pc2 = (struct colorTable *) p2;
   123         -    if (pc1->min >= pc2->min && pc1->min <= pc2->max)
   124         -	return 0;
   125         -    if (pc1->min > pc2->min)
   126         -	return 1;
   127         -    if (pc1->min < pc2->min)
   128         -	return -1;
   129         -    if (pc1->min > pc2->max)
   130         -	return 1;
   131         -    if (pc1->min < pc2->max)
   132         -	return -1;
   133         -    return 0;
   134         -}
   135         -
   136         -static int
   137         -match_color (struct colorTable *color_table, int colors, double value,
   138         -	     unsigned char *red, unsigned char *green, unsigned char *blue)
   139         -{
   140         -/* mapping a value into the corresponding color */
   141         -    struct colorTable *ret;
   142         -    struct colorTable src;
   143         -    src.min = value;
   144         -    ret =
   145         -	bsearch (&src, color_table, colors, sizeof (struct colorTable),
   146         -		 cmp_color_bsearch);
   147         -    if (ret)
   148         -      {
   149         -	  *red = ret->red;
   150         -	  *green = ret->green;
   151         -	  *blue = ret->blue;
   152         -	  return 1;
   153         -      }
   154         -    return 0;
   155         -}
   156         -
   157         -static struct triple_scan *
   158         -triple_alloc (int ncols)
   159         -{
   160         -/* allocating the 3-scanlines object */
   161         -    struct triple_scan *p = malloc (sizeof (struct triple_scan));
   162         -    p->ncols = ncols;
   163         -    p->row1 = malloc (sizeof (float) * ncols);
   164         -    p->row2 = malloc (sizeof (float) * ncols);
   165         -    p->row3 = malloc (sizeof (float) * ncols);
   166         -    p->current_row = p->row1;
   167         -    p->mono_color = 0;
   168         -    p->mono_red = 0;
   169         -    p->mono_green = 0;
   170         -    p->mono_blue = 0;
   171         -    p->no_data_value = 0.0;
   172         -    p->no_red = 0;
   173         -    p->no_green = 0;
   174         -    p->no_blue = 0;
   175         -    p->z_factor = 1.0;
   176         -    p->scale_factor = 1.0;
   177         -    p->altitude = 45.0;
   178         -    p->azimuth = 315.0;
   179         -    return p;
   180         -}
   181         -
   182         -static void
   183         -triple_free (struct triple_scan *p)
   184         -{
   185         -/* freeing the 3-scanlines object */
   186         -    free (p->row1);
   187         -    free (p->row2);
   188         -    free (p->row3);
   189         -    free (p);
   190         -}
   191         -
   192         -static void
   193         -triple_set_no_data (struct triple_scan *p, float no_data_value,
   194         -		    unsigned char no_red, unsigned char no_green,
   195         -		    unsigned char no_blue)
   196         -{
   197         -/* setting NODATA params */
   198         -    p->no_data_value = no_data_value;
   199         -    p->no_red = no_red;
   200         -    p->no_green = no_green;
   201         -    p->no_blue = no_blue;
   202         -}
   203         -
   204         -static void
   205         -triple_set_monochrome_params (struct triple_scan *p, int mono_color,
   206         -			      unsigned char mono_red, unsigned char mono_green,
   207         -			      unsigned char mono_blue)
   208         -{
   209         -/* setting ShadedRelief params */
   210         -    p->mono_color = mono_color;
   211         -    p->mono_red = mono_red;
   212         -    p->mono_green = mono_green;
   213         -    p->mono_blue = mono_blue;
   214         -}
   215         -
   216         -static void
   217         -triple_set_shaded_relief_params (struct triple_scan *p, double z, double scale,
   218         -				 double alt, double az)
   219         -{
   220         -/* setting ShadedRelief params */
   221         -    p->z_factor = z;
   222         -    p->scale_factor = scale;
   223         -    p->altitude = alt;
   224         -    p->azimuth = az;
   225         -}
   226         -
   227         -static void
   228         -triple_rotate (struct triple_scan *p)
   229         -{
   230         -/* rotating the 3-scanlines */
   231         -    if (p->current_row == p->row1)
   232         -      {
   233         -	  p->current_row = p->row2;
   234         -	  goto zero_init;
   235         -      }
   236         -    if (p->current_row == p->row2)
   237         -      {
   238         -	  p->current_row = p->row3;
   239         -	  goto zero_init;
   240         -      }
   241         -    p->current_row = p->row1;
   242         -    p->row1 = p->row2;
   243         -    p->row2 = p->row3;
   244         -    p->row3 = p->current_row;
   245         -  zero_init:
   246         -    memset (p->current_row, 0, sizeof (float) * p->ncols);
   247         -}
   248         -
   249         -static void
   250         -triple_store_cell (struct triple_scan *p, int icol, float value)
   251         -{
   252         -/* storing a cell value into 3-scanlines */
   253         -    if (icol < 0 || icol >= p->ncols)
   254         -	return;
   255         -    *(p->current_row + icol) = value;
   256         -}
   257         -
   258         -static int
   259         -triple_is_valid (struct triple_scan *p)
   260         -{
   261         -/* checking for validitity */
   262         -    if (p->current_row == p->row3)
   263         -	return 1;
   264         -    return 0;
   265         -}
   266         -
   267         -static void
   268         -triple_shaded_relief (struct triple_scan *p, unsigned char *raster)
   269         -{
   270         -/* creating a shaded relief scanline */
   271         -    int j;
   272         -    int n;
   273         -    double x;
   274         -    double y;
   275         -    double aspect;
   276         -    double slope;
   277         -    double cang;
   278         -    int gray;
   279         -    float afWin[9];
   280         -    const double degreesToRadians = M_PI / 180.0;
   281         -    const double altRadians = p->altitude * degreesToRadians;
   282         -    const double azRadians = p->azimuth * degreesToRadians;
   283         -    double red;
   284         -    double green;
   285         -    double blue;
   286         -    double alpha;
   287         -    int bContainsNull;
   288         -    unsigned char *p_raster = raster;
   289         -    unsigned char r;
   290         -    unsigned char g;
   291         -    unsigned char b;
   292         -
   293         -/*
   294         -/ Move a 3x3 pafWindow over each cell 
   295         -/ (where the cell in question is #4)
   296         -/ 
   297         -/      0 1 2
   298         -/      3 4 5
   299         -/      6 7 8
   300         -*/
   301         -    for (j = 0; j < p->ncols; j++)
   302         -      {
   303         -	  /* Exclude the edges */
   304         -	  if (j == 0 || j == p->ncols - 1)
   305         -	      continue;
   306         -
   307         -	  bContainsNull = 0;
   308         -
   309         -	  afWin[0] = p->row1[j - 1];
   310         -	  afWin[1] = p->row1[j];
   311         -	  afWin[2] = p->row1[j + 1];
   312         -	  afWin[3] = p->row2[j - 1];
   313         -	  afWin[4] = p->row2[j];
   314         -	  afWin[5] = p->row2[j + 1];
   315         -	  afWin[6] = p->row3[j - 1];
   316         -	  afWin[7] = p->row3[j];
   317         -	  afWin[8] = p->row3[j + 1];
   318         -
   319         -	  for (n = 0; n <= 8; n++)
   320         -	    {
   321         -		if (afWin[n] == p->no_data_value)
   322         -		  {
   323         -		      bContainsNull = 1;
   324         -		      break;
   325         -		  }
   326         -	    }
   327         -
   328         -	  if (bContainsNull)
   329         -	    {
   330         -		/* We have nulls so write nullValue and move on */
   331         -		r = p->no_red;
   332         -		g = p->no_green;
   333         -		b = p->no_blue;
   334         -	    }
   335         -	  else
   336         -	    {
   337         -		/* We have a valid 3x3 window. */
   338         -
   339         -		/* ---------------------------------------
   340         -		 * Compute Hillshade
   341         -		 */
   342         -
   343         -		/* First Slope ... */
   344         -		x = p->z_factor * ((afWin[0] + afWin[3] + afWin[3] + afWin[6]) -
   345         -				   (afWin[2] + afWin[5] + afWin[5] +
   346         -				    afWin[8])) / (8.0 * p->scale_factor);
   347         -
   348         -		y = p->z_factor * ((afWin[6] + afWin[7] + afWin[7] + afWin[8]) -
   349         -				   (afWin[0] + afWin[1] + afWin[1] +
   350         -				    afWin[2])) / (8.0 * p->scale_factor);
   351         -
   352         -		slope = M_PI / 2 - atan (sqrt (x * x + y * y));
   353         -
   354         -		/* ... then aspect... */
   355         -		aspect = atan2 (x, y);
   356         -
   357         -		/* ... then the shade value */
   358         -		cang = sin (altRadians) * sin (slope) +
   359         -		    cos (altRadians) * cos (slope) *
   360         -		    cos (azRadians - M_PI / 2 - aspect);
   361         -
   362         -		if (cang <= 0.0)
   363         -		    cang = 1.0;
   364         -		else
   365         -		    cang = 1.0 + (254.0 * cang);
   366         -
   367         -		if (p->mono_color)
   368         -		  {
   369         -		      /* using the monochrome base color + ALPHA */
   370         -		      alpha = cang / 255.0;
   371         -		      red = (double) (p->mono_red) * alpha;
   372         -		      green = (double) (p->mono_green) * alpha;
   373         -		      blue = (double) (p->mono_blue) * alpha;
   374         -		      if (red < 0.0)
   375         -			  red = 0.0;
   376         -		      if (green < 0.0)
   377         -			  green = 0.0;
   378         -		      if (blue < 0.0)
   379         -			  blue = 0.0;
   380         -		      if (red > 255.0)
   381         -			  red = 255.0;
   382         -		      if (green > 255.0)
   383         -			  green = 255.0;
   384         -		      if (blue > 255.0)
   385         -			  blue = 255.0;
   386         -		      r = (unsigned char) red;
   387         -		      g = (unsigned char) green;
   388         -		      b = (unsigned) blue;
   389         -		  }
   390         -		else
   391         -		  {
   392         -		      /* plain gray-scale */
   393         -		      gray = (int) cang;
   394         -		      r = (unsigned char) gray;
   395         -		      g = (unsigned char) gray;
   396         -		      b = (unsigned) gray;
   397         -		  }
   398         -	    }
   399         -	  *p_raster++ = r;
   400         -	  *p_raster++ = g;
   401         -	  *p_raster++ = b;
   402         -      }
   403         -}
   404         -
   405         -static int
   406         -triple_shaded_relief_color (struct colorTable *color_table, int colors,
   407         -			    struct triple_scan *p, unsigned char *raster,
   408         -			    int row)
   409         -{
   410         -/* creating a shaded relief color scanline */
   411         -    int j;
   412         -    int n;
   413         -    double x;
   414         -    double y;
   415         -    double aspect;
   416         -    double slope;
   417         -    double cang;
   418         -    float afWin[9];
   419         -    const double degreesToRadians = M_PI / 180.0;
   420         -    const double altRadians = p->altitude * degreesToRadians;
   421         -    const double azRadians = p->azimuth * degreesToRadians;
   422         -    double red;
   423         -    double green;
   424         -    double blue;
   425         -    double alpha;
   426         -    double thisValue;
   427         -    int bContainsNull;
   428         -    unsigned char *p_raster = raster;
   429         -    unsigned char r;
   430         -    unsigned char g;
   431         -    unsigned char b;
   432         -
   433         -/*
   434         -/ Move a 3x3 pafWindow over each cell 
   435         -/ (where the cell in question is #4)
   436         -/ 
   437         -/      0 1 2
   438         -/      3 4 5
   439         -/      6 7 8
   440         -*/
   441         -    for (j = 0; j < p->ncols; j++)
   442         -      {
   443         -	  /* Exclude the edges */
   444         -	  if (j == 0 || j == p->ncols - 1)
   445         -	      continue;
   446         -
   447         -	  bContainsNull = 0;
   448         -
   449         -	  afWin[0] = p->row1[j - 1];
   450         -	  afWin[1] = p->row1[j];
   451         -	  afWin[2] = p->row1[j + 1];
   452         -	  afWin[3] = p->row2[j - 1];
   453         -	  afWin[4] = p->row2[j];
   454         -	  afWin[5] = p->row2[j + 1];
   455         -	  afWin[6] = p->row3[j - 1];
   456         -	  afWin[7] = p->row3[j];
   457         -	  afWin[8] = p->row3[j + 1];
   458         -
   459         -	  thisValue = afWin[4];
   460         -
   461         -	  for (n = 0; n <= 8; n++)
   462         -	    {
   463         -		if (afWin[n] == p->no_data_value)
   464         -		  {
   465         -		      bContainsNull = 1;
   466         -		      break;
   467         -		  }
   468         -	    }
   469         -
   470         -	  if (bContainsNull)
   471         -	    {
   472         -		/* We have nulls so write nullValue and move on */
   473         -		r = p->no_red;
   474         -		g = p->no_green;
   475         -		b = p->no_blue;
   476         -	    }
   477         -	  else
   478         -	    {
   479         -		/* We have a valid 3x3 window. */
   480         -
   481         -		/* ---------------------------------------
   482         -		 * Compute Hillshade
   483         -		 */
   484         -
   485         -		/* First Slope ... */
   486         -		x = p->z_factor * ((afWin[0] + afWin[3] + afWin[3] + afWin[6]) -
   487         -				   (afWin[2] + afWin[5] + afWin[5] +
   488         -				    afWin[8])) / (8.0 * p->scale_factor);
   489         -
   490         -		y = p->z_factor * ((afWin[6] + afWin[7] + afWin[7] + afWin[8]) -
   491         -				   (afWin[0] + afWin[1] + afWin[1] +
   492         -				    afWin[2])) / (8.0 * p->scale_factor);
   493         -
   494         -		slope = M_PI / 2 - atan (sqrt (x * x + y * y));
   495         -
   496         -		/* ... then aspect... */
   497         -		aspect = atan2 (x, y);
   498         -
   499         -		/* ... then the shade value */
   500         -		cang = sin (altRadians) * sin (slope) +
   501         -		    cos (altRadians) * cos (slope) *
   502         -		    cos (azRadians - M_PI / 2 - aspect);
   503         -
   504         -		if (cang <= 0.0)
   505         -		    cang = 1.0;
   506         -		else
   507         -		    cang = 1.0 + (254.0 * cang);
   508         -
   509         -		/* merging the color + ALPHA */
   510         -		if (!match_color (color_table, colors, thisValue, &r, &g, &b))
   511         -		  {
   512         -		      printf
   513         -			  ("Grid row %d: unmatched value %1.8f; color not found\n",
   514         -			   row, thisValue);
   515         -		      return 0;
   516         -		  }
   517         -		alpha = cang / 255.0;
   518         -		red = (double) r *alpha;
   519         -		green = (double) g *alpha;
   520         -		blue = (double) b *alpha;
   521         -		if (red < 0.0)
   522         -		    red = 0.0;
   523         -		if (green < 0.0)
   524         -		    green = 0.0;
   525         -		if (blue < 0.0)
   526         -		    blue = 0.0;
   527         -		if (red > 255.0)
   528         -		    red = 255.0;
   529         -		if (green > 255.0)
   530         -		    green = 255.0;
   531         -		if (blue > 255.0)
   532         -		    blue = 255.0;
   533         -		r = (unsigned char) red;
   534         -		g = (unsigned char) green;
   535         -		b = (unsigned) blue;
   536         -	    }
   537         -	  *p_raster++ = r;
   538         -	  *p_raster++ = g;
   539         -	  *p_raster++ = b;
   540         -      }
   541         -    return 1;
   542         -}
   543         -
   544     77   static int
   545     78   parse_hex (const char hi, const char lo)
   546     79   {
   547     80   /* parsing an hexedecimal value XX */
   548     81       int hex;
   549     82       switch (hi)
   550     83         {
................................................................................
   817    350   	    }
   818    351   	  return 1;
   819    352         }
   820    353       return 0;
   821    354   }
   822    355   
   823    356   static struct colorTable *
   824         -parse_color_table (const char *path, int *count)
          357  +parse_color_table (const char *path)
   825    358   {
   826    359   /* parsing the Color Table */
   827    360       double min;
   828    361       double max;
   829    362       unsigned char red;
   830    363       unsigned char green;
   831    364       unsigned char blue;
................................................................................
   867    400   		ptr = buf;
   868    401   		continue;
   869    402   	    }
   870    403   	  *ptr++ = c;
   871    404         }
   872    405       if (lines == 0 || error > 0)
   873    406   	return NULL;
   874         -    table = malloc (sizeof (struct colorTable) * (lines));
          407  +    table = malloc (sizeof (struct colorTable) * (lines + 1));
          408  +/* marking the last (stop) table item */
          409  +    (table + lines)->min = DBL_MAX;
          410  +    (table + lines)->max = DBL_MAX;
          411  +    (table + lines)->red = 0;
          412  +    (table + lines)->green = 0;
          413  +    (table + lines)->blue = 0;
   875    414   /* closing and reopening the Color Table file */
   876    415       fclose (in);
   877    416       in = fopen (path, "rb");
   878    417       if (!in)
   879    418         {
   880    419   	  printf ("Re-Open error: %s\n", path);
   881    420   	  return NULL;
................................................................................
   918    457         {
   919    458   	  /* unexected error */
   920    459   	  fprintf (stderr, "ColorTable: unexpected read error\n");
   921    460   	  free (table);
   922    461   	  table = NULL;
   923    462         }
   924    463       fclose (in);
   925         -/* sorting the color table */
   926         -    *count = lines;
   927         -    qsort (table, lines, sizeof (struct colorTable), cmp_color_qsort);
   928    464       return table;
   929    465   }
   930    466   
   931    467   static int
   932    468   parseIntHeader (const char *row, const char *tag, int *value)
   933    469   {
   934    470   /* parsing an Integer value Header */
................................................................................
   968    504   	  *value = BYTE_ORDER_BIG;
   969    505   	  return 1;
   970    506         }
   971    507       return 0;
   972    508   }
   973    509   
   974    510   static int
   975         -fetch_scanline (int row, struct colorTable *color_table, int colors, FILE * asc,
          511  +match_color (struct colorTable *color_table, double value, unsigned char *red,
          512  +	     unsigned char *green, unsigned char *blue)
          513  +{
          514  +/* mapping a value into the corresponding color */
          515  +    struct colorTable *p = color_table;
          516  +    while (p)
          517  +      {
          518  +	  if (p->min == DBL_MAX)
          519  +	      return 0;
          520  +	  if (value >= p->min && value <= p->max)
          521  +	    {
          522  +		*red = p->red;
          523  +		*green = p->green;
          524  +		*blue = p->blue;
          525  +		return 1;
          526  +	    }
          527  +	  p++;
          528  +      }
          529  +    return 0;
          530  +}
          531  +
          532  +static int
          533  +fetch_scanline (int row, struct colorTable *color_table, FILE * asc,
   976    534   		unsigned char *raster, int columns, double nodata,
   977    535   		unsigned char no_red, unsigned char no_green,
   978    536   		unsigned char no_blue)
   979    537   {
   980    538   /* feeding a TIFF scanline from an ASCII Grid */
   981    539       int c;
   982    540       int cell = 0;
................................................................................
  1007    565   		  {
  1008    566   		      *p_raster++ = no_red;
  1009    567   		      *p_raster++ = no_green;
  1010    568   		      *p_raster++ = no_blue;
  1011    569   		  }
  1012    570   		else
  1013    571   		  {
  1014         -		      if (match_color
  1015         -			  (color_table, colors, value, &red, &green, &blue))
          572  +		      if (match_color (color_table, value, &red, &green, &blue))
  1016    573   			{
  1017    574   			    *p_raster++ = red;
  1018    575   			    *p_raster++ = green;
  1019    576   			    *p_raster++ = blue;
  1020    577   			}
  1021    578   		      else
  1022    579   			{
................................................................................
  1096    653       convert.int_value = 1;
  1097    654       if (convert.byte[0] == 0)
  1098    655   	return 0;
  1099    656       return 1;
  1100    657   }
  1101    658   
  1102    659   static int
  1103         -fetch_float_scanline (int row, struct colorTable *color_table, int colors,
          660  +fetch_float_scanline (int row, struct colorTable *color_table,
  1104    661   		      unsigned char *floats, unsigned char *raster, int columns,
  1105    662   		      double nodata, unsigned char no_red,
  1106    663   		      unsigned char no_green, unsigned char no_blue,
  1107    664   		      int byteorder)
  1108    665   {
  1109    666   /* feeding a TIFF scanline from a FLOAT Grid */
  1110    667       int cell = 0;
................................................................................
  1122    679   	    {
  1123    680   		*p_raster++ = no_red;
  1124    681   		*p_raster++ = no_green;
  1125    682   		*p_raster++ = no_blue;
  1126    683   	    }
  1127    684   	  else
  1128    685   	    {
  1129         -		if (match_color
  1130         -		    (color_table, colors, value, &red, &green, &blue))
          686  +		if (match_color (color_table, value, &red, &green, &blue))
  1131    687   		  {
  1132    688   		      *p_raster++ = red;
  1133    689   		      *p_raster++ = green;
  1134    690   		      *p_raster++ = blue;
  1135    691   		  }
  1136    692   		else
  1137    693   		  {
................................................................................
  1143    699   	    }
  1144    700   	  ptr += sizeof (float);
  1145    701         }
  1146    702       return 1;
  1147    703   }
  1148    704   
  1149    705   static void
  1150         -export_geoTiff_float (struct colorTable *color_table, int colors,
  1151         -		      const char *proj4text, const char *grid_path,
  1152         -		      const char *tiff_path, unsigned char no_red,
  1153         -		      unsigned char no_green, unsigned char no_blue,
  1154         -		      int verbose)
          706  +export_geoTiff_float (struct colorTable *color_table, const char *proj4text,
          707  +		      const char *grid_path, const char *tiff_path,
          708  +		      unsigned char no_red, unsigned char no_green,
          709  +		      unsigned char no_blue, int verbose)
  1155    710   {
  1156    711   /* exporting a FLOAT GRID as GeoTIFF */
  1157    712       TIFF *tiff = NULL;
  1158    713       GTIF *gtif = NULL;
  1159    714       int byteorder = BYTE_ORDER_NONE;
  1160    715       int c;
  1161    716       int row = 0;
................................................................................
  1301    856   	  if (rd != (sizeof (float) * ncols))
  1302    857   	    {
  1303    858   		printf ("*** Grid read error ***\n");
  1304    859   		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1305    860   		goto stop;
  1306    861   	    }
  1307    862   	  if (fetch_float_scanline
  1308         -	      (row + 1, color_table, colors, flt_buf, raster, ncols, nodata,
  1309         -	       no_red, no_green, no_blue, byteorder))
          863  +	      (row + 1, color_table, flt_buf, raster, ncols, nodata, no_red,
          864  +	       no_green, no_blue, byteorder))
  1310    865   	    {
  1311    866   		if (TIFFWriteScanline (tiff, raster, row, 0) < 0)
  1312    867   		  {
  1313    868   		      printf ("\tTIFF write error @ row=%d\n", row);
  1314    869   		      printf
  1315    870   			  ("An invalid GeoTIFF was generated ... aborting ...\n");
  1316    871   		      goto stop;
................................................................................
  1333    888   	free (raster);
  1334    889       if (flt_buf)
  1335    890   	free (flt_buf);
  1336    891       fclose (grid);
  1337    892   }
  1338    893   
  1339    894   static void
  1340         -export_geoTiff_ascii (struct colorTable *color_table, int colors,
  1341         -		      const char *proj4text, const char *grid_path,
  1342         -		      const char *tiff_path, unsigned char no_red,
  1343         -		      unsigned char no_green, unsigned char no_blue,
  1344         -		      int verbose)
          895  +export_geoTiff_ascii (struct colorTable *color_table, const char *proj4text,
          896  +		      const char *grid_path, const char *tiff_path,
          897  +		      unsigned char no_red, unsigned char no_green,
          898  +		      unsigned char no_blue, int verbose)
  1345    899   {
  1346    900   /* exporting an ASCII GRID as GeoTIFF */
  1347    901       TIFF *tiff = NULL;
  1348    902       GTIF *gtif = NULL;
  1349    903       int c;
  1350    904       int row = 0;
  1351    905       char buf[1024];
................................................................................
  1461   1015         {
  1462   1016   	  if (verbose)
  1463   1017   	    {
  1464   1018   		fprintf (stderr, "writing scanline %d of %d\n", row + 1, nrows);
  1465   1019   		fflush (stderr);
  1466   1020   	    }
  1467   1021   	  if (fetch_scanline
  1468         -	      (row + 1, color_table, colors, asc, raster, ncols, nodata, no_red,
         1022  +	      (row + 1, color_table, asc, raster, ncols, nodata, no_red,
  1469   1023   	       no_green, no_blue))
  1470   1024   	    {
  1471   1025   		if (TIFFWriteScanline (tiff, raster, row, 0) < 0)
  1472   1026   		  {
  1473   1027   		      printf ("\tTIFF write error @ row=%d\n", row);
  1474   1028   		      printf
  1475   1029   			  ("An invalid GeoTIFF was generated ... aborting ...\n");
................................................................................
  1490   1044       if (tiff)
  1491   1045   	XTIFFClose (tiff);
  1492   1046       if (raster)
  1493   1047   	free (raster);
  1494   1048       fclose (asc);
  1495   1049   }
  1496   1050   
  1497         -static int
  1498         -fetch_float_scanline_shaded (int row, unsigned char *floats, int columns,
  1499         -			     int byteorder, struct triple_scan *triplet)
  1500         -{
  1501         -/* feeding a TIFF scanline from a FLOAT Grid */
  1502         -    int cell = 0;
  1503         -    double value;
  1504         -    unsigned char *ptr = floats;
  1505         -    int endian_arch = check_endian_arch ();
  1506         -    for (cell = 0; cell < columns; cell++)
  1507         -      {
  1508         -	  value = fetch_float (ptr, byteorder, endian_arch);
  1509         -	  triple_store_cell (triplet, cell, value);
  1510         -	  ptr += sizeof (float);
  1511         -      }
  1512         -    return 1;
  1513         -}
  1514         -
  1515         -static void
  1516         -export_geoTiff_shaded_float (struct colorTable *color_table, int colors,
  1517         -			     const char *proj4text, const char *grid_path,
  1518         -			     const char *tiff_path, unsigned char no_red,
  1519         -			     unsigned char no_green, unsigned char no_blue,
  1520         -			     int mono_color, unsigned char mono_red,
  1521         -			     unsigned char mono_green, unsigned char mono_blue,
  1522         -			     double z_factor, double scale_factor,
  1523         -			     double azimuth, double altitude, int verbose)
  1524         -{
  1525         -/* exporting a FLOAT GRID as GeoTIFF */
  1526         -    TIFF *tiff = NULL;
  1527         -    GTIF *gtif = NULL;
  1528         -    int byteorder = BYTE_ORDER_NONE;
  1529         -    int c;
  1530         -    int row = 0;
  1531         -    char buf[1024];
  1532         -    char path[1024];
  1533         -    char *ptr = buf;
  1534         -    int err = 0;
  1535         -    int ncols = -1;
  1536         -    int nrows = -1;
  1537         -    double xllcorner = 0.0;
  1538         -    double yllcorner = 0.0;
  1539         -    double cellsize = 0.0;
  1540         -    double nodata = 0.0;
  1541         -    double tiepoint[6];
  1542         -    double pixsize[3];
  1543         -    struct triple_scan *triplet = NULL;
  1544         -    unsigned char *raster = NULL;
  1545         -    unsigned char *flt_buf = NULL;
  1546         -    size_t rd;
  1547         -    FILE *grid;
  1548         -
  1549         -/* parsing the Grid Header .hdr */
  1550         -    sprintf (path, "%s.hdr", grid_path);
  1551         -    grid = fopen (path, "rb");
  1552         -    if (!grid)
  1553         -      {
  1554         -	  printf ("Open error: %s\n", path);
  1555         -	  return;
  1556         -      }
  1557         -    while ((c = getc (grid)) != EOF)
  1558         -      {
  1559         -	  if (c == '\r')
  1560         -	    {
  1561         -		/* ignoring Return chars */
  1562         -		continue;
  1563         -	    }
  1564         -	  if (c == '\n')
  1565         -	    {
  1566         -		*ptr = '\0';
  1567         -		switch (row)
  1568         -		  {
  1569         -		  case 0:
  1570         -		      if (!parseIntHeader (buf, "ncols ", &ncols))
  1571         -			  err = 1;
  1572         -		      break;
  1573         -		  case 1:
  1574         -		      if (!parseIntHeader (buf, "nrows ", &nrows))
  1575         -			  err = 1;
  1576         -		      break;
  1577         -		  case 2:
  1578         -		      if (!parseDblHeader (buf, "xllcorner ", &xllcorner))
  1579         -			  err = 1;
  1580         -		      break;
  1581         -		  case 3:
  1582         -		      if (!parseDblHeader (buf, "yllcorner ", &yllcorner))
  1583         -			  err = 1;
  1584         -		      break;
  1585         -		  case 4:
  1586         -		      if (!parseDblHeader (buf, "cellsize ", &cellsize))
  1587         -			  err = 1;
  1588         -		      break;
  1589         -		  case 5:
  1590         -		      if (!parseDblHeader (buf, "NODATA_value ", &nodata))
  1591         -			  err = 1;
  1592         -		      break;
  1593         -		  case 6:
  1594         -		      if (!parseOrderHeader (buf, "byteorder ", &byteorder))
  1595         -			  err = 1;
  1596         -		      break;
  1597         -		  };
  1598         -		ptr = buf;
  1599         -		row++;
  1600         -		if (row == 7)
  1601         -		    break;
  1602         -		continue;
  1603         -	    }
  1604         -	  *ptr++ = c;
  1605         -      }
  1606         -    if (err)
  1607         -      {
  1608         -	  /* there was some error */
  1609         -	  printf ("Invalid FLOAT Grid Header format in: %s\n", path);
  1610         -	  goto stop;
  1611         -      }
  1612         -    fclose (grid);
  1613         -
  1614         -/* resizing CellSize */
  1615         -    cellsize = (cellsize * (double) ncols) / (double) (ncols - 2);
  1616         -
  1617         -/* parsing the Grid Cells .flt */
  1618         -    sprintf (path, "%s.flt", grid_path);
  1619         -    grid = fopen (path, "rb");
  1620         -    if (!grid)
  1621         -      {
  1622         -	  printf ("Open error: %s\n", path);
  1623         -	  return;
  1624         -      }
  1625         -/* creating the GeoTIFF file */
  1626         -    tiff = XTIFFOpen (tiff_path, "w");
  1627         -    if (!tiff)
  1628         -      {
  1629         -	  printf ("\tCould not open TIFF image '%s'\n", tiff_path);
  1630         -	  goto stop;
  1631         -      }
  1632         -    gtif = GTIFNew (tiff);
  1633         -    if (!gtif)
  1634         -      {
  1635         -	  printf ("\tCould not open GeoTIFF image '%s'\n", tiff_path);
  1636         -	  goto stop;
  1637         -      }
  1638         -
  1639         -/* writing the TIFF Tags */
  1640         -    TIFFSetField (tiff, TIFFTAG_IMAGEWIDTH, ncols - 2);
  1641         -    TIFFSetField (tiff, TIFFTAG_IMAGELENGTH, nrows - 2);
  1642         -    TIFFSetField (tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
  1643         -    TIFFSetField (tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
  1644         -    TIFFSetField (tiff, TIFFTAG_ROWSPERSTRIP, 1);
  1645         -    TIFFSetField (tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
  1646         -    TIFFSetField (tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
  1647         -    TIFFSetField (tiff, TIFFTAG_BITSPERSAMPLE, 8);
  1648         -    TIFFSetField (tiff, TIFFTAG_SAMPLESPERPIXEL, 3);
  1649         -
  1650         -/* writing the GeoTIFF Tags */
  1651         -    pixsize[0] = cellsize;
  1652         -    pixsize[1] = cellsize;
  1653         -    pixsize[2] = 0.0;
  1654         -    TIFFSetField (tiff, GTIFF_PIXELSCALE, 3, pixsize);
  1655         -    tiepoint[0] = 0.0;
  1656         -    tiepoint[1] = 0.0;
  1657         -    tiepoint[2] = 0.0;
  1658         -    tiepoint[3] = xllcorner;
  1659         -    tiepoint[4] = yllcorner + (cellsize * nrows);
  1660         -    tiepoint[5] = 0.0;
  1661         -    TIFFSetField (tiff, GTIFF_TIEPOINTS, 6, tiepoint);
  1662         -    GTIFSetFromProj4 (gtif, proj4text);
  1663         -    GTIFWriteKeys (gtif);
  1664         -    raster = malloc (ncols * 3);
  1665         -    flt_buf = malloc (sizeof (float) * ncols);
  1666         -
  1667         -/* initializing the TripleRow object */
  1668         -    triplet = triple_alloc (ncols);
  1669         -    triple_set_shaded_relief_params (triplet, z_factor, scale_factor, altitude,
  1670         -				     azimuth);
  1671         -    triple_set_monochrome_params (triplet, mono_color, mono_red, mono_green,
  1672         -				  mono_blue);
  1673         -    triple_set_no_data (triplet, nodata, no_red, no_green, no_blue);
  1674         -
  1675         -    for (row = 0; row < nrows; row++)
  1676         -      {
  1677         -	  if (verbose)
  1678         -	    {
  1679         -		fprintf (stderr, "writing scanline %d of %d\n", row + 1, nrows);
  1680         -		fflush (stderr);
  1681         -	    }
  1682         -	  rd = fread (flt_buf, 1, ncols * sizeof (float), grid);
  1683         -	  if (rd != (sizeof (float) * ncols))
  1684         -	    {
  1685         -		printf ("*** Grid read error ***\n");
  1686         -		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1687         -		goto stop;
  1688         -	    }
  1689         -	  if (fetch_float_scanline_shaded
  1690         -	      (row + 1, flt_buf, ncols, byteorder, triplet))
  1691         -	    {
  1692         -		if (triple_is_valid (triplet))
  1693         -		  {
  1694         -		      int ret = 1;
  1695         -		      if (!color_table)
  1696         -			  triple_shaded_relief (triplet, raster);
  1697         -		      else
  1698         -			  ret =
  1699         -			      triple_shaded_relief_color (color_table, colors,
  1700         -							  triplet, raster,
  1701         -							  row + 1);
  1702         -		      if (!ret)
  1703         -			  goto stop;
  1704         -		      if (TIFFWriteScanline (tiff, raster, row - 2, 0) < 0)
  1705         -			{
  1706         -			    printf ("\tTIFF write error @ row=%d\n", row);
  1707         -			    printf
  1708         -				("An invalid GeoTIFF was generated ... aborting ...\n");
  1709         -			    goto stop;
  1710         -			}
  1711         -		  }
  1712         -		triple_rotate (triplet);
  1713         -	    }
  1714         -	  else
  1715         -	    {
  1716         -		printf ("*** Grid read error ***\n");
  1717         -		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1718         -		goto stop;
  1719         -	    }
  1720         -      }
  1721         -
  1722         -  stop:
  1723         -    if (gtif)
  1724         -	GTIFFree (gtif);
  1725         -    if (tiff)
  1726         -	XTIFFClose (tiff);
  1727         -    if (raster)
  1728         -	free (raster);
  1729         -    if (flt_buf)
  1730         -	free (flt_buf);
  1731         -    fclose (grid);
  1732         -    if (triplet)
  1733         -	triple_free (triplet);
  1734         -}
  1735         -
  1736         -static int
  1737         -fetch_scanline_shaded (int row, FILE * asc, int columns,
  1738         -		       struct triple_scan *triplet)
  1739         -{
  1740         -/* feeding a TIFF scanline from an ASCII Grid */
  1741         -    int c;
  1742         -    int cell = 0;
  1743         -    char buf[1024];
  1744         -    char *ptr = buf;
  1745         -    double value;
  1746         -    while ((c = getc (asc)) != EOF)
  1747         -      {
  1748         -	  if (c == '\n')
  1749         -	      break;
  1750         -	  *ptr++ = c;
  1751         -	  if (c == ' ')
  1752         -	    {
  1753         -		/* value delimiter */
  1754         -		*ptr = '\0';
  1755         -		cell++;
  1756         -		if (cell > columns)
  1757         -		  {
  1758         -		      printf ("Grid row %d: exceding column\n", row);
  1759         -		      return 0;
  1760         -		  }
  1761         -		value = atof (buf);
  1762         -		triple_store_cell (triplet, cell, (float) value);
  1763         -		ptr = buf;
  1764         -	    }
  1765         -      }
  1766         -    return 1;
  1767         -}
  1768         -
  1769         -static void
  1770         -export_geoTiff_shaded_ascii (struct colorTable *color_table, int colors,
  1771         -			     const char *proj4text, const char *grid_path,
  1772         -			     const char *tiff_path, unsigned char no_red,
  1773         -			     unsigned char no_green, unsigned char no_blue,
  1774         -			     int mono_color, unsigned char mono_red,
  1775         -			     unsigned char mono_green, unsigned char mono_blue,
  1776         -			     double z_factor, double scale_factor,
  1777         -			     double azimuth, double altitude, int verbose)
  1778         -{
  1779         -/* exporting an ASCII GRID as GeoTIFF */
  1780         -    TIFF *tiff = NULL;
  1781         -    GTIF *gtif = NULL;
  1782         -    int c;
  1783         -    int row = 0;
  1784         -    char buf[1024];
  1785         -    char *ptr = buf;
  1786         -    int err = 0;
  1787         -    int ncols = -1;
  1788         -    int nrows = -1;
  1789         -    double xllcorner = 0.0;
  1790         -    double yllcorner = 0.0;
  1791         -    double cellsize = 0.0;
  1792         -    double nodata = 0.0;
  1793         -    double tiepoint[6];
  1794         -    double pixsize[3];
  1795         -    unsigned char *raster = NULL;
  1796         -    struct triple_scan *triplet = NULL;
  1797         -    FILE *asc = fopen (grid_path, "rb");
  1798         -    if (!asc)
  1799         -      {
  1800         -	  printf ("Open error: %s\n", grid_path);
  1801         -	  return;
  1802         -      }
  1803         -    while ((c = getc (asc)) != EOF)
  1804         -      {
  1805         -	  if (c == '\r')
  1806         -	    {
  1807         -		/* ignoring Return chars */
  1808         -		continue;
  1809         -	    }
  1810         -	  if (c == '\n')
  1811         -	    {
  1812         -		*ptr = '\0';
  1813         -		switch (row)
  1814         -		  {
  1815         -		  case 0:
  1816         -		      if (!parseIntHeader (buf, "ncols ", &ncols))
  1817         -			  err = 1;
  1818         -		      break;
  1819         -		  case 1:
  1820         -		      if (!parseIntHeader (buf, "nrows ", &nrows))
  1821         -			  err = 1;
  1822         -		      break;
  1823         -		  case 2:
  1824         -		      if (!parseDblHeader (buf, "xllcorner ", &xllcorner))
  1825         -			  err = 1;
  1826         -		      break;
  1827         -		  case 3:
  1828         -		      if (!parseDblHeader (buf, "yllcorner ", &yllcorner))
  1829         -			  err = 1;
  1830         -		      break;
  1831         -		  case 4:
  1832         -		      if (!parseDblHeader (buf, "cellsize ", &cellsize))
  1833         -			  err = 1;
  1834         -		      break;
  1835         -		  case 5:
  1836         -		      if (!parseDblHeader (buf, "NODATA_value ", &nodata))
  1837         -			  err = 1;
  1838         -		      break;
  1839         -		  };
  1840         -		ptr = buf;
  1841         -		row++;
  1842         -		if (row == 6)
  1843         -		    break;
  1844         -		continue;
  1845         -	    }
  1846         -	  *ptr++ = c;
  1847         -      }
  1848         -    if (err)
  1849         -      {
  1850         -	  /* there was some error */
  1851         -	  printf ("Invalid ASCII Grid format in: %s\n", grid_path);
  1852         -	  goto stop;
  1853         -      }
  1854         -
  1855         -/* resizing CellSize */
  1856         -    cellsize = (cellsize * (double) ncols) / (double) (ncols - 2);
  1857         -
  1858         -/* creating the GeoTIFF file */
  1859         -    tiff = XTIFFOpen (tiff_path, "w");
  1860         -    if (!tiff)
  1861         -      {
  1862         -	  printf ("\tCould not open TIFF image '%s'\n", tiff_path);
  1863         -	  goto stop;
  1864         -      }
  1865         -    gtif = GTIFNew (tiff);
  1866         -    if (!gtif)
  1867         -      {
  1868         -	  printf ("\tCould not open GeoTIFF image '%s'\n", tiff_path);
  1869         -	  goto stop;
  1870         -      }
  1871         -
  1872         -/* writing the TIFF Tags */
  1873         -    TIFFSetField (tiff, TIFFTAG_IMAGEWIDTH, ncols - 2);
  1874         -    TIFFSetField (tiff, TIFFTAG_IMAGELENGTH, nrows - 2);
  1875         -    TIFFSetField (tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
  1876         -    TIFFSetField (tiff, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
  1877         -    TIFFSetField (tiff, TIFFTAG_ROWSPERSTRIP, 1);
  1878         -    TIFFSetField (tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
  1879         -    TIFFSetField (tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
  1880         -    TIFFSetField (tiff, TIFFTAG_BITSPERSAMPLE, 8);
  1881         -    TIFFSetField (tiff, TIFFTAG_SAMPLESPERPIXEL, 3);
  1882         -
  1883         -/* writing the GeoTIFF Tags */
  1884         -    pixsize[0] = cellsize;
  1885         -    pixsize[1] = cellsize;
  1886         -    pixsize[2] = 0.0;
  1887         -    TIFFSetField (tiff, GTIFF_PIXELSCALE, 3, pixsize);
  1888         -    tiepoint[0] = 0.0;
  1889         -    tiepoint[1] = 0.0;
  1890         -    tiepoint[2] = 0.0;
  1891         -    tiepoint[3] = xllcorner;
  1892         -    tiepoint[4] = yllcorner + (cellsize * nrows);
  1893         -    tiepoint[5] = 0.0;
  1894         -    TIFFSetField (tiff, GTIFF_TIEPOINTS, 6, tiepoint);
  1895         -    GTIFSetFromProj4 (gtif, proj4text);
  1896         -    GTIFWriteKeys (gtif);
  1897         -    raster = malloc (ncols * 3);
  1898         -
  1899         -/* initializing the TripleRow object */
  1900         -    triplet = triple_alloc (ncols);
  1901         -    triple_set_shaded_relief_params (triplet, z_factor, scale_factor, altitude,
  1902         -				     azimuth);
  1903         -    triple_set_monochrome_params (triplet, mono_color, mono_red, mono_green,
  1904         -				  mono_blue);
  1905         -    triple_set_no_data (triplet, nodata, no_red, no_green, no_blue);
  1906         -
  1907         -    for (row = 0; row < nrows; row++)
  1908         -      {
  1909         -	  if (verbose)
  1910         -	    {
  1911         -		fprintf (stderr, "writing scanline %d of %d\n", row + 1, nrows);
  1912         -		fflush (stderr);
  1913         -	    }
  1914         -	  if (fetch_scanline_shaded (row + 1, asc, ncols, triplet))
  1915         -	    {
  1916         -		if (triple_is_valid (triplet))
  1917         -		  {
  1918         -		      int ret = 1;
  1919         -		      if (!color_table)
  1920         -			  triple_shaded_relief (triplet, raster);
  1921         -		      else
  1922         -			  ret =
  1923         -			      triple_shaded_relief_color (color_table, colors,
  1924         -							  triplet, raster,
  1925         -							  row + 1);
  1926         -		      if (!ret)
  1927         -			  goto stop;
  1928         -		      if (TIFFWriteScanline (tiff, raster, row - 2, 0) < 0)
  1929         -			{
  1930         -			    printf ("\tTIFF write error @ row=%d\n", row);
  1931         -			    printf
  1932         -				("An invalid GeoTIFF was generated ... aborting ...\n");
  1933         -			    goto stop;
  1934         -			}
  1935         -		  }
  1936         -		triple_rotate (triplet);
  1937         -	    }
  1938         -	  else
  1939         -	    {
  1940         -		printf ("*** Grid read error ***\n");
  1941         -		printf ("An invalid GeoTIFF was generated ... aborting ...\n");
  1942         -		goto stop;
  1943         -	    }
  1944         -      }
  1945         -
  1946         -  stop:
  1947         -    if (gtif)
  1948         -	GTIFFree (gtif);
  1949         -    if (tiff)
  1950         -	XTIFFClose (tiff);
  1951         -    if (raster)
  1952         -	free (raster);
  1953         -    fclose (asc);
  1954         -    if (triplet)
  1955         -	triple_free (triplet);
  1956         -}
  1957         -
  1958   1051   static void
  1959   1052   do_help ()
  1960   1053   {
  1961   1054   /* printing the argument list */
  1962   1055       fprintf (stderr, "\n\nusage: rasterlite_grid ARGLIST\n");
  1963   1056       fprintf (stderr,
  1964   1057   	     "==============================================================\n");
................................................................................
  1971   1064       fprintf (stderr,
  1972   1065   	     "-t or --tiff-path     pathname    the GeoTIFF path (output)\n");
  1973   1066       fprintf (stderr,
  1974   1067   	     "-p or --proj4text     proj4text   the PROJ.4 parameters\n");
  1975   1068       fprintf (stderr, "-f or --grid-format   grid-type   [ASCII | FLOAT]\n");
  1976   1069       fprintf (stderr,
  1977   1070   	     "-n or --nodata-color  0xRRGGBB    [default = 0x000000]\n");
  1978         -    fprintf (stderr, "-v or --verbose                   verbose output\n\n");
  1979         -    fprintf (stderr, "Shaded Relief specific arguments:\n");
  1980         -    fprintf (stderr, "---------------------------------\n");
  1981         -    fprintf (stderr,
  1982         -	     "-sr or --shaded-relief            *disabled by default*\n");
  1983         -    fprintf (stderr, "-m or --monochrome    0xRRGGBB    [default = none]\n");
  1984         -    fprintf (stderr, "-z or --z-factor      numeric     [default = 1.0]\n");
  1985         -    fprintf (stderr, "-s or --scale-factor  numeric     [default = 1.0]\n");
  1986         -    fprintf (stderr, "-az or --azimuth      numeric     [default = 315.0]\n");
  1987         -    fprintf (stderr, "-al or --altitude     numeric     [default = 45.0]\n\n");
  1988         -    fprintf (stderr, "Please note: --monochrome and --color-path are\n");
  1989         -    fprintf (stderr, "mutually exclusive options\n");
         1071  +    fprintf (stderr, "-v or --verbose                   verbose output\n");
  1990   1072   }
  1991   1073   
  1992   1074   int
  1993   1075   main (int argc, char *argv[])
  1994   1076   {
  1995   1077   /* the MAIN function simply perform arguments checking */
  1996   1078       int i;
................................................................................
  2003   1085       int verbose = 0;
  2004   1086       int error = 0;
  2005   1087       struct colorTable *color_table = NULL;
  2006   1088       unsigned char no_red = 0;
  2007   1089       unsigned char no_green = 0;
  2008   1090       unsigned char no_blue = 0;
  2009   1091       char error_nodata_color[1024];
  2010         -    int shaded_relief = 0;
  2011         -    int mono_color = 0;
  2012         -    unsigned char mono_red = 0;
  2013         -    unsigned char mono_green = 0;
  2014         -    unsigned char mono_blue = 0;
  2015         -    char error_mono_color[1024];
  2016         -    double z_factor = 1.0;
  2017         -    double scale_factor = 1.0;
  2018         -    double azimuth = 315.0;
  2019         -    double altitude = 45.0;
  2020         -    int colors;
  2021   1092       *error_nodata_color = '\0';
  2022         -    *error_mono_color = '\0';
  2023   1093       for (i = 1; i < argc; i++)
  2024   1094         {
  2025   1095   	  /* parsing the invocation arguments */
  2026   1096   	  if (next_arg != ARG_NONE)
  2027   1097   	    {
  2028   1098   		switch (next_arg)
  2029   1099   		  {
................................................................................
  2045   1115   		      if (strcasecmp (argv[i], "FLOAT") == 0)
  2046   1116   			  grid_type = FLOAT_GRID;
  2047   1117   		      break;
  2048   1118   		  case ARG_NODATA_COLOR:
  2049   1119   		      if (!parse_rgb (argv[i], &no_red, &no_green, &no_blue))
  2050   1120   			  strcpy (error_nodata_color, argv[i]);
  2051   1121   		      break;
  2052         -		  case ARG_MONO_COLOR:
  2053         -		      if (!parse_rgb
  2054         -			  (argv[i], &mono_red, &mono_green, &mono_blue))
  2055         -			  strcpy (error_mono_color, argv[i]);
  2056         -		      else
  2057         -			  mono_color = 1;
  2058         -		      break;
  2059         -		  case ARG_Z_FACTOR:
  2060         -		      z_factor = atof (argv[i]);
  2061         -		      break;
  2062         -		  case ARG_SCALE:
  2063         -		      scale_factor = atof (argv[i]);
  2064         -		      break;
  2065         -		  case ARG_AZIMUTH:
  2066         -		      azimuth = atof (argv[i]);
  2067         -		      break;
  2068         -		  case ARG_ALTITUDE:
  2069         -		      altitude = atof (argv[i]);
  2070         -		      break;
  2071   1122   		  };
  2072   1123   		next_arg = ARG_NONE;
  2073   1124   		continue;
  2074   1125   	    }
  2075   1126   	  if (strcasecmp (argv[i], "--help") == 0
  2076   1127   	      || strcmp (argv[i], "-?") == 0)
  2077   1128   	    {
................................................................................
  2144   1195   		continue;
  2145   1196   	    }
  2146   1197   	  if (strcmp (argv[i], "-v") == 0)
  2147   1198   	    {
  2148   1199   		verbose = 1;
  2149   1200   		continue;
  2150   1201   	    }
  2151         -	  if (strcasecmp (argv[i], "--shared-relief") == 0)
  2152         -	    {
  2153         -		shaded_relief = 1;
  2154         -		continue;
  2155         -	    }
  2156         -	  if (strcmp (argv[i], "-sr") == 0)
  2157         -	    {
  2158         -		shaded_relief = 1;
  2159         -		continue;
  2160         -	    }
  2161         -	  if (strcmp (argv[i], "-m") == 0)
  2162         -	    {
  2163         -		next_arg = ARG_MONO_COLOR;
  2164         -		continue;
  2165         -	    }
  2166         -	  if (strcasecmp (argv[i], "--monochrome") == 0)
  2167         -	    {
  2168         -		next_arg = ARG_MONO_COLOR;
  2169         -		continue;
  2170         -	    }
  2171         -	  if (strcmp (argv[i], "-z") == 0)
  2172         -	    {
  2173         -		next_arg = ARG_Z_FACTOR;
  2174         -		continue;
  2175         -	    }
  2176         -	  if (strcasecmp (argv[i], "--z-factor") == 0)
  2177         -	    {
  2178         -		next_arg = ARG_Z_FACTOR;
  2179         -		continue;
  2180         -	    }
  2181         -	  if (strcmp (argv[i], "-s") == 0)
  2182         -	    {
  2183         -		next_arg = ARG_SCALE;
  2184         -		continue;
  2185         -	    }
  2186         -	  if (strcasecmp (argv[i], "--scale-factor") == 0)
  2187         -	    {
  2188         -		next_arg = ARG_SCALE;
  2189         -		continue;
  2190         -	    }
  2191         -	  if (strcmp (argv[i], "-az") == 0)
  2192         -	    {
  2193         -		next_arg = ARG_AZIMUTH;
  2194         -		continue;
  2195         -	    }
  2196         -	  if (strcasecmp (argv[i], "--azimuth") == 0)
  2197         -	    {
  2198         -		next_arg = ARG_AZIMUTH;
  2199         -		continue;
  2200         -	    }
  2201         -	  if (strcmp (argv[i], "-al") == 0)
  2202         -	    {
  2203         -		next_arg = ARG_ALTITUDE;
  2204         -		continue;
  2205         -	    }
  2206         -	  if (strcasecmp (argv[i], "--altitude") == 0)
  2207         -	    {
  2208         -		next_arg = ARG_ALTITUDE;
  2209         -		continue;
  2210         -	    }
  2211   1202   	  fprintf (stderr, "unknown argument: %s\n", argv[i]);
  2212   1203   	  error = 1;
  2213   1204         }
  2214   1205       if (error)
  2215   1206         {
  2216   1207   	  do_help ();
  2217   1208   	  return -1;
................................................................................
  2219   1210   /* checking the arguments */
  2220   1211       if (!grid_path)
  2221   1212         {
  2222   1213   	  fprintf (stderr,
  2223   1214   		   "did you forget setting the --grid-path argument ?\n");
  2224   1215   	  error = 1;
  2225   1216         }
  2226         -    if (!shaded_relief)
         1217  +    if (!color_path)
  2227   1218         {
  2228         -	  if (!color_path)
  2229         -	    {
  2230         -		fprintf (stderr,
  2231         -			 "did you forget setting the --color-path argument ?\n");
  2232         -		error = 1;
  2233         -	    }
         1219  +	  fprintf (stderr,
         1220  +		   "did you forget setting the --color-path argument ?\n");
         1221  +	  error = 1;
  2234   1222         }
  2235   1223       if (!tiff_path)
  2236   1224         {
  2237   1225   	  fprintf (stderr,
  2238   1226   		   "did you forget setting the --tiff-path argument ?\n");
  2239   1227   	  error = 1;
  2240   1228         }
................................................................................
  2251   1239   	  error = 1;
  2252   1240         }
  2253   1241       if (strlen (error_nodata_color))
  2254   1242         {
  2255   1243   	  printf ("invalid NODATA color '%s'\n", error_nodata_color);
  2256   1244   	  error = 1;
  2257   1245         }
  2258         -    if (strlen (error_mono_color))
  2259         -      {
  2260         -	  printf ("invalid Shaded Relief Monochrome color '%s'\n",
  2261         -		  error_mono_color);
  2262         -	  error = 1;
  2263         -      }
  2264         -    if (color_path && mono_color)
  2265         -      {
  2266         -	  printf ("--monochrome and --color-path are mutually exclusive\n");
  2267         -	  error = 1;
  2268         -      }
  2269   1246       if (error)
  2270   1247         {
  2271   1248   	  do_help ();
  2272   1249   	  return -1;
  2273   1250         }
  2274   1251       printf ("=====================================================\n");
  2275   1252       printf ("             Arguments Summary\n");
  2276   1253       printf ("=====================================================\n");
  2277   1254       printf ("Grid       pathname: '%s'\n", grid_path);
  2278         -    if (color_path)
  2279         -	printf ("ColorTable pathname: '%s'\n", color_path);
         1255  +    printf ("ColorTable pathname: '%s'\n", color_path);
  2280   1256       printf ("GeoTIFF    pathname: '%s'\n", tiff_path);
  2281   1257       printf ("PROJ.4       string: '%s'\n", proj4text);
  2282         -    printf ("NoData        color: 0x%02x%02x%02x\n", no_red, no_green, no_blue);
  2283   1258       switch (grid_type)
  2284   1259         {
  2285   1260         case ASCII_GRID:
  2286   1261   	  printf ("Grid Format: ASCII\n");
  2287   1262   	  break;
  2288   1263         case FLOAT_GRID:
  2289   1264   	  printf ("Grid Format: FLOAT\n");
  2290   1265   	  break;
  2291   1266         default:
  2292   1267   	  printf ("Grid Format: UNKNOWN\n");
  2293   1268   	  break;
  2294   1269         }
  2295         -    if (shaded_relief)
         1270  +    printf ("=====================================================\n\n");
         1271  +    color_table = parse_color_table (color_path);
         1272  +    if (!color_table)
  2296   1273         {
  2297         -	  printf ("\n           Shaded Relief arguments:\n");
  2298         -	  printf ("-----------------------------------------------------\n");
  2299         -	  printf ("Z-factor     : %1.4f\n", z_factor);
  2300         -	  printf ("Scale-factor : %1.4f\n", scale_factor);
  2301         -	  printf ("Azimuth      : %1.4f\n", azimuth);
  2302         -	  printf ("Altitude     : %1.4f\n", altitude);
  2303         -	  if (mono_color)
  2304         -	      printf ("Monochrome   : 0x%02x%02x%02x\n", mono_red, mono_green,
  2305         -		      mono_blue);
         1274  +	  fprintf (stderr, "\n*********** Invalid Color Table\n");
         1275  +	  return -1;
  2306   1276         }
  2307         -    printf ("=====================================================\n\n");
  2308         -    if (color_path)
  2309         -      {
  2310         -	  color_table = parse_color_table (color_path, &colors);
  2311         -	  if (!color_table)
  2312         -	    {
  2313         -		fprintf (stderr, "\n*********** Invalid Color Table\n");
  2314         -		return -1;
  2315         -	    }
  2316         -      }
  2317         -    if (shaded_relief)
  2318         -      {
  2319         -	  if (grid_type == FLOAT_GRID)
  2320         -	      export_geoTiff_shaded_float (color_table, colors, proj4text,
  2321         -					   grid_path, tiff_path, no_red,
  2322         -					   no_green, no_blue, mono_color,
  2323         -					   mono_red, mono_green, mono_blue,
  2324         -					   z_factor, scale_factor, azimuth,
  2325         -					   altitude, verbose);
  2326         -	  else
  2327         -	      export_geoTiff_shaded_ascii (color_table, colors, proj4text,
  2328         -					   grid_path, tiff_path, no_red,
  2329         -					   no_green, no_blue, mono_color,
  2330         -					   mono_red, mono_green, mono_blue,
  2331         -					   z_factor, scale_factor, azimuth,
  2332         -					   altitude, verbose);
  2333         -      }
         1277  +    if (grid_type == FLOAT_GRID)
         1278  +	export_geoTiff_float (color_table, proj4text, grid_path, tiff_path,
         1279  +			      no_red, no_green, no_blue, verbose);
  2334   1280       else
  2335         -      {
  2336         -	  if (grid_type == FLOAT_GRID)
  2337         -	      export_geoTiff_float (color_table, colors, proj4text, grid_path,
  2338         -				    tiff_path, no_red, no_green, no_blue,
  2339         -				    verbose);
  2340         -	  else
  2341         -	      export_geoTiff_ascii (color_table, colors, proj4text, grid_path,
  2342         -				    tiff_path, no_red, no_green, no_blue,
  2343         -				    verbose);
  2344         -      }
  2345         -    if (color_table)
  2346         -	free (color_table);
         1281  +	export_geoTiff_ascii (color_table, proj4text, grid_path, tiff_path,
         1282  +			      no_red, no_green, no_blue, verbose);
         1283  +    free (color_table);
  2347   1284       return 0;
  2348   1285   }

Changes to src/rasterlite_load.c.

     1      1   /* 
     2      2   / rasterlite_load.c
     3      3   /
     4      4   / a tool for uploading GeoTIFF rasters into a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13     13   /    it under the terms of the GNU General Public License as published by
................................................................................
    26     26   
    27     27   #include <stdlib.h>
    28     28   #include <stdio.h>
    29     29   #include <string.h>
    30     30   #include <errno.h>
    31     31   #include <sys/types.h>
    32     32   
    33         -#include "rasterlite_tiff_hdrs.h"
           33  +#include <geotiff.h>
           34  +#include <xtiffio.h>
           35  +#include <geo_normalize.h>
           36  +#include <geovalues.h>
    34     37   #include <tiffio.h>
    35     38   
    36     39   #if defined(_WIN32) && !defined(__MINGW32__)
    37     40   #include <io.h>
    38     41   #include <direct.h>
    39     42   #else
    40     43   #include <dirent.h>
    41     44   #endif
    42     45   
    43         -#ifdef SPATIALITE_AMALGAMATION
    44     46   #include <spatialite/sqlite3.h>
    45         -#else
    46         -#include <sqlite3.h>
    47         -#endif
    48         -
    49     47   #include <spatialite/gaiaexif.h>
    50     48   #include <spatialite/gaiageo.h>
    51     49   #include <spatialite.h>
    52     50   
    53     51   #include "rasterlite.h"
    54     52   #include "rasterlite_internals.h"
    55     53   
................................................................................
    64     62   #define ARG_FILE			4
    65     63   #define ARG_TILE_SIZE		5
    66     64   #define ARG_IMAGE_TYPE		6
    67     65   #define ARG_QUALITY_FACTOR	7
    68     66   #define ARG_EPSG_CODE		8
    69     67   
    70     68   static int
    71         -read_by_tile (TIFF * tif, rasterliteImagePtr img, struct geo_info *infos,
           69  +read_by_tile (TIFF * tif, rasterliteImagePrt img, struct geo_info *infos,
    72     70   	      int baseVert, int baseHorz)
    73     71   {
    74     72   /* reading from a TIFF using TILES */
    75     73       uint32 *raster = NULL;
    76     74       int x;
    77     75       int y;
    78     76       int img_x;
................................................................................
   171    169     error:
   172    170       if (raster)
   173    171   	free (raster);
   174    172       return 0;
   175    173   }
   176    174   
   177    175   static int
   178         -read_by_strip (TIFF * tif, rasterliteImagePtr img, struct geo_info *infos,
          176  +read_by_strip (TIFF * tif, rasterliteImagePrt img, struct geo_info *infos,
   179    177   	       int baseVert, int baseHorz)
   180    178   {
   181    179   /* reading from a TIFF using STRIPS */
   182    180       uint32 *raster = NULL;
   183    181       int x;
   184    182       int y;
   185    183       int img_y;
................................................................................
   264    262   /* accessing the TIFF by strips or tiles */
   265    263       int retval = 0;
   266    264       void *image;
   267    265       int image_size;
   268    266       int ret;
   269    267       double xx;
   270    268       double yy;
   271         -    rasterliteImagePtr img = NULL;
          269  +    rasterliteImagePrt img = NULL;
   272    270       gaiaPolygonPtr polyg;
   273    271       tile->geometry = gaiaAllocGeomColl ();
   274    272       tile->tileNo = tileNo;
   275    273   
   276    274   /* computing actual tile dims */
   277    275       tile->raster_horz = infos->tile_width;
   278    276       tile->raster_vert = infos->tile_height;
................................................................................
   399    397   	  /* compressing the section image as TIFF RGB */
   400    398   	  image = image_to_tiff_rgb (img, &image_size);
   401    399   	  if (!image)
   402    400   	    {
   403    401   		printf ("TIFF RGB compression error\n");
   404    402   		goto stop;
   405    403   	    }
          404  +      }
          405  +    else if (infos->image_type == IMAGE_WAVELET_BW)
          406  +      {
          407  +	  /* compressing the section image as WAVELET GRAYSCALE */
          408  +	  image =
          409  +	      image_to_wavelet_grayscale (img, &image_size,
          410  +					  infos->quality_factor);
          411  +	  if (!image)
          412  +	    {
          413  +		printf ("WAVELET compression error\n");
          414  +		goto stop;
          415  +	    }
          416  +      }
          417  +    else if (infos->image_type == IMAGE_WAVELET_RGB)
          418  +      {
          419  +	  /* compressing the section image as WAVELET RGB */
          420  +	  image = image_to_wavelet (img, &image_size, infos->quality_factor);
          421  +	  if (!image)
          422  +	    {
          423  +		printf ("WAVELET compression error\n");
          424  +		goto stop;
          425  +	    }
   406    426         }
   407    427       else if (infos->image_type == IMAGE_JPEG_BW)
   408    428         {
   409    429   	  /* compressing the section image as JPEG GRAYSCALE */
   410    430   	  image =
   411    431   	      image_to_jpeg_grayscale (img, &image_size, infos->quality_factor);
   412    432   	  if (!image)
................................................................................
   824    844   		actual_format = (const char *) "GIF";
   825    845   		infos.image_type = IMAGE_GIF_PALETTE;
   826    846   	    }
   827    847         }
   828    848       if (bits_per_sample == 8 && samples_per_pixel == 1 && photometric < 2)
   829    849         {
   830    850   	  colorspace_name = (const char *) "GrayScale - 256 levels";
   831         -	  format_hint = (const char *) "JPEG / PNG / TIFF";
          851  +	  format_hint = (const char *) "JPEG / WAVELET / PNG / TIFF";
   832    852   	  if (image_type == GAIA_TIFF_BLOB)
   833    853   	    {
   834    854   		strcpy (dummy, "TIFF [GRAYSCALE]");
   835    855   		infos.image_type = IMAGE_TIFF_GRAYSCALE;
   836    856   	    }
   837    857   	  else if (image_type == GAIA_PNG_BLOB)
   838    858   	    {
   839    859   		strcpy (dummy, "PNG [GRAYSCALE]");
   840    860   		infos.image_type = IMAGE_PNG_GRAYSCALE;
          861  +	    }
          862  +	  else if (image_type == IMAGE_WAVELET_RGB)
          863  +	    {
          864  +		sprintf (dummy, "WAVELET [GRAYSCALE] compression ratio 1:%d",
          865  +			 quality_factor);
          866  +		infos.image_type = IMAGE_WAVELET_BW;
   841    867   	    }
   842    868   	  else
   843    869   	    {
   844    870   		sprintf (dummy, "JPEG [GRAYSCALE] quality=%d", quality_factor);
   845    871   		infos.image_type = IMAGE_JPEG_BW;
   846    872   	    }
   847    873   	  actual_format = (const char *) dummy;
   848    874         }
   849    875       if (samples_per_pixel >= 3)
   850    876         {
   851    877   	  colorspace_name = (const char *) "RGB - TrueColor";
   852         -	  format_hint = (const char *) "JPEG / TIFF";
          878  +	  format_hint = (const char *) "JPEG / WAVELET / TIFF";
   853    879   	  if (image_type == GAIA_TIFF_BLOB)
   854    880   	    {
   855    881   		sprintf (dummy, "TIFF [RGB]");
   856    882   		infos.image_type = IMAGE_TIFF_RGB;
   857    883   	    }
   858    884   	  else if (image_type == GAIA_PNG_BLOB)
   859    885   	    {
   860    886   		sprintf (dummy, "PNG [RGB]");
   861    887   		infos.image_type = IMAGE_PNG_RGB;
          888  +	    }
          889  +	  else if (image_type == GAIA_WAVELET_BLOB)
          890  +	    {
          891  +		sprintf (dummy, "WAVELET [RGB] compression ratio 1:%d",
          892  +			 quality_factor);
          893  +		infos.image_type = IMAGE_WAVELET_RGB;
   862    894   	    }
   863    895   	  else
   864    896   	    {
   865    897   		sprintf (dummy, "JPEG [RGB] quality=%d", quality_factor);
   866    898   		infos.image_type = IMAGE_JPEG_RGB;
   867    899   	    }
   868    900   	  actual_format = (const char *) dummy;
................................................................................
   943    975   	  compression_name = (const char *) "JPEG-2000";
   944    976   	  break;
   945    977         default:
   946    978   	  compression_name = (const char *) "UNKNOWN";
   947    979   	  break;
   948    980         };
   949    981   /* retrieving the EPSG code */
   950         -    infos.epsg = definition.PCS;
          982  +    infos.epsg = definition.GCS;
   951    983   /* computing the corners coords */
   952    984       cx = 0.0;
   953    985       cy = 0.0;
   954    986       GTIFImageToPCS (gtif, &cx, &cy);
   955    987       infos.upper_left_x = cx;
   956    988       infos.upper_left_y = cy;
   957    989       cx = 0.0;
................................................................................
  1171   1203       if (ret != SQLITE_OK)
  1172   1204         {
  1173   1205   	  printf ("COMMIT TRANSACTION error: %s\n", sql_err);
  1174   1206   	  sqlite3_free (sql_err);
  1175   1207   	  goto stop;
  1176   1208         }
  1177   1209   
  1178         -    if (tif)
  1179         -	XTIFFClose (tif);
  1180         -    if (gtif)
  1181         -	GTIFFree (gtif);
  1182   1210       for (i = 0; i < NTILES; i++)
  1183   1211         {
  1184   1212   	  tile = &(infos.tiles[i]);
  1185   1213   	  if (tile->geometry)
  1186   1214   	      gaiaFreeGeomColl (tile->geometry);
  1187   1215         }
  1188   1216   
................................................................................
  1407   1435   	     "-D or --dir         dir_path      the DIR path containing GeoTIFF files\n");
  1408   1436       fprintf (stderr,
  1409   1437   	     "-f or --file        file_name     a single GeoTIFF file\n");
  1410   1438       fprintf (stderr, "-s or --tile-size   num           [default = 512]\n");
  1411   1439       fprintf (stderr,
  1412   1440   	     "-e or --epsg-code   num           [optional: EPSG code]\n");
  1413   1441       fprintf (stderr,
  1414         -	     "-i or --image-type  type          [JPEG|PNG|GIF|TIFF]\n");
         1442  +	     "-i or --image-type  type          [JPEG|PNG|GIF|TIFF|WAVELET]\n");
  1415   1443       fprintf (stderr,
  1416         -	     "-q or --quality     num           [default = 75(JPEG)]\n");
         1444  +	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
  1417   1445   }
  1418   1446   
  1419   1447   int
  1420   1448   main (int argc, char *argv[])
  1421   1449   {
  1422   1450   /* the MAIN function simply perform arguments checking */
  1423   1451       sqlite3 *handle;
................................................................................
  1466   1494   			  image_type = GAIA_JPEG_BLOB;
  1467   1495   		      if (strcasecmp (argv[i], "PNG") == 0)
  1468   1496   			  image_type = GAIA_PNG_BLOB;
  1469   1497   		      if (strcasecmp (argv[i], "GIF") == 0)
  1470   1498   			  image_type = GAIA_GIF_BLOB;
  1471   1499   		      if (strcasecmp (argv[i], "TIFF") == 0)
  1472   1500   			  image_type = GAIA_TIFF_BLOB;
         1501  +		      if (strcasecmp (argv[i], "WAVELET") == 0)
         1502  +			  image_type = GAIA_WAVELET_BLOB;
  1473   1503   		      break;
  1474   1504   		  case ARG_QUALITY_FACTOR:
  1475   1505   		      quality_factor = atoi (argv[i]);
  1476   1506   		      break;
  1477   1507   		  case ARG_EPSG_CODE:
  1478   1508   		      epsg_code = atoi (argv[i]);
  1479   1509   		      break;
................................................................................
  1632   1662   	  /* normalizing the quality factor */
  1633   1663   	  if (quality_factor == -999999)
  1634   1664   	      quality_factor = 75;
  1635   1665   	  if (quality_factor < 10)
  1636   1666   	      quality_factor = 10;
  1637   1667   	  if (quality_factor > 90)
  1638   1668   	      quality_factor = 90;
         1669  +      }
         1670  +    if (image_type == GAIA_WAVELET_BLOB)
         1671  +      {
         1672  +	  /* normalizing the commpression factor */
         1673  +	  if (quality_factor == -999999)
         1674  +	      quality_factor = 25;
         1675  +	  if (quality_factor < 10)
         1676  +	      quality_factor = 10;
         1677  +	  if (quality_factor > 200)
         1678  +	      quality_factor = 200;
  1639   1679         }
  1640   1680       printf ("=====================================================\n");
  1641   1681       printf ("             Arguments Summary\n");
  1642   1682       printf ("=====================================================\n");
  1643   1683       if (test_mode)
  1644   1684         {
  1645   1685   	  printf ("TEST mode: no actual action will be performed\n");
................................................................................
  1668   1708   	  printf ("Tile image type: PNG\n");
  1669   1709   	  break;
  1670   1710         case GAIA_GIF_BLOB:
  1671   1711   	  printf ("Tile image type: GIF\n");
  1672   1712   	  break;
  1673   1713         case GAIA_TIFF_BLOB:
  1674   1714   	  printf ("Tile image type: TIFF\n");
         1715  +	  break;
         1716  +      case GAIA_WAVELET_BLOB:
         1717  +	  printf ("Tile image type: WAVELET compression ratio 1:%d\n",
         1718  +		  quality_factor);
  1675   1719   	  break;
  1676   1720         default:
  1677   1721   	  printf ("Tile image type: UNKNOWN\n");
  1678   1722   	  break;
  1679   1723         };
  1680   1724       printf ("=====================================================\n\n");
  1681   1725       if (!test_mode)

Changes to src/rasterlite_pyramid.c.

     1      1   /* 
     2      2   / rasterlite_pyramid.c
     3      3   /
     4      4   / a tool building raster pyramids into a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13     13   /    it under the terms of the GNU General Public License as published by
................................................................................
    27     27   #include <stdlib.h>
    28     28   #include <stdio.h>
    29     29   #include <string.h>
    30     30   #include <errno.h>
    31     31   #include <sys/types.h>
    32     32   #include <float.h>
    33     33   
    34         -#include "rasterlite_tiff_hdrs.h"
           34  +#include <geotiff.h>
           35  +#include <xtiffio.h>
           36  +#include <geo_normalize.h>
           37  +#include <geovalues.h>
    35     38   #include <tiffio.h>
    36     39   
    37         -#ifdef SPATIALITE_AMALGAMATION
    38     40   #include <spatialite/sqlite3.h>
    39         -#else
    40         -#include <sqlite3.h>
    41         -#endif
    42         -
    43     41   #include <spatialite/gaiaexif.h>
    44     42   #include <spatialite/gaiageo.h>
    45     43   #include <spatialite.h>
    46     44   
    47     45   #include "rasterlite.h"
    48     46   #include "rasterlite_internals.h"
    49     47   
    50         -#ifdef _WIN32
           48  +#ifdef _WIN32 
    51     49   #define strcasecmp	_stricmp
    52     50   #endif /* not WIN32 */
    53     51   
    54     52   #if defined(_WIN32) || defined (__MINGW32__)
    55     53   #define FORMAT_64	"%I64d"
    56     54   #else
    57     55   #define FORMAT_64	"%lld"
................................................................................
   259    257   		break;
   260    258   	    }
   261    259   	  p = p->next;
   262    260         }
   263    261       return NULL;
   264    262   }
   265    263   
   266         -static rasterliteImagePtr
          264  +static rasterliteImagePrt
   267    265   raster_decode (const void *blob, int blob_size)
   268    266   {
   269    267   /* trying to decode a BLOB as an image */
   270         -    rasterliteImagePtr img = NULL;
          268  +    rasterliteImagePrt img = NULL;
   271    269       int type = gaiaGuessBlobType (blob, blob_size);
   272    270       if (type == GAIA_JPEG_BLOB || type == GAIA_EXIF_BLOB
   273    271   	|| type == GAIA_EXIF_GPS_BLOB)
   274    272   	img = image_from_jpeg (blob_size, (void *) blob);
   275    273       else if (type == GAIA_PNG_BLOB)
   276    274   	img = image_from_png (blob_size, (void *) blob);
   277    275       else if (type == GAIA_GIF_BLOB)
   278    276   	img = image_from_gif (blob_size, (void *) blob);
   279    277       else if (type == GAIA_TIFF_BLOB)
   280    278   	img = image_from_tiff (blob_size, (void *) blob);
          279  +    else if (type == GAIA_WAVELET_BLOB)
          280  +	img = image_from_wavelet (blob_size, (void *) blob);
   281    281       return img;
   282    282   }
   283    283   
   284    284   static int
   285         -get_tile (sqlite3 * handle, rasterliteImagePtr img, const char *table,
          285  +get_tile (sqlite3 * handle, rasterliteImagePrt img, const char *table,
   286    286   	  sqlite3_int64 tile_id, int declared_x, int declared_y, int where)
   287    287   {
   288    288   /* fetching a raster tile */
   289    289       sqlite3_stmt *stmt;
   290    290       int ret;
   291    291       char sql[1024];
   292    292       char dummy64[64];
................................................................................
   293    293       const void *blob;
   294    294       int blob_size;
   295    295       int row;
   296    296       int col;
   297    297       int x;
   298    298       int y;
   299    299       int pixel;
   300         -    rasterliteImagePtr tile_img = NULL;
          300  +    rasterliteImagePrt tile_img = NULL;
   301    301       sprintf (sql, "SELECT raster FROM \"%s_rasters\" WHERE id = ?", table);
   302    302       ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
   303    303       if (ret != SQLITE_OK)
   304    304         {
   305    305   	  printf ("SQL error: %s\n", sqlite3_errmsg (handle));
   306    306   	  return 0;
   307    307         }
................................................................................
   420    420       image_destroy (tile_img);
   421    421   
   422    422       return 1;
   423    423   }
   424    424   
   425    425   static void
   426    426   thumbnail_export (sqlite3 * handle, sqlite3_stmt * stmt,
   427         -		  rasterliteImagePtr img, int image_type, int quality_factor,
          427  +		  rasterliteImagePrt img, int image_type, int quality_factor,
   428    428   		  struct thumbnail_tile *tile)
   429    429   {
   430    430   /* saving the thumbnail into the DB */
   431    431       int ret;
   432    432       void *blob;
   433    433       int blob_size;
   434    434       int width = img->sx / 2;
   435    435       int height = img->sy / 2;
   436         -    rasterliteImagePtr thumbnail = image_create (width, height);
          436  +    rasterliteImagePrt thumbnail = image_create (width, height);
   437    437       make_thumbnail (thumbnail, img);
   438    438       if (image_type == GAIA_TIFF_BLOB)
   439    439         {
   440    440   	  blob = image_to_tiff_rgb (thumbnail, &blob_size);
   441    441   	  if (!blob)
   442    442   	    {
   443    443   		printf ("TIFF RGB compression error\n");
................................................................................
   448    448         {
   449    449   	  blob = image_to_png_rgb (thumbnail, &blob_size);
   450    450   	  if (!blob)
   451    451   	    {
   452    452   		printf ("PNG RGB compression error\n");
   453    453   		goto end;
   454    454   	    }
          455  +      }
          456  +    else if (image_type == GAIA_WAVELET_BLOB)
          457  +      {
          458  +	  blob = image_to_wavelet (thumbnail, &blob_size, quality_factor);
          459  +	  if (!blob)
          460  +	    {
          461  +		printf ("WAVELET compression error\n");
          462  +		goto end;
          463  +	    }
   455    464         }
   456    465       else
   457    466         {
   458    467   	  blob = image_to_jpeg (thumbnail, &blob_size, quality_factor);
   459    468   	  if (!blob)
   460    469   	    {
   461    470   		printf ("JPEG compression error\n");
................................................................................
   575    584       struct tiles_list tiles;
   576    585       struct tile_item *tile_1;
   577    586       struct tile_item *tile_2;
   578    587       struct tile_item *tile_3;
   579    588       struct tile_item *tile_4;
   580    589       double x;
   581    590       double y;
   582         -    rasterliteImagePtr img = NULL;
          591  +    rasterliteImagePrt img = NULL;
   583    592       struct thumbnail_tile thumb_tiles[NTILES];
   584    593       struct thumbnail_tile *thumb_tile;
   585    594       int max_tile;
   586    595       gaiaPolygonPtr polyg;
   587    596       int raster_ok = 0;
   588    597       int metadata_ok = 0;
   589    598       int i;
................................................................................
  1612   1621   	     "-? or --help                      print this help message\n");
  1613   1622       fprintf (stderr,
  1614   1623   	     "-t or --test                      test only - no actual action\n");
  1615   1624       fprintf (stderr, "-v or --verbose                   verbose output\n");
  1616   1625       fprintf (stderr,
  1617   1626   	     "-d or --db-path     pathname      the SpatiaLite db path\n");
  1618   1627       fprintf (stderr, "-T or --table-name  name          DB table name\n");
  1619         -    fprintf (stderr, "-i or --image-type  type          [JPEG|TIFF]\n");
         1628  +    fprintf (stderr, "-i or --image-type  type          [JPEG|WAVELET|TIFF]\n");
  1620   1629       fprintf (stderr,
  1621         -	     "-q or --quality     num           [default = 75(JPEG)]\n");
         1630  +	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
  1622   1631   }
  1623   1632   
  1624   1633   int
  1625   1634   main (int argc, char *argv[])
  1626   1635   {
  1627   1636   /* the MAIN function simply perform arguments checking */
  1628   1637       sqlite3 *handle;
................................................................................
  1648   1657   		      break;
  1649   1658   		  case ARG_TABLE_NAME:
  1650   1659   		      table = argv[i];
  1651   1660   		      break;
  1652   1661   		  case ARG_IMAGE_TYPE:
  1653   1662   		      if (strcasecmp (argv[i], "JPEG") == 0)
  1654   1663   			  image_type = GAIA_JPEG_BLOB;
         1664  +		      if (strcasecmp (argv[i], "WAVELET") == 0)
         1665  +			  image_type = GAIA_WAVELET_BLOB;
  1655   1666   		      if (strcasecmp (argv[i], "PNG") == 0)
  1656   1667   			  image_type = GAIA_PNG_BLOB;
  1657   1668   		      if (strcasecmp (argv[i], "TIFF") == 0)
  1658   1669   			  image_type = GAIA_TIFF_BLOB;
  1659   1670   		      break;
  1660   1671   		  case ARG_QUALITY_FACTOR:
  1661   1672   		      quality_factor = atoi (argv[i]);
................................................................................
  1759   1770   	  /* normalizing the quality factor */
  1760   1771   	  if (quality_factor == -999999)
  1761   1772   	      quality_factor = 75;
  1762   1773   	  if (quality_factor < 10)
  1763   1774   	      quality_factor = 10;
  1764   1775   	  if (quality_factor > 90)
  1765   1776   	      quality_factor = 90;
         1777  +      }
         1778  +    if (image_type == GAIA_WAVELET_BLOB)
         1779  +      {
         1780  +	  /* normalizing the commpression factor */
         1781  +	  if (quality_factor == -999999)
         1782  +	      quality_factor = 25;
         1783  +	  if (quality_factor < 10)
         1784  +	      quality_factor = 10;
         1785  +	  if (quality_factor > 200)
         1786  +	      quality_factor = 200;
  1766   1787         }
  1767   1788       printf ("=====================================================\n");
  1768   1789       printf ("             Arguments Summary\n");
  1769   1790       printf ("=====================================================\n");
  1770   1791       if (test_mode)
  1771   1792   	printf ("TEST mode: no actual action will be performed\n");
  1772   1793       printf ("SpatiaLite DB path: '%s'\n", path);
................................................................................
  1773   1794       printf ("Table prefix: '%s'\n", table);
  1774   1795       printf ("\ttable '%s_rasters' is assumed to store raster tiles\n", table);
  1775   1796       printf ("\ttable '%s_metadata' is assumed to store tile metadata\n", table);
  1776   1797       switch (image_type)
  1777   1798         {
  1778   1799         case GAIA_JPEG_BLOB:
  1779   1800   	  printf ("Pyramid Tile image type: JPEG quality=%d\n", quality_factor);
         1801  +	  break;
         1802  +      case GAIA_WAVELET_BLOB:
         1803  +	  printf ("Pyramid Tile image type: WAVELET compression ratio 1:%d\n",
         1804  +		  quality_factor);
  1780   1805   	  break;
  1781   1806         case GAIA_PNG_BLOB:
  1782   1807   	  printf ("Pyramid Tile image type: PNG [RGB]\n");
  1783   1808   	  break;
  1784   1809         case GAIA_TIFF_BLOB:
  1785   1810   	  printf ("Pyramid Tile image type: TIFF [RGB]\n");
  1786   1811   	  break;

Changes to src/rasterlite_tool.c.

     1      1   /* 
     2      2   / rasterlite_tool.c
     3      3   /
     4      4   / a tool generating rasters from a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 1
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13     13   /    it under the terms of the GNU General Public License as published by
................................................................................
    27     27   #include <stdlib.h>
    28     28   #include <stdio.h>
    29     29   #include <string.h>
    30     30   #include <float.h>
    31     31   
    32     32   #include <tiffio.h>
    33     33   
    34         -#ifdef SPATIALITE_AMALGAMATION
    35     34   #include <spatialite/sqlite3.h>
    36         -#else
    37         -#include <sqlite3.h>
    38         -#endif
    39         -
    40     35   #include <spatialite/gaiaexif.h>
    41     36   #include <spatialite/gaiageo.h>
    42     37   #include <spatialite.h>
    43     38   
    44     39   #include "rasterlite.h"
    45     40   #include "rasterlite_internals.h"
    46     41   

Changes to src/rasterlite_topmost.c.

     1      1   /* 
     2      2   / rasterlite_topmpst.c
     3      3   /
     4      4   / a tool building raster topmost pyramid's levels into a SpatiaLite DB 
     5      5   /
     6         -/ version 1.1a, 2011 November 12
            6  +/ version 1.0, 2009 June 25
     7      7   /
     8      8   / Author: Sandro Furieri a.furieri@lqt.it
     9      9   /
    10     10   / Copyright (C) 2009  Alessandro Furieri
    11     11   /
    12     12   /    This program is free software: you can redistribute it and/or modify
    13     13   /    it under the terms of the GNU General Public License as published by
................................................................................
    29     29   #include <stdio.h>
    30     30   #include <string.h>
    31     31   #include <float.h>
    32     32   #include <math.h>
    33     33   
    34     34   #include <tiffio.h>
    35     35   
    36         -#ifdef SPATIALITE_AMALGAMATION
    37     36   #include <spatialite/sqlite3.h>
    38         -#else
    39         -#include <sqlite3.h>
    40         -#endif
    41         -
    42     37   #include <spatialite/gaiaexif.h>
    43     38   #include <spatialite/gaiageo.h>
    44     39   #include <spatialite.h>
    45     40   
    46     41   #include "rasterlite.h"
    47     42   #include "rasterlite_internals.h"
    48     43   
................................................................................
   284    279   	list->first = p;
   285    280       if (list->last != NULL)
   286    281   	list->last->next = p;
   287    282       list->last = p;
   288    283   }
   289    284   
   290    285   static void
   291         -copy_rectangle (rasterliteImagePtr output, rasterliteImagePtr input,
          286  +copy_rectangle (rasterliteImagePrt output, rasterliteImagePrt input,
   292    287   		int transparent_color, int base_x, int base_y)
   293    288   {
   294    289   /* copying a raster rectangle */
   295    290       int x;
   296    291       int y;
   297    292       int dst_x;
   298    293       int dst_y;
................................................................................
   337    332       int ret;
   338    333       int hits = 0;
   339    334       void *blob;
   340    335       int blob_size;
   341    336       int new_tile_width;
   342    337       int new_tile_height;
   343    338       gaiaPolygonPtr polyg;
   344         -    rasterliteImagePtr full_size = NULL;
   345         -    rasterliteImagePtr thumbnail = NULL;
          339  +    rasterliteImagePrt full_size = NULL;
          340  +    rasterliteImagePrt thumbnail = NULL;
   346    341       int srid;
   347    342   /* creating the full size image */
   348    343       full_size = image_create (tile_width, tile_height);
   349    344       image_fill (full_size, info->background_color);
   350    345   /* binding query params */
   351    346       sqlite3_reset (info->stmt_query);
   352    347       sqlite3_clear_bindings (info->stmt_query);
................................................................................
   362    357   	  ret = sqlite3_step (info->stmt_query);
   363    358   	  if (ret == SQLITE_DONE)
   364    359   	      break;		/* end of result set */
   365    360   	  if (ret == SQLITE_ROW)
   366    361   	    {
   367    362   		/* retrieving query values */
   368    363   		gaiaGeomCollPtr geom = NULL;
   369         -		rasterliteImagePtr img = NULL;
          364  +		rasterliteImagePrt img = NULL;
   370    365   		if (sqlite3_column_type (info->stmt_query, 0) == SQLITE_BLOB)
   371    366   		  {
   372    367   		      /* fetching Geometry */
   373    368   		      const void *blob =
   374    369   			  sqlite3_column_blob (info->stmt_query, 0);
   375    370   		      int blob_size =
   376    371   			  sqlite3_column_bytes (info->stmt_query, 0);
................................................................................
   461    456         {
   462    457   	  blob = image_to_png_rgb (thumbnail, &blob_size);
   463    458   	  if (!blob)
   464    459   	    {
   465    460   		printf ("PNG RGB compression error\n");
   466    461   		return 0;
   467    462   	    }
          463  +      }
          464  +    else if (info->image_type == GAIA_WAVELET_BLOB)
          465  +      {
          466  +	  blob = image_to_wavelet (thumbnail, &blob_size, info->quality_factor);
          467  +	  if (!blob)
          468  +	    {
          469  +		printf ("WAVELET compression error\n");
          470  +		return 0;
          471  +	    }
   468    472         }
   469    473       else
   470    474         {
   471    475   	  blob = image_to_jpeg (thumbnail, &blob_size, info->quality_factor);
   472    476   	  if (!blob)
   473    477   	    {
   474    478   		printf ("JPEG compression error\n");
................................................................................
  1369   1373   	     "-? or --help                      print this help message\n");
  1370   1374       fprintf (stderr,
  1371   1375   	     "-t or --test                      test only - no actual action\n");
  1372   1376       fprintf (stderr, "-v or --verbose                   verbose output\n");
  1373   1377       fprintf (stderr,
  1374   1378   	     "-d or --db-path     pathname      the SpatiaLite db path\n");
  1375   1379       fprintf (stderr, "-T or --table-name  name          DB table name\n");
  1376         -    fprintf (stderr, "-i or --image-type  type          [JPEG|TIFF]\n");
         1380  +    fprintf (stderr, "-i or --image-type  type          [JPEG|WAVELET|TIFF]\n");
  1377   1381       fprintf (stderr,
  1378         -	     "-q or --quality     num           [default = 75(JPEG)]\n");
         1382  +	     "-q or --quality     num           [default = 75(JPEG) / 25(WAVELET)]\n");
  1379   1383       fprintf (stderr, "-c or --transparent-color 0xRRGGBB [default = NONE]\n");
  1380   1384       fprintf (stderr,
  1381   1385   	     "-b or --background-color  0xRRGGBB [default = 0x000000]\n");
  1382   1386   }
  1383   1387   
  1384   1388   int
  1385   1389   main (int argc, char *argv[])
................................................................................
  1413   1417   		      break;
  1414   1418   		  case ARG_TABLE_NAME:
  1415   1419   		      table = argv[i];
  1416   1420   		      break;
  1417   1421   		  case ARG_IMAGE_TYPE:
  1418   1422   		      if (strcasecmp (argv[i], "JPEG") == 0)
  1419   1423   			  image_type = GAIA_JPEG_BLOB;
         1424  +		      if (strcasecmp (argv[i], "WAVELET") == 0)
         1425  +			  image_type = GAIA_WAVELET_BLOB;
  1420   1426   		      if (strcasecmp (argv[i], "PNG") == 0)
  1421   1427   			  image_type = GAIA_PNG_BLOB;
  1422   1428   		      if (strcasecmp (argv[i], "TIFF") == 0)
  1423   1429   			  image_type = GAIA_TIFF_BLOB;
  1424   1430   		      break;
  1425   1431   		  case ARG_QUALITY_FACTOR:
  1426   1432   		      quality_factor = atoi (argv[i]);
................................................................................
  1581   1587   	  /* normalizing the quality factor */
  1582   1588   	  if (quality_factor == -999999)
  1583   1589   	      quality_factor = 75;
  1584   1590   	  if (quality_factor < 10)
  1585   1591   	      quality_factor = 10;
  1586   1592   	  if (quality_factor > 90)
  1587   1593   	      quality_factor = 90;
         1594  +      }
         1595  +    if (image_type == GAIA_WAVELET_BLOB)
         1596  +      {
         1597  +	  /* normalizing the commpression factor */
         1598  +	  if (quality_factor == -999999)
         1599  +	      quality_factor = 25;
         1600  +	  if (quality_factor < 10)
         1601  +	      quality_factor = 10;
         1602  +	  if (quality_factor > 200)
         1603  +	      quality_factor = 200;
  1588   1604         }
  1589   1605       printf ("=====================================================\n");
  1590   1606       printf ("             Arguments Summary\n");
  1591   1607       printf ("=====================================================\n");
  1592   1608       if (test_mode)
  1593   1609   	printf ("TEST mode: no actual action will be performed\n");
  1594   1610       printf ("SpatiaLite DB path: '%s'\n", path);
................................................................................
  1597   1613       printf ("\ttable '%s_metadata' is assumed to store tile metadata\n", table);
  1598   1614       printf ("Tile preferred max size: %d pixels\n", tile_size);
  1599   1615       switch (image_type)
  1600   1616         {
  1601   1617         case GAIA_JPEG_BLOB:
  1602   1618   	  printf ("Topmost Pyramid Tile image type: JPEG quality=%d\n",
  1603   1619   		  quality_factor);
         1620  +	  break;
         1621  +      case GAIA_WAVELET_BLOB:
         1622  +	  printf
         1623  +	      ("Topmost Pyramid Tile image type: WAVELET compression ratio 1:%d\n",
         1624  +	       quality_factor);
  1604   1625   	  break;
  1605   1626         case GAIA_PNG_BLOB:
  1606   1627   	  printf ("Topmost Pyramid Tile image type: PNG [RGB]\n");
  1607   1628   	  break;
  1608   1629         case GAIA_TIFF_BLOB:
  1609   1630   	  printf ("Topmost Pyramid Tile image type: TIFF [RGB]\n");
  1610   1631   	  break;

Added svn-commit.2.tmp.

            1  +Creating 'librasterlite' SVN
            2  +--Questa linea, e quelle sotto di essa, saranno ignorate--
            3  +
            4  +A    .

Added svn-commit.3.tmp.

            1  +Initial load for 'librasterlite'
            2  +--Questa linea, e quelle sotto di essa, saranno ignorate--
            3  +
            4  +A    .

Added svn-commit.tmp.

            1  +Creating the 'librasterlite' SVN
            2  +--Questa linea, e quelle sotto di essa, saranno ignorate--
            3  +
            4  +A    https://www.gaia-gis.it/svn/librasterlite