[Pkg-gtkpod-devel] r134 - in libgpod/branches/upstream/current: . bindings bindings/python bindings/python/examples docs docs/reference docs/reference/html docs/reference/tmpl docs/reference/xml m4 po src tests

Frank Lichtenheld djpig at costa.debian.org
Fri Sep 29 21:50:47 UTC 2006


Author: djpig
Date: 2006-09-29 21:50:32 +0000 (Fri, 29 Sep 2006)
New Revision: 134

Added:
   libgpod/branches/upstream/current/bindings/Makefile.am
   libgpod/branches/upstream/current/bindings/Makefile.in
   libgpod/branches/upstream/current/bindings/python/Makefile.am
   libgpod/branches/upstream/current/bindings/python/Makefile.in
   libgpod/branches/upstream/current/bindings/python/__init__.py
   libgpod/branches/upstream/current/bindings/python/examples/Makefile.am
   libgpod/branches/upstream/current/bindings/python/examples/Makefile.in
   libgpod/branches/upstream/current/bindings/python/examples/add_song.py
   libgpod/branches/upstream/current/bindings/python/examples/coverart_fetch.py
   libgpod/branches/upstream/current/bindings/python/examples/create_mp3_tags_from_itdb.py
   libgpod/branches/upstream/current/bindings/python/examples/play_with_ipod_api.py
   libgpod/branches/upstream/current/bindings/python/examples/play_with_smart_playlists.py
   libgpod/branches/upstream/current/bindings/python/examples/toy_around.py
   libgpod/branches/upstream/current/bindings/python/gtkpod.py
   libgpod/branches/upstream/current/bindings/python/ipod.py
   libgpod/branches/upstream/current/docs/
   libgpod/branches/upstream/current/docs/Makefile.am
   libgpod/branches/upstream/current/docs/Makefile.in
   libgpod/branches/upstream/current/docs/reference/
   libgpod/branches/upstream/current/docs/reference/Makefile.am
   libgpod/branches/upstream/current/docs/reference/Makefile.in
   libgpod/branches/upstream/current/docs/reference/html/
   libgpod/branches/upstream/current/docs/reference/html/ch01.html
   libgpod/branches/upstream/current/docs/reference/html/ch02.html
   libgpod/branches/upstream/current/docs/reference/html/home.png
   libgpod/branches/upstream/current/docs/reference/html/index.html
   libgpod/branches/upstream/current/docs/reference/html/index.sgml
   libgpod/branches/upstream/current/docs/reference/html/left.png
   libgpod/branches/upstream/current/docs/reference/html/libgpod-Artwork.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-Device.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-File-handling-functions.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-Low-level-functions.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-Playlists.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-The-Itdb-iTunesDB-structure.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-Time-handling.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod-Tracks.html
   libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp
   libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp2
   libgpod/branches/upstream/current/docs/reference/html/right.png
   libgpod/branches/upstream/current/docs/reference/html/style.css
   libgpod/branches/upstream/current/docs/reference/html/up.png
   libgpod/branches/upstream/current/docs/reference/libgpod-docs.xml
   libgpod/branches/upstream/current/docs/reference/libgpod-overrides.txt
   libgpod/branches/upstream/current/docs/reference/libgpod-sections.txt
   libgpod/branches/upstream/current/docs/reference/tmpl/
   libgpod/branches/upstream/current/docs/reference/tmpl/Internal.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/artwork.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/device.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-copying.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-db.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-lowlevel.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-time.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/libgpod-unused.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/playlists.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/smart-playlists.sgml
   libgpod/branches/upstream/current/docs/reference/tmpl/track.sgml
   libgpod/branches/upstream/current/docs/reference/version.xml.in
   libgpod/branches/upstream/current/docs/reference/xml/
   libgpod/branches/upstream/current/docs/reference/xml/Internal.xml
   libgpod/branches/upstream/current/docs/reference/xml/artwork.xml
   libgpod/branches/upstream/current/docs/reference/xml/device.xml
   libgpod/branches/upstream/current/docs/reference/xml/itunesdb-copying.xml
   libgpod/branches/upstream/current/docs/reference/xml/itunesdb-db.xml
   libgpod/branches/upstream/current/docs/reference/xml/itunesdb-lowlevel.xml
   libgpod/branches/upstream/current/docs/reference/xml/itunesdb-time.xml
   libgpod/branches/upstream/current/docs/reference/xml/playlists.xml
   libgpod/branches/upstream/current/docs/reference/xml/smart-playlists.xml
   libgpod/branches/upstream/current/docs/reference/xml/track.xml
   libgpod/branches/upstream/current/gtk-doc.make
   libgpod/branches/upstream/current/m4/
   libgpod/branches/upstream/current/m4/Makefile.am
   libgpod/branches/upstream/current/m4/Makefile.in
   libgpod/branches/upstream/current/m4/python.m4
   libgpod/branches/upstream/current/m4/swig.m4
   libgpod/branches/upstream/current/src/itdb_endianness.h
   libgpod/branches/upstream/current/src/itdb_photoalbum.c
   libgpod/branches/upstream/current/tests/test-init-ipod.c
   libgpod/branches/upstream/current/tests/test-ls.c
   libgpod/branches/upstream/current/tests/test-photos.c
   libgpod/branches/upstream/current/tests/test-rebuild-db.cc
Removed:
   libgpod/branches/upstream/current/bindings/python/Makefile
   libgpod/branches/upstream/current/bindings/python/examples/play.py
   libgpod/branches/upstream/current/po/de.gmo
   libgpod/branches/upstream/current/po/es.gmo
   libgpod/branches/upstream/current/po/fr.gmo
   libgpod/branches/upstream/current/po/he.gmo
   libgpod/branches/upstream/current/po/it.gmo
   libgpod/branches/upstream/current/po/ja.gmo
   libgpod/branches/upstream/current/po/sv.gmo
   libgpod/branches/upstream/current/src/hal-common.c
   libgpod/branches/upstream/current/src/hal-common.h
   libgpod/branches/upstream/current/tests/test-ipod-device.c
Modified:
   libgpod/branches/upstream/current/ChangeLog
   libgpod/branches/upstream/current/Makefile.am
   libgpod/branches/upstream/current/Makefile.in
   libgpod/branches/upstream/current/aclocal.m4
   libgpod/branches/upstream/current/bindings/python/examples/tag_genre_from_audioscrobber.py
   libgpod/branches/upstream/current/bindings/python/gpod.i
   libgpod/branches/upstream/current/config.guess
   libgpod/branches/upstream/current/config.h.in
   libgpod/branches/upstream/current/config.sub
   libgpod/branches/upstream/current/configure
   libgpod/branches/upstream/current/configure.ac
   libgpod/branches/upstream/current/intltool-extract.in
   libgpod/branches/upstream/current/intltool-merge.in
   libgpod/branches/upstream/current/intltool-update.in
   libgpod/branches/upstream/current/ltmain.sh
   libgpod/branches/upstream/current/po/Makefile.in.in
   libgpod/branches/upstream/current/po/POTFILES.in
   libgpod/branches/upstream/current/po/de.po
   libgpod/branches/upstream/current/po/es.po
   libgpod/branches/upstream/current/po/fr.po
   libgpod/branches/upstream/current/po/he.po
   libgpod/branches/upstream/current/po/it.po
   libgpod/branches/upstream/current/po/ja.po
   libgpod/branches/upstream/current/po/sv.po
   libgpod/branches/upstream/current/src/Makefile.am
   libgpod/branches/upstream/current/src/Makefile.in
   libgpod/branches/upstream/current/src/db-artwork-debug.c
   libgpod/branches/upstream/current/src/db-artwork-debug.h
   libgpod/branches/upstream/current/src/db-artwork-parser.c
   libgpod/branches/upstream/current/src/db-artwork-parser.h
   libgpod/branches/upstream/current/src/db-artwork-writer.c
   libgpod/branches/upstream/current/src/db-image-parser.c
   libgpod/branches/upstream/current/src/db-image-parser.h
   libgpod/branches/upstream/current/src/db-itunes-parser.h
   libgpod/branches/upstream/current/src/db-parse-context.c
   libgpod/branches/upstream/current/src/db-parse-context.h
   libgpod/branches/upstream/current/src/glib-compat.h
   libgpod/branches/upstream/current/src/itdb.h
   libgpod/branches/upstream/current/src/itdb_artwork.c
   libgpod/branches/upstream/current/src/itdb_device.c
   libgpod/branches/upstream/current/src/itdb_device.h
   libgpod/branches/upstream/current/src/itdb_itunesdb.c
   libgpod/branches/upstream/current/src/itdb_playlist.c
   libgpod/branches/upstream/current/src/itdb_private.h
   libgpod/branches/upstream/current/src/itdb_track.c
   libgpod/branches/upstream/current/src/ithumb-writer.c
   libgpod/branches/upstream/current/tests/Makefile.am
   libgpod/branches/upstream/current/tests/Makefile.in
Log:
Load /tmp/tmp.Emubb31770/libgpod-0.4.0 into
libgpod/branches/upstream/current.


Modified: libgpod/branches/upstream/current/ChangeLog
===================================================================
--- libgpod/branches/upstream/current/ChangeLog	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/ChangeLog	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,5 +1,627 @@
-2005-02-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-09-24  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
+	* po/es.po: updated version by Alejandro Lamas Daviña
+
+	* configure.ac: bumped to 0.4.0 for release
+
+2006-09-23  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h: explain 'checked' field in Itdb_Track declaration
+
+	* src/itdb_playlist.c (itdb_spl_update): in SPLs with 'match
+	  checked tracks only" set, all unchecked tracks were matched.
+
+2006-09-21  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c: time_added and time_modified where
+	  interchanged.
+
+	* src/itdb_device.c: changed number of directories for 6G 8GB iPod
+	  Nano to 14 after user report.
+
+	* src/ithumb-writer.c: removed re-using of thumbnail data in order
+	  to avoid incompatibility with iTunes (even though our way was
+	  more efficient...)
+	
+2006-09-18  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h
+	  src/itdb_artwork.c: added itdb_artwork_add_thumbnail_from_data().
+
+	* src/itdb.h
+	  src/itdb_track.c: added itdb_track_set_thumbnails_from_data().
+
+	* src/itdb.h
+	  src/itdb_photoalbum.c: added itdb_photodb_add_photo_from_data().
+
+	* src/itdb_artwork.c (itdb_thumb_get_gdk_pixbuf): added support to
+	  retreive thumbnail from raw data instead of file.
+
+	* src/ithumb-writer.c (ithumb_writer_write_thumbnail): added
+	  support to write thumbnail from raw data instead of file.
+
+2006-09-17  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h
+	  src/itdb_device.c: added definitions for new sixth generation
+	  iPod Videos, iPod Nanos and iPod Shuffle.
+
+2006-08-21  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* tests/test-ls.c: added option to list contents of local
+	  repository and specified playlist. Thanks to Richard Hyde for
+	  the patch.
+
+2006-08-18  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/db-artwork-writer.c (ipod_buffer_grow_file): printf(3) type
+	  warnings caused compile error with FreeBSD 6.0-stable/GCC
+	  3.4.4. Thanks to Mike Heffner for the patch.
+
+2006-07-08  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c (itdb_write): don't crash if error ==
+          NULL (SF tracker bugs item #1519048)
+
+2006-07-02  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c (itdb_init_ipod): only write iTunesSD
+	  (shuffle database) when initializing shuffle. Thanks to
+	  James Joyce for the patch.
+
+2006-06-28  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c (wcontents_write): added g_strerror in error
+	  messages.
+
+2006-06-27  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_device.c: fixed endianness autodetection for big endian
+	  mobile phones. Thanks to Rached Ben Mustapha for the patch.
+
+2006-06-24  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c
+	  src/itdb.h:
+	  Added itdb_get_itunessd_path ().
+	  itdb_init_ipod() will no longer overwrite existing iTunesDB and
+	  iTunesSD.
+
+2006-06-10  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_device.c (itdb_device_get_ipod_info): compare more than
+	  4 characters of iPod model if the stored model number is more
+	  than 4 characters long.
+
+2006-06-07  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h
+	  src/itdb_device.c:
+	  Added itdb_device_write_sysinfo() and itdb_device_set_sysinfo().
+
+	* src/itdb_itunesdb.c (itdb_create_directories):
+	  Use functions introduced above.
+
+	  (itdb_write): Write SynsInfo file when writing the iTunesDB if
+	  SysInfo hash has been changed by application.
+
+	* src/itdb_device.[ch]: mark sysinfo hash as changed/unchanged.
+
+	* src/itdb_photoalbum.c (itdb_photodb_write): Write SynsInfo file
+	  when writing the iTunesDB if SysInfo hash has been changed by
+	  application.
+
+
+2006-06-05  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * src/db-artwork-parser.h
+	  src/db-artwork-parserc (ipod_supports_cover_art): made
+	  available G_GNUC_INTERNAL.
+	  Added ipod_supports_photos().
+
+	* src/itdb_itunesdb.c (itdb_create_directories):
+	  Create Photos directory.
+
+	* src/itdb.h
+	  src/itdb_device.c
+	  Rename itdb_info_get_ipod_model_name() ->
+	         itdb_info_get_ipod_model_name_string()
+		 itdb_info_get_ipod_generation_name() ->
+		 itdb_info_get_ipod_generation_string()
+
+        * src/itdb_itunesdb.c (itdb_create_directories): add space after
+	  ":" when writing SysInfo file, only write SysInfo file if
+	  model_number was given, write original model number, not
+	  abbreviated model number from info->model_number.
+
+2006-06-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/db-image-parser.c
+	  src/itdb_artwork.c
+	  src/itdb_device.c
+	  src/itdb_photoalbum.c
+	  src/itdb_track.c
+	  src/ithumb-writer.c: Phased out private
+	  IPOD_COVER_SMALL... enum in favor of identical public enum
+	  "ItdbThumbType" ITDB_THUMB_COVER_SMALL...
+
+	* src/db-image-parser.c (ipod_image_new_from_mhni):
+	  Accept all thumbnail types we know about (i.e. type != -1).
+
+	* src/db-artwork-debug.h
+	  src/db-artwork-parser.h
+	  src/db-image-parser.h
+	  src/db-parse-context.h
+	  src/glib-compat.h
+	  src/itdb_endianness.h: Added CVS "$Id:" line, added copyright
+	  notices where missing, added explanations to itdb_endianess.h
+	  ;-)
+
+	* src/itdb_itunesdb.c
+	  src/itdb_track.c
+	  src/itdb_device.c
+	  src/itdb_device.h
+	  Made naming consistent and suitable for export:
+	    Itdb_IpodModel -> Itdb_IpodInfo
+	    ipod_model_table -> ipod_info_table
+	    itdb_device_get_model_info() -> itdb_device_get_ipod_info()
+	    MODEL_TYPE_... -> ITDB_IPOD_MODEL_...
+	    nth_GENERATION -> ITDB_IPOD_GENERATION_nth
+
+	  Exported Itdb_IpodModel, Itdb_IpodGeneration, Itdb_IpodInfo,
+	  itdb_device_get_ipod_info().
+
+	* src/itdb_device.c: new API:
+	  itdb_info_get_ipod_info_table(),
+	  itdb_info_get_ipod_model_name()
+
+	* src/itdb.h
+	  src/itdb_artwork.c:
+	  Removed unused field ->type in Itdb_Artwork and corresponding
+	  enum ItdbArtworkType.
+
+2006-06-03  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_artwork.c (itdb_thumb_get_gdk_pixbuf): handle thumbnail
+	  padding correctly -- who would have thought that iTunes
+	  indicates _negative_ padding at times... Please use the
+	  test-photos program to check out whether or not your photos show
+	  up correctly without black bars or funny colors.
+
+        * src/db-artwork-writer.c
+	  src/db-image-parser.c
+	  src/itdb.h
+	  src/ithumb-writer.c: Hopefully do padding right:
+
+	   - read padding fields from mhni header and store them with
+	     each thumbnail 
+	   - calculate padding for PhotoDB only (padding for iTunesDB
+	     Artwork does not seem to be necessary)
+	   - include the padding into the total width/height
+
+	   It seems to work well on my iPod Nano -- feedback appreciated.
+
+	* tests/test-photos.c: added possibility to dump all photos into
+	  a directory:
+
+	  tests/test-photos dump <mountpoint> <output_dir>
+
+	* src/itdb_artwork.c: changed byte order for full screen iPod
+	  Nanos. 
+
+2006-06-01  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/db-artwork-writer.c (write_mhni): fix segfault caused by
+	  wrong access of enum inside Itdb_DB
+
+	* src/itdb.h:
+	  src/itdb_private.h:
+	  moved Itdb_DB to private part.
+
+	* src/itdb.h:
+	  src/itdb_private.h:
+	  src/itdb_itunesdb:
+	  New: db_get_itunesdb(), db_get_photodb()
+
+	* src/db-artwork-parser.c
+	  src/db-artwork-writer.c
+	  src/db-image-parser.c
+	  src/db-image-parser.h
+	  src/db-parse-context.c
+	  src/db-parse-context.h
+	  src/itdb_endianness.h
+	  src/itdb_itunesdb.c
+	  src/ithumb-writer.c:
+	  Remove all direct access to Itdb_DB->db. enum
+
+2006-05-31  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* configure.ac:
+	  m4/python: check for eyeD3 (Todd Zullinger)
+
+2006-05-30  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c (itdb_create_directories): applied
+	  Christophe's cleanup-patch, 'normalized' indenting. Function
+	  made 'static'.
+
+	* src/itdb_itunesdb.c (itdb_init_ipod): fixed segfault.
+
+	* m4/python: default configure option --with_python to 'yes'
+	  (Nicholas Piper)
+
+	***** merged photo-support branch back to MAIN. branch is tagged
+	      photo-support-merged_00
+
+2006-05-29  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * tests/test-photos.c: removed unneeded #include.
+
+	* configure.ac: print configuration summary -- thanks to Todd
+	  Zullinger
+
+	* itdb.h:
+	  itdb_itunesdb.c:
+	  added itdb_init_ipod() -- thanks to P.G. Richardson.
+
+	* src/itdb_itunesdb.c (itdb_write_file): only write artwork if
+	  supported by the iPod -- thanks to P.G. Richardson.
+
+	* src/itdb_itunesdb.c:
+	  src/itdb_photoalbum.c:
+	  src/itdb_playlist.c:
+	
+	  fixed some comments so the doc subsystem won't complain.
+
+	* tests/Makefile.am:
+	  tests/test-init-ipod.c
+
+	  added new test for itdb_init_ipod(). The test also demonstrates
+	  how to 'autodetect' the iPod model number.
+
+	* src/itdb_photoalbum.c:
+	  src/ithumb-writer.c:
+	  src/itdb_artwork.c:
+	  src/itdb.h:
+	  src/db-itunes-parser.h:
+	  src/db-artwork-writer.c:
+	  src/db-artwork-parser.c:
+	  src/db-artwork-debug.c:
+
+	  Patch by Michael McLellan:
+	  
+	  Doesn't automatically make the first photoalbum the
+	  'master'. However, if a master already exists it will remain the
+	  master.
+
+	  Sets the creation date of a new image to the modification time
+	  of the image file.
+
+	  Centers new images.
+
+	  Introduces itdb_photodb_remove_photo().
+
+	
+2006-05-29  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h:
+	  src/itunesdb.c: (Itdb_Track)
+	      flag2 -> skip_when_shuffling
+	      flag3 -> remember_playback_position
+
+	* src/itunesdb.c: playlist flags 1,2,3 were not read correctly.
+
+2006-05-28  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/db-parse-context.c (db_parse_context_new_from_file):
+	  Detect endianess if not already set.
+
+	* src/itdb_device.c (itdb_device_autodetect_endianess): try
+	  reading the first for bytes of iTunesDB, ArtworkDB or Photos
+	  Database in order to reliably detect the endianess of the
+	  connected iPod.
+
+	* src/itdb_photoalbum.c: (itdb_photodb_parse): will fail again if
+	  no photos dir is available.
+
+	* tests/test-photos.c: takes into consideration the possibility
+	  that an iPod does not have a Photos Database and creates a new
+	  one in that case. (I think it's safer that way -- the
+	  application is forced to 'think' about the fact that no database
+	  is available and either warn the user or create one. If
+	  itdb_photodb_parse() simply returns an empty database in case
+	  none could be found, the application might not become aware of
+	  the fact.)
+
+	* renamed itdb_get_mountpoint_photo to
+	  itdb_photodb_get_mountpoint.
+
+	* tests/test-photos.c: added g_error_free()
+
+	* src/itdb_device.c
+	  src/itdb_device.h: added number of musicdirs (Fnn dirs) to the
+	  model descriptions. The exact number seems to be version
+	  dependent. Therefore, the numbers here represent a mixture of
+	  reported values and common sense.
+
+2006-05-27  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_photoalbum.c: itdb_photodb_parse() would fail if no
+	  photos dir is available. Quick fix for now (I mean, why
+	  SHOULDN'T it fail if no photos dir is available??).
+
+2006-05-26  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h:
+	  src/itdb_photoalbum.c:
+	  src/itdb_artwork.c:
+	  Added userdata/usertype fields to Itdb_PhotoDB, Itdb_PhotoAlbum,
+	  Itdb_Artwork.
+
+2006-05-25  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * Slight cleanup, make PhotoDB API more consistent with iTunesDB
+	  API:
+
+	* src/db-artwork-parser.h: declared ipod_write_photo_db() as
+	  G_GNUC_INTERNAL
+
+	* src/db-artwork-writer.c (ipod_write_photo_db for non-gdk):
+	  Itdb_iTunesDB -> Itdb_PhotoDB
+
+	* src/itdb.h:
+	  Itdb_ItunesDB: removed photoalbums and photos.
+	  renamed:
+	  	 itdb_parse_photo -> itdb_photodb_parse
+		 itdb_add_photo_to_photoalbum -> itdb_photodb_add_photo
+		 itdb_create_new_photoalbum -> itdb_photodb_photoalbum_new
+		 itdb_free_photodb -> itdb_photodb_free
+		 itdb_write_photo_db -> itdb_photodb_write
+	  new:   itdb_photodb_new()
+
+	* src/itdb_itunesdb.c (itdb_parse_photo, itdb_get_photos_dir,
+	  itdb_get_photodb_path, itdb_get_photos_thumb_dir): moved to
+	  itdb_photoalbum.c
+
+	* src/itdb_photoalbum.c:
+	  new:   error_no_photos_dir, itdb_photodb_new, itdb_photodb_write
+	  moved: itdb_get_photos_dir, itdb_get_photodb_path,
+	         itdb_get_photos_thumb_dir
+	  rewrote: 
+	         itdb_photodb_parse
+	  (itdb_photodb_free): free device struct as well.
+
+	* tests/test-photos.c: change to new API.
+
+	* src/itdb.h: applied Christophe's patch to fix compile time
+	  error.
+
+	* po/sv.po: updated Swedish translation (thanks to Stefan
+	  Asserhall)
+
+2006-05-20  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* po/POTFILES.in: updated file list -> updated .po files.
+
+2006-05-15  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/db-image-parser.c
+	* src/itdb_photoalbum.c
+	* src/ithumb-writer.c
+	  Michael McLellan patch for photo support on iPod Videos
+
+2006-05-11  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb.h
+	* src/itdb_itunesdb.c
+	* src/itdb_private.h
+	* src/db-artwork-parser.c
+	* src/db-artwork-parser.h
+	* src/db-itunes-parser.h
+	* src/db-artwork-writer.c
+	* src/itdb_photoalbum.c
+	  Make sure Photos and Photos/Thumbs directories are created. New:
+	  itdb_get_photodb_path().
+
+
+2006-05-06  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/db-artwork-parser.c:
+	* src/db-itunes-parser.h:
+	* src/db-artwork-writer.c:
+	* src/itdb_photoalbum.c:
+	* src/itdb.h:
+	* src/itdb_private.h:
+	* tests/test-photos.c:
+	  Applied Mikey's second patch for photo support. test-photos now
+	  comes with support for photo albums!
+
+2006-05-07  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* Created new branch "photo-support" for testing of photo
+	  support. Comes complete with a test program to add photos to
+	  your iPod. Works great for me -- thanks to Mikey!
+
+	  --- 2006-05-30: merged back to MAIN.
+
+2006-05-06  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * Applied Mikey's patch for photo support.
+
+	* src/itdb_photoalbum.c: new.
+
+	* tests/test-photo.c: test program to add photos to your iPod.
+
+	* Created branch for this patch: 'photo-support'.
+
+2006-05-05  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c: avoid segfault if album field of podcasts
+	  is not set (NULL).
+
+2006-05-02  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* src/itdb_itunesdb.c: smart playlists: avoid assertion
+	  when writing rules with empty strings.
+
+2006-04-26  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * tests/Makefile.am: removed 'test-rebuild-db' from
+	  'noinst_PROGRAM' declaration (bug reported by Jens
+	  Taprogge). 'test-rebuild-db' is only added when the taglib is
+	  detected.
+
+2006-04-12  Christophe Fergeau  <teuf at gnome.org>
+
+	* tests/test-rebuild-db.cc: forgot to propagate a GError
+
+2006-04-10  Christophe Fergeau  <teuf at gnome.org>
+
+	* tests/test-ls.c: new test program reading and displaying the iPod 
+	content 
+	* tests/test-rebuild-db.cc: new test program which looks for mp3 files
+	on the iPod in the Music dir and rebuild an iPod database from that
+	(it uses taglib to parse the tags, so it's conditionnally built
+	depending on taglib's availability)
+	* configure.ac:
+	* tests/Makefile.am: build system changes to accomodate the 2 new test
+	programs
+	
+2006-04-10  Christophe Fergeau  <teuf at gnome.org>
+
+	* src/itdb_device.h: removed dead code
+	* src/itdb_playlist.c: make spl_update2 static, kill spl_update
+
+2006-04-10  Christophe Fergeau  <teuf at gnome.org>
+
+	* docs/Makefile.am:
+	* docs/reference/Makefile.am:
+	* docs/reference/libgpod-docs.xml:
+	* docs/reference/libgpod-sections.txt:
+	* docs/reference/tmpl/Internal.sgml:
+	* docs/reference/tmpl/artwork.sgml:
+	* docs/reference/tmpl/device.sgml:
+	* docs/reference/tmpl/itunesdb-copying.sgml:
+	* docs/reference/tmpl/itunesdb-db.sgml:
+	* docs/reference/tmpl/itunesdb-lowlevel.sgml:
+	* docs/reference/tmpl/itunesdb-time.sgml:
+	* docs/reference/tmpl/libgpod-unused.sgml:
+	* docs/reference/tmpl/playlists.sgml:
+	* docs/reference/tmpl/smart-playlists.sgml:
+	* docs/reference/tmpl/track.sgml:
+	* docs/reference/version.xml.in: all the files below are new files
+	needed for gtk-doc support
+	* Makefile.am:
+	* configure.ac: add gtk-doc support to build system
+	* src/itdb_artwork.c:
+	* src/itdb_device.c:
+	* src/itdb_itunesdb.c:
+	* src/itdb_playlist.c:
+	* src/itdb_track.c: update inline comments in those files so that
+	gtk-doc can pick them up to build documentation
+	
+2006-04-08  Christophe Fergeau  <teuf at gnome.org>
+
+	* configure.ac: generate Makefile for bindings/python/examples
+
+2006-04-03  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* itdb.h: flag1 -> has_artwork
+
+	* itdb_track.c: (itdb_track_set_thumbnails,
+	  itdb_remove_thumbnails) set has_artwork flag correctly.
+
+2006-04-01  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* itdb.h: unk178 -> mark_unplayed
+
+	* itdb_itunesdb.c: reset the mark_unplayed flag when playcount is
+	  detected.
+
+2006-03-31  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * po/es.po: replaced with version from Alejandro Lamas who
+	  maintains the gtkpod translation as well.
+
+2006-03-29  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * itunesdb.c: set filetype identifier when transfering track to
+	  the iPod.
+
+2006-03-24  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	Alpha version of reversed-endian Artwork writing. Status: iTunesDB
+	can be written and is accepted on mobile phones, ArtworkDB can be
+	read and be written as well, but newly added artwork will not yet
+	display.
+
+	* itdb.h: adjusted a couple of field lengths (4 byte -> 2 byte or
+	  even 1 byte) to address endian issues.
+
+2006-03-18  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* itdb_itunesdb.c (mk_mhod): fixed bug when writing podcast urls.
+
+	* itdb_itunesdb.c (itdb_write_file): move endianess autodetection
+	  to a place before calling ipod_write_artwork_db().
+
+2006-03-17  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* itdb_device.[ch]: rewrote ipod-device.c, removed all hal-code,
+	  removed all code irrelevant to writing the iTunesDB and
+	  ArtworkDB.
+
+	* autodetect iControl directory now also works for ArtworkDB.
+
+	* db-artwork-parser.c (ipod_db_get_artwork_db_path): create
+	  Artwork directory if not already present.
+
+	* itdb.h: Itdb_iTunesDB: moved mountpoint and musicdirs into
+	  private Itdb_Device. Use itdb_set_mountpoint() and
+	  itdb_get_mountpoint() to access the mountpoint.
+
+	* simplified some code by using itdb_get_path() instead of
+	  itdb_resolve_path().
+
+	* itdb_itunesdb.c (itdb_get_path): fixed bug.
+
+2006-03-12  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * itdb.h, itdb_itunesdb.c: added functions for autodetection of
+	  iControl directory (currently either <mp>/iPod_Control or
+	  <mp>/iTunes/iTunes_Control): itdb_get_control_dir() and
+	  itdb_get_itunes_dir()
+
+2006-02-12  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* itdb.h: added movie_flag and lyrics_flag to Itdb_Track
+
+	* itdb.h, itdb_itunesdb.c, itdb_private.h: added support for
+	  mobile phone reversed-endian iTunesDB. Please note that you have
+	  to rename the folder iTunes_Control to iPod_Control manually. to
+	  write reversed-endian files, itdb->reversed must be set to
+	  TRUE. When reading an iTunesDB the endianess is detected
+	  automatically and itdb->reversed set appropriately.  Only the
+	  inversed iTunesDBs, 'Play Counts', and OTG playlist files are
+	  read yet. The ArtworkDB and thumbnail files cannot be parsed
+	  yet.
+
+2006-02-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* ipod-device.c: added entries for iPod Nano 1 GB black and white
+	  (thanks to Leonhard Gruenschlos)
+
+2006-02-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* configure.ac: enable/disable switches for gdk and hal. Thanks to
+	  Olivier Crête
+
+2006-02-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+	* configure.ac: bumped version to 0.3.3 for new CVS version.
+
+	* RELEASED libgpod 0.3.2
+
 	* configure.ac: bumped version to 0.3.2 for release.
 
 	* db-artwork-writer.c: increased IPOD_MMAP_SIZE from 2 to 16 MB as
@@ -9,17 +631,17 @@
 	* db-itunes-parser.h: replaced the #pragma pack(4) with an
 	  'packed' attribute on _MhiiHeader only.
 
-2005-02-28  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-02-28  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
 	* ipod-device.c: (ipod_device_set_property): fixed possible
 	  segfault when hald is present.
 
-2005-02-24  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-02-24  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
 	* configure.ac, po/es.po: added Spanish translation catalog
 	  (thanks to Azael Avalos)
 
-2005-02-19  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-02-19  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
         * libgpod-1.0.pc: added gobject-2.0 to 'Requires:' list
 
@@ -29,7 +651,7 @@
 	* src/ipod-device.c: added HP type color photo ipod 'S492'. Thanks
 	  to David Desrosiers.
 	
-2005-02-14  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-02-14  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
 	* po/ja.po: updated Japanese catalog -- thanks to Kentaro Fukuchi
 
@@ -37,20 +659,20 @@
 	  caused ipod-detection to fail if hal daemon was not running. As
 	  a consequence cover art was not written to the iPod.
 
-2005-02-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-02-04  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
 	* src/itdb_itunesdb.c: (itunesstats_read) Fixed error when reading
 	  the Shuffle's stat file (0x18 was used as minimal record length
 	  instead of decimal '18').
 
-2005-02-03  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-02-03  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
 	* src/itdb_itunesdb.c, src/itdb_playlist.c, src/ithumb-writer.c:
 	  removed nested-functions. Thanks to Brian Jackson for the patch
 	  (he was not the only to send patches -- please, nobody feel
 	  offended that I didn't act sooner).
 
-2005-01-03  Jorg Schuler <jcsjcs at users.sourceforge.net>
+2006-01-03  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
 	* src/ipod-device.c: (ipod_device_set_property) check hal_context
 	  before accessing it to avoid segfault when hald is not running.

Modified: libgpod/branches/upstream/current/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/Makefile.am	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,18 +1,16 @@
-SUBDIRS=src tests po
+SUBDIRS=src bindings tests po m4 docs
 
+# build documentation when doing a distcheck.
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libgpod-1.0.pc
 
-# the bindings/ below are just a hack until a better way is found
 EXTRA_DIST =                    \
         intltool-merge.in       \
         intltool-update.in      \
         intltool-extract.in     \
-        libgpod-1.0.pc.in	\
-	bindings/python/examples/play.py \
-	bindings/python/examples/tag-genre-from-audioscrobber.py \
-        bindings/python/Makefile \
-        bindings/python/gpod.i
+        libgpod-1.0.pc.in
 
 
 DISTCLEANFILES =                \

Modified: libgpod/branches/upstream/current/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/Makefile.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -38,6 +38,7 @@
 host_triplet = @host@
 ACLOCAL = @ACLOCAL@
 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
@@ -66,7 +67,8 @@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-EJECT_PATH = @EJECT_PATH@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
@@ -75,10 +77,16 @@
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
 GMOFILES = @GMOFILES@
 GMSGFMT = @GMSGFMT@
-HAL_CFLAGS = @HAL_CFLAGS@
-HAL_LIBS = @HAL_LIBS@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
 HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
 HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -101,6 +109,7 @@
 INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
 INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
 INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
 INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
 INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
 INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
@@ -141,22 +150,27 @@
 POSUB = @POSUB@
 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-UNMOUNT_PATH = @UNMOUNT_PATH@
-UNMOUNT_PATH_ALT = @UNMOUNT_PATH_ALT@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -171,42 +185,50 @@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
-mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-SUBDIRS = src tests po
+SUBDIRS = src bindings tests po m4 docs
 
+# build documentation when doing a distcheck.
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libgpod-1.0.pc
 
-# the bindings/ below are just a hack until a better way is found
 EXTRA_DIST = \
         intltool-merge.in       \
         intltool-update.in      \
         intltool-extract.in     \
-        libgpod-1.0.pc.in	\
-	bindings/python/examples/play.py \
-	bindings/python/examples/tag-genre-from-audioscrobber.py \
-        bindings/python/Makefile \
-        bindings/python/gpod.i
+        libgpod-1.0.pc.in
 
 
 DISTCLEANFILES = \
@@ -442,7 +464,7 @@
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
 	mkdir $(distdir)
-	$(mkinstalldirs) $(distdir)/. $(distdir)/bindings/python $(distdir)/bindings/python/examples $(distdir)/po
+	$(mkinstalldirs) $(distdir)/. $(distdir)/docs/reference $(distdir)/po
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
 	list='$(DISTFILES)'; for file in $$list; do \

Modified: libgpod/branches/upstream/current/aclocal.m4
===================================================================
--- libgpod/branches/upstream/current/aclocal.m4	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/aclocal.m4	2006-09-29 21:50:32 UTC (rev 134)
@@ -900,8 +900,7 @@
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
-# serial 47 AC_PROG_LIBTOOL
-# Debian $Rev: 214 $
+# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -1011,7 +1010,7 @@
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
 # Same as above, but do not quote variable references.
@@ -1031,7 +1030,7 @@
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -1051,6 +1050,7 @@
 test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
 test -z "$LN_S" && LN_S="ln -s"
@@ -1070,15 +1070,17 @@
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
     ;;
   *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
     ;;
   esac
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
+_LT_CC_BASENAME([$compiler])
+
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
@@ -1119,11 +1121,56 @@
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 ])# _LT_AC_SYS_COMPILER
 
 
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
 # _LT_AC_SYS_LIBPATH_AIX
 # ----------------------
 # Links a minimal program and checks the executable
@@ -1196,15 +1243,15 @@
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 if test -z "$ECHO"; then
 if test "X${echo_test_string+set}" != Xset; then
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -1373,7 +1420,7 @@
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -1424,6 +1471,22 @@
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
@@ -1455,7 +1518,7 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@@ -1465,8 +1528,10 @@
    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        $2=yes
      fi
    fi
@@ -1492,11 +1557,16 @@
    LDFLAGS="$LDFLAGS $3"
    printf "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The compiler can only warn and ignore the option if not recognized
+     # The linker can only warn and ignore the option if not recognized
      # So say no if there are warnings
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
      else
        $2=yes
      fi
@@ -1555,11 +1625,55 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
- *)
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
 	       = "XX$teststring") >/dev/null 2>&1 &&
 	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&
@@ -1585,7 +1699,7 @@
 
 
 # _LT_AC_CHECK_DLFCN
-# --------------------
+# ------------------
 AC_DEFUN([_LT_AC_CHECK_DLFCN],
 [AC_CHECK_HEADERS(dlfcn.h)dnl
 ])# _LT_AC_CHECK_DLFCN
@@ -1593,7 +1707,7 @@
 
 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
+# ---------------------------------------------------------------------
 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 if test "$cross_compiling" = yes; then :
@@ -1659,17 +1773,19 @@
       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
       /* dlclose (self); */
     }
+  else
+    puts (dlerror ());
 
     exit (status);
 }]
 EOF
   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) $1 ;;
       x$lt_dlneed_uscore) $2 ;;
-      x$lt_unknown|x*) $3 ;;
+      x$lt_dlunknown|x*) $3 ;;
     esac
   else :
     # compilation failed
@@ -1681,7 +1797,7 @@
 
 
 # AC_LIBTOOL_DLOPEN_SELF
-# -------------------
+# ----------------------
 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
 if test "x$enable_dlopen" != xyes; then
@@ -1752,7 +1868,7 @@
     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
     save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
@@ -1765,7 +1881,7 @@
     ])
 
     if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
     	  lt_cv_dlopen_self_static, [dnl
 	  _LT_AC_TRY_DLOPEN_SELF(
@@ -1813,7 +1929,7 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
@@ -1825,11 +1941,13 @@
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -1893,8 +2011,8 @@
 [AC_MSG_CHECKING([how to hardcode library paths into programs])
 _LT_AC_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
@@ -2061,7 +2179,7 @@
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[[45]]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2089,7 +2207,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -2119,7 +2238,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -2142,7 +2261,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -2165,20 +2284,17 @@
   dynamic_linker=no
   ;;
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -2196,14 +2312,19 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -2223,7 +2344,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -2263,6 +2384,18 @@
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -2306,7 +2439,7 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -2322,7 +2455,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -2347,18 +2480,6 @@
   dynamic_linker='NetBSD ld.elf_so'
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -2396,8 +2517,13 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=yes
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2435,13 +2561,6 @@
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -2467,7 +2586,7 @@
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -2500,6 +2619,29 @@
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2513,6 +2655,11 @@
 esac
 AC_MSG_RESULT([$dynamic_linker])
 test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
 
@@ -2537,6 +2684,9 @@
       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
     fi
   fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
 
   # Extract list of available tagged configurations in $ofile.
   # Note that this assumes the entire list is on one line.
@@ -2563,7 +2713,9 @@
 
       case $tagname in
       CXX)
-	if test -n "$CXX" && test "X$CXX" != "Xno"; then
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+	    (test "X$CXX" != "Xg++"))) ; then
 	  AC_LIBTOOL_LANG_CXX_CONFIG
 	else
 	  tagname=""
@@ -2625,7 +2777,7 @@
 
 # AC_LIBTOOL_WIN32_DLL
 # --------------------
-# declare package support for building win32 dll's
+# declare package support for building win32 DLLs
 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
 ])# AC_LIBTOOL_WIN32_DLL
@@ -2663,7 +2815,7 @@
 
 # AC_DISABLE_SHARED
 # -----------------
-#- set the default shared flag to --disable-shared
+# set the default shared flag to --disable-shared
 AC_DEFUN([AC_DISABLE_SHARED],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
 AC_ENABLE_SHARED(no)
@@ -2799,7 +2951,7 @@
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -2909,7 +3061,7 @@
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
@@ -2941,7 +3093,7 @@
 AC_DEFUN([AC_PROG_LD_GNU],
 [AC_REQUIRE([AC_PROG_EGREP])dnl
 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -2968,6 +3120,15 @@
 *) reload_flag=" $reload_flag" ;;
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 ])# AC_PROG_LD_RELOAD_FLAG
 
 
@@ -3001,7 +3162,7 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-bsdi4*)
+bsdi[[45]]*)
   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
   lt_cv_file_magic_cmd='/usr/bin/file -L'
   lt_cv_file_magic_test_file=/shlib/libc.so
@@ -3024,13 +3185,13 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | kfreebsd*-gnu)
+freebsd* | dragonfly*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -3046,7 +3207,7 @@
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -3062,6 +3223,11 @@
   esac
   ;;
 
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $LD in
   *-32|*"-32 ") libmagic=32-bit;;
@@ -3073,11 +3239,11 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -3096,12 +3262,10 @@
   ;;
 
 openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   fi
   ;;
 
@@ -3109,15 +3273,11 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
@@ -3138,10 +3298,13 @@
   siemens)
     lt_cv_deplibs_check_method=pass_all
     ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
   esac
   ;;
 
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
@@ -3161,36 +3324,43 @@
   # Let the user override the test.
   lt_cv_path_NM="$NM"
 else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
-    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-      */dev/null* | *'Invalid file or object type'*)
-	lt_cv_path_NM="$tmp_nm -B"
-	break
-        ;;
-      *)
-	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	*/dev/null*)
-	  lt_cv_path_NM="$tmp_nm -p"
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
 	  break
 	  ;;
 	*)
-	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	  continue # so that we can try to find one that supports BSD flags
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
 	  ;;
 	esac
-      esac
-    fi
+      fi
+    done
+    IFS="$lt_save_ifs"
   done
-  IFS="$lt_save_ifs"
   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi])
 NM="$lt_cv_path_NM"
@@ -3222,13 +3392,13 @@
 # -----------------------------------
 # sets LIBLTDL to the link flags for the libltdl convenience library and
 # LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
-# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   case $enable_ltdl_convenience in
@@ -3247,13 +3417,13 @@
 # -----------------------------------
 # sets LIBLTDL to the link flags for the libltdl installable library and
 # LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
-# DIRECTORY is not provided and an installed libltdl is not found, it is
-# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
-# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
-# quotes!).  If your package is not flat and you're not using automake,
-# define top_builddir and top_srcdir appropriately in the Makefiles.
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
@@ -3291,10 +3461,21 @@
 # ---------------
 AC_DEFUN([_LT_AC_LANG_CXX],
 [AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
 ])# _LT_AC_LANG_CXX
 
+# _LT_AC_PROG_CXXCPP
+# ------------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
 
 # AC_LIBTOOL_F77
 # --------------
@@ -3334,7 +3515,7 @@
 
 
 # AC_LIBTOOL_RC
-# --------------
+# -------------
 # enable support for Windows resource files
 AC_DEFUN([AC_LIBTOOL_RC],
 [AC_REQUIRE([LT_AC_PROG_RC])
@@ -3367,37 +3548,10 @@
 
 _LT_AC_SYS_COMPILER
 
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
-    ;;
-  esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
-  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ 	]]" >/dev/null; then :
-  else
-    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
-    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
-  fi
-fi
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
-  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
-  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-
-
 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 AC_LIBTOOL_PROG_COMPILER_PIC($1)
 AC_LIBTOOL_PROG_CC_C_O($1)
@@ -3406,9 +3560,9 @@
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
 AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
+AC_LIBTOOL_DLOPEN_SELF
 
-# Report which librarie types wil actually be built
+# Report which library types will actually be built
 AC_MSG_CHECKING([if libtool supports shared libraries])
 AC_MSG_RESULT([$can_build_shared])
 
@@ -3417,7 +3571,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -3430,43 +3584,6 @@
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
   fi
-  ;;
-  darwin* | rhapsody*)
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[[012]])
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-      ;;
-    esac
-    output_verbose_link_cmd='echo'
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
-    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    _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}'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-  else
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-  fi
     ;;
 esac
 AC_MSG_RESULT([$enable_shared])
@@ -3492,7 +3609,7 @@
 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
 [AC_LANG_PUSH(C++)
 AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 
 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
@@ -3504,6 +3621,7 @@
 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
 _LT_AC_TAGVAR(module_cmds, $1)=
 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
@@ -3521,7 +3639,7 @@
 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
 
 # Source file extension for C++ test sources.
-ac_ext=cc
+ac_ext=cpp
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -3531,11 +3649,15 @@
 lt_simple_compile_test_code="int some_variable = 0;\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -3546,18 +3668,18 @@
 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
 else
-  unset lt_cv_prog_gnu_ld
+  $as_unset lt_cv_prog_gnu_ld
 fi
 if test -n "${lt_cv_path_LDCXX+set}"; then
   lt_cv_path_LD=$lt_cv_path_LDCXX
 else
-  unset lt_cv_path_LD
+  $as_unset lt_cv_path_LD
 fi
 test -z "${LDCXX+set}" || LD=$LDCXX
 CC=${CXX-"c++"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
@@ -3646,6 +3768,7 @@
 	    ;;
 	  esac
 	done
+	;;
       esac
 
       exp_sym_flag='-bexport'
@@ -3664,7 +3787,7 @@
     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
       # We only want to do this on AIX 4.2 and lower, the check
       # below for broken collect2 doesn't work under 4.3+
 	collect2name=`${CC} -print-prog-name=collect2`
@@ -3683,8 +3806,12 @@
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 	fi
+	;;
       esac
       shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+	shared_flag="$shared_flag "'${wl}-G'
+      fi
     else
       # not using gcc
       if test "$host_cpu" = ia64; then
@@ -3711,12 +3838,12 @@
       _LT_AC_SYS_LIBPATH_AIX
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      _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"
      else
       if test "$host_cpu" = ia64; then
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	_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"
       else
 	# Determine the default libpath from the value encoded in an empty executable.
 	_LT_AC_SYS_LIBPATH_AIX
@@ -3725,16 +3852,26 @@
 	# -berok will link without error, but may produce a broken library.
 	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	# -bexpall does not export symbols beginning with underscore (_)
-	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
 	# Exported symbols can be pulled into shared objects from archives
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	# This is similar to how AIX traditionally builds it's shared libraries.
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	# This is similar to how AIX traditionally builds its shared libraries.
+	_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'
       fi
     fi
     ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
+
   chorus*)
     case $cc_basename in
       *)
@@ -3753,7 +3890,7 @@
     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      _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'
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is; otherwise, prepend...
       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -3762,70 +3899,81 @@
 	echo EXPORTS > $output_objdir/$soname.def;
 	cat $export_symbols >> $output_objdir/$soname.def;
       fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
     else
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
   ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-  darwin* | rhapsody*)
-  if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case "$host_os" in
-    rhapsody* | darwin1.[[012]])
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[[012]])
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
-            ;;
-        esac
+          _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'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _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}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _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` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _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 $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _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}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
       fi
-      ;;
-    esac
-    lt_int_apple_cc_single_mod=no
-    output_verbose_link_cmd='echo'
-    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-      lt_int_apple_cc_single_mod=yes
-    fi
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    else
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
-    fi
-    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        ;;
 
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    _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}'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-  else
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-  fi
-    ;;
-
   dgux*)
     case $cc_basename in
-      ec++)
+      ec++*)
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      ghcx)
+      ghcx*)
 	# Green Hills C++ Compiler
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -3836,14 +3984,14 @@
 	;;
     esac
     ;;
-  freebsd[12]*)
+  freebsd[[12]]*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
   freebsd-elf*)
     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
     ;;
-  freebsd* | kfreebsd*-gnu)
+  freebsd* | dragonfly*)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -3860,11 +4008,11 @@
 				# location of the library.
 
     case $cc_basename in
-    CC)
+    CC*)
       # FIXME: insert proper C++ library support
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
       ;;
-    aCC)
+    aCC*)
       _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'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -3874,7 +4022,7 @@
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      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'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -3888,34 +4036,23 @@
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
-      hppa*64*)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
         ;;
-      ia64*)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        ;;
       *)
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
         ;;
       esac
     fi
-    case "$host_cpu" in
-    hppa*64*)
+    case $host_cpu in
+    hppa*64*|ia64*)
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
-    ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
     *)
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
@@ -3925,15 +4062,18 @@
     esac
 
     case $cc_basename in
-      CC)
+      CC*)
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      aCC)
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+      aCC*)
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
 	*)
 	  _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'
 	  ;;
@@ -3951,10 +4091,13 @@
       *)
 	if test "$GXX" = yes; then
 	  if test $with_gnu_ld = no; then
-	    case "$host_cpu" in
-	    ia64*|hppa*64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	    case $host_cpu in
+	    hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      ;;
+	    ia64*)
+	      _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'
+	      ;;
 	    *)
 	      _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'
 	      ;;
@@ -3967,11 +4110,25 @@
 	;;
     esac
     ;;
+  interix3*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    _LT_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'
+    _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'
+    ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC)
+      CC*)
 	# SGI C++
-	_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 ${objdir}/so_locations -o $lib'
+	_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'
 
 	# Archives containing C++ object files must be created using
 	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -3982,7 +4139,7 @@
       *)
 	if test "$GXX" = yes; then
 	  if test "$with_gnu_ld" = no; then
-	    _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}${objdir}/so_locations -o $lib'
+	    _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'
 	  else
 	    _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'
 	  fi
@@ -3993,9 +4150,9 @@
     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
     ;;
-  linux*)
+  linux* | k*bsd*-gnu)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -4020,17 +4177,41 @@
 	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 	;;
-      icpc)
+      icpc*)
 	# Intel C++
 	with_gnu_ld=yes
+	# version 8.0 and above of icpc choke on multiply defined symbols
+	# if we add $predep_objects and $postdep_objects, however 7.1 and
+	# earlier do not add the objects themselves.
+	case `$CC -V 2>&1` in
+	*"Version 7."*)
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  _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'
+	  ;;
+	*)  # Version 8.0 or newer
+	  tmp_idyn=
+	  case $host_cpu in
+	    ia64*) tmp_idyn=' -i_dynamic';;
+	  esac
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _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'
+	  ;;
+	esac
 	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_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'
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	;;
-      cxx)
+      pgCC*)
+        # Portland Group C++ compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	_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'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_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'
+        ;;
+      cxx*)
 	# Compaq C++
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	_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'
@@ -4061,7 +4242,7 @@
     ;;
   mvs*)
     case $cc_basename in
-      cxx)
+      cxx*)
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
@@ -4071,7 +4252,7 @@
 	;;
     esac
     ;;
-  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  netbsd* | netbsdelf*-gnu)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -4082,9 +4263,25 @@
     # Workaround some broken pre-1.5 toolchains
     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
     ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      _LT_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'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
   osf3*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -4100,14 +4297,14 @@
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      cxx)
+      cxx*)
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_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 ${objdir}/so_locations -o $lib'
+	_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'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -4125,7 +4322,7 @@
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	  _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}${objdir}/so_locations -o $lib'
+	  _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'
 
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -4144,7 +4341,7 @@
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -4159,17 +4356,17 @@
 	# the KAI C++ compiler.
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      cxx)
+      cxx*)
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_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 ${objdir}/so_locations -o $lib'
+	_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'
 	_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~
-	  $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 $objdir/so_locations -o $lib~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
 	  $rm $lib.exp'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -4188,7 +4385,7 @@
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	 _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}${objdir}/so_locations -o $lib'
+	 _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'
 
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -4209,27 +4406,14 @@
     # FIXME: insert proper C++ library support
     _LT_AC_TAGVAR(ld_shlibs, $1)=no
     ;;
-  sco*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case $cc_basename in
-      CC)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
   sunos4*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.x
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	;;
-      lcc)
+      lcc*)
 	# Lucid
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -4242,36 +4426,33 @@
     ;;
   solaris*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
 	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 	case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	  *)
 	    # The C++ compiler is used as linker so we must use $wl
 	    # flag to pass the commands to the underlying system
-	    # linker.
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
 	    ;;
 	esac
 	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	output_verbose_link_cmd='echo'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -4279,7 +4460,7 @@
 	# in the archive.
 	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
 	;;
-      gcx)
+      gcx*)
 	# Green Hills C++ Compiler
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -4317,12 +4498,63 @@
 	;;
     esac
     ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
     ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_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'
+	;;
+      *)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_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'
+	;;
+    esac
+    ;;
   tandem*)
     case $cc_basename in
-      NCC)
+      NCC*)
 	# NonStop-UX NCC 3.20
 	# FIXME: insert proper C++ library support
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -4355,8 +4587,6 @@
 AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
 
 AC_LIBTOOL_CONFIG($1)
 
@@ -4374,7 +4604,7 @@
 ])# AC_LIBTOOL_LANG_CXX_CONFIG
 
 # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------
+# ------------------------------------
 # Figure out "hidden" library dependencies from verbose
 # compiler output when linking a shared library.
 # Parse the compiler output and extract the necessary
@@ -4428,7 +4658,7 @@
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -4504,13 +4734,37 @@
 
 $rm -f confest.$objext
 
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_AC_TAGVAR(predep_objects,$1)=
+  _LT_AC_TAGVAR(postdep_objects,$1)=
+  _LT_AC_TAGVAR(postdeps,$1)=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+])
+
 case " $_LT_AC_TAGVAR(postdeps, $1) " in
 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
 esac
 ])# AC_LIBTOOL_POSTDEP_PREDEP
 
 # AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
+# --------------------------
 # Ensure that the configuration vars for the C compiler are
 # suitably defined.  Those variables are subsequently used by
 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
@@ -4554,12 +4808,16 @@
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${F77-"f77"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+_LT_CC_BASENAME([$compiler])
 
 AC_MSG_CHECKING([if libtool supports shared libraries])
 AC_MSG_RESULT([$can_build_shared])
@@ -4569,7 +4827,7 @@
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -4578,7 +4836,9 @@
   fi
   ;;
 aix4* | aix5*)
-  test "$enable_shared" = yes && enable_static=no
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
   ;;
 esac
 AC_MSG_RESULT([$enable_shared])
@@ -4588,8 +4848,6 @@
 test "$enable_shared" = yes || enable_static=yes
 AC_MSG_RESULT([$enable_static])
 
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
 _LT_AC_TAGVAR(GCC, $1)="$G77"
 _LT_AC_TAGVAR(LD, $1)="$LD"
 
@@ -4599,9 +4857,7 @@
 AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
 
-
 AC_LIBTOOL_CONFIG($1)
 
 AC_LANG_POP
@@ -4629,20 +4885,27 @@
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
 AC_LIBTOOL_PROG_COMPILER_PIC($1)
 AC_LIBTOOL_PROG_CC_C_O($1)
@@ -4650,8 +4913,6 @@
 AC_LIBTOOL_PROG_LD_SHLIBS($1)
 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
 
 AC_LIBTOOL_CONFIG($1)
 
@@ -4661,7 +4922,7 @@
 
 
 # AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
+# -------------------------
 # Ensure that the configuration vars for the Windows resource compiler are
 # suitably defined.  Those variables are subsequently used by
 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
@@ -4685,11 +4946,16 @@
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_AC_SYS_COMPILER
 
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 _LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
 AC_LIBTOOL_CONFIG($1)
@@ -4719,7 +4985,7 @@
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -4825,7 +5091,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -4836,11 +5102,11 @@
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e s/^X//"
+Xsed="$SED -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 # The names of the tagged configurations supported by this script.
 available_tags=
@@ -4871,7 +5137,13 @@
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
 
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -4882,6 +5154,9 @@
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
@@ -4947,7 +5222,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -5221,9 +5496,6 @@
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -5245,15 +5517,31 @@
   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   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'"
   ;;
+linux* | k*bsd*-gnu)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    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'"
+  fi
+  ;;
 irix* | nonstopux*)
   symcode='[[BCDEGRST]]'
   ;;
 osf*)
   symcode='[[BCDEGQRST]]'
   ;;
-solaris* | sysv5*)
+solaris*)
   symcode='[[BDRT]]'
   ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
 sysv4)
   symcode='[[DFNSTU]]'
   ;;
@@ -5276,8 +5564,11 @@
 # Try without a prefix undercore, then with it.
 for ac_symprfx in "" "_"; do
 
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -5433,6 +5724,10 @@
       # DJGPP does not support shared libraries at all
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
     sysv4*MP*)
       if test -d /usr/nec; then
 	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
@@ -5441,7 +5736,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	;;
       *)
@@ -5466,18 +5761,28 @@
 	;;
       chorus*)
 	case $cc_basename in
-	cxch68)
+	cxch68*)
 	  # Green Hills C++ Compiler
 	  # _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"
 	  ;;
 	esac
 	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
       dgux*)
 	case $cc_basename in
-	  ec++)
+	  ec++*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    ;;
-	  ghcx)
+	  ghcx*)
 	    # Green Hills C++ Compiler
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
@@ -5485,22 +5790,22 @@
 	    ;;
 	esac
 	;;
-      freebsd* | kfreebsd*-gnu)
+      freebsd* | dragonfly*)
 	# FreeBSD uses GNU C++
 	;;
       hpux9* | hpux10* | hpux11*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 	    if test "$host_cpu" != ia64; then
 	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
-	  aCC)
+	  aCC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-	    case "$host_cpu" in
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
@@ -5513,9 +5818,13 @@
 	    ;;
 	esac
 	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    # CC pic flag -KPIC is the default.
@@ -5524,20 +5833,26 @@
 	    ;;
 	esac
 	;;
-      linux*)
+      linux* | k*bsd*-gnu)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    # KAI C++ Compiler
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
-	  icpc)
+	  icpc* | ecpc*)
 	    # Intel C++
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
 	    ;;
-	  cxx)
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
 	    # Compaq C++
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
@@ -5554,25 +5869,25 @@
 	;;
       mvs*)
 	case $cc_basename in
-	  cxx)
+	  cxx*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
 	    ;;
 	  *)
 	    ;;
 	esac
 	;;
-      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      netbsd* | netbsdelf*-gnu)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 	    ;;
-	  RCC)
+	  RCC*)
 	    # Rational C++ 2.4.1
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
-	  cxx)
+	  cxx*)
 	    # Digital/Compaq C++
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -5586,24 +5901,15 @@
 	;;
       psos*)
 	;;
-      sco*)
-	case $cc_basename in
-	  CC)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
       solaris*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 	    ;;
-	  gcx)
+	  gcx*)
 	    # Green Hills C++ Compiler
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	    ;;
@@ -5613,12 +5919,12 @@
 	;;
       sunos4*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.x
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    ;;
-	  lcc)
+	  lcc*)
 	    # Lucid
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
@@ -5628,7 +5934,7 @@
 	;;
       tandem*)
 	case $cc_basename in
-	  NCC)
+	  NCC*)
 	    # NonStop-UX NCC 3.20
 	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    ;;
@@ -5636,7 +5942,14 @@
 	    ;;
 	esac
 	;;
-      unixware*)
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
 	;;
       vxworks*)
 	;;
@@ -5683,6 +5996,11 @@
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -5699,7 +6017,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -5725,6 +6043,16 @@
 	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -5736,7 +6064,7 @@
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -5759,13 +6087,20 @@
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
-    linux*)
-      case $CC in
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
       icc* | ecc*)
 	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
       ccc*)
         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         # All Alpha code is PIC.
@@ -5780,15 +6115,15 @@
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    sco3.2v5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
-      ;;
-
     solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -5797,7 +6132,7 @@
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5810,6 +6145,17 @@
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
     uts4*)
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5837,7 +6183,7 @@
     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
@@ -5846,6 +6192,16 @@
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
     ;;
 esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
 ])
 
 
@@ -5870,9 +6226,9 @@
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+    _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'
   ;;
-  linux*)
+  linux* | k*bsd*-gnu)
     _LT_AC_TAGVAR(link_all_deplibs, $1)=no
   ;;
   *)
@@ -5916,7 +6272,8 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
-
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
   case $host_os in
   cygwin* | mingw* | pw32*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
@@ -5926,6 +6283,10 @@
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -5936,6 +6297,27 @@
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -5986,10 +6368,10 @@
       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_AC_TAGVAR(always_export_symbols, $1)=no
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        _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'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -5998,13 +6380,60 @@
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
-	ld_shlibs=no
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    interix3*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_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'
+      _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'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  _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'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _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'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=no
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -6014,7 +6443,7 @@
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
 	cat <<EOF 1>&2
@@ -6035,6 +6464,33 @@
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    _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'
+	  else
+	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -6042,32 +6498,6 @@
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
-      fi
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=no
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -6078,16 +6508,11 @@
       ;;
     esac
 
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
-      runpath_var=LD_RUN_PATH
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-      fi
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -6099,7 +6524,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -6133,6 +6558,7 @@
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -6151,7 +6577,7 @@
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -6170,8 +6596,12 @@
   	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
   	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -6179,11 +6609,11 @@
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -6197,12 +6627,12 @@
        # Determine the default libpath from the value encoded in an empty executable.
        _LT_AC_SYS_LIBPATH_AIX
        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	_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"
        else
 	if test "$host_cpu" = ia64; then
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  _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"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 _LT_AC_SYS_LIBPATH_AIX
@@ -6211,13 +6641,11 @@
 	  # -berok will link without error, but may produce a broken library.
 	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _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'
 	fi
       fi
       ;;
@@ -6230,7 +6658,7 @@
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
       ;;
 
-    bsdi4*)
+    bsdi[[45]]*)
       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
       ;;
 
@@ -6251,57 +6679,57 @@
       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
       # FIXME: Should let the user specify the lib program.
       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      case "$host_os" in
-      rhapsody* | darwin1.[[012]])
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
-	;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[[012]])
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-	;;
-      esac
-    	lt_int_apple_cc_single_mod=no
-    	output_verbose_link_cmd='echo'
-    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-    	  lt_int_apple_cc_single_mod=yes
-    	fi
-    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    	else
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
-      fi
-      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          _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}'
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _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}'
     else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _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 $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _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}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
     fi
       ;;
 
@@ -6335,7 +6763,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | dragonfly*)
       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -6358,47 +6786,62 @@
       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
 	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
 	*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
@@ -6422,7 +6865,7 @@
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -6446,6 +6889,7 @@
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       else
@@ -6491,7 +6935,7 @@
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
 	_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'
 	_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~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$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'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -6499,21 +6943,15 @@
       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
-    sco3.2v5*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -6522,8 +6960,18 @@
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       case $host_os in
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
       ;;
@@ -6580,36 +7028,45 @@
       fi
       ;;
 
-    sysv4.2uw2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    sysv5*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_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'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_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'
+      fi
       ;;
 
     uts4*)
@@ -6627,11 +7084,6 @@
 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -6659,6 +7111,7 @@
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -6784,7 +7237,7 @@
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && break
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -6809,32 +7262,35 @@
     fi
   done
 done
+])
 SED=$lt_cv_path_SED
-])
 AC_MSG_RESULT([$SED])
 ])
 
 
 dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
-# serial 2 IT_PROG_INTLTOOL
+# serial 35 IT_PROG_INTLTOOL
 AC_DEFUN([IT_PROG_INTLTOOL],
-[
+[AC_PREREQ([2.50])dnl
 
+case "$am__api_version" in
+    1.[01234])
+	AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
+    ;;
+    *)
+    ;;
+esac
+
 if test -n "$1"; then
     AC_MSG_CHECKING(for intltool >= $1)
 
-    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
-    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }'  < ${ac_aux_dir}/intltool-update.in`
-    changequote({{,}})
-    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
-    changequote([,])
-
-    if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
-	AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
-    else
-	AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool $1 or later.])
-	exit 1
-    fi
+    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
+    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
+    [INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in`
+    ]
+    AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
+    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
+	AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
 fi
 
   INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
@@ -6854,6 +7310,7 @@
     INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
   INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
     INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
+    INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
 
 AC_SUBST(INTLTOOL_DESKTOP_RULE)
 AC_SUBST(INTLTOOL_DIRECTORY_RULE)
@@ -6872,17 +7329,13 @@
 AC_SUBST(INTLTOOL_CAVES_RULE)
 AC_SUBST(INTLTOOL_SCHEMAS_RULE)
 AC_SUBST(INTLTOOL_THEME_RULE)
+AC_SUBST(INTLTOOL_SERVICE_RULE)
 
 # Use the tools built into the package, not the ones that are installed.
+AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
+AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
+AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
 
-INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
-INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
-INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
-
-AC_SUBST(INTLTOOL_EXTRACT)
-AC_SUBST(INTLTOOL_MERGE)
-AC_SUBST(INTLTOOL_UPDATE)
-
 AC_PATH_PROG(INTLTOOL_PERL, perl)
 if test -z "$INTLTOOL_PERL"; then
    AC_MSG_ERROR([perl not found; required for intltool])
@@ -6904,104 +7357,96 @@
 AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
 AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
 
-# Remove file type tags (using []) from po/POTFILES.
+# Substitute ALL_LINGUAS so we can use it in po/Makefile
+AC_SUBST(ALL_LINGUAS)
+    
+IT_PO_SUBDIR([po])
 
-ifdef([AC_DIVERSION_ICMDS],[
-  AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
-      changequote(,)
-      mv -f po/POTFILES po/POTFILES.tmp
-      sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
-      rm -f po/POTFILES.tmp
-      changequote([,])
-  AC_DIVERT_POP()
-],[
-  ifdef([AC_CONFIG_COMMANDS_PRE],[
-    AC_CONFIG_COMMANDS_PRE([
-        changequote(,)
-        mv -f po/POTFILES po/POTFILES.tmp
-        sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
-        rm -f po/POTFILES.tmp
-        changequote([,])
-    ])
-  ])
+dnl The following is very similar to
+dnl
+dnl	AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
+dnl
+dnl with the following slight differences:
+dnl  - the *.in files are in ac_aux_dir,
+dnl  - if the file haven't changed upon reconfigure, it's not touched,
+dnl  - the evaluation of the third parameter enables a hack which computes
+dnl    the actual value of $libdir,
+dnl  - the user sees "executing intltool commands", instead of
+dnl    "creating intltool-extract" and such.
+dnl
+dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
+dnl a reason for it.
 
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # Keeping the `.' argument allows $(mkdir_p) to be used without
-  # argument.  Indeed, we sometimes output rules like
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.
-  # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
-  # expensive solution, as it forces Make to start a sub-shell.)
-  mkdir_p='mkdir -p -- .'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
+AC_CONFIG_COMMANDS([intltool], [
+
+for file in intltool-extract intltool-merge intltool-update; do
+  sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
+      -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
+      -e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
+      -e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
+      -e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
+      -e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
+      -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
+	< ${ac_aux_dir}/${file}.in > ${file}.out
+  if cmp -s ${file} ${file}.out 2>/dev/null; then
+    rm -f ${file}.out
   else
-    mkdir_p='$(install_sh) -d'
+    mv -f ${file}.out ${file}
   fi
-fi
-AC_SUBST([mkdir_p])
-])
+  chmod ugo+x ${file}
+  chmod u+w ${file}
+done
 
-# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
+],
+[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
+prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" 
+INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
+INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
+INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
 
-AC_CONFIG_COMMANDS([intltool], [
+])
 
-intltool_edit="-e 's#@INTLTOOL_EXTRACT@#`pwd`/intltool-extract#g' \
-               -e 's#@INTLTOOL_ICONV@#${INTLTOOL_ICONV}#g' \
-               -e 's#@INTLTOOL_MSGFMT@#${INTLTOOL_MSGFMT}#g' \
-               -e 's#@INTLTOOL_MSGMERGE@#${INTLTOOL_MSGMERGE}#g' \
-               -e 's#@INTLTOOL_XGETTEXT@#${INTLTOOL_XGETTEXT}#g' \
-               -e 's#@INTLTOOL_PERL@#${INTLTOOL_PERL}#g'"
 
-eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-extract.in \
-  > intltool-extract.out
-if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
-  rm -f intltool-extract.out
-else
-  mv -f intltool-extract.out intltool-extract
-fi
-chmod ugo+x intltool-extract
-chmod u+w intltool-extract
+# IT_PO_SUBDIR(DIRNAME)
+# ---------------------
+# All po subdirs have to be declared with this macro; the subdir "po" is
+# declared by IT_PROG_INTLTOOL.
+#
+AC_DEFUN([IT_PO_SUBDIR],
+[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
+dnl
+dnl The following CONFIG_COMMANDS should be exetuted at the very end
+dnl of config.status.
+AC_CONFIG_COMMANDS_PRE([
+  AC_CONFIG_COMMANDS([$1/stamp-it], [
+    rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
+    >"$1/stamp-it.tmp"
+    [sed '/^#/d
+	 s/^[[].*] *//
+	 /^[ 	]*$/d
+	'"s|^|	$ac_top_srcdir/|" \
+      "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
+    ]
+    if test ! -f "$1/Makefile"; then
+      AC_MSG_ERROR([$1/Makefile is not ready.])
+    fi
+    mv "$1/Makefile" "$1/Makefile.tmp"
+    [sed '/^POTFILES =/,/[^\\]$/ {
+		/^POTFILES =/!d
+		r $1/POTFILES
+	  }
+	 ' "$1/Makefile.tmp" >"$1/Makefile"]
+    rm -f "$1/Makefile.tmp"
+    mv "$1/stamp-it.tmp" "$1/stamp-it"
+  ])
+])dnl
+])
 
-eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-merge.in \
-  > intltool-merge.out
-if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
-  rm -f intltool-merge.out
-else
-  mv -f intltool-merge.out intltool-merge
-fi
-chmod ugo+x intltool-merge
-chmod u+w intltool-merge
 
-eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-update.in \
-  > intltool-update.out
-if cmp -s intltool-update intltool-update.out 2>/dev/null; then
-  rm -f intltool-update.out
-else
-  mv -f intltool-update.out intltool-update
-fi
-chmod ugo+x intltool-update
-chmod u+w intltool-update
-
-], INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir=${ac_aux_dir}
-INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' ICONV='${INTLTOOL_ICONV}'
-MSGFMT='${INTLTOOL_MSGFMT}' MSGMERGE='${INTLTOOL_MSGMERGE}'
-XGETTEXT='${INTLTOOL_XGETTEXT}')
-
-])
-
 # deprecated macros
-AC_DEFUN([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL($@)])
+AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
+# A hint is needed for aclocal from Automake <= 1.9.4:
+# AC_DEFUN([AC_PROG_INTLTOOL], ...)
 
 
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
@@ -7037,7 +7482,7 @@
 	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 fi
 if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
+	_pkg_min_version=m4_default([$1], [0.9.0])
 	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 		AC_MSG_RESULT([yes])
@@ -7049,29 +7494,61 @@
 fi[]dnl
 ])# PKG_PROG_PKG_CONFIG
 
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 # ---------------------------------------------
 m4_define([_PKG_CONFIG],
-[if test "x$ac_cv_env_[]$1[]_set" = "xset"; then
-	pkg_cv_[]$1=$ac_cv_env_[]$1[]_value
-elif test -n "$PKG_CONFIG"; then
-	if AC_RUN_LOG([$PKG_CONFIG --exists "$3" >/dev/null 2>&1]); then
-		pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+[if test -n "$PKG_CONFIG"; then
+    if test -n "$$1"; then
+        pkg_cv_[]$1="$$1"
+    else
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+			 [pkg_failed=yes])
+    fi
 else
 	pkg_failed=untried
 fi[]dnl
 ])# _PKG_CONFIG
 
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 # [ACTION-IF-NOT-FOUND])
 #
 #
 # Note that if there is a possibility the first call to
 # PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.in
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 #
 #
 # --------------------------------------------------------------
@@ -7081,40 +7558,51 @@
 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
 pkg_failed=no
-AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS],
-	[_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])])
-AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS],
-	[_PKG_CONFIG([$1][_LIBS], [libs], [$2])])
+AC_MSG_CHECKING([for $1])
 
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
 if test $pkg_failed = yes; then
-	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+        else 
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+        fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
 	ifelse([$4], , [AC_MSG_ERROR(dnl
-[Package requirements ($2) were not met.
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
-to avoid the need to call pkg-config.  See the pkg-config man page for
-more details.])],
-		[$4])
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
 elif test $pkg_failed = untried; then
 	ifelse([$4], , [AC_MSG_FAILURE(dnl
 [The pkg-config script could not be found or is too old.  Make sure it
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
-to avoid the need to call pkg-config.  See the pkg-config man page for
-more details.
+_PKG_TEXT
 
 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
 		[$4])
 else
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
 	ifelse([$3], , :, [$3])
 fi[]dnl
 ])# PKG_CHECK_MODULES
@@ -7518,3 +8006,543 @@
 AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
 ])dnl
 
+dnl -*- mode: autoconf -*-
+
+# serial 1
+
+dnl Usage:
+dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
+AC_DEFUN([GTK_DOC_CHECK],
+[
+  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+  dnl for overriding the documentation installation directory
+  AC_ARG_WITH(html-dir,
+    AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
+    [with_html_dir='${datadir}/gtk-doc/html'])
+  HTML_DIR="$with_html_dir"
+  AC_SUBST(HTML_DIR)
+
+  dnl enable/disable documentation building
+  AC_ARG_ENABLE(gtk-doc,
+    AC_HELP_STRING([--enable-gtk-doc],
+                   [use gtk-doc to build documentation [default=no]]),,
+    enable_gtk_doc=no)
+
+  have_gtk_doc=no
+  if test x$enable_gtk_doc = xyes; then
+    if test -z "$PKG_CONFIG"; then
+      AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+    fi
+    if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
+      have_gtk_doc=yes
+    fi
+
+  dnl do we want to do a version check?
+ifelse([$1],[],,
+    [gtk_doc_min_version=$1
+    if test "$have_gtk_doc" = yes; then
+      AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
+      if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+        have_gtk_doc=no
+      fi
+    fi
+])
+    if test "$have_gtk_doc" != yes; then
+      enable_gtk_doc=no
+    fi
+  fi
+
+  AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
+  AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
+])
+
+dnl copied from pygtk
+dnl
+dnl a macro to check for ability to create python extensions
+dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for python development headers)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl copied and modified from gnome-python
+dnl http://cvs.gnome.org/viewcvs/*checkout*/gnome-python/pygtk/m4/python.m4
+dnl
+dnl AM_CHECK_PYMOD(MODNAME [,VERSION, VERSION_MATCHER [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module of a particular version is visible to python.
+AC_DEFUN([AM_CHECK_PYMOD],
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1`
+AC_MSG_CHECKING(for python module $1 ifelse([$2],[],,[>= $2]))
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+        import $1
+except ImportError:
+        sys.exit(1)
+except:
+        sys.exit(0)
+sys.exit(0)"], [prog="
+import sys, string, $1
+curverstr = $3
+# use method from AM_PYTHON_CHECK_VERSION
+minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
+curver = map(int, string.split(curverstr, '.')) + [[0, 0, 0]]
+curverhex = 0
+for i in xrange(0, 4): curverhex = (curverhex << 8) + curver[[i]]
+if (curverhex >= minverhex):
+        sys.exit(0)
+else:
+        sys.exit(1)
+sys.exit(0)"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  AC_MSG_RESULT(yes)
+  ifelse([$4], [],, [$4
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$5], [],, [$5
+])dnl
+fi
+])
+
+dnl check for python
+AC_DEFUN([LIBGPOD_CHECK_PYTHON],
+[
+    dnl aclocal-1.7 is missing this when version is used in AM_PATH_PYTHON, fudge it
+    am_display_PYTHON=python
+
+    AC_ARG_WITH(python,
+        AC_HELP_STRING([--with-python=PATH],
+            [build python bindings [[default=yes]]]),
+        [with_python=$withval],[with_python=yes])
+
+    AC_MSG_CHECKING(whether to build python bindings)
+    if test "X$with_python" != Xno; then
+        if test "X$with_python" != Xyes; then
+            PYTHON=$with_python
+        fi
+        with_python=yes
+    fi
+    AC_MSG_RESULT($with_python)
+
+    if test "X$with_python" == Xyes; then
+        if test -z "$PYTHON"; then
+            AC_PATH_PROG(PYTHON, python)
+        fi
+    
+        if test -n "$PYTHON"; then
+            AM_PATH_PYTHON($PYTHON_MIN_VERSION)
+            AM_CHECK_PYTHON_HEADERS(with_python="yes",with_python="no")
+    
+            if test "X$with_python" == Xyes; then
+                dnl test for python ldflags
+                dnl copied from the Redland RDF bindings, http://librdf.org/
+                if test `uname` = Darwin; then
+                    PYTHON_LDFLAGS="-Wl,-F. -Wl,-F. -bundle"
+                    if $PYTHON -c 'import sys, string; sys.exit(string.find(sys.prefix,"Framework")+1)'; then
+                        :
+                    else
+                        PYTHON_LDFLAGS="$PYTHON_LDFLAGS -framework Python"
+                    fi
+                else
+                    PYTHON_LDFLAGS="-shared"
+                fi
+                AC_SUBST(PYTHON_LDFLAGS)
+
+                dnl check for eyeD3 module >= $PYTHON_EYED3_MIN_VERSION
+                AM_CHECK_PYMOD(eyeD3,$PYTHON_EYED3_MIN_VERSION,eyeD3.eyeD3Version,,with_python=no)
+
+                dnl check for swig
+                if test "X$with_python" == Xyes; then
+                    AC_PROG_SWIG($SWIG_MIN_VERSION)
+                    with_python="$has_swig"
+                fi
+            fi
+        else
+            AC_MSG_WARN(python not found.  try --with-python=/path/to/python)
+            with_python="no"
+        fi
+    fi
+    AM_CONDITIONAL(HAVE_PYTHON, test x$with_python = xyes)
+])dnl
+
+
+
+# Copyright 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# AM_PATH_PYTHON([MINIMUM-VERSION])
+
+# Adds support for distributing Python modules and packages.  To
+# install modules, copy them to $(pythondir), using the python_PYTHON
+# automake variable.  To install a package with the same name as the
+# automake package, install to $(pkgpythondir), or use the
+# pkgpython_PYTHON automake variable.
+
+# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
+# locations to install python extension modules (shared libraries).
+# Another macro is required to find the appropriate flags to compile
+# extension modules.
+
+# If your package is configured with a different prefix to python,
+# users will have to add the install directory to the PYTHONPATH
+# environment variable, or create a .pth file (see the python
+# documentation for details).
+
+# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
+# cause an error if the version of python installed on the system
+# doesn't meet the requirement.  MINIMUM-VERSION should consist of
+# numbers and dots only.
+
+AC_DEFUN([AM_PATH_PYTHON],
+ [
+  dnl Find a Python interpreter.  Python versions prior to 1.5 are not
+  dnl supported because the default installation locations changed from
+  dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
+  dnl in 1.5.
+  m4_define([_AM_PYTHON_INTERPRETER_LIST],
+	    [python python2 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
+
+  m4_if([$1],[],[
+    dnl No version check is needed.
+    # Find any Python interpreter.
+    AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST)
+    am_display_PYTHON=python
+  ], [
+    dnl A version check is needed.
+    if test -n "$PYTHON"; then
+      # If the user set $PYTHON, use it and don't search something else.
+      AC_MSG_CHECKING([whether $PYTHON version >= $1])
+      AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
+			      [AC_MSG_RESULT(yes)],
+			      [AC_MSG_ERROR(too old)])
+    else
+      # Otherwise, try each interpreter until we find one that satisfies
+      # VERSION.
+      AC_CACHE_CHECK([for a Python interpreter with version >= $1],
+	[am_cv_pathless_PYTHON],[
+	for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST : ; do
+          if test "$am_cv_pathless_PYTHON" = : ; then
+            AC_MSG_ERROR([no suitable Python interpreter found])
+	  fi
+          AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
+        done])
+      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+      AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
+      am_display_PYTHON=$am_cv_pathless_PYTHON
+    fi
+  ])
+
+  dnl Query Python for its version number.  Getting [:3] seems to be
+  dnl the best way to do this; it's what "site.py" does in the standard
+  dnl library.
+
+  AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
+    [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
+  AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+
+  dnl Use the values of $prefix and $exec_prefix for the corresponding
+  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
+  dnl distinct variables so they can be overridden if need be.  However,
+  dnl general consensus is that you shouldn't need this ability.
+
+  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
+  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+
+  dnl At times (like when building shared libraries) you may want
+  dnl to know which OS platform Python thinks this is.
+
+  AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
+    [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
+  AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
+
+
+  dnl Set up 4 directories:
+
+  dnl pythondir -- where to install python scripts.  This is the
+  dnl   site-packages directory, not the python standard library
+  dnl   directory like in previous automake betas.  This behavior
+  dnl   is more consistent with lispdir.m4 for example.
+  dnl Query distutils for this directory.  distutils does not exist in
+  dnl Python 1.5, so we fall back to the hardcoded directory if it
+  dnl doesn't work.
+  AC_CACHE_CHECK([for $am_display_PYTHON script directory],
+    [am_cv_python_pythondir],
+    [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
+     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
+  AC_SUBST([pythondir], [$am_cv_python_pythondir])
+
+  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
+  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
+  dnl   more consistent with the rest of automake.
+
+  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
+
+  dnl pyexecdir -- directory for installing python extension modules
+  dnl   (shared libraries)
+  dnl Query distutils for this directory.  distutils does not exist in
+  dnl Python 1.5, so we fall back to the hardcoded directory if it
+  dnl doesn't work.
+  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
+    [am_cv_python_pyexecdir],
+    [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
+     echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
+  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
+
+  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
+
+  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
+])
+
+
+# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# ---------------------------------------------------------------------------
+# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
+# Run ACTION-IF-FALSE otherwise.
+# This test uses sys.hexversion instead of the string equivalent (first
+# word of sys.version), in order to cope with versions such as 2.2c1.
+# hexversion has been introduced in Python 1.5.2; it's probably not
+# worth to support older versions (1.5.1 was released on October 31, 1998).
+AC_DEFUN([AM_PYTHON_CHECK_VERSION],
+ [prog="import sys, string
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
+sys.exit(sys.hexversion < minverhex)"
+  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
+
+# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+dnl @synopsis AC_PROG_SWIG([major.minor.micro])
+dnl
+dnl This macro searches for a SWIG installation on your system. If
+dnl found you should call SWIG via $(SWIG). You can use the optional
+dnl first argument to check if the version of the available SWIG is
+dnl greater than or equal to the value of the argument. It should have
+dnl the format: N[.N[.N]] (N is a number between 0 and 999. Only the
+dnl first N is mandatory.)
+dnl
+dnl If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks
+dnl that the swig package is this version number or higher.
+dnl
+dnl In configure.in, use as:
+dnl
+dnl             AC_PROG_SWIG(1.3.17)
+dnl             SWIG_ENABLE_CXX
+dnl             SWIG_MULTI_MODULE_SUPPORT
+dnl             SWIG_PYTHON
+dnl
+dnl @category InstalledPackages
+dnl @author Sebastian Huber <sebastian-huber at web.de>
+dnl @author Alan W. Irwin <irwin at beluga.phys.uvic.ca>
+dnl @author Rafael Laboissiere <rafael at laboissiere.net>
+dnl @author Andrew Collier <abcollier at yahoo.com>
+dnl @version 2004-09-20
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_SWIG],[
+        AC_PATH_PROG([SWIG],[swig])
+        if test -z "$SWIG" ; then
+                AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "$1" ; then
+                AC_MSG_CHECKING([for SWIG version])
+                [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+                AC_MSG_RESULT([$swig_version])
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        [required=$1]
+                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_major" ; then
+                                [required_major=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_minor" ; then
+                                [required_minor=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_patch" ; then
+                                [required_patch=0]
+                        fi
+                        # Calculate the available version number components
+                        [available=$swig_version]
+                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_major" ; then
+                                [available_major=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_minor" ; then
+                                [available_minor=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_patch" ; then
+                                [available_patch=0]
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
+                                SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                                has_swig="no"
+                        else
+                                SWIG_LIB=`$SWIG -swiglib`
+                                has_swig="yes"
+                        fi
+                else
+                        AC_MSG_WARN([cannot determine SWIG version])
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                        has_swig="no"
+                fi
+        fi
+        AC_SUBST([SWIG_LIB])
+])
+
+# SWIG_ENABLE_CXX()
+#
+# Enable SWIG C++ support.  This affects all invocations of $(SWIG).
+AC_DEFUN([SWIG_ENABLE_CXX],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        AC_REQUIRE([AC_PROG_CXX])
+        SWIG="$SWIG -c++"
+])
+
+# SWIG_MULTI_MODULE_SUPPORT()
+#
+# Enable support for multiple modules.  This effects all invocations
+# of $(SWIG).  You have to link all generated modules against the
+# appropriate SWIG runtime library.  If you want to build Python
+# modules for example, use the SWIG_PYTHON() macro and link the
+# modules against $(SWIG_PYTHON_LIBS).
+#
+AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        SWIG="$SWIG -noruntime"
+])
+
+# SWIG_PYTHON([use-shadow-classes = {no, yes}])
+#
+# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
+# and $(SWIG_PYTHON_OPT) output variables.
+#
+# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate
+# code for Python.  Shadow classes are enabled unless the value of the
+# optional first argument is exactly 'no'.  If you need multi module
+# support (provided by the SWIG_MULTI_MODULE_SUPPORT() macro) use
+# $(SWIG_PYTHON_LIBS) to link against the appropriate library.  It
+# contains the SWIG Python runtime library that is needed by the type
+# check system for example.
+AC_DEFUN([SWIG_PYTHON],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        AC_REQUIRE([AC_PYTHON_DEVEL])
+        test "x$1" != "xno" || swig_shadow=" -noproxy"
+        AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow])
+        AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
+])
+
+
+dnl @synopsis AC_LIB_WAD
+dnl
+dnl This macro searches for installed WAD library.
+dnl
+AC_DEFUN([AC_LIB_WAD],
+[
+        AC_REQUIRE([AC_PYTHON_DEVEL])
+        AC_ARG_ENABLE(wad,
+        AC_HELP_STRING([--enable-wad], [enable wad module]),
+        [
+                case "${enableval}" in
+                        no)     ;;
+                        *)      if test "x${enableval}" = xyes;
+                                then
+                                        check_wad="yes"
+                                fi ;;
+                esac
+        ], [])
+
+        if test -n "$check_wad";
+        then
+                AC_CHECK_LIB(wadpy, _init, [WADPY=-lwadpy], [], $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS)
+                AC_SUBST(WADPY)
+        fi
+])
+

Added: libgpod/branches/upstream/current/bindings/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/bindings/Makefile.am	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1 @@
+SUBDIRS=python

Added: libgpod/branches/upstream/current/bindings/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/bindings/Makefile.in	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,517 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
+GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
+HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_ICONV = @INTLTOOL_ICONV@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
+INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
+INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBGPOD_AGE = @LIBGPOD_AGE@
+LIBGPOD_CFLAGS = @LIBGPOD_CFLAGS@
+LIBGPOD_CURRENT = @LIBGPOD_CURRENT@
+LIBGPOD_LIBS = @LIBGPOD_LIBS@
+LIBGPOD_REVISION = @LIBGPOD_REVISION@
+LIBGPOD_VERSION = @LIBGPOD_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = python
+subdir = bindings
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+	ps-recursive install-info-recursive uninstall-info-recursive \
+	all-recursive install-data-recursive install-exec-recursive \
+	installdirs-recursive install-recursive uninstall-recursive \
+	check-recursive installcheck-recursive
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+DIST_SUBDIRS = $(SUBDIRS)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  bindings/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	else \
+	  include_option=--include; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d $(distdir)/$$subdir \
+	    || mkdir $(distdir)/$$subdir \
+	    || exit 1; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$(top_distdir)" \
+	        distdir=../$(distdir)/$$subdir \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
+	clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am \
+	dvi-recursive info info-am info-recursive install install-am \
+	install-data install-data-am install-data-recursive \
+	install-exec install-exec-am install-exec-recursive \
+	install-info install-info-am install-info-recursive install-man \
+	install-recursive install-strip installcheck installcheck-am \
+	installdirs installdirs-am installdirs-recursive \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
+	pdf-recursive ps ps-am ps-recursive tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am \
+	uninstall-info-recursive uninstall-recursive
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Deleted: libgpod/branches/upstream/current/bindings/python/Makefile
===================================================================
--- libgpod/branches/upstream/current/bindings/python/Makefile	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/bindings/python/Makefile	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,20 +0,0 @@
-all: _gpod.so
-
-gpod_wrap.c: gpod.i
-	swig -python gpod.i
-
-gpod.py: gpod.i
-	swig -python gpod.i
-
-gpod_wrap.o: gpod_wrap.c
-	gcc -c -fpic gpod_wrap.c -I /usr/include/python2.3/ `pkg-config glib-2.0 --cflags`
-
-_gpod.so: gpod_wrap.o
-	gcc -shared gpod_wrap.o -o _gpod.so -L../../src/.libs -lgpod `pkg-config glib-2.0 --libs`
-
-
-clean:
-	rm gpod.py  gpod.pyc _gpod.so gpod_wrap.c gpod_wrap.o
-
-test: _gpod.so play.py
-	LD_LIBRARY_PATH=../../src/.libs ./play.py 

Added: libgpod/branches/upstream/current/bindings/python/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/bindings/python/Makefile.am	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,46 @@
+SUBDIRS = examples
+
+EXTRA_DIST =		\
+	gpod.i 		\
+	ipod.py 	\
+	__init__.py	\
+	gtkpod.py
+
+CLEANFILES =		\
+	*.pyc		\
+	*.pyo		\
+	_gpod.so	\
+	gpod.py		\
+	gpod_wrap.c	\
+	gpod_wrap.o
+
+if HAVE_PYTHON
+MODULE_CFLAGS	= `$(PKG_CONFIG) --cflags $(top_srcdir)/libgpod-1.0.pc` $(PYTHON_INCLUDES)
+MODULE_LIBS	= `$(PKG_CONFIG) --libs $(top_srcdir)/libgpod-1.0.pc` -L$(top_srcdir)/src/.libs
+python_DATA	= gpod.py _gpod.so
+
+gpod_wrap.c: gpod.i
+	$(SWIG) -python gpod.i
+
+gpod.py: gpod.i
+	$(SWIG) -python gpod.i
+
+gpod_wrap.o: gpod_wrap.c
+	$(CC) $(MODULE_CFLAGS) -c -fpic gpod_wrap.c
+
+_gpod.so: gpod_wrap.o
+	$(CC) $(MODULE_LIBS) @PYTHON_LDFLAGS@ gpod_wrap.o -o $@
+
+install-pythonDATA: $(python_DATA)
+	$(mkinstalldirs) $(DESTDIR)$(pythondir)/gpod
+	$(INSTALL_PROGRAM) _gpod.so  $(DESTDIR)$(pythondir)/gpod/_gpod.so
+	$(INSTALL_DATA) *.py         $(DESTDIR)$(pythondir)/gpod/
+	$(PYTHON) -c 'from compileall import compile_dir; compile_dir("$(DESTDIR)$(pythondir)/gpod/", ddir="$(pythondir)/gpod/")'
+	$(PYTHON) -O -c 'from compileall import compile_dir; compile_dir("$(DESTDIR)$(pythondir)/gpod/", ddir="$(pythondir)/gpod/")'
+
+uninstall-pythonDATA: $(python_DATA)
+	rm -rf $(DESTDIR)$(pythondir)/gpod
+
+test:
+	cd tests && python tests.py
+endif

Added: libgpod/branches/upstream/current/bindings/python/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/bindings/python/Makefile.in	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,585 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
+GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
+HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_ICONV = @INTLTOOL_ICONV@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
+INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
+INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBGPOD_AGE = @LIBGPOD_AGE@
+LIBGPOD_CFLAGS = @LIBGPOD_CFLAGS@
+LIBGPOD_CURRENT = @LIBGPOD_CURRENT@
+LIBGPOD_LIBS = @LIBGPOD_LIBS@
+LIBGPOD_REVISION = @LIBGPOD_REVISION@
+LIBGPOD_VERSION = @LIBGPOD_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = examples
+
+EXTRA_DIST = \
+	gpod.i 		\
+	ipod.py 	\
+	__init__.py	\
+	gtkpod.py
+
+
+CLEANFILES = \
+	*.pyc		\
+	*.pyo		\
+	_gpod.so	\
+	gpod.py		\
+	gpod_wrap.c	\
+	gpod_wrap.o
+
+
+ at HAVE_PYTHON_TRUE@MODULE_CFLAGS = `$(PKG_CONFIG) --cflags $(top_srcdir)/libgpod-1.0.pc` $(PYTHON_INCLUDES)
+ at HAVE_PYTHON_TRUE@MODULE_LIBS = `$(PKG_CONFIG) --libs $(top_srcdir)/libgpod-1.0.pc` -L$(top_srcdir)/src/.libs
+ at HAVE_PYTHON_TRUE@python_DATA = gpod.py _gpod.so
+subdir = bindings/python
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DATA = $(python_DATA)
+
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+	ps-recursive install-info-recursive uninstall-info-recursive \
+	all-recursive install-data-recursive install-exec-recursive \
+	installdirs-recursive install-recursive uninstall-recursive \
+	check-recursive installcheck-recursive
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+DIST_SUBDIRS = $(SUBDIRS)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  bindings/python/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+pythonDATA_INSTALL = $(INSTALL_DATA)
+ at HAVE_PYTHON_FALSE@install-pythonDATA: $(python_DATA)
+ at HAVE_PYTHON_FALSE@	@$(NORMAL_INSTALL)
+ at HAVE_PYTHON_FALSE@	$(mkinstalldirs) $(DESTDIR)$(pythondir)
+ at HAVE_PYTHON_FALSE@	@list='$(python_DATA)'; for p in $$list; do \
+ at HAVE_PYTHON_FALSE@	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ at HAVE_PYTHON_FALSE@	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+ at HAVE_PYTHON_FALSE@	  echo " $(pythonDATA_INSTALL) $$d$$p $(DESTDIR)$(pythondir)/$$f"; \
+ at HAVE_PYTHON_FALSE@	  $(pythonDATA_INSTALL) $$d$$p $(DESTDIR)$(pythondir)/$$f; \
+ at HAVE_PYTHON_FALSE@	done
+
+ at HAVE_PYTHON_FALSE@uninstall-pythonDATA:
+ at HAVE_PYTHON_FALSE@	@$(NORMAL_UNINSTALL)
+ at HAVE_PYTHON_FALSE@	@list='$(python_DATA)'; for p in $$list; do \
+ at HAVE_PYTHON_FALSE@	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+ at HAVE_PYTHON_FALSE@	  echo " rm -f $(DESTDIR)$(pythondir)/$$f"; \
+ at HAVE_PYTHON_FALSE@	  rm -f $(DESTDIR)$(pythondir)/$$f; \
+ at HAVE_PYTHON_FALSE@	done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	else \
+	  include_option=--include; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ../..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d $(distdir)/$$subdir \
+	    || mkdir $(distdir)/$$subdir \
+	    || exit 1; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$(top_distdir)" \
+	        distdir=../$(distdir)/$$subdir \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+	$(mkinstalldirs) $(DESTDIR)$(pythondir)
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pythonDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pythonDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
+	clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am \
+	dvi-recursive info info-am info-recursive install install-am \
+	install-data install-data-am install-data-recursive \
+	install-exec install-exec-am install-exec-recursive \
+	install-info install-info-am install-info-recursive install-man \
+	install-pythonDATA install-recursive install-strip installcheck \
+	installcheck-am installdirs installdirs-am \
+	installdirs-recursive maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
+	pdf-recursive ps ps-am ps-recursive tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am \
+	uninstall-info-recursive uninstall-pythonDATA \
+	uninstall-recursive
+
+
+ at HAVE_PYTHON_TRUE@gpod_wrap.c: gpod.i
+ at HAVE_PYTHON_TRUE@	$(SWIG) -python gpod.i
+
+ at HAVE_PYTHON_TRUE@gpod.py: gpod.i
+ at HAVE_PYTHON_TRUE@	$(SWIG) -python gpod.i
+
+ at HAVE_PYTHON_TRUE@gpod_wrap.o: gpod_wrap.c
+ at HAVE_PYTHON_TRUE@	$(CC) $(MODULE_CFLAGS) -c -fpic gpod_wrap.c
+
+ at HAVE_PYTHON_TRUE@_gpod.so: gpod_wrap.o
+ at HAVE_PYTHON_TRUE@	$(CC) $(MODULE_LIBS) @PYTHON_LDFLAGS@ gpod_wrap.o -o $@
+
+ at HAVE_PYTHON_TRUE@install-pythonDATA: $(python_DATA)
+ at HAVE_PYTHON_TRUE@	$(mkinstalldirs) $(DESTDIR)$(pythondir)/gpod
+ at HAVE_PYTHON_TRUE@	$(INSTALL_PROGRAM) _gpod.so  $(DESTDIR)$(pythondir)/gpod/_gpod.so
+ at HAVE_PYTHON_TRUE@	$(INSTALL_DATA) *.py         $(DESTDIR)$(pythondir)/gpod/
+ at HAVE_PYTHON_TRUE@	$(PYTHON) -c 'from compileall import compile_dir; compile_dir("$(DESTDIR)$(pythondir)/gpod/", ddir="$(pythondir)/gpod/")'
+ at HAVE_PYTHON_TRUE@	$(PYTHON) -O -c 'from compileall import compile_dir; compile_dir("$(DESTDIR)$(pythondir)/gpod/", ddir="$(pythondir)/gpod/")'
+
+ at HAVE_PYTHON_TRUE@uninstall-pythonDATA: $(python_DATA)
+ at HAVE_PYTHON_TRUE@	rm -rf $(DESTDIR)$(pythondir)/gpod
+
+ at HAVE_PYTHON_TRUE@test:
+ at HAVE_PYTHON_TRUE@	cd tests && python tests.py
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: libgpod/branches/upstream/current/bindings/python/__init__.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/__init__.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/__init__.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,6 @@
+from gpod import *
+from ipod import *
+
+__all__ = ["DatabaseException", "TrackException",
+           "Database","Track","Playlist"]
+

Added: libgpod/branches/upstream/current/bindings/python/examples/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/Makefile.am	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,4 @@
+EXTRA_DIST = coverart_fetch.py toy_around.py \
+             tag_genre_from_audioscrobber.py add_song.py \
+             play_with_ipod_api.py create_mp3_tags_from_itdb.py \
+             play_with_smart_playlists.py

Added: libgpod/branches/upstream/current/bindings/python/examples/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/Makefile.in	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,372 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
+GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
+HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_ICONV = @INTLTOOL_ICONV@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
+INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
+INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBGPOD_AGE = @LIBGPOD_AGE@
+LIBGPOD_CFLAGS = @LIBGPOD_CFLAGS@
+LIBGPOD_CURRENT = @LIBGPOD_CURRENT@
+LIBGPOD_LIBS = @LIBGPOD_LIBS@
+LIBGPOD_REVISION = @LIBGPOD_REVISION@
+LIBGPOD_VERSION = @LIBGPOD_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+EXTRA_DIST = coverart_fetch.py toy_around.py \
+             tag_genre_from_audioscrobber.py add_song.py \
+             play_with_ipod_api.py create_mp3_tags_from_itdb.py \
+             play_with_smart_playlists.py
+
+subdir = bindings/python/examples
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  bindings/python/examples/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ../../..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: libgpod/branches/upstream/current/bindings/python/examples/add_song.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/add_song.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/add_song.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,121 @@
+#!/usr/bin/python
+
+##  Copyright (C) 2006 Nick Piper <nick-gtkpod at nickpiper co uk>
+##  Part of the gtkpod project.
+ 
+##  URL: http://www.gtkpod.org/
+##  URL: http://gtkpod.sourceforge.net/
+
+##  The code contained in this file is free software; you can redistribute
+##  it and/or modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either version
+##  2.1 of the License, or (at your option) any later version.
+
+##  This file is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this code; if not, write to the Free Software
+##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# this file is just a little example to see how you could add music
+
+import os, os.path
+import gpod
+import sys
+from optparse import OptionParser
+import urlparse, urllib2
+import tempfile
+import shutil
+import eyeD3
+
+def download(path):
+    print "Downloading %s" % path
+    remotefile = urllib2.urlopen(path)
+    try:
+        size = int(remotefile.info()['Content-Length'])
+    except KeyError:
+        size = None
+    hndl, tempfilename = tempfile.mkstemp('.mp3')
+    temp = open(tempfilename,"wb")
+    fetched = 0
+    while 1:
+        buf = remotefile.read(1024*20)
+        if not buf: break
+        temp.write(buf)
+        fetched += len(buf)
+        if size:
+            sys.stdout.write("%.02f%% of %s Bytes\r" % (100*fetched / float(size), size))
+        else:
+            sys.stdout.write(" Fetched %d bytes\r" % fetched)
+        sys.stdout.flush()
+    temp.close()
+    remotefile.close()
+    return tempfilename
+
+
+parser = OptionParser()
+parser.add_option("-m", "--mountpoint", dest="mountpoint",
+                  default="/mnt/ipod",
+                  help="use iPod at MOUNTPOINT", metavar="MOUNTPOINT")
+parser.add_option("-l", "--playlist", dest="playlist",
+                  help="add tracks to PLAYLIST", metavar="PLAYLIST")
+parser.add_option("-p", "--podcast",
+                  dest="ispodcast",
+                  action="store_true",
+                  default=False,
+                  help="add to podcast playlist")
+(options, args) = parser.parse_args()
+
+if len(args) == 0:
+    parser.error("Requires an mp3 to add.")
+
+db = gpod.Database(options.mountpoint)
+
+
+playlist = None
+if options.playlist:
+    for pl in db.Playlists:
+        if pl.name == options.playlist:
+            playlist = pl
+    if not playlist:
+        playlist = db.new_Playlist(title=options.playlist)
+        print "Created new playlist %s" % playlist
+
+
+deleteWhenDone = []
+
+for path in args:
+    transport = urlparse.urlsplit(path)[0]
+    if transport:
+        path = download(path)
+        deleteWhenDone.append(path)
+
+    try:
+        track = db.new_Track(filename=path, podcast=options.ispodcast)
+    except gpod.TrackException, e:
+        print "Exception handling %s: %s" % (path, e)
+        continue # skip this track
+
+    print "Added %s to database" % track
+
+    if playlist:
+        print " adding to playlist %s" % playlist
+        playlist.add(track)
+
+def print_progress(database, track, i, total):
+    sys.stdout.write("Copying to iPod %04d/%d: %s\r" % (i,total,track))
+    sys.stdout.flush()
+        
+print "Copying to iPod"
+db.copy_delayed_files(callback=print_progress)
+
+[os.unlink(f) for f in deleteWhenDone]
+
+print "Saving database"
+db.close()
+print "Saved db"
+
+


Property changes on: libgpod/branches/upstream/current/bindings/python/examples/add_song.py
___________________________________________________________________
Name: svn:executable
   + *

Added: libgpod/branches/upstream/current/bindings/python/examples/coverart_fetch.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/coverart_fetch.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/coverart_fetch.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,108 @@
+#!/usr/bin/python
+
+##  Copyright (C) 2005 Nick Piper <nick-gtkpod at nickpiper co uk>
+##  Part of the gtkpod project.
+ 
+##  URL: http://www.gtkpod.org/
+##  URL: http://gtkpod.sourceforge.net/
+
+##  The code contained in this file is free software; you can redistribute
+##  it and/or modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either version
+##  2.1 of the License, or (at your option) any later version.
+
+##  This file is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this code; if not, write to the Free Software
+##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+##  $Id: coverart_fetch.py,v 1.7 2006/04/08 08:23:14 nicholas Exp $
+
+import os, os.path
+import gpod
+import sys
+import amazon
+import urllib
+import Image
+import tempfile
+
+ipod_mount = '/mnt/ipod'
+itdb = gpod.itdb_parse(ipod_mount, None)
+if not itdb:
+    print "Failed to read ipod at mountpoint %s" % ipod_mount
+    sys.exit(2)
+
+# set your key here, or see amazon.py for a list of other places to
+# store it.
+amazon.setLicense('')
+
+images = {}
+
+for track in gpod.sw_get_tracks(itdb):
+    print track.artist, track.album, track.title, " :",
+
+    #gpod.itdb_track_remove_thumbnails(track)
+
+    if track.artwork.artwork_size:
+        print "Already has artwork, skipping."
+        continue
+
+    if not (track.artist and track.album):
+        print "Need an artist AND album name, skipping."       
+        continue
+    
+    # avoid fetching again if we already had a suitable image
+    if not images.has_key((track.album,track.artist)):
+        query = "%s + %s" % (track.artist, track.album)
+        # nasty hacks to get better hits. Is there a library out there
+        # for this?  Note we take out double quotes too: Amazon place 
+        # this string literally into their XML response, so can end up 
+        # giving us back: <Arg value="search"term" 
+        # name="KeywordSearch"> which is not well formed :-( 
+        for term in ["Disk 1", "Disk 2", '12"', '12 "','"','&']: 
+            query = query.replace(term,"") 
+        print "Searching for %s: " % query,
+        try:
+            albums = amazon.searchByKeyword(query,
+                                            type="lite",product_line="music")
+        except amazon.AmazonError, e:
+            print e
+            albums = []
+                
+        if len(albums) == 0:
+            continue
+        album = albums[0]
+
+        hdle, filename = tempfile.mkstemp()
+        i = urllib.urlopen(album.ImageUrlLarge)
+        open(filename,"w").write(i.read())
+        img = Image.open(filename)
+        if not (img.size[0] > 10 or img.size[1] > 10):
+            os.unlink(filename)
+        else:
+            print "Fetched image for %s, %s" % (track.album,track.artist)
+            images[(track.album,track.artist)] = filename
+
+    try:
+        r = gpod.itdb_track_set_thumbnails(track,images[(track.album,track.artist)])
+        if r != 1:
+            print "Failed to save image thumbnail to ipod."
+        else:
+            print "Added thumbnails for %s, %s" % (track.album,track.artist)
+    except KeyError:
+        print "No image available for %s, %s" % (track.album,track.artist)
+
+
+print "Writing ipod database..."
+gpod.itdb_write(itdb, None)
+
+print "Cleaning up downloaded images..."
+# really, we should do this if any of the real work threw an exception
+# too. This is just a demo script :-)
+for filename in images.values():
+    os.unlink(filename)
+


Property changes on: libgpod/branches/upstream/current/bindings/python/examples/coverart_fetch.py
___________________________________________________________________
Name: svn:executable
   + *

Added: libgpod/branches/upstream/current/bindings/python/examples/create_mp3_tags_from_itdb.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/create_mp3_tags_from_itdb.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/create_mp3_tags_from_itdb.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# create_mp3_tags_from_itdb.py (Populate iPod's MP3 tags with data from iTunesDB)
+# Copyright (c) 20060423 Thomas Perl <thp at perli.net>
+#
+# I wrote this small script to populate MP3 files on my iPod that have set 
+# artist/title/album data in their iTunesDB entry, but not in their ID3 tag.
+#
+# This makes it possible to import your iPod_Control folder with any tool
+# you like or even import it into Rockbox' (www.rockbox.org) nifty TagCache.
+#
+# This file comes with no warranty. It might even kill your iPod, delete all
+# your songs, or do some other nasty stuff. Then again, it might just work ;)
+#
+# Release under the terms of the GNU LGPL.
+#
+#  The code contained in this file is free software; you can redistribute
+#  it and/or modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either version
+#  2.1 of the License, or (at your option) any later version.
+#
+#  This file is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this code; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+import gpod
+import eyeD3
+
+# please specify your iPod mountpoint here..
+IPOD_MOUNT = '/media/ipod/'
+
+itdb = gpod.itdb_parse( IPOD_MOUNT, None)
+
+if not itdb:
+    print 'Cannot open iPod at %s' % ( IPOD_MOUNT )
+    sys.exit( 2)
+
+# just for some stats..
+counter_upd = 0
+counter_left = 0
+
+for track in gpod.sw_get_tracks( itdb):
+    if track.artist is None or track.title is None or track.album is None:
+        # silently ignore
+        continue
+
+    filename = gpod.itdb_filename_on_ipod( track)
+    try:
+        tag = eyeD3.Tag()
+        tag.link( filename)
+        if tag.link( filename) != True:
+            print ''
+            print '%s has no id3 tags' % ( filename )
+            print 'iTDB says: AR = %s, TI = %s, AL = %s' % ( track.artist, track.title, track.album )
+            tag.setVersion( eyeD3.ID3_DEFAULT_VERSION)
+            tag.setArtist( track.artist)
+            tag.setAlbum( track.album)
+            tag.setTitle( track.title)
+            tag.addComment( 'tagged from itdb with libgpod')
+            tag.update()
+            counter_upd = counter_upd + 1
+            print 'wrote tags to: %s' % ( filename )
+    except:
+        print 'informative debug output: something went wrong.. :/'
+        counter_left = counter_left + 1
+
+print ''
+print ' ++ results ++'
+print "updated: %d\nleft as-is: %d" % ( counter_upd, counter_left )
+print ''
+


Property changes on: libgpod/branches/upstream/current/bindings/python/examples/create_mp3_tags_from_itdb.py
___________________________________________________________________
Name: svn:executable
   + *

Deleted: libgpod/branches/upstream/current/bindings/python/examples/play.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/play.py	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/bindings/python/examples/play.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,90 +0,0 @@
-#!/usr/bin/python
-
-##  Copyright (C) 2005 Nick Piper <nick-gtkpod at nickpiper co uk>
-##  Part of the gtkpod project.
- 
-##  URL: http://www.gtkpod.org/
-##  URL: http://gtkpod.sourceforge.net/
-
-##  The code contained in this file is free software; you can redistribute
-##  it and/or modify it under the terms of the GNU Lesser General Public
-##  License as published by the Free Software Foundation; either version
-##  2.1 of the License, or (at your option) any later version.
-
-##  This file is distributed in the hope that it will be useful,
-##  but WITHOUT ANY WARRANTY; without even the implied warranty of
-##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-##  Lesser General Public License for more details.
-
-##  You should have received a copy of the GNU Lesser General Public
-##  License along with this code; if not, write to the Free Software
-##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-##  $Id: play.py,v 1.4 2005/11/27 17:27:51 nicholas Exp $
-
-
-# this file is just a little example I use for testing, it doesn't
-# play the music, but plays with the database ;-)
-
-import os, os.path
-import gpod
-import sys
-
-ipod_mount = '/mnt/ipod'
-
-remove_track = "The Dancer"
-
-#dbname = os.path.join(os.environ['HOME'],".gtkpod/iTunesDB")
-#dbname = os.path.join(os.environ['HOME'],".gtkpod/local_0.itdb")
-dbname = os.path.join(ipod_mount,"iPod_Control/iTunes/iTunesDB")
-
-#itdb = gpod.itdb_parse_file(dbname, None)
-# the image related functions require us to use parse and give it the
-# mount point; and they won't work without an actual ipod.
-itdb = gpod.itdb_parse(ipod_mount, None)
-if not itdb:
-    print "Failed to read %s" % dbname
-    sys.exit(2)
-itdb.mountpoint = ipod_mount
-
-if False:
-    for playlist in gpod.sw_get_playlists(itdb):
-        print playlist.name
-        print type(playlist.name)
-        print gpod.itdb_playlist_tracks_number(playlist)
-        for track in gpod.sw_get_playlist_tracks(playlist):
-            print track.title
-    
-for track in gpod.sw_get_tracks(itdb):
-    lists = []
-    for playlist in gpod.sw_get_playlists(itdb):
-        if gpod.itdb_playlist_contains_track(playlist, track):
-            lists.append(playlist)
-
-    if track.artist == "Placebo":
-        print u"%-25s %-20s %-20s %-30s %s" % (track.title,
-                                               track.album,
-                                               track.artist,
-                                               gpod.itdb_filename_on_ipod(track),
-                                               repr(u",".join([l.name for l in lists])))
-
-        if gpod.itdb_track_set_thumbnail(track,"/tmp/placebo.jpg") != 0:
-            print "Failed to save image thumbnail"
-        print track.orig_image_filename
-
-    if track.title == remove_track:
-        print "Removing track.."
-        print "..disk"
-        os.unlink(gpod.itdb_filename_on_ipod(track))
-        for l in lists:
-            print u"..playlist %s" % l.name
-            gpod.itdb_playlist_remove_track(l, track)
-        print "..db"
-        gpod.itdb_track_unlink(track)
-        print "Track removed."
-
-gpod.itdb_write(itdb, None)
-print "Saved db"
-
-
-

Added: libgpod/branches/upstream/current/bindings/python/examples/play_with_ipod_api.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/play_with_ipod_api.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/play_with_ipod_api.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+
+import gpod
+
+db = gpod.Database()
+
+print db
+
+for track in db[4:20]:
+    print track
+    print track['title']
+
+for pl in db.Playlists:
+    print pl
+    for track in pl:
+        print " ", track


Property changes on: libgpod/branches/upstream/current/bindings/python/examples/play_with_ipod_api.py
___________________________________________________________________
Name: svn:executable
   + *

Added: libgpod/branches/upstream/current/bindings/python/examples/play_with_smart_playlists.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/play_with_smart_playlists.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/play_with_smart_playlists.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+
+##  Copyright (C) 2006 Nick Piper <nick-gtkpod at nickpiper co uk>
+##  Part of the gtkpod project.
+ 
+##  URL: http://www.gtkpod.org/
+##  URL: http://gtkpod.sourceforge.net/
+
+##  The code contained in this file is free software; you can redistribute
+##  it and/or modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either version
+##  2.1 of the License, or (at your option) any later version.
+
+##  This file is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this code; if not, write to the Free Software
+##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+import gpod
+import time
+from optparse import OptionParser
+
+parser = OptionParser()
+parser.add_option("-m", "--mountpoint", dest="mountpoint",
+                  default="/mnt/ipod",
+                  help="use iPod at MOUNTPOINT", metavar="MOUNTPOINT")
+(options, args) = parser.parse_args()
+
+
+itdb = gpod.itdb_parse(options.mountpoint, None)
+if not itdb:
+    print "Failed to read iPod at %s" % options.mountpoint
+    sys.exit(2)
+itdb.mountpoint = options.mountpoint
+
+for playlist in gpod.sw_get_playlists(itdb):
+  if playlist.is_spl:
+      n = gpod.sw_get_list_len(playlist.splrules.rules)
+      splrules = [gpod.sw_get_rule(playlist.splrules.rules,i) for i in xrange(n)]
+      print "Playlist: %s" % playlist.name
+      for i in xrange(gpod.sw_get_list_len(playlist.splrules.rules)):
+          rule = gpod.sw_get_rule(playlist.splrules.rules, i)
+          print "|  field: %4d          action: %4d    |"  % (rule.field,rule.action)
+          print "|  string: %25s    |"                     % rule.string
+          print "|  fromvalue: %4d    fromdate: %4d    |"  % (rule.fromvalue,rule.fromdate)
+          print "|  fromunits: %4d                      |" % rule.fromunits
+      print "Contains:"
+      for track in gpod.sw_get_playlist_tracks(playlist):
+          print track.title, track.artist, time.strftime("%c",
+                                                         time.localtime(track.time_added - 2082844800))


Property changes on: libgpod/branches/upstream/current/bindings/python/examples/play_with_smart_playlists.py
___________________________________________________________________
Name: svn:executable
   + *

Modified: libgpod/branches/upstream/current/bindings/python/examples/tag_genre_from_audioscrobber.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/tag_genre_from_audioscrobber.py	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/bindings/python/examples/tag_genre_from_audioscrobber.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -20,7 +20,7 @@
 ##  License along with this code; if not, write to the Free Software
 ##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-##  $Id: tag-genre-from-audioscrobber.py,v 1.2 2005/11/26 14:31:15 nicholas Exp $
+##  $Id: tag_genre_from_audioscrobber.py,v 1.1 2006/04/07 14:51:40 nicholas Exp $
 
 
 import os, os.path

Added: libgpod/branches/upstream/current/bindings/python/examples/toy_around.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/examples/toy_around.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/examples/toy_around.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+
+##  Copyright (C) 2005 Nick Piper <nick-gtkpod at nickpiper co uk>
+##  Part of the gtkpod project.
+ 
+##  URL: http://www.gtkpod.org/
+##  URL: http://gtkpod.sourceforge.net/
+
+##  The code contained in this file is free software; you can redistribute
+##  it and/or modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either version
+##  2.1 of the License, or (at your option) any later version.
+
+##  This file is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this code; if not, write to the Free Software
+##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+##  $Id: toy_around.py,v 1.1 2006/04/07 14:51:40 nicholas Exp $
+
+
+# this file is just a little example I use for testing, it doesn't
+# play the music, but plays with the database ;-)
+
+import os, os.path
+import gpod
+import sys
+
+ipod_mount = '/mnt/ipod'
+
+remove_track = "The Dancer"
+
+#dbname = os.path.join(os.environ['HOME'],".gtkpod/iTunesDB")
+#dbname = os.path.join(os.environ['HOME'],".gtkpod/local_0.itdb")
+dbname = os.path.join(ipod_mount,"iPod_Control/iTunes/iTunesDB")
+
+#itdb = gpod.itdb_parse_file(dbname, None)
+# the image related functions require us to use parse and give it the
+# mount point; and they won't work without an actual ipod.
+itdb = gpod.itdb_parse(ipod_mount, None)
+if not itdb:
+    print "Failed to read %s" % dbname
+    sys.exit(2)
+itdb.mountpoint = ipod_mount
+
+if True:
+    for playlist in gpod.sw_get_playlists(itdb):
+        print playlist.name
+        print type(playlist.name)
+        print gpod.itdb_playlist_tracks_number(playlist)
+        for track in gpod.sw_get_playlist_tracks(playlist):
+            print track.title
+    
+for track in gpod.sw_get_tracks(itdb):
+    lists = []
+    for playlist in gpod.sw_get_playlists(itdb):
+        if gpod.itdb_playlist_contains_track(playlist, track):
+            lists.append(playlist)
+
+    print track.artist
+    print track.tracklen
+    print track.size
+    if track.artist == "Placebo":
+        print u"%-25s %-20s %-20s %-30s %s" % (track.title,
+                                               track.album,
+                                               track.artist,
+                                               gpod.itdb_filename_on_ipod(track),
+                                               repr(u",".join([l.name for l in lists])))
+
+        if gpod.itdb_track_set_thumbnail(track,"/tmp/placebo.jpg") != 0:
+            print "Failed to save image thumbnail"
+        print track.orig_image_filename
+
+    if track.title == remove_track:
+        print "Removing track.."
+        print "..disk"
+        os.unlink(gpod.itdb_filename_on_ipod(track))
+        for l in lists:
+            print u"..playlist %s" % l.name
+            gpod.itdb_playlist_remove_track(l, track)
+        print "..db"
+        gpod.itdb_track_unlink(track)
+        print "Track removed."
+
+gpod.itdb_write(itdb, None)
+print "Saved db"
+
+
+


Property changes on: libgpod/branches/upstream/current/bindings/python/examples/toy_around.py
___________________________________________________________________
Name: svn:executable
   + *

Modified: libgpod/branches/upstream/current/bindings/python/gpod.i
===================================================================
--- libgpod/branches/upstream/current/bindings/python/gpod.i	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/bindings/python/gpod.i	2006-09-29 21:50:32 UTC (rev 134)
@@ -21,7 +21,7 @@
  License along with this code; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
- $Id: gpod.i,v 1.7 2006/02/25 23:16:40 nicholas Exp $
+ $Id: gpod.i,v 1.15 2006/05/17 08:26:11 nicholas Exp $
 
 Please send any fixes, improvements or suggestions to
 <nick-gtkpod at nickpiper co uk>.
@@ -49,6 +49,40 @@
   return list;
  }
 
+PyObject* sw_get_track(GList *list, gint index) {
+  GList *position;
+  if ( (index >= g_list_length(list)) || index < 0 ) {
+   PyErr_SetString(PyExc_IndexError, "Value out of range");
+   return NULL;
+  }
+  position = g_list_nth(list, index);
+  return SWIG_NewPointerObj((void*)(position->data), SWIGTYPE_p__Itdb_Track, 0);
+ }
+
+PyObject* sw_get_rule(GList *list, gint index) {
+  GList *position;
+  if ( (index >= g_list_length(list)) || index < 0 ) {
+   PyErr_SetString(PyExc_IndexError, "Value out of range");
+   return NULL;
+  }
+  position = g_list_nth(list, index);
+  return SWIG_NewPointerObj((void*)(position->data), SWIGTYPE_p__SPLRule, 0);
+ }
+
+PyObject* sw_get_playlist(GList *list, gint index) {
+  GList *position;
+  if ( (index >= g_list_length(list)) || index < 0 ) {
+   PyErr_SetString(PyExc_IndexError, "Value out of range");
+   return NULL;
+  }
+  position = g_list_nth(list, index);
+  return SWIG_NewPointerObj((void*)(position->data), SWIGTYPE_p__Itdb_Playlist, 0);
+ }
+
+PyObject* sw_get_list_len(GList *list) {
+   return PyInt_FromLong(g_list_length(list));
+ }
+
 PyObject* sw_get_playlist_tracks(Itdb_Playlist *pl) {
   PyObject    *list;
   gint        i;
@@ -70,6 +104,48 @@
   }
   return list;
  }
+ 
+ void sw__track_extra_destroy (PyObject *data) {
+   Py_XDECREF(data);   
+ }
+
+ PyObject *sw__track_extra_duplicate (PyObject *data) {
+   if (data == Py_None) {
+     Py_INCREF(Py_None);
+     return Py_None;
+   } else {
+     return PyDict_Copy(data);
+   }
+ }
+
+ PyObject *sw_set_track_userdata(Itdb_Track *track, PyObject *data) {
+   Py_INCREF(data);
+   if ((PyDict_Check(data)) || (data == Py_None)) {
+     if (track->userdata) {
+       Py_DECREF((PyObject *)track->userdata);
+     }
+     track->userdata = (gpointer) data;
+     track->userdata_duplicate = (ItdbUserDataDuplicateFunc)sw__track_extra_duplicate;
+     track->userdata_destroy   = (ItdbUserDataDestroyFunc)sw__track_extra_destroy;
+     Py_INCREF(Py_None);
+     return Py_None;
+   } else {
+     PyErr_SetString(PyExc_TypeError, "userdata must be a Dictionary");
+     return NULL;
+   }
+ }
+ 
+ PyObject* sw_get_track_userdata(Itdb_Track *track) {
+   if (track->userdata) {
+     Py_INCREF((PyObject *)track->userdata);
+     return (PyObject *)track->userdata;
+   } else {
+     Py_INCREF(Py_None);
+     return Py_None;
+   }
+ }
+ 
+ 
 %}
 
 # be nicer to decode these utf8 strings into Unicode objects in the C
@@ -77,14 +153,131 @@
 # them utf8 encoded Strings.
 typedef char gchar;
 
+
+%typemap(in) guint8 {
+   unsigned long ival;
+   ival = PyInt_AsUnsignedLongMask($input);
+   if (PyErr_Occurred())
+        SWIG_fail;
+   if (ival > 255) {
+      PyErr_SetString(PyExc_ValueError, "$symname: Value must be between 0 and 255");
+      SWIG_fail;
+   } else {
+      $1 = (guint8) ival;
+   }
+}
+
+%typemap(in) gint8 {
+   long ival;
+   ival = PyInt_AsInt($input);
+   if (PyErr_Occurred())
+        SWIG_fail;
+   if ((ival < -128) || (ival > 127)) {
+      PyErr_SetString(PyExc_ValueError, "$symname: Value must be between -128 and 127");
+      SWIG_fail;
+   } else {
+      $1 = (gint8) ival;
+   }
+}
+
+%typemap(in) guint16 {
+   unsigned long ival;
+   ival = PyInt_AsUnsignedLongMask($input);
+   if (PyErr_Occurred())
+        SWIG_fail;
+   if (ival > 65535) {
+      PyErr_SetString(PyExc_ValueError, "$symname: Value must be between 0 and 65535");
+      SWIG_fail;
+   } else {
+      $1 = (guint16) ival;
+   }
+}
+
+%typemap(in) gint16 {
+   long ival;
+   ival = PyInt_AsLong($input);
+   if (PyErr_Occurred())
+        SWIG_fail;
+   if ((ival < -32768) || (ival > 32767)) {
+      PyErr_SetString(PyExc_ValueError, "$symname: Value must be between -32,768 and 32,767");
+      SWIG_fail;
+   } else {
+      $1 = (gint16) ival;
+   }
+}
+
+%typemap(in) guint32 {
+   unsigned long ival;
+   ival = PyInt_AsUnsignedLongMask($input);
+   if (PyErr_Occurred())
+        SWIG_fail;
+   $1 = (guint32) ival;
+}
+
+%typemap(in) gint32 {
+   long ival;
+   ival = PyInt_AsLong($input);
+   if (PyErr_Occurred())
+        SWIG_fail;
+   $1 = (gint32) ival;
+}
+
+%typemap(in) guint64 {
+  if (PyInt_CheckExact($input))
+    $1 = PyInt_AsUnsignedLongLongMask($input);
+  else
+    $1 = PyLong_AsUnsignedLongLong($input);
+  if (PyErr_Occurred())
+    SWIG_fail;
+}
+
+%typemap(in) gint64 {
+  if (PyInt_CheckExact($input))
+    $1 = PyInt_AsLong($input);
+  else
+    $1 = PyLong_AsLongLong($input);
+  if (PyErr_Occurred())
+    SWIG_fail;
+}
+
+%typemap(out) guint64 {
+   $result = PyLong_FromUnsignedLongLong($1);
+}
+
+%typemap(out) gint64 {
+   $result = PyLong_FromLongLong($1);
+}
+
+%typemap(out) guint32 {
+   $result = PyLong_FromUnsignedLong($1);
+}
+
+%typemap(out) gint32 {
+   $result = PyLong_FromLong($1);
+}
+
+%typemap(out) guint16 {
+   $result = PyLong_FromUnsignedLong($1);
+}
+
+%typemap(out) guint8 {
+   $result = PyInt_FromLong($1);
+}
+
 typedef int gboolean;
-typedef int gint32;
-typedef unsigned int guint32;
+typedef int gint;
 
 #define G_BEGIN_DECLS
 #define G_END_DECLS
 
 PyObject* sw_get_tracks(Itdb_iTunesDB *itdb);
+PyObject* sw_get_track(GList *list, gint index);
+PyObject* sw_get_rule(GList *list, gint index);
+PyObject* sw_get_playlist(GList *list, gint index);
+PyObject* sw_get_list_len(GList *list);
 PyObject* sw_get_playlists(Itdb_iTunesDB *itdb);
 PyObject* sw_get_playlist_tracks(Itdb_Playlist *pl);
+PyObject* sw_set_track_userdata(Itdb_Track *track, PyObject *data);
+PyObject* sw_get_track_userdata(Itdb_Track *track);
+
 %include "../../src/itdb.h"

Added: libgpod/branches/upstream/current/bindings/python/gtkpod.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/gtkpod.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/gtkpod.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+import sha
+import os
+import socket
+
+# This file is originally stolen from pypod-0.5.0
+# http://superduper.net/index.py?page=pypod
+# I hope that's ok, both works are GPL.
+
+hostname = socket.gethostname()
+
+class ParseError(Exception):
+    pass
+
+class SyncError(Exception):
+    pass
+
+def sha1_hash(filename):
+    import struct
+    # only hash the first 16k
+    hash_len = 4*4096
+    hash = sha.sha()
+    size = os.path.getsize(filename)
+    hash.update(struct.pack("<L", size))
+    hash.update(open(filename).read(hash_len))
+    return hash.hexdigest()
+
+def write(filename, db, itunesdb_file):
+    file = open(filename, "w")
+
+    def write_pair(name, value):
+        value = unicode(value).encode("utf-8")
+        file.write("=".join([name, value]))
+        file.write('\n')
+
+    write_pair("itunesdb_hash", sha1_hash(itunesdb_file))
+    write_pair("version", "0.88.1")
+
+    for track in db:
+        write_pair("id", track['id'])
+        if not track['userdata']:
+            track['userdata'] = {}
+        track['userdata']['filename_ipod'] = track.ipod_filename()
+        try:
+            del track['userdata']['md5_hash']
+        except IndexError:
+            pass
+        if track['userdata'].has_key('filename_locale') and not track['userdata'].has_key('md5_hash'):
+            if os.path.exists(track['userdata']['filename_locale']):
+                track['userdata']['md5_hash'] = sha1_hash(
+                    track['userdata']['filename_locale'])
+        [write_pair(i[0],i[1]) for i in track['userdata'].items()]
+
+    write_pair("id", "xxx")
+
+def parse(filename, db, itunesdb_file=None):
+    tracks_by_id  = {}
+    tracks_by_sha = {}    
+    id = 0
+    ext_hash_valid = True
+
+    for track in db:
+        track['userdata'] = {}
+
+    for track in db:
+        tracks_by_id[track['id']] = track
+
+    track = None
+    file = open(filename)
+    ext_data = {}
+    ext_block = None
+    for line in file:
+        parts = line.strip().split("=", 1)
+        if len(parts) != 2:
+            print parts
+        name, value = parts
+        if name == "id":
+            if ext_block:
+                ext_data[id] = ext_block
+            if value != 'xxx':
+                id = int(value)
+                ext_block = {}
+        elif name == "version":
+            pass
+        elif name == "itunesdb_hash":
+            if itunesdb_file and sha1_hash(itunesdb_file) != value:
+                ext_hash_valid = False
+        else:
+            ext_block[name] = value
+
+    if ext_hash_valid:
+        for id,ext_block in ext_data.items():
+            tracks_by_id[id]['userdata'] = ext_block
+    else:
+        for track in db:
+            tracks_by_sha[sha1_hash(track.ipod_filename())] = track
+        for ext_block in ext_data.values():
+            tracks_by_sha[ext_block['md5_hash']]['userdata'] = ext_block
+

Added: libgpod/branches/upstream/current/bindings/python/ipod.py
===================================================================
--- libgpod/branches/upstream/current/bindings/python/ipod.py	                        (rev 0)
+++ libgpod/branches/upstream/current/bindings/python/ipod.py	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,472 @@
+"""Documentation for this module.
+
+More details.
+"""
+
+import gpod
+import types
+import eyeD3
+import gtkpod
+import os
+
+class DatabaseException(RuntimeError):
+    pass
+
+class TrackException(RuntimeError):
+    pass
+
+class Database:
+    def __init__(self, mountpoint="/mnt/ipod", local=False, localdb=None):
+        if local or localdb:
+            if localdb:
+                self._itdb_file = localdb
+            else:
+                self._itdb_file = os.path.join(os.environ['HOME'],
+                                               ".gtkpod",
+                                               "local_0.itdb")
+            self._itdb = gpod.itdb_parse_file(self._itdb_file, None)
+        else:
+            self._itdb = gpod.itdb_parse(mountpoint, None)
+            if not self._itdb:
+                raise DatabaseException("Unable to parse iTunes database at mount point %s" % mountpoint)
+            else:
+                self._itdb.mountpoint = mountpoint
+            self._itdb_file    = os.path.join(self._itdb.mountpoint,
+                                              "iPod_Control","iTunes","iTunesDB")
+        self._load_gtkpod_extended_info()
+
+    def __str__(self):
+        return self.__repr__()
+    
+    def __repr__(self):
+        return "<Database Filename:%s Playlists:%s Tracks:%s>" % (
+            repr(self._itdb.filename),
+            gpod.sw_get_list_len(self._itdb.playlists),
+            len(self))
+
+    def _load_gtkpod_extended_info(self):
+        itdbext_file = "%s.ext" % (self._itdb_file)
+
+        if os.path.exists(self._itdb_file) and os.path.exists(itdbext_file):
+            gtkpod.parse(itdbext_file, self, self._itdb_file)
+
+    def close(self):
+        if not gpod.itdb_write_file(self._itdb, self._itdb_file, None):
+            raise DatabaseException("Unable to save iTunes database %s" % self)
+        itdbext_file = "%s.ext" % (self._itdb_file)        
+        gtkpod.write(itdbext_file, self, self._itdb_file)
+
+    def __getitem__(self, index):
+        if type(index) == types.SliceType:
+            return [self[i] for i in xrange(*index.indices(len(self)))]
+        else:
+            if index < 0:
+                index += len(self)
+            return Track(proxied_track=gpod.sw_get_track(self._itdb.tracks, index))
+
+    def __len__(self):
+        return gpod.sw_get_list_len(self._itdb.tracks)
+
+    def import_file(self, filename):
+        track = Track(filename)
+        track.copy_to_ipod()
+        gpod.itdb_playlist_add_track(gpod.itdb_playlist_mpl(self._itdb),
+                                     track._track, -1)
+
+    def __del__(self):
+        gpod.itdb_free(self._itdb)
+
+    def add(self, track, pos=-1):
+        gpod.itdb_track_add(self._itdb, track._track, pos)
+
+    def remove(self, item, harddisk=False, ipod=True):
+        if isinstance(item, Playlist):
+            if ipod or harddisk:
+                # remove all the tracks that were in this playlist
+                for track in item:
+                    self.remove(track, ipod=ipod, harddisk=harddisk)
+            if gpod.itdb_playlist_exists(self._itdb, item._pl):
+                gpod.itdb_playlist_remove(item._pl)
+            else:
+                raise DatabaseException("Playlist %s was not in %s" % (item, self))
+        elif isinstance(item, Track):
+            for pl in self.Playlists:
+                if item in pl:
+                    pl.remove(item)
+            if harddisk:
+                try:
+                    filename = item['userdata']['filename_locale']
+                except KeyError, e:
+                    raise TrackException("Unable to remove %s from hard disk, no filename available." % item)
+                os.unlink(filename)
+            if ipod:
+                filename = item.ipod_filename()
+                if filename and os.path.exists(filename):
+                    os.unlink(filename)
+                    print "unlinked %s" % filename
+            gpod.itdb_track_unlink(item._track)
+        else:
+            raise DatabaseException("Unable to remove a %s from database" % type(item))
+
+    def get_master(self):
+        return Playlist(self,proxied_playlist=gpod.itdb_playlist_mpl(self._itdb))
+
+    def get_podcasts(self):
+        return Playlist(self,proxied_playlist=gpod.itdb_playlist_podcasts(self._itdb))
+
+    def get_playlists(self):
+        return _Playlists(self)
+
+    Master   = property(get_master)
+    Podcasts = property(get_podcasts)
+    Playlists= property(get_playlists) 
+
+    def smart_update(self):
+        gpod.itdb_spl_update_all(self._itdb)
+
+    def new_Playlist(self,*args,**kwargs):
+        return Playlist(self, *args,**kwargs)
+
+    def new_Track(self,**kwargs):
+        track = Track(**kwargs)
+        self.add(track)
+        if kwargs.has_key('podcast') and kwargs['podcast'] == True:
+            self.Podcasts.add(track)
+        else:
+            self.Master.add(track)
+        return track
+
+    def copy_delayed_files(self,callback=False):
+        if not gpod.itdb_get_mountpoint(self._itdb):
+            # we're not working with a real ipod.
+            return
+        to_copy=[]
+        for track in self:
+            try:
+                transferred = int(track['userdata']['transferred'])
+            except KeyError:
+                transferred = 1
+            if not transferred:
+                to_copy.append(track)
+        i = 0
+        total = len(to_copy)
+        for track in to_copy:
+            if callback:
+                i=i+1
+                callback(self,track, i, total)
+            track.copy_to_ipod()
+
+class Track:
+    # Note we don't free the underlying structure, as it's still used
+    # by the itdb.
+    
+    
+    _proxied_attributes = ("title","ipod_path","album","artist","genre","filetype",
+                           "comment","category","composer","grouping","description",
+                           "podcasturl","podcastrss","chapterdata","subtitle","id",
+                           "size","tracklen","cd_nr","cds","track_nr","tracks",
+                           "bitrate","samplerate","samplerate_low","year","volume",
+                           "soundcheck","time_added","time_played","time_modified",
+                           "bookmark_time","rating","playcount","playcount2",
+                           "recent_playcount","transferred","BPM","app_rating",
+                           "type1","type2","compilation","starttime","stoptime",
+                           "checked","dbid","drm_userid","visible","filetype_marker",
+                           "artwork_count","artwork_size","samplerate2", "remember_playback_position",
+                           "time_released","has_artwork","flag4", "skip_when_shuffling",
+                           "lyrics_flag","movie_flag","mark_unplayed","samplecount",
+                           "chapterdata_raw","chapterdata_raw_length","artwork",
+                           "usertype")
+
+    def __init__(self, filename=None, from_file=None,
+                 proxied_track=None, podcast=False):
+        if from_file:
+            filename = from_file
+        if filename:
+            self._track = gpod.itdb_track_new()
+            self['userdata'] = {'filename_locale': filename,
+                                'transferred': 0}
+            try:
+                audiofile = eyeD3.Mp3AudioFile(self['userdata']['filename_locale'])
+            except eyeD3.tag.InvalidAudioFormatException, e:
+                raise TrackException(str(e))
+            tag = audiofile.getTag()
+            for func, attrib in (('getArtist','artist'),
+                                 ('getTitle','title'),
+                                 ('getBPM','BPM'),
+                                 ('getPlayCount','playcount'),
+                                 ('getAlbum','album')):
+                value = getattr(tag,func)()
+                if value:
+                    self[attrib] = value
+            try:
+                self['genre'] = tag.getGenre().name
+            except AttributeError:
+                pass
+            disc, of = tag.getDiscNum()
+            if disc is not None:
+                self['cd_nr'] = disc
+            if of is not None:
+                self['cds'] = of
+            n, of = tag.getTrackNum()
+            if n is not None:
+                self['track_nr'] = n
+            if of is not None:
+                self['tracks'] = of
+            self['tracklen'] = audiofile.getPlayTime() * 1000
+            self.set_podcast(podcast)
+        elif proxied_track:
+            self._track = proxied_track
+        else:
+            self._track = gpod.itdb_track_new()
+        self.set_podcast(podcast)
+
+    def copy_to_ipod(self):
+        self['userdata']['md5_hash'] = gtkpod.sha1_hash(
+            self['userdata']['filename_locale'])
+        if not gpod.itdb_get_mountpoint(self._track.itdb):
+            return False
+        self['userdata']['transferred'] = 1
+        if gpod.itdb_cp_track_to_ipod(self._track,
+                                      self['userdata']['filename_locale'], None) != 1:
+            raise TrackException('Unable to copy %s to iPod as %s' % (
+                self['userdata']['filename_locale'],
+                self))
+        return True
+
+    def ipod_filename(self):
+        return gpod.itdb_filename_on_ipod(self._track)
+
+    def set_podcast(self, value):
+        if value:
+            self['skip_when_shuffling'] = 0x01
+            self['remember_playback_position'] = 0x01
+            self['flag4'] = 0x01 # Show Title/Album on the 'Now Playing' page            
+        else:
+            self['skip_when_shuffling'] = 0x00
+            self['remember_playback_position'] = 0x00
+            self['flag4'] = 0x00 # Show Title/Album/Artist on the 'New Playing' page
+
+    def __str__(self):
+        return self.__repr__()
+    
+    def __repr__(self):
+        return "<Track Artist:%s Title:%s Album:%s>" % (
+            repr(self['artist']),
+            repr(self['title']),
+            repr(self['album']))
+
+    def keys(self):
+        return list(self._proxied_attributes)
+
+    def items(self):
+        return [self[k] for k in self._proxied_attributes]
+
+    def pairs(self):
+        return [(k, self[k]) for k in self._proxied_attributes]        
+
+    def __getitem__(self, item):
+        if item == "userdata":
+            return gpod.sw_get_track_userdata(self._track)
+        elif item in self._proxied_attributes:
+            return getattr(self._track, item)
+        else:
+            raise KeyError('No such key: %s' % item)
+
+    def __setitem__(self, item, value):
+        #print item, value
+        if item == "userdata":
+            gpod.sw_set_track_userdata(self._track, value)
+            return
+        if type(value) == types.UnicodeType:
+            value = value.encode()
+        if item in self._proxied_attributes:
+            return setattr(self._track, item, value)
+        else:
+            raise KeyError('No such key: %s' % item)
+
+_playlist_sorting = {
+    1:'playlist',
+    2:'unknown2',
+    3:'songtitle',
+    4:'album',
+    5:'artist',
+    6:'bitrate',
+    7:'genre',
+    8:'kind',
+    9:'modified',
+    10:'track',
+    11:'size',
+    12:'time',
+    13:'year',
+    14:'rate',
+    15:'comment',
+    16:'added',
+    17:'equalizer',
+    18:'composer',
+    19:'unknown19',
+    20:'count',
+    21:'last',
+    22:'disc',
+    23:'rating',
+    24:'release',
+    25:'BPM',
+    26:'grouping',
+    27:'category',
+    28:'description'}
+
+class _Playlists:
+    def __init__(self, db):
+        self._db = db
+
+    def __len__(self):
+        return gpod.sw_get_list_len(self._db._itdb.playlists)
+
+    def __nonzero__(self):
+        return True
+    
+    def __getitem__(self, index):
+        if type(index) == types.SliceType:
+            return [self[i] for i in xrange(*index.indices(len(self)))]
+        else:
+            if index < 0:
+                index += len(self)
+            return Playlist(self._db,
+                            proxied_playlist=gpod.sw_get_playlist(self._db._itdb.playlists,
+                                                                  index))
+
+    def __repr__(self):
+        return "<Playlists from %s>" % self._db
+    
+    def __call__(self, id=None, number=None, name=None):
+        if ((id and (number or name)) or (number and name)):
+            raise ValueError("Only specify id, number OR name")
+        if id:
+            if type(id) in (types.TupleType, types.ListType):
+                return [self.__call__(id=i) for i in id]
+            else:
+                pl = gpod.itdb_playlist_by_id(self._db._itdb,
+                                              id)
+                if pl:
+                    return Playlist(self._db,
+                                    proxied_playlist=pl)
+                else:
+                    raise KeyError("Playlist with id %s not found." % repr(id))
+        if name:
+            if type(name) in (types.TupleType, types.ListType):
+                return [self.__call__(name=i) for i in name]
+            else:
+                pl = gpod.itdb_playlist_by_name(self._db._itdb,
+                                                name)
+                if pl:
+                    return Playlist(self._db,
+                                    proxied_playlist=pl)
+                else:
+                    raise KeyError("Playlist with name %s not found." % repr(name))
+        if number:
+            if type(number) in (types.TupleType, types.ListType):
+                return [self.__call__(number=i) for i in number]
+            else:
+                pl = gpod.itdb_playlist_by_nr(self._db._itdb,
+                                                number)
+                if pl:
+                    return Playlist(self._db,
+                                    proxied_playlist=pl)
+                else:
+                    raise KeyError("Playlist with number %s not found." % repr(number))
+        
+class Playlist:
+    def __init__(self, parent_db, title="New Playlist",
+                 smart=False, pos=-1, proxied_playlist=None):
+        self._db = parent_db
+        if proxied_playlist:
+            self._pl = proxied_playlist
+        else:
+            if smart:
+                smart = 1
+            else:
+                smart = 0
+            self._pl = gpod.itdb_playlist_new(title, smart)
+            gpod.itdb_playlist_add(self._db._itdb, self._pl, pos)
+
+    def smart_update(self):
+        gpod.itdb_spl_update(self._pl)
+
+    def randomize(self):
+        gpod.itdb_playlist_randomize(self._pl)
+
+    def get_name(self):
+        return self._pl.name
+    def set_name(self, name):
+        self._pl.name = name
+    def get_id(self):
+        return self._pl.id
+    def get_smart(self):
+        if self._pl.is_spl == 1:
+            return True
+        return False
+    def get_master(self):
+        if gpod.itdb_playlist_is_mpl(self._pl) == 1:
+            return True
+        return False
+    def get_podcast(self):
+        if gpod.itdb_playlist_is_podcasts(self._pl) == 1:
+            return True
+        return False
+    def get_sort(self):
+        return _playlist_sorting[self._pl.sortorder]
+    def set_sort(self, order):
+        order = order.lower()
+        for k, v in _playlist_sorting.items():
+            if v == order:
+                self._pl.sortorder = v
+                return
+        return ValueError("Unknown playlist sorting '%s'" % order)
+
+    name   = property(get_name, set_name)
+    id     = property(get_id)
+    smart  = property(get_smart)
+    master = property(get_master)
+    podcast= property(get_podcast)    
+    order  = property(get_sort, set_sort)
+
+    def __str__(self):
+        return self.__repr__()
+    
+    def __repr__(self):
+        return "<Playlist Title:%s Sort:%s Smart:%s Master:%s Podcast:%s Tracks:%d>" % (
+            repr(self.name),
+            repr(self.order),
+            repr(self.smart),
+            repr(self.master),
+            repr(self.podcast),
+            len(self))
+        
+    def __getitem__(self, index):
+        if type(index) == types.SliceType:
+            return [self[i] for i in xrange(*index.indices(len(self)))]
+        else:
+            if index < 0:
+                index += len(self)
+            return Track(proxied_track=gpod.sw_get_track(self._pl.members, index))
+
+    def __len__(self):
+        #return self._pl.num # Always 0 ?
+        return gpod.sw_get_list_len(self._pl.members)
+
+    def __nonzero__(self):
+        return True
+
+    def __contains__(self, track):
+        if gpod.itdb_playlist_contains_track(self._pl, track._track):
+            return True
+        else:
+            return False
+    
+    def add(self, track, pos=-1):
+        gpod.itdb_playlist_add_track(self._pl, track._track, pos)
+
+    def remove(self, track):
+        if self.__contains__(track):
+            gpod.itdb_playlist_remove_track(self._pl, track._track)
+        else:
+            raise DatabaseException("Playlist %s does not contain %s" % (self, track))

Modified: libgpod/branches/upstream/current/config.guess
===================================================================
--- libgpod/branches/upstream/current/config.guess	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/config.guess	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2005-04-22'
+timestamp='2006-07-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,13 +18,15 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Originally written by Per Bothner <per at bothner.com>.
 # Please send patches to <config-patches at gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -66,11 +69,11 @@
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -104,7 +107,7 @@
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +126,7 @@
 	;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi at noc.rutgers.edu 1994-08-24)
@@ -196,55 +199,23 @@
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
-	exit 0 ;;
-    amd64:OpenBSD:*:*)
-	echo x86_64-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    cats:OpenBSD:*:*)
-	echo arm-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    luna88k:OpenBSD:*:*)
-    	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    macppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-	echo powerpc-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mips64-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:OpenBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
     *:ekkoBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
     macppc:MirBSD:*:*)
-	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-	exit 0 ;;
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
     *:MirBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -297,40 +268,43 @@
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit 0 ;;
+	exit ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
 	# of the specific Alpha model?
 	echo alpha-pc-interix
-	exit 0 ;;
+	exit ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
-	exit 0 ;;
+	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
-	exit 0;;
+	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit 0 ;;
+	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-morphos
-	exit 0 ;;
+	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
-	exit 0 ;;
+	exit ;;
     *:z/VM:*:*)
 	echo s390-ibm-zvmoe
-	exit 0 ;;
+	exit ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-	exit 0 ;;
+	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit 0;;
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
-	exit 0;;
+	exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -338,32 +312,32 @@
 	else
 		echo pyramid-pyramid-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
-	exit 0 ;;
+	exit ;;
     DRS?6000:unix:4.0:6*)
 	echo sparc-icl-nx6
-	exit 0 ;;
+	exit ;;
     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     i86pc:SunOS:5.*:*)
 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
 	    Series*|S4*)
@@ -372,10 +346,10 @@
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit 0 ;;
+	exit ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -387,10 +361,10 @@
 		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
 	esac
-	exit 0 ;;
+	exit ;;
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -401,40 +375,40 @@
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
+        exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
-	exit 0 ;;
+	exit ;;
     RISC*:ULTRIX:*:*)
 	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -458,32 +432,33 @@
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c \
-	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
 	echo mips-mips-riscos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
-	exit 0 ;;
+	exit ;;
     Motorola:*:4.3:PL8-*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 	echo powerpc-harris-powermax
-	exit 0 ;;
+	exit ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
-	exit 0 ;;
+	exit ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
-	exit 0 ;;
+	exit ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
-	exit 0 ;;
+	exit ;;
     m88k:*:3*:R3*)
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -499,29 +474,29 @@
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit 0 ;;
+ 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
-	exit 0 ;;
+	exit ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 	echo m88k-tektronix-sysv3
-	exit 0 ;;
+	exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 	echo m68k-tektronix-bsd
-	exit 0 ;;
+	exit ;;
     *:IRIX*:*:*)
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit 0 ;;
+	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
 	echo i386-ibm-aix
-	exit 0 ;;
+	exit ;;
     ia64:AIX:*:*)
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
@@ -529,7 +504,7 @@
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 		eval $set_cc_for_build
@@ -544,14 +519,18 @@
 			exit(0);
 			}
 EOF
-		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-		echo rs6000-ibm-aix3.2.5
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
 	else
 		echo rs6000-ibm-aix3.2
 	fi
-	exit 0 ;;
+	exit ;;
     *:AIX:*:[45])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -565,28 +544,28 @@
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
-	exit 0 ;;
+	exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
-	exit 0 ;;
+	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit 0 ;;                           # report: romp-ibm BSD 4.3
+	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
-	exit 0 ;;
+	exit ;;
     DPX/2?00:B.O.S.:*:*)
 	echo m68k-bull-sysv3
-	exit 0 ;;
+	exit ;;
     9000/[34]??:4.3bsd:1.*:*)
 	echo m68k-hp-bsd
-	exit 0 ;;
+	exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
-	exit 0 ;;
+	exit ;;
     9000/[34678]??:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
@@ -648,9 +627,19 @@
 	esac
 	if [ ${HP_ARCH} = "hppa2.0w" ]
 	then
-	    # avoid double evaluation of $set_cc_for_build
-	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -658,11 +647,11 @@
 	    fi
 	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     ia64:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ia64-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
     3050*:HI-UX:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -690,161 +679,179 @@
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
-	exit 0 ;;
+	exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
-	exit 0 ;;
+	exit ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
-	exit 0 ;;
+	exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
-	exit 0 ;;
+	exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
-	exit 0 ;;
+	exit ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
-	exit 0 ;;
+	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
 	    echo ${UNAME_MACHINE}-unknown-osf1
 	fi
-	exit 0 ;;
+	exit ;;
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
-	exit 0 ;;
+	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit 0 ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit 0 ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit 0 ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit 0 ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit 0 ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*TS:*:*:*)
 	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*T3E:*:*:*)
 	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     CRAY*SV1:*:*:*)
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     *:UNICOS/mp:*:*)
 	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit 0 ;;
+	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
+        exit ;;
     5000:UNIX_System_V:4.*:*)
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit 0 ;;
+	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sparc*:BSD/OS:*:*)
 	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:BSD/OS:*:*)
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:FreeBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit 0 ;;
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
-	exit 0 ;;
+	exit ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
-	exit 0 ;;
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
-	exit 0 ;;
-    x86:Interix*:[34]*)
-	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-	exit 0 ;;
+	exit ;;
+    x86:Interix*:[3456]*)
+	echo i586-pc-interix${UNAME_RELEASE}
+	exit ;;
+    EM64T:Interix*:[3456]*)
+	echo x86_64-unknown-interix${UNAME_RELEASE}
+	exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
-	exit 0 ;;
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 	# UNAME_MACHINE based on the output of uname instead of i386?
 	echo i586-pc-interix
-	exit 0 ;;
+	exit ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
-	exit 0 ;;
-    amd64:CYGWIN*:*:*)
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
-	exit 0 ;;
+	exit ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
-	exit 0 ;;
+	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     *:GNU:*:*)
 	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit 0 ;;
+	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit 0 ;;
+	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
-	exit 0 ;;
+	exit ;;
     arm*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-gnu
-	exit 0 ;;
+	exit ;;
     crisv32:Linux:*:*)
 	echo crisv32-axis-linux-gnu
-	exit 0 ;;
+	exit ;;
     frv:Linux:*:*)
     	echo frv-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     ia64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     m32r*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     mips:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -861,8 +868,12 @@
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -880,15 +891,22 @@
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^CPU/{
+		s: ::g
+		p
+	    }'`"
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
     ppc:Linux:*:*)
 	echo powerpc-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     ppc64:Linux:*:*)
 	echo powerpc64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -902,7 +920,7 @@
 	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-	exit 0 ;;
+	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -910,25 +928,28 @@
 	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
 	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
-	exit 0 ;;
+	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
 	echo hppa64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
-	exit 0 ;;
+	exit ;;
     sh64*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     sh*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
     x86_64:Linux:*:*)
 	echo x86_64-unknown-linux-gnu
-	exit 0 ;;
+	exit ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
 	# first see if it will tell us. cd to the root directory to prevent
@@ -946,15 +967,15 @@
 		;;
 	  a.out-i386-linux)
 		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit 0 ;;
+		exit ;;
 	  coff-i386)
 		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-		exit 0 ;;
+		exit ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
 		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-		exit 0 ;;
+		exit ;;
 	esac
 	# Determine whether the default compiler is a.out or elf
 	eval $set_cc_for_build
@@ -971,7 +992,7 @@
 	LIBC=gnulibc1
 	# endif
 	#else
-	#ifdef __INTEL_COMPILER
+	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 	LIBC=gnu
 	#else
 	LIBC=gnuaout
@@ -981,16 +1002,23 @@
 	LIBC=dietlibc
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
-	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+	    /^LIBC/{
+		s: ::g
+		p
+	    }'`"
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
 	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
 	echo i386-sequent-sysv4
-	exit 0 ;;
+	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -998,27 +1026,27 @@
 	# I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
 	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit 0 ;;
+	exit ;;
     i*86:XTS-300:*:STOP)
 	echo ${UNAME_MACHINE}-unknown-stop
-	exit 0 ;;
+	exit ;;
     i*86:atheos:*:*)
 	echo ${UNAME_MACHINE}-unknown-atheos
-	exit 0 ;;
-	i*86:syllable:*:*)
+	exit ;;
+    i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
-	exit 0 ;;
+	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit 0 ;;
+	exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1026,15 +1054,16 @@
 	else
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
-	exit 0 ;;
-    i*86:*:5:[78]*)
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
 	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit 0 ;;
+	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1052,73 +1081,73 @@
 	else
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
-	exit 0 ;;
+	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
-        exit 0 ;;
+        exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
-	exit 0 ;;
+	exit ;;
     paragon:*:*:*)
 	echo i860-intel-osf1
-	exit 0 ;;
+	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
-	exit 0 ;;
+	exit ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
-	exit 0 ;;
+	exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
 	echo m68k-convergent-sysv
-	exit 0 ;;
+	exit ;;
     M680?0:D-NIX:5.3:*)
 	echo m68k-diab-dnix
-	exit 0 ;;
+	exit ;;
     M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
-	exit 0 ;;
+	exit ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1126,73 +1155,72 @@
 	else
 		echo ns32k-sni-sysv
 	fi
-	exit 0 ;;
+	exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel at ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit 0 ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
 	echo hppa1.1-stratus-sysv4
-	exit 0 ;;
+	exit ;;
     *:*:*:FTX*)
 	# From seanf at swdc.stratus.com.
 	echo i860-stratus-sysv4
-	exit 0 ;;
+	exit ;;
     i*86:VOS:*:*)
 	# From Paul.Green at stratus.com.
 	echo ${UNAME_MACHINE}-stratus-vos
-	exit 0 ;;
+	exit ;;
     *:VOS:*:*)
 	# From Paul.Green at stratus.com.
 	echo hppa1.1-stratus-vos
-	exit 0 ;;
+	exit ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
-	exit 0 ;;
+	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit 0 ;;
+        exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
-	exit 0 ;;
+	exit ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
-	exit 0 ;;
+	exit ;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
-	exit 0 ;;
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-5:SUPER-UX:*:*)
 	echo sx5-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	case $UNAME_PROCESSOR in
-	    *86) UNAME_PROCESSOR=i686 ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
 	if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1200,25 +1228,25 @@
 		UNAME_MACHINE=pc
 	fi
 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
-	exit 0 ;;
+	exit ;;
     NSE-?:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
-	exit 0 ;;
+	exit ;;
     BS2000:POSIX*:*:*)
 	echo bs2000-siemens-sysv
-	exit 0 ;;
+	exit ;;
     DS/*:UNIX_System_V:*:*)
 	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
@@ -1229,41 +1257,47 @@
 	    UNAME_MACHINE="$cputype"
 	fi
 	echo ${UNAME_MACHINE}-unknown-plan9
-	exit 0 ;;
+	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
-	exit 0 ;;
+	exit ;;
     *:TENEX:*:*)
 	echo pdp10-unknown-tenex
-	exit 0 ;;
+	exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
-	exit 0 ;;
+	exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 	echo pdp10-xkl-tops20
-	exit 0 ;;
+	exit ;;
     *:TOPS-20:*:*)
 	echo pdp10-unknown-tops20
-	exit 0 ;;
+	exit ;;
     *:ITS:*:*)
 	echo pdp10-unknown-its
-	exit 0 ;;
+	exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit 0 ;;
+	exit ;;
     *:*VMS:*:*)
     	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms && exit 0 ;;
-	    I*) echo ia64-dec-vms && exit 0 ;;
-	    V*) echo vax-dec-vms && exit 0 ;;
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
 	esac ;;
     *:XENIX:*:SysV)
 	echo i386-pc-xenix
-	exit 0 ;;
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1295,7 +1329,7 @@
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1384,11 +1418,12 @@
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1397,22 +1432,22 @@
     case `getsysinfo -f cpu_type` in
     c1*)
 	echo c1-convex-bsd
-	exit 0 ;;
+	exit ;;
     c2*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     c34*)
 	echo c34-convex-bsd
-	exit 0 ;;
+	exit ;;
     c38*)
 	echo c38-convex-bsd
-	exit 0 ;;
+	exit ;;
     c4*)
 	echo c4-convex-bsd
-	exit 0 ;;
+	exit ;;
     esac
 fi
 

Modified: libgpod/branches/upstream/current/config.h.in
===================================================================
--- libgpod/branches/upstream/current/config.h.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/config.h.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,8 +1,5 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
-/* eject command */
-#undef EJECT_COMMAND
-
 /* always defined to indicate that i18n is enabled */
 #undef ENABLE_NLS
 
@@ -31,9 +28,6 @@
 /* Define if your <locale.h> file defines LC_MESSAGES. */
 #undef HAVE_LC_MESSAGES
 
-/* Whether HAL is available or not */
-#undef HAVE_LIBHAL
-
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 
@@ -61,6 +55,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Whether TagLib is installed, it's only used in a test program */
+#undef HAVE_TAGLIB
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
@@ -85,9 +82,6 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* unmount command */
-#undef UNMOUNT_COMMAND
-
 /* Version number of package */
 #undef VERSION
 

Modified: libgpod/branches/upstream/current/config.sub
===================================================================
--- libgpod/branches/upstream/current/config.sub	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/config.sub	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,9 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
 
-timestamp='2005-04-22'
+timestamp='2006-07-02'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +22,15 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Please send patches to <config-patches at gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -83,11 +85,11 @@
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit 0 ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit 0 ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit 0 ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -99,7 +101,7 @@
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -118,8 +120,9 @@
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
-  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -170,6 +173,10 @@
 	-hiux*)
 		os=-hiuxwe2
 		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -186,6 +193,10 @@
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -230,7 +241,7 @@
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
@@ -238,7 +249,8 @@
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -247,6 +259,7 @@
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
 	| mipsisa64 | mipsisa64el \
@@ -255,17 +268,19 @@
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| mt \
 	| msp430 \
+	| nios | nios2 \
 	| ns16k | ns32k \
-	| openrisc | or32 \
+	| or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
-	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b \
-	| strongarm \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
 	| we32k \
@@ -280,6 +295,9 @@
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
@@ -299,7 +317,7 @@
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* \
+	| avr-* | avr32-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 	| clipper-* | craynv-* | cydra-* \
@@ -310,7 +328,7 @@
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
-	| m32r-* | m32rle-* \
+	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
 	| m88110-* | m88k-* | maxq-* | mcore-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -321,6 +339,7 @@
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
 	| mipsisa64-* | mipsisa64el-* \
@@ -329,18 +348,20 @@
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
+	| mt-* \
 	| msp430-* \
+	| nios-* | nios2-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tron-* \
@@ -686,6 +707,9 @@
 		basic_machine=i386-pc
 		os=-msdos
 		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
@@ -761,9 +785,8 @@
 		basic_machine=hppa1.1-oki
 		os=-proelf
 		;;
-	or32 | or32-*)
+	openrisc | openrisc-*)
 		basic_machine=or32-unknown
-		os=-coff
 		;;
 	os400)
 		basic_machine=powerpc-ibm
@@ -794,6 +817,12 @@
 	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
@@ -850,6 +879,10 @@
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -1089,13 +1122,10 @@
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b)
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1168,20 +1198,23 @@
 	      | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1199,7 +1232,7 @@
 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
@@ -1333,6 +1366,9 @@
 # system, and we'll never get to this point.
 
 case $basic_machine in
+        spu-*)
+		os=-elf
+		;;
 	*-acorn)
 		os=-riscix1.2
 		;;
@@ -1342,9 +1378,9 @@
 	arm*-semi)
 		os=-aout
 		;;
-    c4x-* | tic4x-*)
-        os=-coff
-        ;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
 		os=-tops20
@@ -1388,6 +1424,9 @@
 	*-be)
 		os=-beos
 		;;
+	*-haiku)
+		os=-haiku
+		;;
 	*-ibm)
 		os=-aix
 		;;
@@ -1559,7 +1598,7 @@
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)

Modified: libgpod/branches/upstream/current/configure
===================================================================
--- libgpod/branches/upstream/current/configure	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/configure	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,8 +1,9 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
+# Generated by GNU Autoconf 2.60a.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -16,11 +17,35 @@
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -29,8 +54,43 @@
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -44,18 +104,19 @@
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -63,157 +124,386 @@
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
 fi
 
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
+  case $as_dir in
 	 /*)
-	   if ("$as_dir/$as_base" -c '
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
 
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf at gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+  chmod +x "$as_me.lineno" ||
     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -222,7 +512,19 @@
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
+# systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  as_executable_p="test -x"
+else
+  as_executable_p=:
+fi
+rm -f conf$$.file
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -231,17 +533,8 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
 
-# CDPATH.
-$as_unset CDPATH
 
-
-
 # Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
 
@@ -278,15 +571,15 @@
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 if test -z "$ECHO"; then
 if test "X${echo_test_string+set}" != Xset; then
 # find a string as large as possible, as long as the shell can cope with it
   for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
-       echo_test_string="`eval $cmd`" &&
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
     then
       break
@@ -395,29 +688,26 @@
 
 tagnames=${tagnames+${tagnames},}F77
 
+exec 7<&0 </dev/null 6>&1
+
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME=
 PACKAGE_TARNAME=
@@ -430,43 +720,244 @@
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LIBGPOD_CURRENT LIBGPOD_REVISION LIBGPOD_AGE LIBGPOD_VERSION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot ACLOCAL_AMFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP CPP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE INTLTOOL_PROP_RULE INTLTOOL_OAF_RULE INTLTOOL_PONG_RULE INTLTOOL_SERVER_RULE INTLTOOL_SHEET_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_UI_RULE INTLTOOL_XAM_RULE INTLTOOL_KBD_RULE INTLTOOL_XML_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_CAVES_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_THEME_RULE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE INTLTOOL_PERL INTLTOOL_ICONV INTLTOOL_MSGFMT INTLTOOL_MSGMERGE INTLTOOL_XGETTEXT mkdir_p PKG_CONFIG ac_pt_PKG_CONFIG LIBGPOD_CFLAGS LIBGPOD_LIBS GDKPIXBUF_CFLAGS GDKPIXBUF_LIBS HAVE_GDKPIXBUF_TRUE HAVE_GDKPIXBUF_FALSE HAL_CFLAGS HAL_LIBS EJECT_PATH UNMOUNT_PATH UNMOUNT_PATH_ALT GETTEXT_PACKAGE USE_NLS MSGFMT GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+LIBGPOD_CURRENT
+LIBGPOD_REVISION
+LIBGPOD_AGE
+LIBGPOD_VERSION
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+AMTAR
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+AWK
+SET_MAKE
+am__leading_dot
+ACLOCAL_AMFLAGS
+MAINTAINER_MODE_TRUE
+MAINTAINER_MODE_FALSE
+MAINT
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+GREP
+EGREP
+CPP
+LN_S
+ECHO
+AR
+RANLIB
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+INTLTOOL_DESKTOP_RULE
+INTLTOOL_DIRECTORY_RULE
+INTLTOOL_KEYS_RULE
+INTLTOOL_PROP_RULE
+INTLTOOL_OAF_RULE
+INTLTOOL_PONG_RULE
+INTLTOOL_SERVER_RULE
+INTLTOOL_SHEET_RULE
+INTLTOOL_SOUNDLIST_RULE
+INTLTOOL_UI_RULE
+INTLTOOL_XAM_RULE
+INTLTOOL_KBD_RULE
+INTLTOOL_XML_RULE
+INTLTOOL_XML_NOMERGE_RULE
+INTLTOOL_CAVES_RULE
+INTLTOOL_SCHEMAS_RULE
+INTLTOOL_THEME_RULE
+INTLTOOL_SERVICE_RULE
+INTLTOOL_EXTRACT
+INTLTOOL_MERGE
+INTLTOOL_UPDATE
+INTLTOOL_PERL
+INTLTOOL_ICONV
+INTLTOOL_MSGFMT
+INTLTOOL_MSGMERGE
+INTLTOOL_XGETTEXT
+ALL_LINGUAS
+PKG_CONFIG
+LIBGPOD_CFLAGS
+LIBGPOD_LIBS
+TAGLIB_CFLAGS
+TAGLIB_LIBS
+HAVE_TAGLIB_TRUE
+HAVE_TAGLIB_FALSE
+GDKPIXBUF_CFLAGS
+GDKPIXBUF_LIBS
+HAVE_GDKPIXBUF_TRUE
+HAVE_GDKPIXBUF_FALSE
+GETTEXT_PACKAGE
+USE_NLS
+MSGFMT
+GMSGFMT
+XGETTEXT
+CATALOGS
+CATOBJEXT
+DATADIRNAME
+GMOFILES
+INSTOBJEXT
+INTLLIBS
+PO_IN_DATADIR_TRUE
+PO_IN_DATADIR_FALSE
+POFILES
+POSUB
+MKINSTALLDIRS
+HTML_DIR
+ENABLE_GTK_DOC_TRUE
+ENABLE_GTK_DOC_FALSE
+GTK_DOC_USE_LIBTOOL_TRUE
+GTK_DOC_USE_LIBTOOL_FALSE
+PYTHON
+PYTHON_VERSION
+PYTHON_PREFIX
+PYTHON_EXEC_PREFIX
+PYTHON_PLATFORM
+pythondir
+pkgpythondir
+pyexecdir
+pkgpyexecdir
+PYTHON_INCLUDES
+PYTHON_LDFLAGS
+SWIG
+SWIG_LIB
+HAVE_PYTHON_TRUE
+HAVE_PYTHON_FALSE
+LIBOBJS
+LTLIBOBJS'
 ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+F77
+FFLAGS
+PKG_CONFIG
+LIBGPOD_CFLAGS
+LIBGPOD_LIBS
+TAGLIB_CFLAGS
+TAGLIB_LIBS
+GDKPIXBUF_CFLAGS
+GDKPIXBUF_LIBS'
 
+
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
@@ -492,34 +983,48 @@
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -541,12 +1046,18 @@
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
@@ -554,8 +1065,18 @@
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    eval enable_$ac_feature=no ;;
 
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
   -enable-* | --enable-*)
     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
@@ -563,11 +1084,7 @@
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -594,6 +1111,12 @@
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -618,13 +1141,16 @@
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -689,6 +1215,16 @@
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -745,11 +1281,7 @@
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
@@ -758,7 +1290,7 @@
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -789,8 +1321,7 @@
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
@@ -810,29 +1341,21 @@
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
   case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
 # There might be people who depend on the old broken behavior: `$host'
 # used to hold the argument of --host etc.
 # FIXME: To remove some day.
@@ -857,122 +1380,76 @@
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$0" : 'X\(//\)[^/]' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
-  fi
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-ac_env_CXX_set=${CXX+set}
-ac_env_CXX_value=$CXX
-ac_cv_env_CXX_set=${CXX+set}
-ac_cv_env_CXX_value=$CXX
-ac_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_env_CXXFLAGS_value=$CXXFLAGS
-ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_cv_env_CXXFLAGS_value=$CXXFLAGS
-ac_env_CXXCPP_set=${CXXCPP+set}
-ac_env_CXXCPP_value=$CXXCPP
-ac_cv_env_CXXCPP_set=${CXXCPP+set}
-ac_cv_env_CXXCPP_value=$CXXCPP
-ac_env_F77_set=${F77+set}
-ac_env_F77_value=$F77
-ac_cv_env_F77_set=${F77+set}
-ac_cv_env_F77_value=$F77
-ac_env_FFLAGS_set=${FFLAGS+set}
-ac_env_FFLAGS_value=$FFLAGS
-ac_cv_env_FFLAGS_set=${FFLAGS+set}
-ac_cv_env_FFLAGS_value=$FFLAGS
-ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
-ac_env_PKG_CONFIG_value=$PKG_CONFIG
-ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
-ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
-ac_env_LIBGPOD_CFLAGS_set=${LIBGPOD_CFLAGS+set}
-ac_env_LIBGPOD_CFLAGS_value=$LIBGPOD_CFLAGS
-ac_cv_env_LIBGPOD_CFLAGS_set=${LIBGPOD_CFLAGS+set}
-ac_cv_env_LIBGPOD_CFLAGS_value=$LIBGPOD_CFLAGS
-ac_env_LIBGPOD_LIBS_set=${LIBGPOD_LIBS+set}
-ac_env_LIBGPOD_LIBS_value=$LIBGPOD_LIBS
-ac_cv_env_LIBGPOD_LIBS_set=${LIBGPOD_LIBS+set}
-ac_cv_env_LIBGPOD_LIBS_value=$LIBGPOD_LIBS
-ac_env_GDKPIXBUF_CFLAGS_set=${GDKPIXBUF_CFLAGS+set}
-ac_env_GDKPIXBUF_CFLAGS_value=$GDKPIXBUF_CFLAGS
-ac_cv_env_GDKPIXBUF_CFLAGS_set=${GDKPIXBUF_CFLAGS+set}
-ac_cv_env_GDKPIXBUF_CFLAGS_value=$GDKPIXBUF_CFLAGS
-ac_env_GDKPIXBUF_LIBS_set=${GDKPIXBUF_LIBS+set}
-ac_env_GDKPIXBUF_LIBS_value=$GDKPIXBUF_LIBS
-ac_cv_env_GDKPIXBUF_LIBS_set=${GDKPIXBUF_LIBS+set}
-ac_cv_env_GDKPIXBUF_LIBS_value=$GDKPIXBUF_LIBS
-ac_env_HAL_CFLAGS_set=${HAL_CFLAGS+set}
-ac_env_HAL_CFLAGS_value=$HAL_CFLAGS
-ac_cv_env_HAL_CFLAGS_set=${HAL_CFLAGS+set}
-ac_cv_env_HAL_CFLAGS_value=$HAL_CFLAGS
-ac_env_HAL_LIBS_set=${HAL_LIBS+set}
-ac_env_HAL_LIBS_value=$HAL_LIBS
-ac_cv_env_HAL_LIBS_set=${HAL_LIBS+set}
-ac_cv_env_HAL_LIBS_value=$HAL_LIBS
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -1001,9 +1478,6 @@
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
 			  [$ac_default_prefix]
@@ -1021,15 +1495,22 @@
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1056,13 +1537,13 @@
                           (and sometimes confusing) to the casual installer
   --disable-dependency-tracking Speeds up one-time builds
   --enable-dependency-tracking  Do not reject slow dependency extractors
-  --enable-shared[=PKGS]
-                          build shared libraries [default=yes]
-  --enable-static[=PKGS]
-                          build static libraries [default=yes]
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-gdk-pixbuf    ArtworkDB will be disabled without gdk-pixbuf
+  --enable-gtk-doc        use gtk-doc to build documentation default=no
   --enable-more-warnings  Maximum compiler warnings
 
 Optional Packages:
@@ -1071,18 +1552,17 @@
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
-  --with-tags[=TAGS]
-                          include additional configurations [automatic]
-  --with-eject-command   Command to invoke in order to eject a device]
-  --with-unmount-command Command to invoke in order to unmount a device]
+  --with-tags[=TAGS]      include additional configurations [automatic]
+  --with-html-dir=PATH    path to installed docs
+  --with-python=PATH      build python bindings [default=yes]
 
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
@@ -1094,129 +1574,98 @@
               C compiler flags for LIBGPOD, overriding pkg-config
   LIBGPOD_LIBS
               linker flags for LIBGPOD, overriding pkg-config
+  TAGLIB_CFLAGS
+              C compiler flags for TAGLIB, overriding pkg-config
+  TAGLIB_LIBS linker flags for TAGLIB, overriding pkg-config
   GDKPIXBUF_CFLAGS
               C compiler flags for GDKPIXBUF, overriding pkg-config
   GDKPIXBUF_LIBS
               linker flags for GDKPIXBUF, overriding pkg-config
-  HAL_CFLAGS  C compiler flags for HAL, overriding pkg-config
-  HAL_LIBS    linker flags for HAL, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd "$ac_popdir"
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.60a
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.60a.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1235,7 +1684,7 @@
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1249,6 +1698,7 @@
   test -z "$as_dir" && as_dir=.
   echo "PATH: $as_dir"
 done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1270,7 +1720,6 @@
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1281,7 +1730,7 @@
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    *\'*)
       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
@@ -1303,9 +1752,7 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
@@ -1316,8 +1763,8 @@
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
@@ -1330,20 +1777,34 @@
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
     cat <<\_ASBOX
@@ -1354,22 +1815,28 @@
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1381,26 +1848,24 @@
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1431,14 +1896,17 @@
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
   if test -r "$ac_site_file"; then
     { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1454,8 +1922,8 @@
     { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
@@ -1467,12 +1935,11 @@
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
       { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1497,8 +1964,7 @@
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1515,11 +1981,6 @@
    { (exit 1); exit 1; }; }
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
@@ -1536,12 +1997,25 @@
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+case m4 in
+  [\\/]* | ?:[\\/]* ) ac_macro_dir=m4         ;;
+  *)                      ac_macro_dir=$srcdir/m4 ;;
+esac
+test -d "$ac_macro_dir" ||
+  { { echo "$as_me:$LINENO: error: cannot find macro directory \`m4'" >&5
+echo "$as_me: error: cannot find macro directory \`m4'" >&2;}
+   { (exit 1); exit 1; }; }
 
 
-          ac_config_headers="$ac_config_headers config.h"
+ac_config_headers="$ac_config_headers config.h"
 
 
 # Making releases:
@@ -1552,8 +2026,8 @@
 # set LIBGPOD_BINARY_AGE and LIBGPOD_INTERFACE_AGE to 0.
 #
 LIBGPOD_MAJOR_VERSION=0
-LIBGPOD_MINOR_VERSION=3
-LIBGPOD_MICRO_VERSION=2
+LIBGPOD_MINOR_VERSION=4
+LIBGPOD_MICRO_VERSION=0
 LIBGPOD_INTERFACE_AGE=0
 # If you need a modifier for the version number.
 # Normally empty, but can be used to make "fixup" releases.
@@ -1573,30 +2047,36 @@
 
 am__api_version="1.7"
 ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
@@ -1610,8 +2090,8 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1633,7 +2113,7 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -1652,21 +2132,22 @@
     ;;
 esac
 done
+IFS=$as_save_IFS
 
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -1676,8 +2157,8 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
@@ -1719,20 +2200,20 @@
 Check your system clock" >&2;}
    { (exit 1); exit 1; }; }
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
 # Double any \ or $.  echo might interpret backslashes.
 # By default was `s,x,x', remove it if useless.
 cat <<\_ACEOF >conftest.sed
 s/[\\$]/&&/g;s/;s,x,x,$//
 _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+rm -f conftest.sed
 
 
 # expand $ac_aux_dir to an absolute path
@@ -1752,8 +2233,8 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1766,54 +2247,57 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$AWK" && break
 done
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-	@echo 'ac_maketemp="$(MAKE)"'
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
 rm -f conftest.make
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -1887,8 +2371,8 @@
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1901,32 +2385,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -1939,27 +2425,41 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  STRIP=$ac_ct_STRIP
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
 else
   STRIP="$ac_cv_prog_STRIP"
 fi
@@ -1976,19 +2476,19 @@
 ACLOCAL_AMFLAGS="$ACLOCAL_FLAGS"
 
 
-echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
-    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+    # Check whether --enable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
-  enableval="$enable_maintainer_mode"
-  USE_MAINTAINER_MODE=$enableval
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
 else
   USE_MAINTAINER_MODE=no
-fi;
-  echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+fi
 
+  { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
 
+
 if test $USE_MAINTAINER_MODE = yes; then
   MAINTAINER_MODE_TRUE=
   MAINTAINER_MODE_FALSE='#'
@@ -2015,8 +2515,8 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2029,32 +2529,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2067,36 +2569,51 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2109,74 +2626,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+
   fi
-done
-done
-
 fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2190,7 +2667,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2201,6 +2678,7 @@
   fi
 done
 done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -2218,22 +2696,23 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2246,36 +2725,38 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2288,29 +2769,45 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
@@ -2323,21 +2820,35 @@
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -2362,47 +2873,77 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
 	;;
-    conftest.$ac_ext )
-	# This is the source file.
-	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
@@ -2414,19 +2955,21 @@
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
 
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -2445,22 +2988,27 @@
     fi
   fi
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
 
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
@@ -2471,9 +3019,8 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
@@ -2487,14 +3034,14 @@
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2514,14 +3061,20 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -2539,12 +3092,12 @@
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2567,23 +3120,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -2592,24 +3158,28 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2625,23 +3195,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -2650,12 +3233,131 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2671,12 +3373,12 @@
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -2710,12 +3412,17 @@
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2730,201 +3437,74 @@
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  ac_cv_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2932,7 +3512,7 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 DEPDIR="${am__leading_dot}deps"
 
-          ac_config_commands="$ac_config_commands depfiles"
+ac_config_commands="$ac_config_commands depfiles"
 
 
 am_make=${MAKE-make}
@@ -2942,8 +3522,8 @@
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
 am__include="#"
 am__quote=
 _am_result=none
@@ -2970,15 +3550,15 @@
 fi
 
 
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
 rm -f confinc confmf
 
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+# Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then
-  enableval="$enable_dependency_tracking"
+  enableval=$enable_dependency_tracking;
+fi
 
-fi;
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
@@ -2998,8 +3578,8 @@
 
 depcc="$CC"   am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3081,8 +3661,8 @@
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
 
@@ -3098,8 +3678,8 @@
 fi
 
 
-echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
 if test "${lt_cv_path_SED+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3123,7 +3703,7 @@
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && break
+  test ! -f $lt_ac_sed && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -3148,95 +3728,271 @@
     fi
   done
 done
-SED=$lt_cv_path_SED
 
 fi
 
-echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6
+SED=$lt_cv_path_SED
+{ echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6; }
 
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
 
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
+else
+  ac_cv_path_GREP=$GREP
+fi
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+
+# Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
-fi;
+fi
+
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -3265,11 +4021,11 @@
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3282,7 +4038,7 @@
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
@@ -3302,21 +4058,21 @@
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -3326,8 +4082,8 @@
   ;;
 esac
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
@@ -3337,8 +4093,8 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3372,8 +4128,13 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3398,9 +4159,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3410,8 +4172,13 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3438,6 +4205,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3455,8 +4223,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -3479,8 +4247,13 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3505,9 +4278,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3517,8 +4291,13 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3545,6 +4324,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3567,8 +4347,8 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3592,23 +4372,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3617,10 +4410,11 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+	ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
@@ -3675,6 +4469,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -3694,18 +4489,27 @@
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3718,12 +4522,14 @@
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -3745,8 +4551,8 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3768,7 +4574,7 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -3787,21 +4593,22 @@
     ;;
 esac
 done
+IFS=$as_save_IFS
 
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -3811,10 +4618,9 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-# Check whether --enable-shared or --disable-shared was given.
+# Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
-  p=${PACKAGE-default}
+  enableval=$enable_shared; p=${PACKAGE-default}
     case $enableval in
     yes) enable_shared=yes ;;
     no) enable_shared=no ;;
@@ -3833,12 +4639,12 @@
     esac
 else
   enable_shared=yes
-fi;
+fi
 
-# Check whether --enable-static or --disable-static was given.
+
+# Check whether --enable-static was given.
 if test "${enable_static+set}" = set; then
-  enableval="$enable_static"
-  p=${PACKAGE-default}
+  enableval=$enable_static; p=${PACKAGE-default}
     case $enableval in
     yes) enable_static=yes ;;
     no) enable_static=no ;;
@@ -3857,12 +4663,12 @@
     esac
 else
   enable_static=yes
-fi;
+fi
 
-# Check whether --enable-fast-install or --disable-fast-install was given.
+
+# Check whether --enable-fast-install was given.
 if test "${enable_fast_install+set}" = set; then
-  enableval="$enable_fast_install"
-  p=${PACKAGE-default}
+  enableval=$enable_fast_install; p=${PACKAGE-default}
     case $enableval in
     yes) enable_fast_install=yes ;;
     no) enable_fast_install=no ;;
@@ -3881,26 +4687,36 @@
     esac
 else
   enable_fast_install=yes
-fi;
+fi
 
-echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
 if test "${lt_cv_ld_reload_flag+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   lt_cv_ld_reload_flag='-r'
 fi
-echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
 reload_flag=$lt_cv_ld_reload_flag
 case $reload_flag in
 "" | " "*) ;;
 *) reload_flag=" $reload_flag" ;;
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
 
-echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
 if test "${lt_cv_path_NM+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3908,56 +4724,63 @@
   # Let the user override the test.
   lt_cv_path_NM="$NM"
 else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
-    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-      */dev/null* | *'Invalid file or object type'*)
-	lt_cv_path_NM="$tmp_nm -B"
-	break
-        ;;
-      *)
-	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	*/dev/null*)
-	  lt_cv_path_NM="$tmp_nm -p"
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
 	  break
 	  ;;
 	*)
-	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	  continue # so that we can try to find one that supports BSD flags
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
 	  ;;
 	esac
-      esac
-    fi
+      fi
+    done
+    IFS="$lt_save_ifs"
   done
-  IFS="$lt_save_ifs"
   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
 fi
 fi
-echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
 NM="$lt_cv_path_NM"
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; }
 if test "${lt_cv_deplibs_check_method+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3984,7 +4807,7 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-bsdi4*)
+bsdi[45]*)
   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
   lt_cv_file_magic_cmd='/usr/bin/file -L'
   lt_cv_file_magic_test_file=/shlib/libc.so
@@ -4007,13 +4830,13 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | kfreebsd*-gnu)
+freebsd* | dragonfly*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -4029,7 +4852,7 @@
 
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
@@ -4045,6 +4868,11 @@
   esac
   ;;
 
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $LD in
   *-32|*"-32 ") libmagic=32-bit;;
@@ -4056,11 +4884,11 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -4079,12 +4907,10 @@
   ;;
 
 openbsd*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   fi
   ;;
 
@@ -4092,15 +4918,11 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
@@ -4121,17 +4943,20 @@
   siemens)
     lt_cv_deplibs_check_method=pass_all
     ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
   esac
   ;;
 
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -4142,14 +4967,17 @@
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+# Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+  enableval=$enable_libtool_lock;
+fi
 
-fi;
 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
@@ -4176,7 +5004,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4179 "configure"' > conftest.$ac_ext
+  echo '#line 5007 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4219,7 +5047,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-    case "`/usr/bin/file conftest.o`" in
+    case `/usr/bin/file conftest.o` in
     *32-bit*)
       case $host in
         x86_64-*linux*)
@@ -4261,8 +5089,8 @@
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
-  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
 if test "${lt_cv_cc_needs_belf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4288,23 +5116,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4313,9 +5154,10 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-lt_cv_cc_needs_belf=no
+	lt_cv_cc_needs_belf=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
      ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -4324,14 +5166,34 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
+
 esac
 
 need_locks="$enable_libtool_lock"
@@ -4351,9 +5213,9 @@
 		  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4367,23 +5229,36 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4392,12 +5267,14 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+	eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -4412,18 +5289,19 @@
 for ac_header in dlfcn.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4434,23 +5312,36 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4459,15 +5350,16 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4476,8 +5368,13 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -4501,9 +5398,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -4527,25 +5425,19 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4557,18 +5449,22 @@
 
 done
 
-ac_ext=cc
+ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4581,36 +5477,38 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CXX" && break
   done
 fi
 if test -z "$CXX"; then
   ac_ct_CXX=$CXX
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4623,55 +5521,85 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CXX" && break
 done
-test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
 
-  CXX=$ac_ct_CXX
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
 fi
 
-
+  fi
+fi
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C++ compiler version" >&5
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
-echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4694,23 +5622,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4719,24 +5660,28 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
 GXX=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cxx_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -4752,23 +5697,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4777,69 +5735,53 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cxx_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -4848,61 +5790,92 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  break
+  ac_cv_prog_cxx_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-ac_ext=cc
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -4910,8 +5883,8 @@
 
 depcc="$CXX"  am_compiler_list=
 
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4993,8 +5966,8 @@
 fi
 
 fi
-echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
 
@@ -5010,13 +5983,18 @@
 fi
 
 
-ac_ext=cc
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
 if test -z "$CXXCPP"; then
   if test "${ac_cv_prog_CXXCPP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5046,8 +6024,13 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5072,9 +6055,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5084,8 +6068,13 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5112,6 +6101,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -5129,8 +6119,8 @@
 else
   ac_cv_prog_CXXCPP=$CXXCPP
 fi
-echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
 ac_preproc_ok=false
 for ac_cxx_preproc_warn_flag in '' yes
 do
@@ -5153,8 +6143,13 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5179,9 +6174,10 @@
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5191,8 +6187,13 @@
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5219,6 +6220,7 @@
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -5234,24 +6236,26 @@
    { (exit 1); exit 1; }; }
 fi
 
-ac_ext=cc
+ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
+fi
 
+
 ac_ext=f
 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5264,36 +6268,38 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 F77=$ac_cv_prog_F77
 if test -n "$F77"; then
-  echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6
+  { echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$F77" && break
   done
 fi
 if test -z "$F77"; then
   ac_ct_F77=$F77
-  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5306,48 +6312,78 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_F77="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_F77=$ac_cv_prog_ac_ct_F77
 if test -n "$ac_ct_F77"; then
-  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_F77" && break
 done
 
-  F77=$ac_ct_F77
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
 fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:5336:" \
-     "checking for Fortran 77 compiler version" >&5
+echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -5357,8 +6393,8 @@
 # input file.  (Note that this only needs to work for GNU compilers.)
 ac_save_ext=$ac_ext
 ac_ext=F
-echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
 if test "${ac_cv_f77_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5371,23 +6407,36 @@
       end
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -5396,20 +6445,21 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+	ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_f77_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
 ac_ext=$ac_save_ext
 ac_test_FFLAGS=${FFLAGS+set}
 ac_save_FFLAGS=$FFLAGS
 FFLAGS=
-echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_f77_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5420,23 +6470,36 @@
       end
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -5445,13 +6508,14 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_f77_g=no
+	ac_cv_prog_f77_g=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
 if test "$ac_test_FFLAGS" = set; then
   FFLAGS=$ac_save_FFLAGS
 elif test $ac_cv_prog_f77_g = yes; then
@@ -5480,8 +6544,8 @@
 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
 
 # find the maximum length of command line arguments
-echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
 if test "${lt_cv_sys_max_cmd_len+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5521,11 +6585,55 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
- *)
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ 	]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
     # we can't tell.
-    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
 	       = "XX$teststring") >/dev/null 2>&1 &&
 	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
 	    lt_cv_sys_max_cmd_len=$new_result &&
@@ -5545,19 +6653,19 @@
 fi
 
 if test -n $lt_cv_sys_max_cmd_len ; then
-  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
 else
-  echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
 fi
 
 
 
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
-echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5571,9 +6679,6 @@
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
 # Transform an extracted symbol line into a proper C declaration
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
@@ -5595,15 +6700,31 @@
   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
   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'"
   ;;
+linux* | k*bsd*-gnu)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    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'"
+  fi
+  ;;
 irix* | nonstopux*)
   symcode='[BCDEGRST]'
   ;;
 osf*)
   symcode='[BCDEGQRST]'
   ;;
-solaris* | sysv5*)
+solaris*)
   symcode='[BDRT]'
   ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
 sysv4)
   symcode='[DFNSTU]'
   ;;
@@ -5626,8 +6747,11 @@
 # Try without a prefix undercore, then with it.
 for ac_symprfx in "" "_"; do
 
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -5745,15 +6869,15 @@
   lt_cv_sys_global_symbol_to_cdecl=
 fi
 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
 else
-  echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
 if test "${lt_cv_objdir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5767,8 +6891,8 @@
 fi
 rmdir .libs 2>/dev/null
 fi
-echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
 objdir=$lt_cv_objdir
 
 
@@ -5789,7 +6913,7 @@
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
+Xsed='sed -e 1s/^X//'
 sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 
 # Same as above, but do not quote variable references.
@@ -5809,7 +6933,7 @@
 default_ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 ltmain="$ac_aux_dir/ltmain.sh"
@@ -5819,8 +6943,8 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5833,32 +6957,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_AR"; then
   ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5871,27 +6997,41 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_AR="ar"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
 fi
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  AR=$ac_ct_AR
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
 else
   AR="$ac_cv_prog_AR"
 fi
@@ -5899,8 +7039,8 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5913,32 +7053,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5951,27 +7093,41 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  RANLIB=$ac_ct_RANLIB
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
@@ -5979,8 +7135,8 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5993,32 +7149,34 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6031,27 +7189,41 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  STRIP=$ac_ct_STRIP
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
 else
   STRIP="$ac_cv_prog_STRIP"
 fi
@@ -6066,6 +7238,7 @@
 test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
 test -z "$LN_S" && LN_S="ln -s"
@@ -6085,21 +7258,32 @@
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
     ;;
   *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
     ;;
   esac
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
 # Only perform the check for file, if the check method requires it
 case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6119,7 +7303,7 @@
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -6151,17 +7335,17 @@
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
-    echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6181,7 +7365,7 @@
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
-	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
 	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
@@ -6213,11 +7397,11 @@
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
   else
@@ -6232,21 +7416,21 @@
 enable_dlopen=no
 enable_win32_dll=no
 
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+# Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then
-  enableval="$enable_libtool_lock"
+  enableval=$enable_libtool_lock;
+fi
 
-fi;
 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 
-# Check whether --with-pic or --without-pic was given.
+# Check whether --with-pic was given.
 if test "${with_pic+set}" = set; then
-  withval="$with_pic"
-  pic_mode="$withval"
+  withval=$with_pic; pic_mode="$withval"
 else
   pic_mode=default
-fi;
+fi
+
 test -z "$pic_mode" && pic_mode=default
 
 # Use C for the default configuration in the libtool script
@@ -6276,79 +7460,36 @@
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
-#
-# Check for any special shared library compilation flags.
-#
-lt_prog_cc_shlib=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    lt_prog_cc_shlib='-belf'
-    ;;
-  esac
-fi
-if test -n "$lt_prog_cc_shlib"; then
-  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
-echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
-  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
-  else
-    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
-echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
-    lt_cv_prog_cc_can_build_shared=no
-  fi
-fi
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
 
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
 
-#
-# Check to make sure the static flag actually works.
-#
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-     else
-       lt_prog_compiler_static_works=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
 
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
 
-if test x"$lt_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
-
-
-
-
 lt_prog_compiler_no_builtin_flag=
 
 if test "$GCC" = yes; then
   lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6362,26 +7503,28 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6368: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7509: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6372: \$? = $ac_status" >&5
+   echo "$as_me:7513: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -6395,8 +7538,8 @@
 lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
@@ -6434,6 +7577,11 @@
       lt_prog_compiler_pic='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -6450,7 +7598,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -6476,6 +7624,16 @@
 	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -6487,7 +7645,7 @@
       lt_prog_compiler_wl='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -6510,13 +7668,20 @@
       lt_prog_compiler_static='-Bstatic'
       ;;
 
-    linux*)
-      case $CC in
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
       icc* | ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
 	lt_prog_compiler_static='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
       ccc*)
         lt_prog_compiler_wl='-Wl,'
         # All Alpha code is PIC.
@@ -6531,15 +7696,15 @@
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    sco3.2v5*)
-      lt_prog_compiler_pic='-Kpic'
-      lt_prog_compiler_static='-dn'
-      ;;
-
     solaris*)
-      lt_prog_compiler_wl='-Wl,'
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -6548,7 +7713,7 @@
       lt_prog_compiler_static='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       lt_prog_compiler_wl='-Wl,'
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
@@ -6561,6 +7726,17 @@
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic='-pic'
       lt_prog_compiler_static='-Bstatic'
@@ -6572,16 +7748,16 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6595,26 +7771,28 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6601: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7777: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6605: \$? = $ac_status" >&5
+   echo "$as_me:7781: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
 
 if test x"$lt_prog_compiler_pic_works" = xyes; then
     case $lt_prog_compiler_pic in
@@ -6627,7 +7805,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
@@ -6637,8 +7815,50 @@
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6655,23 +7875,25 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6661: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7881: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6665: \$? = $ac_status" >&5
+   echo "$as_me:7885: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -6682,23 +7904,23 @@
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -6708,8 +7930,8 @@
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   runpath_var=
   allow_undefined_flag=
@@ -6747,6 +7969,16 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -6757,6 +7989,10 @@
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -6767,6 +8003,27 @@
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -6817,10 +8074,10 @@
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -6829,13 +8086,60 @@
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    interix3*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+	link_all_deplibs=no
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -6845,7 +8149,7 @@
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	ld_shlibs=no
 	cat <<EOF 1>&2
@@ -6866,6 +8170,33 @@
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -6873,32 +8204,6 @@
       hardcode_shlibpath_var=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_cmds="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds="$tmp_archive_cmds"
-      fi
-      link_all_deplibs=no
-    else
-      ld_shlibs=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -6909,16 +8214,11 @@
       ;;
     esac
 
-    if test "$ld_shlibs" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec=
-      fi
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -6930,7 +8230,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -6964,6 +8264,7 @@
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -6982,7 +8283,7 @@
       link_all_deplibs=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.012|aix4.012.*)
+	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -7001,8 +8302,12 @@
   	  hardcode_libdir_flag_spec='-L$libdir'
   	  hardcode_libdir_separator=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -7010,11 +8315,11 @@
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -7042,23 +8347,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -7072,18 +8390,20 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
        else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
@@ -7102,23 +8422,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -7132,8 +8465,10 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -7142,13 +8477,11 @@
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag=' ${wl}-bernotok'
 	  allow_undefined_flag=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  always_export_symbols=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec=' '
+	  whole_archive_flag_spec='$convenience'
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -7161,7 +8494,7 @@
       ld_shlibs=no
       ;;
 
-    bsdi4*)
+    bsdi[45]*)
       export_dynamic_flag_spec=-rdynamic
       ;;
 
@@ -7187,52 +8520,52 @@
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
       archive_cmds_need_lc=no
-      case "$host_os" in
-      rhapsody* | darwin1.[012])
-	allow_undefined_flag='-undefined suppress'
-	;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	allow_undefined_flag='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-	;;
-      esac
-    	lt_int_apple_cc_single_mod=no
-    	output_verbose_link_cmd='echo'
-    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-    	  lt_int_apple_cc_single_mod=yes
-    	fi
-    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-    	  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    	else
-        archive_cmds='$CC -r ${wl}-bind_at_load -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'
-      fi
-      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          module_expsym_cmds='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}'
       hardcode_direct=no
       hardcode_automatic=yes
       hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec='-all_load $convenience'
+      whole_archive_flag_spec=''
       link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='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}'
     else
-      ld_shlibs=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='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 $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='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}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
     fi
       ;;
 
@@ -7266,7 +8599,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | dragonfly*)
       archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
@@ -7289,47 +8622,62 @@
       export_dynamic_flag_spec='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	hardcode_direct=yes
+	export_dynamic_flag_spec='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
-	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  hardcode_libdir_flag_spec_ld='+b $libdir'
-	  hardcode_libdir_separator=:
 	  hardcode_direct=no
 	  hardcode_shlibpath_var=no
 	  ;;
-	ia64*)
-	  hardcode_libdir_flag_spec='-L$libdir'
-	  hardcode_direct=no
-	  hardcode_shlibpath_var=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L=yes
-	  ;;
 	*)
-	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator=:
 	  hardcode_direct=yes
 	  export_dynamic_flag_spec='${wl}-E'
 
@@ -7353,7 +8701,7 @@
       link_all_deplibs=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -7377,6 +8725,7 @@
       hardcode_shlibpath_var=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
 	export_dynamic_flag_spec='${wl}-E'
       else
@@ -7422,7 +8771,7 @@
 	allow_undefined_flag=' -expect_unresolved \*'
 	archive_cmds='$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'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$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'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -7430,21 +8779,15 @@
       hardcode_libdir_separator=:
       ;;
 
-    sco3.2v5*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       no_undefined_flag=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -7453,8 +8796,18 @@
       hardcode_shlibpath_var=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       link_all_deplibs=yes
       ;;
@@ -7511,36 +8864,45 @@
       fi
       ;;
 
-    sysv4.2uw2*)
-      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
       ;;
 
-    sysv5*)
-      no_undefined_flag=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      hardcode_libdir_flag_spec=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
       ;;
 
     uts4*)
@@ -7555,15 +8917,10 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
 test "$ld_shlibs" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -7581,8 +8938,8 @@
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -7596,6 +8953,7 @@
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl
+	pic_flag=$lt_prog_compiler_pic
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -7618,16 +8976,16 @@
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -7728,7 +9086,7 @@
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -7756,7 +9114,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -7786,7 +9145,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -7809,7 +9168,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -7832,20 +9191,17 @@
   dynamic_linker=no
   ;;
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -7863,14 +9219,19 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -7890,7 +9251,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -7930,6 +9291,18 @@
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -7973,7 +9346,7 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -7989,7 +9362,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -8014,18 +9387,6 @@
   dynamic_linker='NetBSD ld.elf_so'
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -8063,8 +9424,13 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=yes
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -8102,13 +9468,6 @@
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -8134,7 +9493,7 @@
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -8167,6 +9526,29 @@
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -8178,16 +9560,21 @@
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action=
 if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var " || \
-   test "X$hardcode_automatic"="Xyes" ; then
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct" != no &&
@@ -8207,8 +9594,8 @@
   # directories.
   hardcode_action=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
 
 if test "$hardcode_action" = relink; then
   # Fast installation is not supported
@@ -8221,29 +9608,29 @@
 
 striplib=
 old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
    darwin*)
        if test -n "$STRIP" ; then
          striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+         { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
        else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
        ;;
    *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
     ;;
   esac
 fi
@@ -8275,8 +9662,8 @@
 
   darwin*)
   # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8289,39 +9676,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
 main ()
 {
-dlopen ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8330,14 +9730,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
+	ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
 if test $ac_cv_lib_dl_dlopen = yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
@@ -8351,8 +9752,8 @@
    ;;
 
   *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
 if test "${ac_cv_func_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8379,52 +9780,59 @@
 
 #undef shl_load
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shl_load ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
+#if defined __stub_shl_load || defined __stub___shl_load
 choke me
-#else
-char (*f) () = shl_load;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != shl_load;
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8433,18 +9841,19 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_shl_load=no
+	ac_cv_func_shl_load=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
 if test $ac_cv_func_shl_load = yes; then
   lt_cv_dlopen="shl_load"
 else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8457,39 +9866,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shl_load ();
 int
 main ()
 {
-shl_load ();
+return shl_load ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8498,19 +9920,20 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_shl_load=no
+	ac_cv_lib_dld_shl_load=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
 if test $ac_cv_lib_dld_shl_load = yes; then
   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
 else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
 if test "${ac_cv_func_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8537,52 +9960,59 @@
 
 #undef dlopen
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
+#if defined __stub_dlopen || defined __stub___dlopen
 choke me
-#else
-char (*f) () = dlopen;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != dlopen;
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8591,18 +10021,19 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_dlopen=no
+	ac_cv_func_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
 if test $ac_cv_func_dlopen = yes; then
   lt_cv_dlopen="dlopen"
 else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8615,39 +10046,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
 main ()
 {
-dlopen ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8656,19 +10100,20 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_dlopen=no
+	ac_cv_lib_dl_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
 if test $ac_cv_lib_dl_dlopen = yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
 if test "${ac_cv_lib_svld_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8681,39 +10126,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dlopen ();
 int
 main ()
 {
-dlopen ();
+return dlopen ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8722,19 +10180,20 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_svld_dlopen=no
+	ac_cv_lib_svld_dlopen=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
 if test $ac_cv_lib_svld_dlopen = yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dld_dld_link+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8747,39 +10206,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dld_link ();
 int
 main ()
 {
-dld_link ();
+return dld_link ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -8788,14 +10260,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_dld_link=no
+	ac_cv_lib_dld_dld_link=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
 if test $ac_cv_lib_dld_dld_link = yes; then
   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
 fi
@@ -8830,13 +10303,13 @@
     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
     save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
 if test "${lt_cv_dlopen_self+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8846,7 +10319,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8849 "configure"
+#line 10322 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -8903,6 +10376,8 @@
       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
       /* dlclose (self); */
     }
+  else
+    puts (dlerror ());
 
     exit (status);
 }
@@ -8912,12 +10387,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
       x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
     esac
   else :
     # compilation failed
@@ -8928,13 +10403,13 @@
 
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
 
     if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
 if test "${lt_cv_dlopen_self_static+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8944,7 +10419,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8947 "configure"
+#line 10422 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9001,6 +10476,8 @@
       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
       /* dlclose (self); */
     }
+  else
+    puts (dlerror ());
 
     exit (status);
 }
@@ -9010,12 +10487,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
+    (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
       x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
       x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
     esac
   else :
     # compilation failed
@@ -9026,8 +10503,8 @@
 
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
     fi
 
     CPPFLAGS="$save_CPPFLAGS"
@@ -9048,19 +10525,19 @@
 fi
 
 
-# Report which librarie types wil actually be built
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
+# Report which library types will actually be built
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
 test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -9073,54 +10550,17 @@
   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
     test "$enable_shared" = yes && enable_static=no
   fi
-  ;;
-  darwin* | rhapsody*)
-  if test "$GCC" = yes; then
-    archive_cmds_need_lc=no
-    case "$host_os" in
-    rhapsody* | darwin1.[012])
-      allow_undefined_flag='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	allow_undefined_flag='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-      ;;
-    esac
-    output_verbose_link_cmd='echo'
-    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
-    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    module_expsym_cmds='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}'
-    hardcode_direct=no
-    hardcode_automatic=yes
-    hardcode_shlibpath_var=unsupported
-    whole_archive_flag_spec='-all_load $convenience'
-    link_all_deplibs=yes
-  else
-    ld_shlibs=no
-  fi
     ;;
 esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
 
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
 # Make sure either enable_shared or enable_static is yes.
 test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
 
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
@@ -9135,7 +10575,7 @@
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -9239,7 +10679,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -9250,11 +10690,11 @@
 SED=$lt_SED
 
 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e s/^X//"
+Xsed="$SED -e 1s/^X//"
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 # The names of the tagged configurations supported by this script.
 available_tags=
@@ -9284,7 +10724,13 @@
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
 
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -9295,6 +10741,9 @@
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler
 
@@ -9360,7 +10809,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -9603,12 +11052,12 @@
 CC="$lt_save_CC"
 
 
-# Check whether --with-tags or --without-tags was given.
+# Check whether --with-tags was given.
 if test "${with_tags+set}" = set; then
-  withval="$with_tags"
-  tagnames="$withval"
-fi;
+  withval=$with_tags; tagnames="$withval"
+fi
 
+
 if test -f "$ltmain" && test -n "$tagnames"; then
   if test ! -f "${ofile}"; then
     { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
@@ -9625,6 +11074,9 @@
 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
     fi
   fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
 
   # Extract list of available tagged configurations in $ofile.
   # Note that this assumes the entire list is on one line.
@@ -9655,8 +11107,10 @@
 
       case $tagname in
       CXX)
-	if test -n "$CXX" && test "X$CXX" != "Xno"; then
-	  ac_ext=cc
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+	    (test "X$CXX" != "Xg++"))) ; then
+	  ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -9675,6 +11129,7 @@
 hardcode_libdir_flag_spec_ld_CXX=
 hardcode_libdir_separator_CXX=
 hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
 hardcode_automatic_CXX=no
 module_cmds_CXX=
 module_expsym_cmds_CXX=
@@ -9692,7 +11147,7 @@
 compiler_lib_search_path_CXX=
 
 # Source file extension for C++ test sources.
-ac_ext=cc
+ac_ext=cpp
 
 # Object file extension for compiled C++ test sources.
 objext=o
@@ -9702,17 +11157,34 @@
 lt_simple_compile_test_code="int some_variable = 0;\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC=$CC
 lt_save_LD=$LD
@@ -9723,19 +11195,28 @@
 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
 else
-  unset lt_cv_prog_gnu_ld
+  $as_unset lt_cv_prog_gnu_ld
 fi
 if test -n "${lt_cv_path_LDCXX+set}"; then
   lt_cv_path_LD=$lt_cv_path_LDCXX
 else
-  unset lt_cv_path_LD
+  $as_unset lt_cv_path_LD
 fi
 test -z "${LDCXX+set}" || LD=$LDCXX
 CC=${CXX-"c++"}
 compiler=$CC
 compiler_CXX=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
+
 # We don't want -fno-exception wen compiling C++ code, so set the
 # no_builtin_flag separately
 if test "$GXX" = yes; then
@@ -9748,18 +11229,18 @@
   # Set up default GNU C++ configuration
 
 
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
+# Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
-  withval="$with_gnu_ld"
-  test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
 else
   with_gnu_ld=no
-fi;
+fi
+
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -9788,11 +11269,11 @@
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
 else
-  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9805,7 +11286,7 @@
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
       # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
+      # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
@@ -9825,21 +11306,21 @@
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
   lt_cv_prog_gnu_ld=yes
@@ -9849,8 +11330,8 @@
   ;;
 esac
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
@@ -9900,8 +11381,8 @@
 fi
 
 # PORTME: fill in a description of your system's C++ link characteristics
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 ld_shlibs_CXX=yes
 case $host_os in
   aix3*)
@@ -9930,6 +11411,7 @@
 	    ;;
 	  esac
 	done
+	;;
       esac
 
       exp_sym_flag='-bexport'
@@ -9948,7 +11430,7 @@
     link_all_deplibs_CXX=yes
 
     if test "$GXX" = yes; then
-      case $host_os in aix4.012|aix4.012.*)
+      case $host_os in aix4.[012]|aix4.[012].*)
       # We only want to do this on AIX 4.2 and lower, the check
       # below for broken collect2 doesn't work under 4.3+
 	collect2name=`${CC} -print-prog-name=collect2`
@@ -9967,8 +11449,12 @@
 	  hardcode_libdir_flag_spec_CXX='-L$libdir'
 	  hardcode_libdir_separator_CXX=
 	fi
+	;;
       esac
       shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+	shared_flag="$shared_flag "'${wl}-G'
+      fi
     else
       # not using gcc
       if test "$host_cpu" = ia64; then
@@ -10008,23 +11494,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10038,19 +11537,21 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
       hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
      else
       if test "$host_cpu" = ia64; then
 	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
 	allow_undefined_flag_CXX="-z nodefs"
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
       else
 	# Determine the default libpath from the value encoded in an empty executable.
 	cat >conftest.$ac_ext <<_ACEOF
@@ -10069,23 +11570,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -10099,8 +11613,10 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -10109,16 +11625,26 @@
 	# -berok will link without error, but may produce a broken library.
 	no_undefined_flag_CXX=' ${wl}-bernotok'
 	allow_undefined_flag_CXX=' ${wl}-berok'
-	# -bexpall does not export symbols beginning with underscore (_)
-	always_export_symbols_CXX=yes
 	# Exported symbols can be pulled into shared objects from archives
-	whole_archive_flag_spec_CXX=' '
+	whole_archive_flag_spec_CXX='$convenience'
 	archive_cmds_need_lc_CXX=yes
-	# This is similar to how AIX traditionally builds it's shared libraries.
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
       fi
     fi
     ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      allow_undefined_flag_CXX=unsupported
+      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+    ;;
+
   chorus*)
     case $cc_basename in
       *)
@@ -10137,7 +11663,7 @@
     enable_shared_with_static_runtimes_CXX=yes
 
     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is; otherwise, prepend...
       archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -10146,70 +11672,81 @@
 	echo EXPORTS > $output_objdir/$soname.def;
 	cat $export_symbols >> $output_objdir/$soname.def;
       fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
     else
       ld_shlibs_CXX=no
     fi
   ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
 
-  darwin* | rhapsody*)
-  if test "$GXX" = yes; then
-    archive_cmds_need_lc_CXX=no
-    case "$host_os" in
-    rhapsody* | darwin1.[012])
-      allow_undefined_flag_CXX='-undefined suppress'
-      ;;
-    *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
       else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag_CXX='-undefined dynamic_lookup'
-            ;;
-        esac
+          archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='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}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='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 $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='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}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
       fi
-      ;;
-    esac
-    lt_int_apple_cc_single_mod=no
-    output_verbose_link_cmd='echo'
-    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-      lt_int_apple_cc_single_mod=yes
-    fi
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    else
-      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -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'
-    fi
-    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        ;;
 
-    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-    if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    module_expsym_cmds_CXX='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}'
-    hardcode_direct_CXX=no
-    hardcode_automatic_CXX=yes
-    hardcode_shlibpath_var_CXX=unsupported
-    whole_archive_flag_spec_CXX='-all_load $convenience'
-    link_all_deplibs_CXX=yes
-  else
-    ld_shlibs_CXX=no
-  fi
-    ;;
-
   dgux*)
     case $cc_basename in
-      ec++)
+      ec++*)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      ghcx)
+      ghcx*)
 	# Green Hills C++ Compiler
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -10220,14 +11757,14 @@
 	;;
     esac
     ;;
-  freebsd12*)
+  freebsd[12]*)
     # C++ shared libraries reported to be fairly broken before switch to ELF
     ld_shlibs_CXX=no
     ;;
   freebsd-elf*)
     archive_cmds_need_lc_CXX=no
     ;;
-  freebsd* | kfreebsd*-gnu)
+  freebsd* | dragonfly*)
     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
     # conventions
     ld_shlibs_CXX=yes
@@ -10244,11 +11781,11 @@
 				# location of the library.
 
     case $cc_basename in
-    CC)
+    CC*)
       # FIXME: insert proper C++ library support
       ld_shlibs_CXX=no
       ;;
-    aCC)
+    aCC*)
       archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
@@ -10258,7 +11795,7 @@
       # explicitly linking system object files so we need to strip them
       # from the output so that they don't get included in the library
       # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      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'
       ;;
     *)
       if test "$GXX" = yes; then
@@ -10272,34 +11809,23 @@
     ;;
   hpux10*|hpux11*)
     if test $with_gnu_ld = no; then
-      case "$host_cpu" in
-      hppa*64*)
-	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_CXX=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
 	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
-	hardcode_libdir_separator_CXX=:
         ;;
-      ia64*)
-	hardcode_libdir_flag_spec_CXX='-L$libdir'
-        ;;
       *)
-	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_CXX=:
 	export_dynamic_flag_spec_CXX='${wl}-E'
         ;;
       esac
     fi
-    case "$host_cpu" in
-    hppa*64*)
+    case $host_cpu in
+    hppa*64*|ia64*)
       hardcode_direct_CXX=no
       hardcode_shlibpath_var_CXX=no
       ;;
-    ia64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      hardcode_minus_L_CXX=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
     *)
       hardcode_direct_CXX=yes
       hardcode_minus_L_CXX=yes # Not in the search PATH,
@@ -10309,15 +11835,18 @@
     esac
 
     case $cc_basename in
-      CC)
+      CC*)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      aCC)
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+      aCC*)
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
 	*)
 	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	  ;;
@@ -10335,10 +11864,13 @@
       *)
 	if test "$GXX" = yes; then
 	  if test $with_gnu_ld = no; then
-	    case "$host_cpu" in
-	    ia64*|hppa*64*)
-	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+	    case $host_cpu in
+	    hppa*64*)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      ;;
+	    ia64*)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
 	    *)
 	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      ;;
@@ -10351,11 +11883,25 @@
 	;;
     esac
     ;;
+  interix3*)
+    hardcode_direct_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
   irix5* | irix6*)
     case $cc_basename in
-      CC)
+      CC*)
 	# SGI C++
-	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$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'
 
 	# Archives containing C++ object files must be created using
 	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -10366,7 +11912,7 @@
       *)
 	if test "$GXX" = yes; then
 	  if test "$with_gnu_ld" = no; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$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'
 	  else
 	    archive_cmds_CXX='$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'
 	  fi
@@ -10377,9 +11923,9 @@
     hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
     hardcode_libdir_separator_CXX=:
     ;;
-  linux*)
+  linux* | k*bsd*-gnu)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -10404,17 +11950,41 @@
 	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
 	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 	;;
-      icpc)
+      icpc*)
 	# Intel C++
 	with_gnu_ld=yes
+	# version 8.0 and above of icpc choke on multiply defined symbols
+	# if we add $predep_objects and $postdep_objects, however 7.1 and
+	# earlier do not add the objects themselves.
+	case `$CC -V 2>&1` in
+	*"Version 7."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	*)  # Version 8.0 or newer
+	  tmp_idyn=
+	  case $host_cpu in
+	    ia64*) tmp_idyn=' -i_dynamic';;
+	  esac
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
 	archive_cmds_need_lc_CXX=no
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
 	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	;;
-      cxx)
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
 	# Compaq C++
 	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
@@ -10445,7 +12015,7 @@
     ;;
   mvs*)
     case $cc_basename in
-      cxx)
+      cxx*)
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
@@ -10455,7 +12025,7 @@
 	;;
     esac
     ;;
-  netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+  netbsd* | netbsdelf*-gnu)
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
@@ -10466,9 +12036,25 @@
     # Workaround some broken pre-1.5 toolchains
     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
     ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
   osf3*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -10484,14 +12070,14 @@
 	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
 
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      cxx)
+      cxx*)
 	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$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'
 
 	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	hardcode_libdir_separator_CXX=:
@@ -10509,7 +12095,7 @@
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	  hardcode_libdir_separator_CXX=:
@@ -10528,7 +12114,7 @@
     ;;
   osf4* | osf5*)
     case $cc_basename in
-      KCC)
+      KCC*)
 	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
 	# KCC will only create a shared library if the output file
@@ -10543,17 +12129,17 @@
 	# the KAI C++ compiler.
 	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
 	;;
-      RCC)
+      RCC*)
 	# Rational C++ 2.4.1
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      cxx)
+      cxx*)
 	allow_undefined_flag_CXX=' -expect_unresolved \*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+	archive_cmds_CXX='$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'
 	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
 	  $rm $lib.exp'
 
 	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -10572,7 +12158,7 @@
       *)
 	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	  hardcode_libdir_separator_CXX=:
@@ -10593,27 +12179,14 @@
     # FIXME: insert proper C++ library support
     ld_shlibs_CXX=no
     ;;
-  sco*)
-    archive_cmds_need_lc_CXX=no
-    case $cc_basename in
-      CC)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
   sunos4*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.x
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
 	;;
-      lcc)
+      lcc*)
 	# Lucid
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -10626,36 +12199,33 @@
     ;;
   solaris*)
     case $cc_basename in
-      CC)
+      CC*)
 	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
 	no_undefined_flag_CXX=' -zdefs'
-	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
 	hardcode_libdir_flag_spec_CXX='-R$libdir'
 	hardcode_shlibpath_var_CXX=no
 	case $host_os in
-	  solaris2.0-5 | solaris2.0-5.*) ;;
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
 	  *)
 	    # The C++ compiler is used as linker so we must use $wl
 	    # flag to pass the commands to the underlying system
-	    # linker.
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
 	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
 	    ;;
 	esac
 	link_all_deplibs_CXX=yes
 
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	output_verbose_link_cmd='echo'
 
 	# Archives containing C++ object files must be created using
 	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -10663,7 +12233,7 @@
 	# in the archive.
 	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
 	;;
-      gcx)
+      gcx*)
 	# Green Hills C++ Compiler
 	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
@@ -10701,12 +12271,63 @@
 	;;
     esac
     ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+    no_undefined_flag_CXX='${wl}-z,text'
     archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
     ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    no_undefined_flag_CXX='${wl}-z,text'
+    allow_undefined_flag_CXX='${wl}-z,nodefs'
+    archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+    export_dynamic_flag_spec_CXX='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
   tandem*)
     case $cc_basename in
-      NCC)
+      NCC*)
 	# NonStop-UX NCC 3.20
 	# FIXME: insert proper C++ library support
 	ld_shlibs_CXX=no
@@ -10726,8 +12347,8 @@
     ld_shlibs_CXX=no
     ;;
 esac
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
 test "$ld_shlibs_CXX" = no && can_build_shared=no
 
 GCC_CXX="$GXX"
@@ -10759,7 +12380,7 @@
   # The `*' in the case matches for architectures that use `case' in
   # $output_verbose_cmd can trigger glob expansion during the loop
   # eval without this substitution.
-  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
   for p in `eval $output_verbose_link_cmd`; do
     case $p in
@@ -10835,6 +12456,29 @@
 
 $rm -f confest.$objext
 
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+
+
 case " $postdeps_CXX " in
 *" -lc "*) archive_cmds_need_lc_CXX=no ;;
 esac
@@ -10843,8 +12487,8 @@
 lt_prog_compiler_pic_CXX=
 lt_prog_compiler_static_CXX=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -10882,6 +12526,10 @@
       # DJGPP does not support shared libraries at all
       lt_prog_compiler_pic_CXX=
       ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
     sysv4*MP*)
       if test -d /usr/nec; then
 	lt_prog_compiler_pic_CXX=-Kconform_pic
@@ -10890,7 +12538,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	;;
       *)
@@ -10915,18 +12563,28 @@
 	;;
       chorus*)
 	case $cc_basename in
-	cxch68)
+	cxch68*)
 	  # Green Hills C++ Compiler
 	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 	  ;;
 	esac
 	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
       dgux*)
 	case $cc_basename in
-	  ec++)
+	  ec++*)
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    ;;
-	  ghcx)
+	  ghcx*)
 	    # Green Hills C++ Compiler
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
@@ -10934,22 +12592,22 @@
 	    ;;
 	esac
 	;;
-      freebsd* | kfreebsd*-gnu)
+      freebsd* | dragonfly*)
 	# FreeBSD uses GNU C++
 	;;
       hpux9* | hpux10* | hpux11*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
 	    if test "$host_cpu" != ia64; then
 	      lt_prog_compiler_pic_CXX='+Z'
 	    fi
 	    ;;
-	  aCC)
+	  aCC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
-	    case "$host_cpu" in
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
@@ -10962,9 +12620,13 @@
 	    ;;
 	esac
 	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    # CC pic flag -KPIC is the default.
@@ -10973,20 +12635,26 @@
 	    ;;
 	esac
 	;;
-      linux*)
+      linux* | k*bsd*-gnu)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    # KAI C++ Compiler
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
-	  icpc)
+	  icpc* | ecpc*)
 	    # Intel C++
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-static'
 	    ;;
-	  cxx)
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
 	    # Compaq C++
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
@@ -11003,25 +12671,25 @@
 	;;
       mvs*)
 	case $cc_basename in
-	  cxx)
+	  cxx*)
 	    lt_prog_compiler_pic_CXX='-W c,exportall'
 	    ;;
 	  *)
 	    ;;
 	esac
 	;;
-      netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+      netbsd* | netbsdelf*-gnu)
 	;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
-	  KCC)
+	  KCC*)
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    ;;
-	  RCC)
+	  RCC*)
 	    # Rational C++ 2.4.1
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
-	  cxx)
+	  cxx*)
 	    # Digital/Compaq C++
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
@@ -11035,24 +12703,15 @@
 	;;
       psos*)
 	;;
-      sco*)
-	case $cc_basename in
-	  CC)
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
       solaris*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-Bstatic'
 	    lt_prog_compiler_wl_CXX='-Qoption ld '
 	    ;;
-	  gcx)
+	  gcx*)
 	    # Green Hills C++ Compiler
 	    lt_prog_compiler_pic_CXX='-PIC'
 	    ;;
@@ -11062,12 +12721,12 @@
 	;;
       sunos4*)
 	case $cc_basename in
-	  CC)
+	  CC*)
 	    # Sun C++ 4.x
 	    lt_prog_compiler_pic_CXX='-pic'
 	    lt_prog_compiler_static_CXX='-Bstatic'
 	    ;;
-	  lcc)
+	  lcc*)
 	    # Lucid
 	    lt_prog_compiler_pic_CXX='-pic'
 	    ;;
@@ -11077,7 +12736,7 @@
 	;;
       tandem*)
 	case $cc_basename in
-	  NCC)
+	  NCC*)
 	    # NonStop-UX NCC 3.20
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    ;;
@@ -11085,7 +12744,14 @@
 	    ;;
 	esac
 	;;
-      unixware*)
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
 	;;
       vxworks*)
 	;;
@@ -11095,16 +12761,16 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_CXX"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11118,26 +12784,28 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11124: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12790: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11128: \$? = $ac_status" >&5
+   echo "$as_me:12794: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_CXX=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
 
 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
     case $lt_prog_compiler_pic_CXX in
@@ -11150,7 +12818,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_CXX=
@@ -11160,8 +12828,50 @@
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11178,23 +12888,25 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11184: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12894: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11188: \$? = $ac_status" >&5
+   echo "$as_me:12898: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -11205,23 +12917,23 @@
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -11231,8 +12943,8 @@
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   case $host_os in
@@ -11249,9 +12961,9 @@
     export_symbols_cmds_CXX="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
-  linux*)
+  linux* | k*bsd*-gnu)
     link_all_deplibs_CXX=no
   ;;
   *)
@@ -11259,15 +12971,10 @@
   ;;
   esac
 
-echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
 test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -11285,8 +12992,8 @@
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -11300,6 +13007,7 @@
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl_CXX
+	pic_flag=$lt_prog_compiler_pic_CXX
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -11322,16 +13030,16 @@
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -11432,7 +13140,7 @@
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11460,7 +13168,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -11490,7 +13199,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -11513,7 +13222,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -11536,20 +13245,17 @@
   dynamic_linker=no
   ;;
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -11567,14 +13273,19 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -11594,7 +13305,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -11634,6 +13345,18 @@
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -11677,7 +13400,7 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -11693,7 +13416,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -11718,18 +13441,6 @@
   dynamic_linker='NetBSD ld.elf_so'
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -11767,8 +13478,13 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=yes
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -11806,13 +13522,6 @@
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -11838,7 +13547,7 @@
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -11871,6 +13580,29 @@
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11882,16 +13614,21 @@
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action_CXX=
 if test -n "$hardcode_libdir_flag_spec_CXX" || \
-   test -n "$runpath_var CXX" || \
-   test "X$hardcode_automatic_CXX"="Xyes" ; then
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct_CXX" != no &&
@@ -11911,8 +13648,8 @@
   # directories.
   hardcode_action_CXX=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
 
 if test "$hardcode_action_CXX" = relink; then
   # Fast installation is not supported
@@ -11923,835 +13660,7 @@
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
 
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-   ;;
-
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 12553 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 12651 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
 # with your package, and you will get complaints that there are
@@ -12765,7 +13674,7 @@
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -12866,7 +13775,13 @@
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
 
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -12877,6 +13792,9 @@
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_CXX
 
@@ -12942,7 +13860,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -13219,29 +14137,55 @@
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${F77-"f77"}
 compiler=$CC
 compiler_F77=$CC
-cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
-echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6
 
-echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
 test "$can_build_shared" = "no" && enable_shared=no
 
 # On AIX, shared libraries and static libraries use the same namespace, and
 # are all built from PIC.
-case "$host_os" in
+case $host_os in
 aix3*)
   test "$enable_shared" = yes && enable_static=no
   if test -n "$RANLIB"; then
@@ -13250,21 +14194,21 @@
   fi
   ;;
 aix4* | aix5*)
-  test "$enable_shared" = yes && enable_static=no
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
   ;;
 esac
-echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6
+{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
 
-echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
 # Make sure either enable_shared or enable_static is yes.
 test "$enable_shared" = yes || enable_static=yes
-echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6
+{ echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
 
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
 GCC_F77="$G77"
 LD_F77="$LD"
 
@@ -13272,8 +14216,8 @@
 lt_prog_compiler_pic_F77=
 lt_prog_compiler_static_F77=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl_F77='-Wl,'
@@ -13311,6 +14255,11 @@
       lt_prog_compiler_pic_F77='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -13327,7 +14276,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -13353,6 +14302,16 @@
 	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -13364,7 +14323,7 @@
       lt_prog_compiler_wl_F77='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -13387,13 +14346,20 @@
       lt_prog_compiler_static_F77='-Bstatic'
       ;;
 
-    linux*)
-      case $CC in
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
       icc* | ecc*)
 	lt_prog_compiler_wl_F77='-Wl,'
 	lt_prog_compiler_pic_F77='-KPIC'
 	lt_prog_compiler_static_F77='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
       ccc*)
         lt_prog_compiler_wl_F77='-Wl,'
         # All Alpha code is PIC.
@@ -13408,15 +14374,15 @@
       lt_prog_compiler_static_F77='-non_shared'
       ;;
 
-    sco3.2v5*)
-      lt_prog_compiler_pic_F77='-Kpic'
-      lt_prog_compiler_static_F77='-dn'
-      ;;
-
     solaris*)
-      lt_prog_compiler_wl_F77='-Wl,'
       lt_prog_compiler_pic_F77='-KPIC'
       lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -13425,7 +14391,7 @@
       lt_prog_compiler_static_F77='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       lt_prog_compiler_wl_F77='-Wl,'
       lt_prog_compiler_pic_F77='-KPIC'
       lt_prog_compiler_static_F77='-Bstatic'
@@ -13438,6 +14404,17 @@
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic_F77='-pic'
       lt_prog_compiler_static_F77='-Bstatic'
@@ -13449,16 +14426,16 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_F77"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13472,26 +14449,28 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13478: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14455: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13482: \$? = $ac_status" >&5
+   echo "$as_me:14459: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_F77=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
 
 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
     case $lt_prog_compiler_pic_F77 in
@@ -13504,7 +14483,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_F77=
@@ -13514,8 +14493,50 @@
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_F77=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_F77=yes
+       fi
+     else
+       lt_prog_compiler_static_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
+
+if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+    :
+else
+    lt_prog_compiler_static_F77=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13532,23 +14553,25 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13538: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14559: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13542: \$? = $ac_status" >&5
+   echo "$as_me:14563: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_F77=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -13559,23 +14582,23 @@
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -13585,8 +14608,8 @@
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   runpath_var=
   allow_undefined_flag_F77=
@@ -13624,6 +14647,16 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -13634,6 +14667,10 @@
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -13644,6 +14681,27 @@
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -13694,10 +14752,10 @@
       allow_undefined_flag_F77=unsupported
       always_export_symbols_F77=no
       enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -13706,13 +14764,60 @@
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
-	ld_shlibs=no
+	ld_shlibs_F77=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    interix3*)
+      hardcode_direct_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_F77='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_F77='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'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+	link_all_deplibs_F77=no
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -13722,7 +14827,7 @@
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	ld_shlibs_F77=no
 	cat <<EOF 1>&2
@@ -13743,6 +14848,33 @@
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs_F77=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -13750,32 +14882,6 @@
       hardcode_shlibpath_var_F77=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_cmds_F77="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds_F77="$tmp_archive_cmds"
-      fi
-      link_all_deplibs_F77=no
-    else
-      ld_shlibs_F77=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -13786,16 +14892,11 @@
       ;;
     esac
 
-    if test "$ld_shlibs_F77" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec_F77='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_F77=
-      fi
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -13807,7 +14908,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L_F77=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct_F77=unsupported
@@ -13841,6 +14942,7 @@
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -13859,7 +14961,7 @@
       link_all_deplibs_F77=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.012|aix4.012.*)
+	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -13878,8 +14980,12 @@
   	  hardcode_libdir_flag_spec_F77='-L$libdir'
   	  hardcode_libdir_separator_F77=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -13887,11 +14993,11 @@
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -13909,23 +15015,36 @@
       end
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -13939,18 +15058,20 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
        hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	archive_expsym_cmds_F77="\$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"
        else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag_F77="-z nodefs"
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
@@ -13959,23 +15080,36 @@
       end
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_f77_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -13989,8 +15123,10 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -13999,13 +15135,11 @@
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag_F77=' ${wl}-bernotok'
 	  allow_undefined_flag_F77=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  always_export_symbols_F77=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_F77=' '
+	  whole_archive_flag_spec_F77='$convenience'
 	  archive_cmds_need_lc_F77=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -14018,7 +15152,7 @@
       ld_shlibs_F77=no
       ;;
 
-    bsdi4*)
+    bsdi[45]*)
       export_dynamic_flag_spec_F77=-rdynamic
       ;;
 
@@ -14039,57 +15173,57 @@
       old_archive_From_new_cmds_F77='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_F77=yes
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
       archive_cmds_need_lc_F77=no
-      case "$host_os" in
-      rhapsody* | darwin1.[012])
-	allow_undefined_flag_F77='-undefined suppress'
-	;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	allow_undefined_flag_F77='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag_F77='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag_F77='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-	;;
-      esac
-    	lt_int_apple_cc_single_mod=no
-    	output_verbose_link_cmd='echo'
-    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-    	  lt_int_apple_cc_single_mod=yes
-    	fi
-    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-    	  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    	else
-        archive_cmds_F77='$CC -r ${wl}-bind_at_load -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'
-      fi
-      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          module_expsym_cmds_F77='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}'
       hardcode_direct_F77=no
       hardcode_automatic_F77=yes
       hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77='-all_load $convenience'
+      whole_archive_flag_spec_F77=''
       link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='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}'
     else
-      ld_shlibs_F77=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='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 $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='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}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
     fi
       ;;
 
@@ -14123,7 +15257,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | dragonfly*)
       archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_F77='-R$libdir'
       hardcode_direct_F77=yes
@@ -14146,47 +15280,62 @@
       export_dynamic_flag_spec_F77='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
+
+	hardcode_direct_F77=yes
+	export_dynamic_flag_spec_F77='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_F77=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
-	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
-	  hardcode_libdir_separator_F77=:
 	  hardcode_direct_F77=no
 	  hardcode_shlibpath_var_F77=no
 	  ;;
-	ia64*)
-	  hardcode_libdir_flag_spec_F77='-L$libdir'
-	  hardcode_direct_F77=no
-	  hardcode_shlibpath_var_F77=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_F77=yes
-	  ;;
 	*)
-	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator_F77=:
 	  hardcode_direct_F77=yes
 	  export_dynamic_flag_spec_F77='${wl}-E'
 
@@ -14210,7 +15359,7 @@
       link_all_deplibs_F77=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -14234,6 +15383,7 @@
       hardcode_shlibpath_var_F77=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
 	export_dynamic_flag_spec_F77='${wl}-E'
       else
@@ -14279,7 +15429,7 @@
 	allow_undefined_flag_F77=' -expect_unresolved \*'
 	archive_cmds_F77='$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'
 	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$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'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec_F77='-rpath $libdir'
@@ -14287,21 +15437,15 @@
       hardcode_libdir_separator_F77=:
       ;;
 
-    sco3.2v5*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       no_undefined_flag_F77=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -14310,8 +15454,18 @@
       hardcode_shlibpath_var_F77=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       link_all_deplibs_F77=yes
       ;;
@@ -14368,36 +15522,45 @@
       fi
       ;;
 
-    sysv4.2uw2*)
-      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z,text'
+      archive_cmds_need_lc_F77=no
       hardcode_shlibpath_var_F77=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag_F77='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
       ;;
 
-    sysv5*)
-      no_undefined_flag_F77=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      hardcode_libdir_flag_spec_F77=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_F77='${wl}-z,text'
+      allow_undefined_flag_F77='${wl}-z,nodefs'
+      archive_cmds_need_lc_F77=no
       hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
       ;;
 
     uts4*)
@@ -14412,15 +15575,10 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6; }
 test "$ld_shlibs_F77" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -14438,8 +15596,8 @@
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -14453,6 +15611,7 @@
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl_F77
+	pic_flag=$lt_prog_compiler_pic_F77
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -14475,16 +15634,16 @@
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -14585,7 +15744,7 @@
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -14613,7 +15772,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -14643,7 +15803,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -14666,7 +15826,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -14689,20 +15849,17 @@
   dynamic_linker=no
   ;;
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -14720,14 +15877,19 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -14747,7 +15909,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -14787,6 +15949,18 @@
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -14830,7 +16004,7 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -14846,7 +16020,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -14871,18 +16045,6 @@
   dynamic_linker='NetBSD ld.elf_so'
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -14920,8 +16082,13 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=yes
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -14959,13 +16126,6 @@
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -14991,7 +16151,7 @@
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -15024,6 +16184,29 @@
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -15035,16 +16218,21 @@
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action_F77=
 if test -n "$hardcode_libdir_flag_spec_F77" || \
-   test -n "$runpath_var F77" || \
-   test "X$hardcode_automatic_F77"="Xyes" ; then
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct_F77" != no &&
@@ -15064,8 +16252,8 @@
   # directories.
   hardcode_action_F77=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6; }
 
 if test "$hardcode_action_F77" = relink; then
   # Fast installation is not supported
@@ -15076,37 +16264,7 @@
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
 
-
-
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
 # with your package, and you will get complaints that there are
@@ -15120,7 +16278,7 @@
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -15221,7 +16379,13 @@
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
 
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -15232,6 +16396,9 @@
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_F77
 
@@ -15297,7 +16464,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -15523,7 +16690,6 @@
 	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
 
 
-
 # Source file extension for Java test sources.
 ac_ext=java
 
@@ -15535,35 +16701,64 @@
 lt_simple_compile_test_code="class foo {}\n"
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${GCJ-"gcj"}
 compiler=$CC
 compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
+
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
 archive_cmds_need_lc_GCJ=no
 
+old_archive_cmds_GCJ=$old_archive_cmds
 
+
 lt_prog_compiler_no_builtin_flag_GCJ=
 
 if test "$GCC" = yes; then
   lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
 
 
-echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15577,26 +16772,28 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15583: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16778: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15587: \$? = $ac_status" >&5
+   echo "$as_me:16782: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
@@ -15610,8 +16807,8 @@
 lt_prog_compiler_pic_GCJ=
 lt_prog_compiler_static_GCJ=
 
-echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl_GCJ='-Wl,'
@@ -15649,6 +16846,11 @@
       lt_prog_compiler_pic_GCJ='-fno-common'
       ;;
 
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
@@ -15665,7 +16867,7 @@
     hpux*)
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -15691,6 +16893,16 @@
 	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
 
     mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
@@ -15702,7 +16914,7 @@
       lt_prog_compiler_wl_GCJ='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
-      case "$host_cpu" in
+      case $host_cpu in
       hppa*64*|ia64*)
 	# +Z the default
 	;;
@@ -15725,13 +16937,20 @@
       lt_prog_compiler_static_GCJ='-Bstatic'
       ;;
 
-    linux*)
-      case $CC in
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
       icc* | ecc*)
 	lt_prog_compiler_wl_GCJ='-Wl,'
 	lt_prog_compiler_pic_GCJ='-KPIC'
 	lt_prog_compiler_static_GCJ='-static'
         ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-fpic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
       ccc*)
         lt_prog_compiler_wl_GCJ='-Wl,'
         # All Alpha code is PIC.
@@ -15746,15 +16965,15 @@
       lt_prog_compiler_static_GCJ='-non_shared'
       ;;
 
-    sco3.2v5*)
-      lt_prog_compiler_pic_GCJ='-Kpic'
-      lt_prog_compiler_static_GCJ='-dn'
-      ;;
-
     solaris*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
       ;;
 
     sunos4*)
@@ -15763,7 +16982,7 @@
       lt_prog_compiler_static_GCJ='-Bstatic'
       ;;
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+    sysv4 | sysv4.2uw2* | sysv4.3*)
       lt_prog_compiler_wl_GCJ='-Wl,'
       lt_prog_compiler_pic_GCJ='-KPIC'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -15776,6 +16995,17 @@
       fi
       ;;
 
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
     uts4*)
       lt_prog_compiler_pic_GCJ='-pic'
       lt_prog_compiler_static_GCJ='-Bstatic'
@@ -15787,16 +17017,16 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_GCJ"; then
 
-echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15810,26 +17040,28 @@
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    # The option is referenced via a variable to avoid confusing sed.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15816: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17046: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15820: \$? = $ac_status" >&5
+   echo "$as_me:17050: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test ! -s conftest.err; then
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_prog_compiler_pic_works_GCJ=yes
      fi
    fi
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
 
 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
     case $lt_prog_compiler_pic_GCJ in
@@ -15842,7 +17074,7 @@
 fi
 
 fi
-case "$host_os" in
+case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_GCJ=
@@ -15852,8 +17084,50 @@
     ;;
 esac
 
-echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_GCJ=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_GCJ=yes
+       fi
+     else
+       lt_prog_compiler_static_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
+
+if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+    :
+else
+    lt_prog_compiler_static_GCJ=
+fi
+
+
+{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15870,23 +17144,25 @@
    # Note that $ac_compile itself does not contain backslashes and begins
    # with a dollar sign (not a hyphen), so the echo should work correctly.
    lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15876: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:17150: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15880: \$? = $ac_status" >&5
+   echo "$as_me:17154: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     if test ! -s out/conftest.err; then
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_GCJ=yes
      fi
    fi
-   chmod u+w .
+   chmod u+w . 2>&5
    $rm conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
@@ -15897,23 +17173,23 @@
    $rm conftest*
 
 fi
-echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
   hard_links=yes
   $rm conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
   if test "$hard_links" = no; then
     { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
@@ -15923,8 +17199,8 @@
   need_locks=no
 fi
 
-echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
   runpath_var=
   allow_undefined_flag_GCJ=
@@ -15962,6 +17238,16 @@
   # rely on this symbol name, it's probably fine to never include it in
   # preloaded symbol tables.
   extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
   cygwin* | mingw* | pw32*)
@@ -15972,6 +17258,10 @@
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -15982,6 +17272,27 @@
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
     # See if GNU ld supports shared libraries.
     case $host_os in
     aix3* | aix4* | aix5*)
@@ -16032,10 +17343,10 @@
       allow_undefined_flag_GCJ=unsupported
       always_export_symbols_GCJ=no
       enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -16044,13 +17355,60 @@
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
-	ld_shlibs=no
+	ld_shlibs_GCJ=no
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    interix3*)
+      hardcode_direct_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_GCJ='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'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+	link_all_deplibs_GCJ=no
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -16060,7 +17418,7 @@
       fi
       ;;
 
-    solaris* | sysv5*)
+    solaris*)
       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
 	ld_shlibs_GCJ=no
 	cat <<EOF 1>&2
@@ -16081,6 +17439,33 @@
       fi
       ;;
 
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_GCJ=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs_GCJ=no
+	  fi
+	;;
+      esac
+      ;;
+
     sunos4*)
       archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
@@ -16088,32 +17473,6 @@
       hardcode_shlibpath_var_GCJ=no
       ;;
 
-  linux*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_cmds_GCJ="$tmp_archive_cmds"
-      supports_anon_versioning=no
-      case `$LD -v 2>/dev/null` in
-        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-        *\ 2.11.*) ;; # other 2.11 versions
-        *) supports_anon_versioning=yes ;;
-      esac
-      if test $supports_anon_versioning = yes; then
-        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-$echo "local: *; };" >> $output_objdir/$libname.ver~
-        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-      else
-        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
-      fi
-      link_all_deplibs_GCJ=no
-    else
-      ld_shlibs_GCJ=no
-    fi
-    ;;
-
     *)
       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
 	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -16124,16 +17483,11 @@
       ;;
     esac
 
-    if test "$ld_shlibs_GCJ" = yes; then
-      runpath_var=LD_RUN_PATH
-      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
-      # ancient GNU ld didn't support --whole-archive et. al.
-      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_GCJ=
-      fi
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
@@ -16145,7 +17499,7 @@
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L_GCJ=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct_GCJ=unsupported
@@ -16179,6 +17533,7 @@
   	    break
   	  fi
 	  done
+	  ;;
 	esac
 
 	exp_sym_flag='-bexport'
@@ -16197,7 +17552,7 @@
       link_all_deplibs_GCJ=yes
 
       if test "$GCC" = yes; then
-	case $host_os in aix4.012|aix4.012.*)
+	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
@@ -16216,8 +17571,12 @@
   	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
   	  hardcode_libdir_separator_GCJ=
 	  fi
+	  ;;
 	esac
 	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -16225,11 +17584,11 @@
   	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-  	if test "$aix_use_runtimelinking" = yes; then
+	  if test "$aix_use_runtimelinking" = yes; then
 	    shared_flag='${wl}-G'
 	  else
 	    shared_flag='${wl}-bM:SRE'
-  	fi
+	  fi
 	fi
       fi
 
@@ -16257,23 +17616,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -16287,18 +17659,20 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
        hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+	archive_expsym_cmds_GCJ="\$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"
        else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag_GCJ="-z nodefs"
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
@@ -16317,23 +17691,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -16347,8 +17734,10 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
@@ -16357,13 +17746,11 @@
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag_GCJ=' ${wl}-bernotok'
 	  allow_undefined_flag_GCJ=' ${wl}-berok'
-	  # -bexpall does not export symbols beginning with underscore (_)
-	  always_export_symbols_GCJ=yes
 	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_GCJ=' '
+	  whole_archive_flag_spec_GCJ='$convenience'
 	  archive_cmds_need_lc_GCJ=yes
-	  # This is similar to how AIX traditionally builds it's shared libraries.
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
@@ -16376,7 +17763,7 @@
       ld_shlibs_GCJ=no
       ;;
 
-    bsdi4*)
+    bsdi[45]*)
       export_dynamic_flag_spec_GCJ=-rdynamic
       ;;
 
@@ -16397,57 +17784,57 @@
       old_archive_From_new_cmds_GCJ='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
       enable_shared_with_static_runtimes_GCJ=yes
       ;;
 
     darwin* | rhapsody*)
-    if test "$GXX" = yes ; then
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
       archive_cmds_need_lc_GCJ=no
-      case "$host_os" in
-      rhapsody* | darwin1.[012])
-	allow_undefined_flag_GCJ='-undefined suppress'
-	;;
-      *) # Darwin 1.3 on
-      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-      	allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
-      else
-        case ${MACOSX_DEPLOYMENT_TARGET} in
-          10.[012])
-            allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
-            ;;
-          10.*)
-            allow_undefined_flag_GCJ='-undefined dynamic_lookup'
-            ;;
-        esac
-      fi
-	;;
-      esac
-    	lt_int_apple_cc_single_mod=no
-    	output_verbose_link_cmd='echo'
-    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
-    	  lt_int_apple_cc_single_mod=yes
-    	fi
-    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-    	  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-    	else
-        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -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'
-      fi
-      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
-        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        else
-          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-        fi
-          module_expsym_cmds_GCJ='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}'
       hardcode_direct_GCJ=no
       hardcode_automatic_GCJ=yes
       hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      whole_archive_flag_spec_GCJ=''
       link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='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}'
     else
-      ld_shlibs_GCJ=no
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='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 $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='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}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
     fi
       ;;
 
@@ -16481,7 +17868,7 @@
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu)
+    freebsd* | dragonfly*)
       archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec_GCJ='-R$libdir'
       hardcode_direct_GCJ=yes
@@ -16504,47 +17891,62 @@
       export_dynamic_flag_spec_GCJ='${wl}-E'
       ;;
 
-    hpux10* | hpux11*)
+    hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*|ia64*)
+	archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_GCJ=:
+
+	hardcode_direct_GCJ=yes
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_GCJ=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
 	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
 	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
-	case "$host_cpu" in
-	hppa*64*|ia64*)
-	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
+	ia64*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
 	*)
-	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	case "$host_cpu" in
-	hppa*64*)
-	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_GCJ=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
 	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
-	  hardcode_libdir_separator_GCJ=:
 	  hardcode_direct_GCJ=no
 	  hardcode_shlibpath_var_GCJ=no
 	  ;;
-	ia64*)
-	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
-	  hardcode_direct_GCJ=no
-	  hardcode_shlibpath_var_GCJ=no
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_GCJ=yes
-	  ;;
 	*)
-	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator_GCJ=:
 	  hardcode_direct_GCJ=yes
 	  export_dynamic_flag_spec_GCJ='${wl}-E'
 
@@ -16568,7 +17970,7 @@
       link_all_deplibs_GCJ=yes
       ;;
 
-    netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
 	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -16592,6 +17994,7 @@
       hardcode_shlibpath_var_GCJ=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
 	export_dynamic_flag_spec_GCJ='${wl}-E'
       else
@@ -16637,7 +18040,7 @@
 	allow_undefined_flag_GCJ=' -expect_unresolved \*'
 	archive_cmds_GCJ='$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'
 	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+	$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'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
@@ -16645,21 +18048,15 @@
       hardcode_libdir_separator_GCJ=:
       ;;
 
-    sco3.2v5*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
-
     solaris*)
       no_undefined_flag_GCJ=' -z text'
       if test "$GCC" = yes; then
+	wlarc='${wl}'
 	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
 	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
       else
+	wlarc=''
 	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
   	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
@@ -16668,8 +18065,18 @@
       hardcode_shlibpath_var_GCJ=no
       case $host_os in
       solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
-	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
       esac
       link_all_deplibs_GCJ=yes
       ;;
@@ -16726,36 +18133,45 @@
       fi
       ;;
 
-    sysv4.2uw2*)
-      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z,text'
+      archive_cmds_need_lc_GCJ=no
       hardcode_shlibpath_var_GCJ=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+      runpath_var='LD_RUN_PATH'
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
-      no_undefined_flag_GCJ='${wl}-z ${wl}text'
       if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
       ;;
 
-    sysv5*)
-      no_undefined_flag_GCJ=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      hardcode_libdir_flag_spec_GCJ=
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_GCJ='${wl}-z,text'
+      allow_undefined_flag_GCJ='${wl}-z,nodefs'
+      archive_cmds_need_lc_GCJ=no
       hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
       ;;
 
     uts4*)
@@ -16770,15 +18186,10 @@
     esac
   fi
 
-echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
 test "$ld_shlibs_GCJ" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
 #
 # Do we need to explicitly link libc?
 #
@@ -16796,8 +18207,8 @@
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
       $rm conftest*
       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
@@ -16811,6 +18222,7 @@
         libobjs=conftest.$ac_objext
         deplibs=
         wl=$lt_prog_compiler_wl_GCJ
+	pic_flag=$lt_prog_compiler_pic_GCJ
         compiler_flags=-v
         linker_flags=-v
         verstring=
@@ -16833,16 +18245,16 @@
         cat conftest.err 1>&5
       fi
       $rm conftest*
-      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -16943,7 +18355,7 @@
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
+bsdi[45]*)
   version_type=linux
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16971,7 +18383,8 @@
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname'
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
@@ -17001,7 +18414,7 @@
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
     ;;
@@ -17024,7 +18437,7 @@
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
   if test "$GCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
@@ -17047,20 +18460,17 @@
   dynamic_linker=no
   ;;
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
-freebsd*)
-  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
@@ -17078,14 +18488,19 @@
   freebsd2*)
     shlibpath_overrides_runpath=yes
     ;;
-  freebsd3.01* | freebsdelf3.01*)
+  freebsd3.[01]* | freebsdelf3.[01]*)
     shlibpath_overrides_runpath=yes
     hardcode_into_libs=yes
     ;;
-  *) # from 3.2 on
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
     shlibpath_overrides_runpath=no
     hardcode_into_libs=yes
     ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
   esac
   ;;
 
@@ -17105,7 +18520,7 @@
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  case "$host_cpu" in
+  case $host_cpu in
   ia64*)
     shrext_cmds='.so'
     hardcode_into_libs=yes
@@ -17145,6 +18560,18 @@
   postinstall_cmds='chmod 555 $lib'
   ;;
 
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
@@ -17188,7 +18615,7 @@
   ;;
 
 # This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -17204,7 +18631,7 @@
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -17229,18 +18656,6 @@
   dynamic_linker='NetBSD ld.elf_so'
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -17278,8 +18693,13 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
-  need_version=yes
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -17317,13 +18737,6 @@
   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
 solaris*)
   version_type=linux
   need_lib_prefix=no
@@ -17349,7 +18762,7 @@
   need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -17382,6 +18795,29 @@
   fi
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -17393,16 +18829,21 @@
   dynamic_linker=no
   ;;
 esac
-echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
 hardcode_action_GCJ=
 if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var GCJ" || \
-   test "X$hardcode_automatic_GCJ"="Xyes" ; then
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
 
   # We can hardcode non-existant directories.
   if test "$hardcode_direct_GCJ" != no &&
@@ -17422,8 +18863,8 @@
   # directories.
   hardcode_action_GCJ=unsupported
 fi
-echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6
+{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
 
 if test "$hardcode_action_GCJ" = relink; then
   # Fast installation is not supported
@@ -17434,835 +18875,7 @@
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-       ;;
-   *)
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-    ;;
-  esac
-fi
 
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-   ;;
-
-  *)
-    echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shl_load (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != shl_load;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
-  lt_cv_dlopen="shl_load"
-else
-  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_shl_load=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
-  echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != dlopen;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
-  lt_cv_dlopen="dlopen"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dl_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dld_dld_link=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 18064 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 18162 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-
-    exit (status);
-}
-EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
 # The else clause should only fire when bootstrapping the
 # libtool distribution, otherwise you forgot to ship ltmain.sh
 # with your package, and you will get complaints that there are
@@ -18276,7 +18889,7 @@
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -18377,7 +18990,13 @@
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
 
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -18388,6 +19007,9 @@
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_GCJ
 
@@ -18453,7 +19075,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -18678,7 +19300,6 @@
       RC)
 
 
-
 # Source file extension for RC test sources.
 ac_ext=rc
 
@@ -18697,15 +19318,42 @@
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
 
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
 CC=${RC-"windres"}
 compiler=$CC
 compiler_RC=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
 lt_cv_prog_compiler_c_o_RC=yes
 
 # The else clause should only fire when bootstrapping the
@@ -18721,7 +19369,7 @@
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -18822,7 +19470,13 @@
 # The host system.
 host_alias=$host_alias
 host=$host
+host_os=$host_os
 
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
 # An echo program that does not interpret backslashes.
 echo=$lt_echo
 
@@ -18833,6 +19487,9 @@
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_compiler_RC
 
@@ -18898,7 +19555,7 @@
 # Does compiler simultaneously support -c and -o options?
 compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
 
-# Must we lock files when doing compilation ?
+# Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
 # Do we need the lib prefix for modules?
@@ -19173,66 +19830,72 @@
 
 
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-	@echo 'ac_maketemp="$(MAKE)"'
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
 rm -f conftest.make
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
 
+case "$am__api_version" in
+    1.01234)
+	{ { echo "$as_me:$LINENO: error: Automake 1.5 or newer is required to use intltool" >&5
+echo "$as_me: error: Automake 1.5 or newer is required to use intltool" >&2;}
+   { (exit 1); exit 1; }; }
+    ;;
+    *)
+    ;;
+esac
 
 if test -n "0.21"; then
-    echo "$as_me:$LINENO: checking for intltool >= 0.21" >&5
-echo $ECHO_N "checking for intltool >= 0.21... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for intltool >= 0.21" >&5
+echo $ECHO_N "checking for intltool >= 0.21... $ECHO_C" >&6; }
 
-    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.21 | awk -F. '{ printf "%d", $1 * 100 + $2; }'`
-    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $2; }'  < ${ac_aux_dir}/intltool-update.in`
+    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo 0.21 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
+    INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
+    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in`
 
-    INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($2, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
-
-
-    if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
-	echo "$as_me:$LINENO: result: $INTLTOOL_APPLIED_VERSION found" >&5
-echo "${ECHO_T}$INTLTOOL_APPLIED_VERSION found" >&6
-    else
-	echo "$as_me:$LINENO: result: $INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool 0.21 or later." >&5
-echo "${ECHO_T}$INTLTOOL_APPLIED_VERSION found. Your intltool is too old.  You need intltool 0.21 or later." >&6
-	exit 1
-    fi
+    { echo "$as_me:$LINENO: result: $INTLTOOL_APPLIED_VERSION found" >&5
+echo "${ECHO_T}$INTLTOOL_APPLIED_VERSION found" >&6; }
+    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
+	{ { echo "$as_me:$LINENO: error: Your intltool is too old.  You need intltool 0.21 or later." >&5
+echo "$as_me: error: Your intltool is too old.  You need intltool 0.21 or later." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
   INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
@@ -19252,6 +19915,7 @@
     INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
   INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
     INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
+    INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
 
 
 
@@ -19271,20 +19935,19 @@
 
 
 
+
 # Use the tools built into the package, not the ones that are installed.
+INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
 
-INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
 INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
+
 INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
 
 
-
-
-
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INTLTOOL_PERL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19299,27 +19962,28 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL
-
 if test -n "$INTLTOOL_PERL"; then
-  echo "$as_me:$LINENO: result: $INTLTOOL_PERL" >&5
-echo "${ECHO_T}$INTLTOOL_PERL" >&6
+  { echo "$as_me:$LINENO: result: $INTLTOOL_PERL" >&5
+echo "${ECHO_T}$INTLTOOL_PERL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 if test -z "$INTLTOOL_PERL"; then
    { { echo "$as_me:$LINENO: error: perl not found; required for intltool" >&5
 echo "$as_me: error: perl not found; required for intltool" >&2;}
@@ -19331,11 +19995,11 @@
    { (exit 1); exit 1; }; }
 fi
 if test "x" != "xno-xml"; then
-   echo "$as_me:$LINENO: checking for XML::Parser" >&5
-echo $ECHO_N "checking for XML::Parser... $ECHO_C" >&6
+   { echo "$as_me:$LINENO: checking for XML::Parser" >&5
+echo $ECHO_N "checking for XML::Parser... $ECHO_C" >&6; }
    if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
-       echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6
+       { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
    else
        { { echo "$as_me:$LINENO: error: XML::Parser perl module is required for intltool" >&5
 echo "$as_me: error: XML::Parser perl module is required for intltool" >&2;}
@@ -19345,8 +20009,8 @@
 
 # Extract the first word of "iconv", so it can be a program name with args.
 set dummy iconv; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INTLTOOL_ICONV+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19361,32 +20025,33 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INTLTOOL_ICONV="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_path_INTLTOOL_ICONV" && ac_cv_path_INTLTOOL_ICONV="iconv"
   ;;
 esac
 fi
 INTLTOOL_ICONV=$ac_cv_path_INTLTOOL_ICONV
-
 if test -n "$INTLTOOL_ICONV"; then
-  echo "$as_me:$LINENO: result: $INTLTOOL_ICONV" >&5
-echo "${ECHO_T}$INTLTOOL_ICONV" >&6
+  { echo "$as_me:$LINENO: result: $INTLTOOL_ICONV" >&5
+echo "${ECHO_T}$INTLTOOL_ICONV" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INTLTOOL_MSGFMT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19401,32 +20066,33 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INTLTOOL_MSGFMT="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_path_INTLTOOL_MSGFMT" && ac_cv_path_INTLTOOL_MSGFMT="msgfmt"
   ;;
 esac
 fi
 INTLTOOL_MSGFMT=$ac_cv_path_INTLTOOL_MSGFMT
-
 if test -n "$INTLTOOL_MSGFMT"; then
-  echo "$as_me:$LINENO: result: $INTLTOOL_MSGFMT" >&5
-echo "${ECHO_T}$INTLTOOL_MSGFMT" >&6
+  { echo "$as_me:$LINENO: result: $INTLTOOL_MSGFMT" >&5
+echo "${ECHO_T}$INTLTOOL_MSGFMT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "msgmerge", so it can be a program name with args.
 set dummy msgmerge; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INTLTOOL_MSGMERGE+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19441,32 +20107,33 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INTLTOOL_MSGMERGE="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_path_INTLTOOL_MSGMERGE" && ac_cv_path_INTLTOOL_MSGMERGE="msgmerge"
   ;;
 esac
 fi
 INTLTOOL_MSGMERGE=$ac_cv_path_INTLTOOL_MSGMERGE
-
 if test -n "$INTLTOOL_MSGMERGE"; then
-  echo "$as_me:$LINENO: result: $INTLTOOL_MSGMERGE" >&5
-echo "${ECHO_T}$INTLTOOL_MSGMERGE" >&6
+  { echo "$as_me:$LINENO: result: $INTLTOOL_MSGMERGE" >&5
+echo "${ECHO_T}$INTLTOOL_MSGMERGE" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INTLTOOL_XGETTEXT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19481,76 +20148,47 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INTLTOOL_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_path_INTLTOOL_XGETTEXT" && ac_cv_path_INTLTOOL_XGETTEXT="xgettext"
   ;;
 esac
 fi
 INTLTOOL_XGETTEXT=$ac_cv_path_INTLTOOL_XGETTEXT
-
 if test -n "$INTLTOOL_XGETTEXT"; then
-  echo "$as_me:$LINENO: result: $INTLTOOL_XGETTEXT" >&5
-echo "${ECHO_T}$INTLTOOL_XGETTEXT" >&6
+  { echo "$as_me:$LINENO: result: $INTLTOOL_XGETTEXT" >&5
+echo "${ECHO_T}$INTLTOOL_XGETTEXT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
-# Remove file type tags (using []) from po/POTFILES.
 
+# Substitute ALL_LINGUAS so we can use it in po/Makefile
 
 
 
 
 
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
-  # Keeping the `.' argument allows $(mkdir_p) to be used without
-  # argument.  Indeed, we sometimes output rules like
-  #   $(mkdir_p) $(somedir)
-  # where $(somedir) is conditionally defined.
-  # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
-  # expensive solution, as it forces Make to start a sub-shell.)
-  mkdir_p='mkdir -p -- .'
-else
-  # On NextStep and OpenStep, the `mkdir' command does not
-  # recognize any option.  It will interpret all options as
-  # directories to create, and then abort because `.' already
-  # exists.
-  for d in ./-p ./--version;
-  do
-    test -d $d && rmdir $d
-  done
-  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
-  if test -f "$ac_aux_dir/mkinstalldirs"; then
-    mkdir_p='$(mkinstalldirs)'
-  else
-    mkdir_p='$(install_sh) -d'
-  fi
-fi
+ac_config_commands="$ac_config_commands intltool"
 
 
 
-# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
 
-          ac_config_commands="$ac_config_commands intltool"
-
-
-
-
 for ac_func in mremap
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -19576,52 +20214,59 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -19630,13 +20275,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -19652,8 +20299,8 @@
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19668,34 +20315,35 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-
 if test -n "$PKG_CONFIG"; then
-  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_path_PKG_CONFIG"; then
   ac_pt_PKG_CONFIG=$PKG_CONFIG
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19710,28 +20358,42 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-
 if test -n "$ac_pt_PKG_CONFIG"; then
-  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  PKG_CONFIG=$ac_pt_PKG_CONFIG
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
 else
   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 fi
@@ -19739,95 +20401,108 @@
 fi
 if test -n "$PKG_CONFIG"; then
 	_pkg_min_version=0.9.0
-	echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
 	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 	else
-		echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 		PKG_CONFIG=""
 	fi
 
 fi
 
 pkg_failed=no
-echo "$as_me:$LINENO: checking for LIBGPOD_CFLAGS" >&5
-echo $ECHO_N "checking for LIBGPOD_CFLAGS... $ECHO_C" >&6
-if test "${pkg_cv_LIBGPOD_CFLAGS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "x$ac_cv_env_LIBGPOD_CFLAGS_set" = "xset"; then
-	pkg_cv_LIBGPOD_CFLAGS=$ac_cv_env_LIBGPOD_CFLAGS_value
-elif test -n "$PKG_CONFIG"; then
-	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"glib-2.0 >= 2.4.0 gobject-2.0\" >/dev/null 2>&1") >&5
-  ($PKG_CONFIG --exists "glib-2.0 >= 2.4.0 gobject-2.0" >/dev/null 2>&1) 2>&5
+{ echo "$as_me:$LINENO: checking for LIBGPOD" >&5
+echo $ECHO_N "checking for LIBGPOD... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBGPOD_CFLAGS"; then
+        pkg_cv_LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.4.0 gobject-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.4.0 gobject-2.0") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-		pkg_cv_LIBGPOD_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.4.0 gobject-2.0" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+  pkg_cv_LIBGPOD_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.4.0 gobject-2.0" 2>/dev/null`
 else
+  pkg_failed=yes
+fi
+    fi
+else
 	pkg_failed=untried
 fi
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_LIBGPOD_CFLAGS" >&5
-echo "${ECHO_T}$pkg_cv_LIBGPOD_CFLAGS" >&6
-echo "$as_me:$LINENO: checking for LIBGPOD_LIBS" >&5
-echo $ECHO_N "checking for LIBGPOD_LIBS... $ECHO_C" >&6
-if test "${pkg_cv_LIBGPOD_LIBS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "x$ac_cv_env_LIBGPOD_LIBS_set" = "xset"; then
-	pkg_cv_LIBGPOD_LIBS=$ac_cv_env_LIBGPOD_LIBS_value
-elif test -n "$PKG_CONFIG"; then
-	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"glib-2.0 >= 2.4.0 gobject-2.0\" >/dev/null 2>&1") >&5
-  ($PKG_CONFIG --exists "glib-2.0 >= 2.4.0 gobject-2.0" >/dev/null 2>&1) 2>&5
+if test -n "$PKG_CONFIG"; then
+    if test -n "$LIBGPOD_LIBS"; then
+        pkg_cv_LIBGPOD_LIBS="$LIBGPOD_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.4.0 gobject-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.4.0 gobject-2.0") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-		pkg_cv_LIBGPOD_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.4.0 gobject-2.0" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+  pkg_cv_LIBGPOD_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.4.0 gobject-2.0" 2>/dev/null`
 else
+  pkg_failed=yes
+fi
+    fi
+else
 	pkg_failed=untried
 fi
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_LIBGPOD_LIBS" >&5
-echo "${ECHO_T}$pkg_cv_LIBGPOD_LIBS" >&6
 
+
+
 if test $pkg_failed = yes; then
-	LIBGPOD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0 >= 2.4.0 gobject-2.0"`
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBGPOD_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glib-2.0 >= 2.4.0 gobject-2.0"`
+        else
+	        LIBGPOD_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0 >= 2.4.0 gobject-2.0"`
+        fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$LIBGPOD_PKG_ERRORS" 1>&5
+	echo "$LIBGPOD_PKG_ERRORS" >&5
 
-	{ { echo "$as_me:$LINENO: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0) were not met.
+	{ { echo "$as_me:$LINENO: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0) were not met:
+
+$LIBGPOD_PKG_ERRORS
+
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively you may set the LIBGPOD_CFLAGS and LIBGPOD_LIBS environment variables
-to avoid the need to call pkg-config.  See the pkg-config man page for
-more details." >&5
-echo "$as_me: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0) were not met.
+Alternatively, you may set the environment variables LIBGPOD_CFLAGS
+and LIBGPOD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0) were not met:
+
+$LIBGPOD_PKG_ERRORS
+
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively you may set the LIBGPOD_CFLAGS and LIBGPOD_LIBS environment variables
-to avoid the need to call pkg-config.  See the pkg-config man page for
-more details." >&2;}
+Alternatively, you may set the environment variables LIBGPOD_CFLAGS
+and LIBGPOD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
    { (exit 1); exit 1; }; }
 elif test $pkg_failed = untried; then
 	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively you may set the LIBGPOD_CFLAGS and LIBGPOD_LIBS environment variables
-to avoid the need to call pkg-config.  See the pkg-config man page for
-more details.
+Alternatively, you may set the environment variables LIBGPOD_CFLAGS
+and LIBGPOD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
 See \`config.log' for more details." >&5
@@ -19835,9 +20510,9 @@
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively you may set the LIBGPOD_CFLAGS and LIBGPOD_LIBS environment variables
-to avoid the need to call pkg-config.  See the pkg-config man page for
-more details.
+Alternatively, you may set the environment variables LIBGPOD_CFLAGS
+and LIBGPOD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
 See \`config.log' for more details." >&2;}
@@ -19845,320 +20520,210 @@
 else
 	LIBGPOD_CFLAGS=$pkg_cv_LIBGPOD_CFLAGS
 	LIBGPOD_LIBS=$pkg_cv_LIBGPOD_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 	:
 fi
 LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS -Wall"
 
 
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TAGLIB" >&5
+echo $ECHO_N "checking for TAGLIB... $ECHO_C" >&6; }
 
-
-pkg_failed=no
-echo "$as_me:$LINENO: checking for GDKPIXBUF_CFLAGS" >&5
-echo $ECHO_N "checking for GDKPIXBUF_CFLAGS... $ECHO_C" >&6
-if test "${pkg_cv_GDKPIXBUF_CFLAGS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "x$ac_cv_env_GDKPIXBUF_CFLAGS_set" = "xset"; then
-	pkg_cv_GDKPIXBUF_CFLAGS=$ac_cv_env_GDKPIXBUF_CFLAGS_value
-elif test -n "$PKG_CONFIG"; then
-	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"gdk-pixbuf-2.0\" >/dev/null 2>&1") >&5
-  ($PKG_CONFIG --exists "gdk-pixbuf-2.0" >/dev/null 2>&1) 2>&5
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TAGLIB_CFLAGS"; then
+        pkg_cv_TAGLIB_CFLAGS="$TAGLIB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"taglib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "taglib") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-		pkg_cv_GDKPIXBUF_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+  pkg_cv_TAGLIB_CFLAGS=`$PKG_CONFIG --cflags "taglib" 2>/dev/null`
 else
+  pkg_failed=yes
+fi
+    fi
+else
 	pkg_failed=untried
 fi
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_GDKPIXBUF_CFLAGS" >&5
-echo "${ECHO_T}$pkg_cv_GDKPIXBUF_CFLAGS" >&6
-echo "$as_me:$LINENO: checking for GDKPIXBUF_LIBS" >&5
-echo $ECHO_N "checking for GDKPIXBUF_LIBS... $ECHO_C" >&6
-if test "${pkg_cv_GDKPIXBUF_LIBS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "x$ac_cv_env_GDKPIXBUF_LIBS_set" = "xset"; then
-	pkg_cv_GDKPIXBUF_LIBS=$ac_cv_env_GDKPIXBUF_LIBS_value
-elif test -n "$PKG_CONFIG"; then
-	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"gdk-pixbuf-2.0\" >/dev/null 2>&1") >&5
-  ($PKG_CONFIG --exists "gdk-pixbuf-2.0" >/dev/null 2>&1) 2>&5
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TAGLIB_LIBS"; then
+        pkg_cv_TAGLIB_LIBS="$TAGLIB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"taglib\"") >&5
+  ($PKG_CONFIG --exists --print-errors "taglib") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-		pkg_cv_GDKPIXBUF_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+  pkg_cv_TAGLIB_LIBS=`$PKG_CONFIG --libs "taglib" 2>/dev/null`
 else
+  pkg_failed=yes
+fi
+    fi
+else
 	pkg_failed=untried
 fi
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_GDKPIXBUF_LIBS" >&5
-echo "${ECHO_T}$pkg_cv_GDKPIXBUF_LIBS" >&6
 
+
+
 if test $pkg_failed = yes; then
-	GDKPIXBUF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gdk-pixbuf-2.0"`
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        TAGLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "taglib"`
+        else
+	        TAGLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "taglib"`
+        fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$GDKPIXBUF_PKG_ERRORS" 1>&5
+	echo "$TAGLIB_PKG_ERRORS" >&5
 
-	have_gdkpibux=no
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                have_taglib=no
 elif test $pkg_failed = untried; then
-	have_gdkpibux=no
+	have_taglib=no
 else
-	GDKPIXBUF_CFLAGS=$pkg_cv_GDKPIXBUF_CFLAGS
-	GDKPIXBUF_LIBS=$pkg_cv_GDKPIXBUF_LIBS
-	have_gdkpixbuf=yes
+	TAGLIB_CFLAGS=$pkg_cv_TAGLIB_CFLAGS
+	TAGLIB_LIBS=$pkg_cv_TAGLIB_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_taglib=yes
 fi
+if test x"$have_taglib" = xyes; then
 
 
-if test x"$have_gdkpixbuf" = xyes; then
-  HAVE_GDKPIXBUF_TRUE=
-  HAVE_GDKPIXBUF_FALSE='#'
+   cat >>confdefs.h <<_ACEOF
+#define HAVE_TAGLIB 1
+_ACEOF
+
+fi
+
+
+
+
+if test x"$have_taglib" = xyes; then
+  HAVE_TAGLIB_TRUE=
+  HAVE_TAGLIB_FALSE='#'
 else
-  HAVE_GDKPIXBUF_TRUE='#'
-  HAVE_GDKPIXBUF_FALSE=
+  HAVE_TAGLIB_TRUE='#'
+  HAVE_TAGLIB_FALSE=
 fi
 
-if test x"$have_gdkpixbuf" = xyes; then
-   cat >>confdefs.h <<_ACEOF
-#define HAVE_GDKPIXBUF 1
-_ACEOF
 
+
+
+# Check whether --enable-gdk-pixbuf was given.
+if test "${enable_gdk_pixbuf+set}" = set; then
+  enableval=$enable_gdk_pixbuf; case "${enableval}" in
+  no) have_gdkpixbuf=no ;;
+  *) have_gdkpixbuf=yes;;
+esac
+else
+  have_gdkpixbuf=yes
 fi
-LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $GDKPIXBUF_CFLAGS"
-LIBGPOD_LIBS="$LIBGPOD_LIBS $GDKPIXBUF_LIBS"
 
 
 
+if test x$have_gdkpixbuf = xyes; then
+
 pkg_failed=no
-echo "$as_me:$LINENO: checking for HAL_CFLAGS" >&5
-echo $ECHO_N "checking for HAL_CFLAGS... $ECHO_C" >&6
-if test "${pkg_cv_HAL_CFLAGS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "x$ac_cv_env_HAL_CFLAGS_set" = "xset"; then
-	pkg_cv_HAL_CFLAGS=$ac_cv_env_HAL_CFLAGS_value
-elif test -n "$PKG_CONFIG"; then
-	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6\" >/dev/null 2>&1") >&5
-  ($PKG_CONFIG --exists "dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6" >/dev/null 2>&1) 2>&5
+{ echo "$as_me:$LINENO: checking for GDKPIXBUF" >&5
+echo $ECHO_N "checking for GDKPIXBUF... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GDKPIXBUF_CFLAGS"; then
+        pkg_cv_GDKPIXBUF_CFLAGS="$GDKPIXBUF_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-		pkg_cv_HAL_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+  pkg_cv_GDKPIXBUF_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0" 2>/dev/null`
 else
+  pkg_failed=yes
+fi
+    fi
+else
 	pkg_failed=untried
 fi
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_HAL_CFLAGS" >&5
-echo "${ECHO_T}$pkg_cv_HAL_CFLAGS" >&6
-echo "$as_me:$LINENO: checking for HAL_LIBS" >&5
-echo $ECHO_N "checking for HAL_LIBS... $ECHO_C" >&6
-if test "${pkg_cv_HAL_LIBS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "x$ac_cv_env_HAL_LIBS_set" = "xset"; then
-	pkg_cv_HAL_LIBS=$ac_cv_env_HAL_LIBS_value
-elif test -n "$PKG_CONFIG"; then
-	if { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists \"dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6\" >/dev/null 2>&1") >&5
-  ($PKG_CONFIG --exists "dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6" >/dev/null 2>&1) 2>&5
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GDKPIXBUF_LIBS"; then
+        pkg_cv_GDKPIXBUF_LIBS="$GDKPIXBUF_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0\"") >&5
+  ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-		pkg_cv_HAL_LIBS=`$PKG_CONFIG --libs "dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6" 2>/dev/null`
-	else
-		pkg_failed=yes
-	fi
+  pkg_cv_GDKPIXBUF_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0" 2>/dev/null`
 else
-	pkg_failed=untried
+  pkg_failed=yes
 fi
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_HAL_LIBS" >&5
-echo "${ECHO_T}$pkg_cv_HAL_LIBS" >&6
-
-if test $pkg_failed = yes; then
-	HAL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6"`
-	# Put the nasty error message in config.log where it belongs
-	echo "$HAL_PKG_ERRORS" 1>&5
-
-	enable_hal05=no
-elif test $pkg_failed = untried; then
-	enable_hal05=no
+    fi
 else
-	HAL_CFLAGS=$pkg_cv_HAL_CFLAGS
-	HAL_LIBS=$pkg_cv_HAL_LIBS
-	enable_hal05=yes
+	pkg_failed=untried
 fi
-if test x$enable_hal05 == xyes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBHAL 1
-_ACEOF
 
-fi
-LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $HAL_CFLAGS"
-LIBGPOD_LIBS="$LIBGPOD_LIBS $HAL_LIBS"
 
-# Extract the first word of "eject", so it can be a program name with args.
-set dummy eject; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_EJECT_PATH+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $EJECT_PATH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_EJECT_PATH="$EJECT_PATH" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_EJECT_PATH="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+if test $pkg_failed = yes; then
 
-  test -z "$ac_cv_path_EJECT_PATH" && ac_cv_path_EJECT_PATH="eject"
-  ;;
-esac
-fi
-EJECT_PATH=$ac_cv_path_EJECT_PATH
-
-if test -n "$EJECT_PATH"; then
-  echo "$as_me:$LINENO: result: $EJECT_PATH" >&5
-echo "${ECHO_T}$EJECT_PATH" >&6
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+        _pkg_short_errors_supported=no
 fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GDKPIXBUF_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gdk-pixbuf-2.0"`
+        else
+	        GDKPIXBUF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gdk-pixbuf-2.0"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GDKPIXBUF_PKG_ERRORS" >&5
 
-# Extract the first word of "pumount", so it can be a program name with args.
-set dummy pumount; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_UNMOUNT_PATH+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                have_gdkpixbuf=no
+elif test $pkg_failed = untried; then
+	have_gdkpixbuf=no
 else
-  case $UNMOUNT_PATH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_UNMOUNT_PATH="$UNMOUNT_PATH" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_UNMOUNT_PATH="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_UNMOUNT_PATH" && ac_cv_path_UNMOUNT_PATH="no"
-  ;;
-esac
+	GDKPIXBUF_CFLAGS=$pkg_cv_GDKPIXBUF_CFLAGS
+	GDKPIXBUF_LIBS=$pkg_cv_GDKPIXBUF_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	have_gdkpixbuf=yes
 fi
-UNMOUNT_PATH=$ac_cv_path_UNMOUNT_PATH
+   if test x"$have_gdkpixbuf" = xyes; then
+      cat >>confdefs.h <<_ACEOF
+#define HAVE_GDKPIXBUF 1
+_ACEOF
 
-if test -n "$UNMOUNT_PATH"; then
-  echo "$as_me:$LINENO: result: $UNMOUNT_PATH" >&5
-echo "${ECHO_T}$UNMOUNT_PATH" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+   fi
+   LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $GDKPIXBUF_CFLAGS"
+   LIBGPOD_LIBS="$LIBGPOD_LIBS $GDKPIXBUF_LIBS"
 fi
 
 
-if test "x$UNMOUNT_PATH" = "xno"; then
-	# Extract the first word of "umount", so it can be a program name with args.
-set dummy umount; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_UNMOUNT_PATH_ALT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test x"$have_gdkpixbuf" = xyes; then
+  HAVE_GDKPIXBUF_TRUE=
+  HAVE_GDKPIXBUF_FALSE='#'
 else
-  case $UNMOUNT_PATH_ALT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_UNMOUNT_PATH_ALT="$UNMOUNT_PATH_ALT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_UNMOUNT_PATH_ALT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_UNMOUNT_PATH_ALT" && ac_cv_path_UNMOUNT_PATH_ALT="umount"
-  ;;
-esac
+  HAVE_GDKPIXBUF_TRUE='#'
+  HAVE_GDKPIXBUF_FALSE=
 fi
-UNMOUNT_PATH_ALT=$ac_cv_path_UNMOUNT_PATH_ALT
 
-if test -n "$UNMOUNT_PATH_ALT"; then
-  echo "$as_me:$LINENO: result: $UNMOUNT_PATH_ALT" >&5
-echo "${ECHO_T}$UNMOUNT_PATH_ALT" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
 
-	UNMOUNT_PATH=$UNMOUNT_PATH_ALT
-fi
-
-
-# Check whether --with-eject-command or --without-eject-command was given.
-if test "${with_eject_command+set}" = set; then
-  withval="$with_eject_command"
-  eject_command="$withval"
-else
-  eject_command="${EJECT_PATH} %d"
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define EJECT_COMMAND "${eject_command}"
-_ACEOF
-
-
-
-# Check whether --with-unmount-command or --without-unmount-command was given.
-if test "${with_unmount_command+set}" = set; then
-  withval="$with_unmount_command"
-  unmount_command="$withval"
-else
-  unmount_command="${UNMOUNT_PATH} %d"
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define UNMOUNT_COMMAND "${unmount_command}"
-_ACEOF
-
-
-
 ALL_LINGUAS="de es fr he it ja sv"
 
 GETTEXT_PACKAGE=libgpod
@@ -20174,18 +20739,19 @@
 for ac_header in locale.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20196,23 +20762,36 @@
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20221,15 +20800,16 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20238,8 +20818,13 @@
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -20263,9 +20848,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20289,25 +20875,19 @@
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -20320,8 +20900,8 @@
 done
 
     if test $ac_cv_header_locale_h = yes; then
-    echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
-echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+    { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; }
 if test "${am_cv_val_LC_MESSAGES+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20341,23 +20921,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20366,13 +20959,14 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-am_cv_val_LC_MESSAGES=no
+	am_cv_val_LC_MESSAGES=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5
-echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6
+{ echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6; }
     if test $am_cv_val_LC_MESSAGES = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -20391,17 +20985,17 @@
     INTLLIBS=
 
     if test "${ac_cv_header_libintl_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for libintl.h" >&5
-echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_libintl_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
-echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking libintl.h usability" >&5
-echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking libintl.h usability" >&5
+echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20412,23 +21006,36 @@
 #include <libintl.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20437,15 +21044,16 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+	ac_header_compiler=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
 # Is the header present?
-echo "$as_me:$LINENO: checking libintl.h presence" >&5
-echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking libintl.h presence" >&5
+echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20454,8 +21062,13 @@
 /* end confdefs.h.  */
 #include <libintl.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -20479,9 +21092,10 @@
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20505,25 +21119,18 @@
 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for libintl.h" >&5
-echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_libintl_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_libintl_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
-echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; }
 
 fi
 if test $ac_cv_header_libintl_h = yes; then
@@ -20533,8 +21140,8 @@
       #
       # First check in libc
       #
-      echo "$as_me:$LINENO: checking for ngettext in libc" >&5
-echo $ECHO_N "checking for ngettext in libc... $ECHO_C" >&6
+      { echo "$as_me:$LINENO: checking for ngettext in libc" >&5
+echo $ECHO_N "checking for ngettext in libc... $ECHO_C" >&6; }
 if test "${gt_cv_func_ngettext_libc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20556,23 +21163,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20581,18 +21201,19 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gt_cv_func_ngettext_libc=no
+	gt_cv_func_ngettext_libc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5
-echo "${ECHO_T}$gt_cv_func_ngettext_libc" >&6
+{ echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5
+echo "${ECHO_T}$gt_cv_func_ngettext_libc" >&6; }
 
       if test "$gt_cv_func_ngettext_libc" = "yes" ; then
-	      echo "$as_me:$LINENO: checking for dgettext in libc" >&5
-echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6
+	      { echo "$as_me:$LINENO: checking for dgettext in libc" >&5
+echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6; }
 if test "${gt_cv_func_dgettext_libc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20614,23 +21235,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20639,14 +21273,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gt_cv_func_dgettext_libc=no
+	gt_cv_func_dgettext_libc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5
-echo "${ECHO_T}$gt_cv_func_dgettext_libc" >&6
+{ echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5
+echo "${ECHO_T}$gt_cv_func_dgettext_libc" >&6; }
       fi
 
       if test "$gt_cv_func_ngettext_libc" = "yes" ; then
@@ -20654,9 +21289,9 @@
 for ac_func in bind_textdomain_codeset
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -20682,52 +21317,59 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20736,13 +21378,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -20760,8 +21404,8 @@
 	 || test "$gt_cv_func_ngettext_libc" != "yes" \
          || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
-        echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
-echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6
+        { echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
+echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20774,39 +21418,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char bindtextdomain ();
 int
 main ()
 {
-bindtextdomain ();
+return bindtextdomain ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20815,17 +21472,18 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_bindtextdomain=no
+	ac_cv_lib_intl_bindtextdomain=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6; }
 if test $ac_cv_lib_intl_bindtextdomain = yes; then
-  echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
-echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
+echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_ngettext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20838,39 +21496,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char ngettext ();
 int
 main ()
 {
-ngettext ();
+return ngettext ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20879,17 +21550,18 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_ngettext=no
+	ac_cv_lib_intl_ngettext=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6; }
 if test $ac_cv_lib_intl_ngettext = yes; then
-  echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
-echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
+echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_dgettext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20902,39 +21574,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dgettext ();
 int
 main ()
 {
-dgettext ();
+return dgettext ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20943,14 +21628,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_dgettext=no
+	ac_cv_lib_intl_dgettext=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_dgettext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_dgettext" >&6; }
 if test $ac_cv_lib_intl_dgettext = yes; then
   gt_cv_func_dgettext_libintl=yes
 fi
@@ -20961,12 +21647,12 @@
 
 
 	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
-	  echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5
-echo $ECHO_N "checking if -liconv is needed to use gettext... $ECHO_C" >&6
-	  echo "$as_me:$LINENO: result: " >&5
-echo "${ECHO_T}" >&6
-  	  echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
-echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6
+	  { echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5
+echo $ECHO_N "checking if -liconv is needed to use gettext... $ECHO_C" >&6; }
+	  { echo "$as_me:$LINENO: result: " >&5
+echo "${ECHO_T}" >&6; }
+  	  { echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
+echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_ngettext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20979,39 +21665,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char ngettext ();
 int
 main ()
 {
-ngettext ();
+return ngettext ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21020,17 +21719,18 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_ngettext=no
+	ac_cv_lib_intl_ngettext=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6; }
 if test $ac_cv_lib_intl_ngettext = yes; then
-  echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5
-echo $ECHO_N "checking for dcgettext in -lintl... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5
+echo $ECHO_N "checking for dcgettext in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_dcgettext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21043,39 +21743,52 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dcgettext ();
 int
 main ()
 {
-dcgettext ();
+return dcgettext ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21084,14 +21797,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_dcgettext=no
+	ac_cv_lib_intl_dcgettext=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dcgettext" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_dcgettext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dcgettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_dcgettext" >&6; }
 if test $ac_cv_lib_intl_dcgettext = yes; then
   gt_cv_func_dgettext_libintl=yes
 			libintl_extra_libs=-liconv
@@ -21118,9 +21832,9 @@
 for ac_func in bind_textdomain_codeset
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -21146,52 +21860,59 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21200,13 +21921,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -21245,8 +21968,8 @@
 
 	# Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_MSGFMT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21272,11 +21995,11 @@
 fi
 MSGFMT="$ac_cv_path_MSGFMT"
 if test "$MSGFMT" != "no"; then
-  echo "$as_me:$LINENO: result: $MSGFMT" >&5
-echo "${ECHO_T}$MSGFMT" >&6
+  { echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 	if test "$MSGFMT" != "no"; then
           glib_save_LIBS="$LIBS"
@@ -21285,9 +22008,9 @@
 for ac_func in dcgettext
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -21313,52 +22036,59 @@
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21367,13 +22097,15 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+	eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -21384,8 +22116,8 @@
 
 	  # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_GMSGFMT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21400,32 +22132,33 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
   ;;
 esac
 fi
 GMSGFMT=$ac_cv_path_GMSGFMT
-
 if test -n "$GMSGFMT"; then
-  echo "$as_me:$LINENO: result: $GMSGFMT" >&5
-echo "${ECHO_T}$GMSGFMT" >&6
+  { echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 	  # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_XGETTEXT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21451,11 +22184,11 @@
 fi
 XGETTEXT="$ac_cv_path_XGETTEXT"
 if test "$XGETTEXT" != ":"; then
-  echo "$as_me:$LINENO: result: $XGETTEXT" >&5
-echo "${ECHO_T}$XGETTEXT" >&6
+  { echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 	  cat >conftest.$ac_ext <<_ACEOF
@@ -21475,23 +22208,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21501,10 +22247,10 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-case $host in
+	case $host in
 	    *-*-solaris*)
-	    	                	    	                echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5
-echo $ECHO_N "checking for bind_textdomain_codeset... $ECHO_C" >&6
+	    	                	    	                { echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5
+echo $ECHO_N "checking for bind_textdomain_codeset... $ECHO_C" >&6; }
 if test "${ac_cv_func_bind_textdomain_codeset+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21531,52 +22277,59 @@
 
 #undef bind_textdomain_codeset
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char bind_textdomain_codeset ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_bind_textdomain_codeset) || defined (__stub___bind_textdomain_codeset)
+#if defined __stub_bind_textdomain_codeset || defined __stub___bind_textdomain_codeset
 choke me
-#else
-char (*f) () = bind_textdomain_codeset;
 #endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != bind_textdomain_codeset;
+return bind_textdomain_codeset ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21585,13 +22338,14 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_bind_textdomain_codeset=no
+	ac_cv_func_bind_textdomain_codeset=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5
-echo "${ECHO_T}$ac_cv_func_bind_textdomain_codeset" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5
+echo "${ECHO_T}$ac_cv_func_bind_textdomain_codeset" >&6; }
 if test $ac_cv_func_bind_textdomain_codeset = yes; then
   CATOBJEXT=.gmo
                DATADIRNAME=share
@@ -21607,7 +22361,8 @@
 	    ;;
 	    esac
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
           LIBS="$glib_save_LIBS"
 	  INSTOBJEXT=.mo
@@ -21632,8 +22387,8 @@
                   if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
         : ;
       else
-        echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5
-echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6
+        { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5
+echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; }
         XGETTEXT=":"
       fi
     fi
@@ -21641,7 +22396,7 @@
     # We need to process the po/ directory.
     POSUB=po
 
-              ac_config_commands="$ac_config_commands default-1"
+    ac_config_commands="$ac_config_commands default-1"
 
 
                 for lang in $ALL_LINGUAS; do
@@ -21665,8 +22420,8 @@
      if test "x$ALL_LINGUAS" = "x"; then
        LINGUAS=
      else
-       echo "$as_me:$LINENO: checking for catalogs to be installed" >&5
-echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6
+       { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5
+echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; }
        NEW_LINGUAS=
        for presentlang in $ALL_LINGUAS; do
          useit=no
@@ -21690,8 +22445,8 @@
          fi
        done
        LINGUAS=$NEW_LINGUAS
-       echo "$as_me:$LINENO: result: $LINGUAS" >&5
-echo "${ECHO_T}$LINGUAS" >&6
+       { echo "$as_me:$LINENO: result: $LINGUAS" >&5
+echo "${ECHO_T}$LINGUAS" >&6; }
      fi
 
           if test -n "$LINGUAS"; then
@@ -21725,10 +22480,608 @@
 
 
 
-# Check whether --enable-more-warnings or --disable-more-warnings was given.
+
+# Check whether --with-html-dir was given.
+if test "${with_html_dir+set}" = set; then
+  withval=$with_html_dir;
+else
+  with_html_dir='${datadir}/gtk-doc/html'
+fi
+
+  HTML_DIR="$with_html_dir"
+
+
+    # Check whether --enable-gtk-doc was given.
+if test "${enable_gtk_doc+set}" = set; then
+  enableval=$enable_gtk_doc;
+else
+  enable_gtk_doc=no
+fi
+
+
+  have_gtk_doc=no
+  if test x$enable_gtk_doc = xyes; then
+    if test -z "$PKG_CONFIG"; then
+      # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    fi
+    if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
+      have_gtk_doc=yes
+    fi
+
+  gtk_doc_min_version=1.0
+    if test "$have_gtk_doc" = yes; then
+      { echo "$as_me:$LINENO: checking gtk-doc version >= $gtk_doc_min_version" >&5
+echo $ECHO_N "checking gtk-doc version >= $gtk_doc_min_version... $ECHO_C" >&6; }
+      if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+      else
+        { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+        have_gtk_doc=no
+      fi
+    fi
+
+    if test "$have_gtk_doc" != yes; then
+      enable_gtk_doc=no
+    fi
+  fi
+
+
+
+if test x$enable_gtk_doc = xyes; then
+  ENABLE_GTK_DOC_TRUE=
+  ENABLE_GTK_DOC_FALSE='#'
+else
+  ENABLE_GTK_DOC_TRUE='#'
+  ENABLE_GTK_DOC_FALSE=
+fi
+
+
+
+if test -n "$LIBTOOL"; then
+  GTK_DOC_USE_LIBTOOL_TRUE=
+  GTK_DOC_USE_LIBTOOL_FALSE='#'
+else
+  GTK_DOC_USE_LIBTOOL_TRUE='#'
+  GTK_DOC_USE_LIBTOOL_FALSE=
+fi
+
+
+
+
+PYTHON_MIN_VERSION=2.1.1
+PYTHON_EYED3_MIN_VERSION=0.6.6
+SWIG_MIN_VERSION=1.3.24
+
+        am_display_PYTHON=python
+
+
+# Check whether --with-python was given.
+if test "${with_python+set}" = set; then
+  withval=$with_python; with_python=$withval
+else
+  with_python=yes
+fi
+
+
+    { echo "$as_me:$LINENO: checking whether to build python bindings" >&5
+echo $ECHO_N "checking whether to build python bindings... $ECHO_C" >&6; }
+    if test "X$with_python" != Xno; then
+        if test "X$with_python" != Xyes; then
+            PYTHON=$with_python
+        fi
+        with_python=yes
+    fi
+    { echo "$as_me:$LINENO: result: $with_python" >&5
+echo "${ECHO_T}$with_python" >&6; }
+
+    if test "X$with_python" == Xyes; then
+        if test -z "$PYTHON"; then
+            # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PYTHON+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+  { echo "$as_me:$LINENO: result: $PYTHON" >&5
+echo "${ECHO_T}$PYTHON" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+        fi
+
+        if test -n "$PYTHON"; then
+
+
+
+
+        if test -n "$PYTHON"; then
+      # If the user set $PYTHON, use it and don't search something else.
+      { echo "$as_me:$LINENO: checking whether $PYTHON version >= $PYTHON_MIN_VERSION" >&5
+echo $ECHO_N "checking whether $PYTHON version >= $PYTHON_MIN_VERSION... $ECHO_C" >&6; }
+      prog="import sys, string
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('$PYTHON_MIN_VERSION', '.')) + [0, 0, 0]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+  if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5
+   ($PYTHON -c "$prog") >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { { echo "$as_me:$LINENO: error: too old" >&5
+echo "$as_me: error: too old" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+    else
+      # Otherwise, try each interpreter until we find one that satisfies
+      # VERSION.
+      { echo "$as_me:$LINENO: checking for a Python interpreter with version >= $PYTHON_MIN_VERSION" >&5
+echo $ECHO_N "checking for a Python interpreter with version >= $PYTHON_MIN_VERSION... $ECHO_C" >&6; }
+if test "${am_cv_pathless_PYTHON+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	for am_cv_pathless_PYTHON in python python2 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 : ; do
+          if test "$am_cv_pathless_PYTHON" = : ; then
+            { { echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5
+echo "$as_me: error: no suitable Python interpreter found" >&2;}
+   { (exit 1); exit 1; }; }
+	  fi
+          prog="import sys, string
+# split strings by '.' and convert to numeric.  Append some zeros
+# because we need at least 4 digits for the hex conversion.
+minver = map(int, string.split('$PYTHON_MIN_VERSION', '.')) + [0, 0, 0]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+  if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5
+   ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; then
+  break
+fi
+
+        done
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5
+echo "${ECHO_T}$am_cv_pathless_PYTHON" >&6; }
+      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+      # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args.
+set dummy $am_cv_pathless_PYTHON; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PYTHON+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+  { echo "$as_me:$LINENO: result: $PYTHON" >&5
+echo "${ECHO_T}$PYTHON" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+      am_display_PYTHON=$am_cv_pathless_PYTHON
+    fi
+
+
+
+  { echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5
+echo $ECHO_N "checking for $am_display_PYTHON version... $ECHO_C" >&6; }
+if test "${am_cv_python_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"`
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_python_version" >&5
+echo "${ECHO_T}$am_cv_python_version" >&6; }
+  PYTHON_VERSION=$am_cv_python_version
+
+
+
+  PYTHON_PREFIX='${prefix}'
+
+  PYTHON_EXEC_PREFIX='${exec_prefix}'
+
+
+
+  { echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5
+echo $ECHO_N "checking for $am_display_PYTHON platform... $ECHO_C" >&6; }
+if test "${am_cv_python_platform+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5
+echo "${ECHO_T}$am_cv_python_platform" >&6; }
+  PYTHON_PLATFORM=$am_cv_python_platform
+
+
+
+
+                { echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5
+echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6; }
+if test "${am_cv_python_pythondir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
+     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5
+echo "${ECHO_T}$am_cv_python_pythondir" >&6; }
+  pythondir=$am_cv_python_pythondir
+
+
+
+  pkgpythondir=\${pythondir}/$PACKAGE
+
+
+            { echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5
+echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6; }
+if test "${am_cv_python_pyexecdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
+     echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5
+echo "${ECHO_T}$am_cv_python_pyexecdir" >&6; }
+  pyexecdir=$am_cv_python_pyexecdir
+
+
+
+  pkgpyexecdir=\${pyexecdir}/$PACKAGE
+
+
+
+{ echo "$as_me:$LINENO: checking for python development headers" >&5
+echo $ECHO_N "checking for python development headers... $ECHO_C" >&6; }
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <Python.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  { echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6; }
+with_python="yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  { echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6; }
+with_python="no"
+fi
+
+rm -f conftest.err conftest.$ac_ext
+CPPFLAGS="$save_CPPFLAGS"
+
+
+            if test "X$with_python" == Xyes; then
+                                                if test `uname` = Darwin; then
+                    PYTHON_LDFLAGS="-Wl,-F. -Wl,-F. -bundle"
+                    if $PYTHON -c 'import sys, string; sys.exit(string.find(sys.prefix,"Framework")+1)'; then
+                        :
+                    else
+                        PYTHON_LDFLAGS="$PYTHON_LDFLAGS -framework Python"
+                    fi
+                else
+                    PYTHON_LDFLAGS="-shared"
+                fi
+
+
+
+py_mod_var=`echo eyeD3`
+{ echo "$as_me:$LINENO: checking for python module eyeD3 >= $PYTHON_EYED3_MIN_VERSION" >&5
+echo $ECHO_N "checking for python module eyeD3 >= $PYTHON_EYED3_MIN_VERSION... $ECHO_C" >&6; }
+if { as_var=py_cv_mod_$py_mod_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+prog="
+import sys, string, eyeD3
+curverstr = eyeD3.eyeD3Version
+# use method from AM_PYTHON_CHECK_VERSION
+minver = map(int, string.split('$PYTHON_EYED3_MIN_VERSION', '.')) + [0, 0, 0]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i]
+curver = map(int, string.split(curverstr, '.')) + [0, 0, 0]
+curverhex = 0
+for i in xrange(0, 4): curverhex = (curverhex << 8) + curver[i]
+if (curverhex >= minverhex):
+        sys.exit(0)
+else:
+        sys.exit(1)
+sys.exit(0)"
+if $PYTHON -c "$prog" 1>&5 2>&5
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+
+fi
+
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  with_python=no
+fi
+
+
+                                if test "X$with_python" == Xyes; then
+
+        # Extract the first word of "swig", so it can be a program name with args.
+set dummy swig; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SWIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { echo "$as_me:$LINENO: result: $SWIG" >&5
+echo "${ECHO_T}$SWIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+        if test -z "$SWIG" ; then
+                { echo "$as_me:$LINENO: WARNING: cannot find 'swig' program. You should look at http://www.swig.org" >&5
+echo "$as_me: WARNING: cannot find 'swig' program. You should look at http://www.swig.org" >&2;}
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "$SWIG_MIN_VERSION" ; then
+                { echo "$as_me:$LINENO: checking for SWIG version" >&5
+echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; }
+                swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
+                { echo "$as_me:$LINENO: result: $swig_version" >&5
+echo "${ECHO_T}$swig_version" >&6; }
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        required=$SWIG_MIN_VERSION
+                        required_major=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_major" ; then
+                                required_major=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_minor=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_minor" ; then
+                                required_minor=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_patch=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_patch" ; then
+                                required_patch=0
+                        fi
+                        # Calculate the available version number components
+                        available=$swig_version
+                        available_major=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_major" ; then
+                                available_major=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_minor=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_minor" ; then
+                                available_minor=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_patch=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_patch" ; then
+                                available_patch=0
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                { echo "$as_me:$LINENO: WARNING: SWIG version >= $SWIG_MIN_VERSION is required.  You have $swig_version.  You should look at http://www.swig.org" >&5
+echo "$as_me: WARNING: SWIG version >= $SWIG_MIN_VERSION is required.  You have $swig_version.  You should look at http://www.swig.org" >&2;}
+                                SWIG='echo "Error: SWIG version >= $SWIG_MIN_VERSION is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                                has_swig="no"
+                        else
+                                SWIG_LIB=`$SWIG -swiglib`
+                                has_swig="yes"
+                        fi
+                else
+                        { echo "$as_me:$LINENO: WARNING: cannot determine SWIG version" >&5
+echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                        has_swig="no"
+                fi
+        fi
+
+
+                    with_python="$has_swig"
+                fi
+            fi
+        else
+            { echo "$as_me:$LINENO: WARNING: python not found.  try --with-python=/path/to/python" >&5
+echo "$as_me: WARNING: python not found.  try --with-python=/path/to/python" >&2;}
+            with_python="no"
+        fi
+    fi
+
+
+if test x$with_python = xyes; then
+  HAVE_PYTHON_TRUE=
+  HAVE_PYTHON_FALSE='#'
+else
+  HAVE_PYTHON_TRUE='#'
+  HAVE_PYTHON_FALSE=
+fi
+
+
+
+
+
+# Check whether --enable-more-warnings was given.
 if test "${enable_more_warnings+set}" = set; then
-  enableval="$enable_more_warnings"
-  set_more_warnings="$enableval"
+  enableval=$enable_more_warnings; set_more_warnings="$enableval"
 else
 
 if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS"; then
@@ -21737,12 +23090,13 @@
 	set_more_warnings=no
 fi
 
-fi;
-echo "$as_me:$LINENO: checking for more warnings" >&5
-echo $ECHO_N "checking for more warnings... $ECHO_C" >&6
+fi
+
+{ echo "$as_me:$LINENO: checking for more warnings" >&5
+echo $ECHO_N "checking for more warnings... $ECHO_C" >&6; }
 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+	{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 	CFLAGS="\
 	-Wall \
 	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
@@ -21754,8 +23108,8 @@
 	for option in -Wno-strict-aliasing -Wno-sign-compare -Wdeclaration-after-statement; do
 		SAVE_CFLAGS="$CFLAGS"
 		CFLAGS="$CFLAGS $option"
-		echo "$as_me:$LINENO: checking whether gcc understands $option" >&5
-echo $ECHO_N "checking whether gcc understands $option... $ECHO_C" >&6
+		{ echo "$as_me:$LINENO: checking whether gcc understands $option" >&5
+echo $ECHO_N "checking whether gcc understands $option... $ECHO_C" >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21772,23 +23126,36 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
 	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21797,21 +23164,22 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-has_option=no
+	has_option=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 		if test $has_option = no; then
 			CFLAGS="$SAVE_CFLAGS"
 		fi
-		echo "$as_me:$LINENO: result: $has_option" >&5
-echo "${ECHO_T}$has_option" >&6
+		{ echo "$as_me:$LINENO: result: $has_option" >&5
+echo "${ECHO_T}$has_option" >&6; }
 		unset has_option
 		unset SAVE_CFLAGS
 	done
 	unset option
 else
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
@@ -21820,7 +23188,8 @@
 
 
 
-                                                  ac_config_files="$ac_config_files Makefile po/Makefile.in src/Makefile tests/Makefile libgpod-1.0.pc"
+ac_config_files="$ac_config_files Makefile bindings/Makefile bindings/python/Makefile bindings/python/examples/Makefile docs/Makefile docs/reference/Makefile docs/reference/version.xml m4/Makefile po/Makefile.in src/Makefile tests/Makefile libgpod-1.0.pc"
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -21839,39 +23208,58 @@
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
+      ;; #(
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    echo "not updating unwritable cache $cache_file"
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -21880,32 +23268,18 @@
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -21941,12 +23315,16 @@
    { (exit 1); exit 1; }; }
 fi
 
+  ac_config_commands="$ac_config_commands po/stamp-it"
 
-        mv -f po/POTFILES po/POTFILES.tmp
-        sed -e '/\[encoding.*\]/d' -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
-        rm -f po/POTFILES.tmp
 
-
+if test -z "${HAVE_TAGLIB_TRUE}" && test -z "${HAVE_TAGLIB_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_TAGLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_TAGLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${HAVE_GDKPIXBUF_TRUE}" && test -z "${HAVE_GDKPIXBUF_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"HAVE_GDKPIXBUF\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -21954,6 +23332,27 @@
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_GTK_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENABLE_GTK_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"GTK_DOC_USE_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GTK_DOC_USE_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PYTHON\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PYTHON\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -21985,11 +23384,35 @@
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   as_unset=unset
@@ -21998,8 +23421,43 @@
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -22013,18 +23471,19 @@
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -22032,159 +23491,120 @@
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
 
-
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
-
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -22193,7 +23613,19 @@
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+# Find out whether ``test -x'' works.  Don't use a zero-byte file, as
+# systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  as_executable_p="test -x"
+else
+  as_executable_p=:
+fi
+rm -f conf$$.file
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -22202,31 +23634,14 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.60a.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -22234,30 +23649,20 @@
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 # Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
 
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+_ACEOF
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -22265,7 +23670,7 @@
 Usage: $0 [OPTIONS] [FILE]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
+  -V, --version    print version number and configuration settings, then exit
   -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
@@ -22284,19 +23689,21 @@
 $config_commands
 
 Report bugs to <bug-autoconf at gnu.org>."
+
 _ACEOF
-
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.60a,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -22307,39 +23714,24 @@
 do
   case $1 in
   --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
@@ -22349,18 +23741,24 @@
     $ac_shift
     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -22376,48 +23774,69 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 #
-# INIT-COMMANDS section.
+# INIT-COMMANDS
 #
-
 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir=${ac_aux_dir}
-INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' ICONV='${INTLTOOL_ICONV}'
-MSGFMT='${INTLTOOL_MSGFMT}' MSGMERGE='${INTLTOOL_MSGMERGE}'
-XGETTEXT='${INTLTOOL_XGETTEXT}'
+INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
+prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
+INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
+INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
+INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'
 
 
 _ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF
 
-
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
-  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-  "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
-  "libgpod-1.0.pc" ) CONFIG_FILES="$CONFIG_FILES libgpod-1.0.pc" ;;
-  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-  "intltool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS intltool" ;;
-  "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
-  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "intltool") CONFIG_COMMANDS="$CONFIG_COMMANDS intltool" ;;
+    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;;
+    "bindings/python/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/Makefile" ;;
+    "bindings/python/examples/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/examples/Makefile" ;;
+    "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
+    "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;;
+    "docs/reference/version.xml") CONFIG_FILES="$CONFIG_FILES docs/reference/version.xml" ;;
+    "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
+    "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+    "libgpod-1.0.pc") CONFIG_FILES="$CONFIG_FILES libgpod-1.0.pc" ;;
+    "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;;
+
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -22429,661 +23848,667 @@
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
 } ||
 {
    echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
 #
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
 #
 
 # No need to generate the scripts if there are no CONFIG_FILES.
 # This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at LIBGPOD_CURRENT@,$LIBGPOD_CURRENT,;t t
-s, at LIBGPOD_REVISION@,$LIBGPOD_REVISION,;t t
-s, at LIBGPOD_AGE@,$LIBGPOD_AGE,;t t
-s, at LIBGPOD_VERSION@,$LIBGPOD_VERSION,;t t
-s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s, at INSTALL_DATA@,$INSTALL_DATA,;t t
-s, at CYGPATH_W@,$CYGPATH_W,;t t
-s, at PACKAGE@,$PACKAGE,;t t
-s, at VERSION@,$VERSION,;t t
-s, at ACLOCAL@,$ACLOCAL,;t t
-s, at AUTOCONF@,$AUTOCONF,;t t
-s, at AUTOMAKE@,$AUTOMAKE,;t t
-s, at AUTOHEADER@,$AUTOHEADER,;t t
-s, at MAKEINFO@,$MAKEINFO,;t t
-s, at AMTAR@,$AMTAR,;t t
-s, at install_sh@,$install_sh,;t t
-s, at STRIP@,$STRIP,;t t
-s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s, at AWK@,$AWK,;t t
-s, at SET_MAKE@,$SET_MAKE,;t t
-s, at am__leading_dot@,$am__leading_dot,;t t
-s, at ACLOCAL_AMFLAGS@,$ACLOCAL_AMFLAGS,;t t
-s, at MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
-s, at MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
-s, at MAINT@,$MAINT,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at DEPDIR@,$DEPDIR,;t t
-s, at am__include@,$am__include,;t t
-s, at am__quote@,$am__quote,;t t
-s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s, at CCDEPMODE@,$CCDEPMODE,;t t
-s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at EGREP@,$EGREP,;t t
-s, at CPP@,$CPP,;t t
-s, at LN_S@,$LN_S,;t t
-s, at ECHO@,$ECHO,;t t
-s, at AR@,$AR,;t t
-s, at ac_ct_AR@,$ac_ct_AR,;t t
-s, at RANLIB@,$RANLIB,;t t
-s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s, at CXX@,$CXX,;t t
-s, at CXXFLAGS@,$CXXFLAGS,;t t
-s, at ac_ct_CXX@,$ac_ct_CXX,;t t
-s, at CXXDEPMODE@,$CXXDEPMODE,;t t
-s, at am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
-s, at am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
-s, at CXXCPP@,$CXXCPP,;t t
-s, at F77@,$F77,;t t
-s, at FFLAGS@,$FFLAGS,;t t
-s, at ac_ct_F77@,$ac_ct_F77,;t t
-s, at LIBTOOL@,$LIBTOOL,;t t
-s, at INTLTOOL_DESKTOP_RULE@,$INTLTOOL_DESKTOP_RULE,;t t
-s, at INTLTOOL_DIRECTORY_RULE@,$INTLTOOL_DIRECTORY_RULE,;t t
-s, at INTLTOOL_KEYS_RULE@,$INTLTOOL_KEYS_RULE,;t t
-s, at INTLTOOL_PROP_RULE@,$INTLTOOL_PROP_RULE,;t t
-s, at INTLTOOL_OAF_RULE@,$INTLTOOL_OAF_RULE,;t t
-s, at INTLTOOL_PONG_RULE@,$INTLTOOL_PONG_RULE,;t t
-s, at INTLTOOL_SERVER_RULE@,$INTLTOOL_SERVER_RULE,;t t
-s, at INTLTOOL_SHEET_RULE@,$INTLTOOL_SHEET_RULE,;t t
-s, at INTLTOOL_SOUNDLIST_RULE@,$INTLTOOL_SOUNDLIST_RULE,;t t
-s, at INTLTOOL_UI_RULE@,$INTLTOOL_UI_RULE,;t t
-s, at INTLTOOL_XAM_RULE@,$INTLTOOL_XAM_RULE,;t t
-s, at INTLTOOL_KBD_RULE@,$INTLTOOL_KBD_RULE,;t t
-s, at INTLTOOL_XML_RULE@,$INTLTOOL_XML_RULE,;t t
-s, at INTLTOOL_XML_NOMERGE_RULE@,$INTLTOOL_XML_NOMERGE_RULE,;t t
-s, at INTLTOOL_CAVES_RULE@,$INTLTOOL_CAVES_RULE,;t t
-s, at INTLTOOL_SCHEMAS_RULE@,$INTLTOOL_SCHEMAS_RULE,;t t
-s, at INTLTOOL_THEME_RULE@,$INTLTOOL_THEME_RULE,;t t
-s, at INTLTOOL_EXTRACT@,$INTLTOOL_EXTRACT,;t t
-s, at INTLTOOL_MERGE@,$INTLTOOL_MERGE,;t t
-s, at INTLTOOL_UPDATE@,$INTLTOOL_UPDATE,;t t
-s, at INTLTOOL_PERL@,$INTLTOOL_PERL,;t t
-s, at INTLTOOL_ICONV@,$INTLTOOL_ICONV,;t t
-s, at INTLTOOL_MSGFMT@,$INTLTOOL_MSGFMT,;t t
-s, at INTLTOOL_MSGMERGE@,$INTLTOOL_MSGMERGE,;t t
-s, at INTLTOOL_XGETTEXT@,$INTLTOOL_XGETTEXT,;t t
-s, at mkdir_p@,$mkdir_p,;t t
-s, at PKG_CONFIG@,$PKG_CONFIG,;t t
-s, at ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
-s, at LIBGPOD_CFLAGS@,$LIBGPOD_CFLAGS,;t t
-s, at LIBGPOD_LIBS@,$LIBGPOD_LIBS,;t t
-s, at GDKPIXBUF_CFLAGS@,$GDKPIXBUF_CFLAGS,;t t
-s, at GDKPIXBUF_LIBS@,$GDKPIXBUF_LIBS,;t t
-s, at HAVE_GDKPIXBUF_TRUE@,$HAVE_GDKPIXBUF_TRUE,;t t
-s, at HAVE_GDKPIXBUF_FALSE@,$HAVE_GDKPIXBUF_FALSE,;t t
-s, at HAL_CFLAGS@,$HAL_CFLAGS,;t t
-s, at HAL_LIBS@,$HAL_LIBS,;t t
-s, at EJECT_PATH@,$EJECT_PATH,;t t
-s, at UNMOUNT_PATH@,$UNMOUNT_PATH,;t t
-s, at UNMOUNT_PATH_ALT@,$UNMOUNT_PATH_ALT,;t t
-s, at GETTEXT_PACKAGE@,$GETTEXT_PACKAGE,;t t
-s, at USE_NLS@,$USE_NLS,;t t
-s, at MSGFMT@,$MSGFMT,;t t
-s, at GMSGFMT@,$GMSGFMT,;t t
-s, at XGETTEXT@,$XGETTEXT,;t t
-s, at CATALOGS@,$CATALOGS,;t t
-s, at CATOBJEXT@,$CATOBJEXT,;t t
-s, at DATADIRNAME@,$DATADIRNAME,;t t
-s, at GMOFILES@,$GMOFILES,;t t
-s, at INSTOBJEXT@,$INSTOBJEXT,;t t
-s, at INTLLIBS@,$INTLLIBS,;t t
-s, at PO_IN_DATADIR_TRUE@,$PO_IN_DATADIR_TRUE,;t t
-s, at PO_IN_DATADIR_FALSE@,$PO_IN_DATADIR_FALSE,;t t
-s, at POFILES@,$POFILES,;t t
-s, at POSUB@,$POSUB,;t t
-s, at MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+if test -n "$CONFIG_FILES"; then
 
 _ACEOF
 
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+LIBGPOD_CURRENT!$LIBGPOD_CURRENT$ac_delim
+LIBGPOD_REVISION!$LIBGPOD_REVISION$ac_delim
+LIBGPOD_AGE!$LIBGPOD_AGE$ac_delim
+LIBGPOD_VERSION!$LIBGPOD_VERSION$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+AMTAR!$AMTAR$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+ACLOCAL_AMFLAGS!$ACLOCAL_AMFLAGS$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+CPP!$CPP$ac_delim
+LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
+AR!$AR$ac_delim
+RANLIB!$RANLIB$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
 
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 _ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+F77!$F77$ac_delim
+FFLAGS!$FFLAGS$ac_delim
+ac_ct_F77!$ac_ct_F77$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+INTLTOOL_DESKTOP_RULE!$INTLTOOL_DESKTOP_RULE$ac_delim
+INTLTOOL_DIRECTORY_RULE!$INTLTOOL_DIRECTORY_RULE$ac_delim
+INTLTOOL_KEYS_RULE!$INTLTOOL_KEYS_RULE$ac_delim
+INTLTOOL_PROP_RULE!$INTLTOOL_PROP_RULE$ac_delim
+INTLTOOL_OAF_RULE!$INTLTOOL_OAF_RULE$ac_delim
+INTLTOOL_PONG_RULE!$INTLTOOL_PONG_RULE$ac_delim
+INTLTOOL_SERVER_RULE!$INTLTOOL_SERVER_RULE$ac_delim
+INTLTOOL_SHEET_RULE!$INTLTOOL_SHEET_RULE$ac_delim
+INTLTOOL_SOUNDLIST_RULE!$INTLTOOL_SOUNDLIST_RULE$ac_delim
+INTLTOOL_UI_RULE!$INTLTOOL_UI_RULE$ac_delim
+INTLTOOL_XAM_RULE!$INTLTOOL_XAM_RULE$ac_delim
+INTLTOOL_KBD_RULE!$INTLTOOL_KBD_RULE$ac_delim
+INTLTOOL_XML_RULE!$INTLTOOL_XML_RULE$ac_delim
+INTLTOOL_XML_NOMERGE_RULE!$INTLTOOL_XML_NOMERGE_RULE$ac_delim
+INTLTOOL_CAVES_RULE!$INTLTOOL_CAVES_RULE$ac_delim
+INTLTOOL_SCHEMAS_RULE!$INTLTOOL_SCHEMAS_RULE$ac_delim
+INTLTOOL_THEME_RULE!$INTLTOOL_THEME_RULE$ac_delim
+INTLTOOL_SERVICE_RULE!$INTLTOOL_SERVICE_RULE$ac_delim
+INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_delim
+INTLTOOL_MERGE!$INTLTOOL_MERGE$ac_delim
+INTLTOOL_UPDATE!$INTLTOOL_UPDATE$ac_delim
+INTLTOOL_PERL!$INTLTOOL_PERL$ac_delim
+INTLTOOL_ICONV!$INTLTOOL_ICONV$ac_delim
+INTLTOOL_MSGFMT!$INTLTOOL_MSGFMT$ac_delim
+INTLTOOL_MSGMERGE!$INTLTOOL_MSGMERGE$ac_delim
+INTLTOOL_XGETTEXT!$INTLTOOL_XGETTEXT$ac_delim
+ALL_LINGUAS!$ALL_LINGUAS$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+LIBGPOD_CFLAGS!$LIBGPOD_CFLAGS$ac_delim
+LIBGPOD_LIBS!$LIBGPOD_LIBS$ac_delim
+TAGLIB_CFLAGS!$TAGLIB_CFLAGS$ac_delim
+TAGLIB_LIBS!$TAGLIB_LIBS$ac_delim
+HAVE_TAGLIB_TRUE!$HAVE_TAGLIB_TRUE$ac_delim
+HAVE_TAGLIB_FALSE!$HAVE_TAGLIB_FALSE$ac_delim
+GDKPIXBUF_CFLAGS!$GDKPIXBUF_CFLAGS$ac_delim
+GDKPIXBUF_LIBS!$GDKPIXBUF_LIBS$ac_delim
+HAVE_GDKPIXBUF_TRUE!$HAVE_GDKPIXBUF_TRUE$ac_delim
+HAVE_GDKPIXBUF_FALSE!$HAVE_GDKPIXBUF_FALSE$ac_delim
+GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
+USE_NLS!$USE_NLS$ac_delim
+MSGFMT!$MSGFMT$ac_delim
+GMSGFMT!$GMSGFMT$ac_delim
+XGETTEXT!$XGETTEXT$ac_delim
+CATALOGS!$CATALOGS$ac_delim
+CATOBJEXT!$CATOBJEXT$ac_delim
+DATADIRNAME!$DATADIRNAME$ac_delim
+GMOFILES!$GMOFILES$ac_delim
+INSTOBJEXT!$INSTOBJEXT$ac_delim
+INTLLIBS!$INTLLIBS$ac_delim
+PO_IN_DATADIR_TRUE!$PO_IN_DATADIR_TRUE$ac_delim
+PO_IN_DATADIR_FALSE!$PO_IN_DATADIR_FALSE$ac_delim
+POFILES!$POFILES$ac_delim
+POSUB!$POSUB$ac_delim
+MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim
+HTML_DIR!$HTML_DIR$ac_delim
+ENABLE_GTK_DOC_TRUE!$ENABLE_GTK_DOC_TRUE$ac_delim
+ENABLE_GTK_DOC_FALSE!$ENABLE_GTK_DOC_FALSE$ac_delim
+GTK_DOC_USE_LIBTOOL_TRUE!$GTK_DOC_USE_LIBTOOL_TRUE$ac_delim
+GTK_DOC_USE_LIBTOOL_FALSE!$GTK_DOC_USE_LIBTOOL_FALSE$ac_delim
+PYTHON!$PYTHON$ac_delim
+PYTHON_VERSION!$PYTHON_VERSION$ac_delim
+PYTHON_PREFIX!$PYTHON_PREFIX$ac_delim
+PYTHON_EXEC_PREFIX!$PYTHON_EXEC_PREFIX$ac_delim
+PYTHON_PLATFORM!$PYTHON_PLATFORM$ac_delim
+pythondir!$pythondir$ac_delim
+pkgpythondir!$pkgpythondir$ac_delim
+pyexecdir!$pyexecdir$ac_delim
+pkgpyexecdir!$pkgpyexecdir$ac_delim
+PYTHON_INCLUDES!$PYTHON_INCLUDES$ac_delim
+PYTHON_LDFLAGS!$PYTHON_LDFLAGS$ac_delim
+SWIG!$SWIG$ac_delim
+SWIG_LIB!$SWIG_LIB$ac_delim
+HAVE_PYTHON_TRUE!$HAVE_PYTHON_TRUE$ac_delim
+HAVE_PYTHON_FALSE!$HAVE_PYTHON_FALSE$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
 cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
   ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+_ACEOF
 
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
 
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
 $extrasub
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-s, at INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
 
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
 
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  rm -f "$tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
   esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
 
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
 
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
 
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
 
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
 do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
   rm -f conftest.defines
   mv conftest.tail conftest.defines
 done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
+rm -f conftest.defines conftest.tail
 
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
       rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      mv "$tmp/config.h" $ac_file
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    echo "/* $configure_input  */"
+    cat "$ac_result"
   fi
+  rm -f "$tmp/out12"
 # Compute $ac_file's index in $config_headers.
 _am_stamp_count=1
 for _am_header in $config_headers :; do
@@ -23094,135 +24519,39 @@
       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
   esac
 done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
 $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X$ac_file : 'X\(//\)[^/]' \| \
 	 X$ac_file : 'X\(//\)$' \| \
-	 X$ac_file : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
 echo X$ac_file |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
 
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_dest" : 'X\(//\)[^/]' \| \
-	 X"$ac_dest" : 'X\(//\)$' \| \
-	 X"$ac_dest" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
 
-  ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
   # Strip MF so we end up with the name of the file.
   mf=`echo "$mf" | sed -e 's/:.*$//'`
   # Check whether this is an Automake generated Makefile or not.
@@ -23232,18 +24561,29 @@
   # each Makefile.in and add a new line on top of each file to say so.
   # So let's grep whole file.
   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
-    dirpart=`(dirname "$mf") 2>/dev/null ||
+    dirpart=`$as_dirname -- "$mf" ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   else
     continue
   fi
@@ -23271,96 +24611,126 @@
        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
     # Make sure the directory exists.
     test -f "$dirpart/$file" && continue
-    fdir=`(dirname "$file") 2>/dev/null ||
+    fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    { if $as_mkdir_p; then
-    mkdir -p $dirpart/$fdir
-  else
-    as_dir=$dirpart/$fdir
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
     # echo "creating $dirpart/$file"
     echo '# dummy' > "$dirpart/$file"
   done
 done
  ;;
-    intltool )
+    "intltool":C)
 
-intltool_edit="-e 's#@INTLTOOL_EXTRACT@#`pwd`/intltool-extract#g' \
-               -e 's#@INTLTOOL_ICONV@#${INTLTOOL_ICONV}#g' \
-               -e 's#@INTLTOOL_MSGFMT@#${INTLTOOL_MSGFMT}#g' \
-               -e 's#@INTLTOOL_MSGMERGE@#${INTLTOOL_MSGMERGE}#g' \
-               -e 's#@INTLTOOL_XGETTEXT@#${INTLTOOL_XGETTEXT}#g' \
-               -e 's#@INTLTOOL_PERL@#${INTLTOOL_PERL}#g'"
+for file in intltool-extract intltool-merge intltool-update; do
+  sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
+      -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
+      -e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
+      -e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
+      -e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
+      -e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
+      -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
+	< ${ac_aux_dir}/${file}.in > ${file}.out
+  if cmp -s ${file} ${file}.out 2>/dev/null; then
+    rm -f ${file}.out
+  else
+    mv -f ${file}.out ${file}
+  fi
+  chmod ugo+x ${file}
+  chmod u+w ${file}
+done
 
-eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-extract.in \
-  > intltool-extract.out
-if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
-  rm -f intltool-extract.out
-else
-  mv -f intltool-extract.out intltool-extract
-fi
-chmod ugo+x intltool-extract
-chmod u+w intltool-extract
-
-eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-merge.in \
-  > intltool-merge.out
-if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
-  rm -f intltool-merge.out
-else
-  mv -f intltool-merge.out intltool-merge
-fi
-chmod ugo+x intltool-merge
-chmod u+w intltool-merge
-
-eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-update.in \
-  > intltool-update.out
-if cmp -s intltool-update intltool-update.out 2>/dev/null; then
-  rm -f intltool-update.out
-else
-  mv -f intltool-update.out intltool-update
-fi
-chmod ugo+x intltool-update
-chmod u+w intltool-update
-
  ;;
-    default-1 ) case "$CONFIG_FILES" in *po/Makefile.in*)
+    "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*)
         sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
       esac ;;
+    "po/stamp-it":C)
+    rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp"
+    >"po/stamp-it.tmp"
+    sed '/^#/d
+	 s/^[[].*] *//
+	 /^[ 	]*$/d
+	'"s|^|	$ac_top_srcdir/|" \
+      "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES"
+
+    if test ! -f "po/Makefile"; then
+      { { echo "$as_me:$LINENO: error: po/Makefile is not ready." >&5
+echo "$as_me: error: po/Makefile is not ready." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    mv "po/Makefile" "po/Makefile.tmp"
+    sed '/^POTFILES =/,/[^\\]$/ {
+		/^POTFILES =/!d
+		r po/POTFILES
+	  }
+	 ' "po/Makefile.tmp" >"po/Makefile"
+    rm -f "po/Makefile.tmp"
+    mv "po/stamp-it.tmp" "po/stamp-it"
+   ;;
+
   esac
-done
-_ACEOF
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
 { (exit 0); exit 0; }
 _ACEOF
@@ -23389,3 +24759,20 @@
   $ac_cs_success || { (exit 1); exit 1; }
 fi
 
+
+echo "
+Configuration for $PACKAGE $VERSION :
+--------------------------------
+
+ Host System Type .....: $host
+ Install path .........: $prefix
+ Preprocessor .........: $CC $CPPFLAGS
+ Compiler .............: $CC $CFLAGS $PACKAGE_CFLAGS
+ Linker ...............: $CC $LDFLAGS $LIBS $PACKAGE_LIBS
+ ArtworkDB support ....: $have_gdkpixbuf
+ Python bindings ......: $with_python
+
+ Now type 'make' to build $PACKAGE $VERSION,
+ and then 'make install' for installation.
+"
+

Modified: libgpod/branches/upstream/current/configure.ac
===================================================================
--- libgpod/branches/upstream/current/configure.ac	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/configure.ac	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,6 +1,7 @@
 AC_PREREQ(2.52)
 AC_INIT(src)
 AC_CONFIG_SRCDIR(configure.ac)
+AC_CONFIG_MACRO_DIR(m4)
 
 AM_CONFIG_HEADER(config.h)
 
@@ -12,8 +13,8 @@
 # set LIBGPOD_BINARY_AGE and LIBGPOD_INTERFACE_AGE to 0.
 #
 LIBGPOD_MAJOR_VERSION=0
-LIBGPOD_MINOR_VERSION=3
-LIBGPOD_MICRO_VERSION=2
+LIBGPOD_MINOR_VERSION=4
+LIBGPOD_MICRO_VERSION=0
 LIBGPOD_INTERFACE_AGE=0
 # If you need a modifier for the version number. 
 # Normally empty, but can be used to make "fixup" releases.
@@ -54,48 +55,38 @@
 LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS -Wall"
 
 dnl **************************************************
-dnl * GDKPIXBUF is optional
+dnl * TagLib is only used by test-rebuild-db 
 dnl **************************************************
-AH_TEMPLATE([HAVE_GDKPIXBUF], [Whether gdk-pixbuf is installed, ArtworkDB writing support will be disabled if it can't be found])
-PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0, have_gdkpixbuf=yes, have_gdkpibux=no)
-AM_CONDITIONAL(HAVE_GDKPIXBUF, test x"$have_gdkpixbuf" = xyes)
-if test x"$have_gdkpixbuf" = xyes; then
-   AC_DEFINE_UNQUOTED(HAVE_GDKPIXBUF, 1)
+PKG_CHECK_MODULES(TAGLIB, taglib, have_taglib=yes, have_taglib=no)
+if test x"$have_taglib" = xyes; then
+   AH_TEMPLATE([HAVE_TAGLIB], [Whether TagLib is installed, it's only used in a test program])
+   AC_DEFINE_UNQUOTED(HAVE_TAGLIB, 1)
 fi
-LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $GDKPIXBUF_CFLAGS"
-LIBGPOD_LIBS="$LIBGPOD_LIBS $GDKPIXBUF_LIBS"
+AC_SUBST(TAGLIB_CFLAGS)
+AC_SUBST(TAGLIB_LIBS)
+AM_CONDITIONAL(HAVE_TAGLIB, test x"$have_taglib" = xyes)
 
-dnl **************************************************
-dnl * hal is optional
-dnl **************************************************
 
-PKG_CHECK_MODULES(HAL, dbus-1 dbus-glib-1 hal >= 0.5.2 hal < 0.6, enable_hal05=yes, enable_hal05=no)
-if test x$enable_hal05 == xyes; then
-   AC_DEFINE_UNQUOTED(HAVE_LIBHAL, 1, [Whether HAL is available or not])
-fi
-LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $HAL_CFLAGS"
-LIBGPOD_LIBS="$LIBGPOD_LIBS $HAL_LIBS"
-
 dnl **************************************************
-dnl * necessary for the HAL libipoddevice code
+dnl * GDKPIXBUF is optional
 dnl **************************************************
-AC_PATH_PROG(EJECT_PATH, eject, eject)
-AC_PATH_PROG(UNMOUNT_PATH, pumount, no)
 
-if test "x$UNMOUNT_PATH" = "xno"; then
-	AC_PATH_PROG(UNMOUNT_PATH_ALT, umount, umount)
-	UNMOUNT_PATH=$UNMOUNT_PATH_ALT
+AC_ARG_ENABLE(gdk-pixbuf, [AC_HELP_STRING([--disable-gdk-pixbuf],[ArtworkDB will be disabled without gdk-pixbuf])], 
+[case "${enableval}" in
+  no) have_gdkpixbuf=no ;;
+  *) have_gdkpixbuf=yes;;
+esac], have_gdkpixbuf=yes)
+AH_TEMPLATE([HAVE_GDKPIXBUF], [Whether gdk-pixbuf is installed, ArtworkDB writing support will be disabled if it can't be found])
+if test x$have_gdkpixbuf = xyes; then
+   PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0, have_gdkpixbuf=yes, have_gdkpixbuf=no)
+   if test x"$have_gdkpixbuf" = xyes; then
+      AC_DEFINE_UNQUOTED(HAVE_GDKPIXBUF, 1)
+   fi
+   LIBGPOD_CFLAGS="$LIBGPOD_CFLAGS $GDKPIXBUF_CFLAGS"
+   LIBGPOD_LIBS="$LIBGPOD_LIBS $GDKPIXBUF_LIBS"
 fi
-  
-AC_ARG_WITH(eject-command, AC_HELP_STRING(--with-eject-command], [Command to invoke in order to eject a device]), 
-              eject_command="$withval", eject_command="${EJECT_PATH} %d")
-AC_DEFINE_UNQUOTED([EJECT_COMMAND], ["${eject_command}"], [eject command])
+AM_CONDITIONAL(HAVE_GDKPIXBUF, test x"$have_gdkpixbuf" = xyes)
 
-AC_ARG_WITH(unmount-command, AC_HELP_STRING(--with-unmount-command], [Command to invoke in order to unmount a device]), 
-              unmount_command="$withval", unmount_command="${UNMOUNT_PATH} %d")
-AC_DEFINE_UNQUOTED([UNMOUNT_COMMAND], ["${unmount_command}"], [unmount command])
-
-
 dnl **************************************************
 dnl * internationalization support
 dnl **************************************************
@@ -108,6 +99,21 @@
 AM_GLIB_GNU_GETTEXT
 
 
+dnl **************************************************
+dnl * gtk-doc
+dnl **************************************************
+GTK_DOC_CHECK(1.0)
+
+dnl **************************************************
+dnl * optional python bindings
+dnl **************************************************
+
+PYTHON_MIN_VERSION=2.1.1
+PYTHON_EYED3_MIN_VERSION=0.6.6
+SWIG_MIN_VERSION=1.3.24
+LIBGPOD_CHECK_PYTHON($PYTHON_MIN_VERSION)
+
+
 dnl warnings bits, copied from gnome-keyring configure.in
 dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
 
@@ -158,8 +164,32 @@
 
 AC_OUTPUT([
 Makefile
+bindings/Makefile
+bindings/python/Makefile
+bindings/python/examples/Makefile
+docs/Makefile
+docs/reference/Makefile
+docs/reference/version.xml
+m4/Makefile
 po/Makefile.in
 src/Makefile
 tests/Makefile
 libgpod-1.0.pc
 ])
+
+echo "
+Configuration for $PACKAGE $VERSION :
+--------------------------------
+
+ Host System Type .....: $host
+ Install path .........: $prefix
+ Preprocessor .........: $CC $CPPFLAGS
+ Compiler .............: $CC $CFLAGS $PACKAGE_CFLAGS
+ Linker ...............: $CC $LDFLAGS $LIBS $PACKAGE_LIBS
+ ArtworkDB support ....: $have_gdkpixbuf
+ Python bindings ......: $with_python
+
+ Now type 'make' to build $PACKAGE $VERSION,
+ and then 'make install' for installation.
+"
+

Added: libgpod/branches/upstream/current/docs/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/docs/Makefile.am	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1 @@
+SUBDIRS=reference

Added: libgpod/branches/upstream/current/docs/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/docs/Makefile.in	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,517 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
+GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
+HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_ICONV = @INTLTOOL_ICONV@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
+INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
+INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBGPOD_AGE = @LIBGPOD_AGE@
+LIBGPOD_CFLAGS = @LIBGPOD_CFLAGS@
+LIBGPOD_CURRENT = @LIBGPOD_CURRENT@
+LIBGPOD_LIBS = @LIBGPOD_LIBS@
+LIBGPOD_REVISION = @LIBGPOD_REVISION@
+LIBGPOD_VERSION = @LIBGPOD_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = reference
+subdir = docs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+	ps-recursive install-info-recursive uninstall-info-recursive \
+	all-recursive install-data-recursive install-exec-recursive \
+	installdirs-recursive install-recursive uninstall-recursive \
+	check-recursive installcheck-recursive
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+DIST_SUBDIRS = $(SUBDIRS)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  docs/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	else \
+	  include_option=--include; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d $(distdir)/$$subdir \
+	    || mkdir $(distdir)/$$subdir \
+	    || exit 1; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$(top_distdir)" \
+	        distdir=../$(distdir)/$$subdir \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
+	clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am \
+	dvi-recursive info info-am info-recursive install install-am \
+	install-data install-data-am install-data-recursive \
+	install-exec install-exec-am install-exec-recursive \
+	install-info install-info-am install-info-recursive install-man \
+	install-recursive install-strip installcheck installcheck-am \
+	installdirs installdirs-am installdirs-recursive \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
+	pdf-recursive ps ps-am ps-recursive tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am \
+	uninstall-info-recursive uninstall-recursive
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: libgpod/branches/upstream/current/docs/reference/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/docs/reference/Makefile.am	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,78 @@
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=libgpod
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=../../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" 
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=$(top_srcdir)/src/*.h
+CFILE_GLOB=$(top_srcdir)/src/*.c
+
+# Header files to ignore when scanning.
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES=
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files=
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+INCLUDES=
+GTKDOC_LIBS=
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST += 

Added: libgpod/branches/upstream/current/docs/reference/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/docs/reference/Makefile.in	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,602 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+# -*- mode: makefile -*-
+
+####################################
+# Everything below here is generic #
+####################################
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
+GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
+HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_ICONV = @INTLTOOL_ICONV@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
+INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
+INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBGPOD_AGE = @LIBGPOD_AGE@
+LIBGPOD_CFLAGS = @LIBGPOD_CFLAGS@
+LIBGPOD_CURRENT = @LIBGPOD_CURRENT@
+LIBGPOD_LIBS = @LIBGPOD_LIBS@
+LIBGPOD_REVISION = @LIBGPOD_REVISION@
+LIBGPOD_VERSION = @LIBGPOD_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE = libgpod
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR = ../../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS = 
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" 
+SCAN_OPTIONS = 
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS = --sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS = 
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS = 
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB = $(top_srcdir)/src/*.h
+CFILE_GLOB = $(top_srcdir)/src/*.c
+
+# Header files to ignore when scanning.
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES = 
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES = 
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files = 
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files = 
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+INCLUDES = 
+GTKDOC_LIBS = 
+ at GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
+
+ at GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
+ at GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+ at GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+
+# We set GPATH here; this gives us semantics for GNU make
+# which are more like other make's VPATH, when it comes to
+# whether a source that is a target of one rule is then
+# searched for in VPATH/GPATH.
+#
+GPATH = $(srcdir)
+
+TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)
+
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST = \
+	$(content_files)		\
+	$(HTML_IMAGES)			\
+	$(DOC_MAIN_SGML_FILE)		\
+	$(DOC_MODULE)-sections.txt	\
+	$(DOC_MODULE)-overrides.txt\
+
+
+DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
+	   $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
+
+
+SCANOBJ_FILES = \
+	$(DOC_MODULE).args 	 \
+	$(DOC_MODULE).hierarchy  \
+	$(DOC_MODULE).interfaces \
+	$(DOC_MODULE).prerequisites \
+	$(DOC_MODULE).signals
+
+
+CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
+subdir = docs/reference
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = version.xml
+DIST_SOURCES =
+DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/gtk-doc.make \
+	Makefile.am version.xml.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/gtk-doc.make $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  docs/reference/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+version.xml: $(top_builddir)/config.status version.xml.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ../..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	$(mkinstalldirs) $(distdir)/../..
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
+	  dist-hook
+check-am: all-am
+check: check-am
+all-am: Makefile all-local
+
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+	maintainer-clean-local
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-local
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+	clean-libtool clean-local distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am info info-am install \
+	install-am install-data install-data-am install-data-local \
+	install-exec install-exec-am install-info install-info-am \
+	install-man install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	maintainer-clean-local mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am uninstall-local
+
+
+ at ENABLE_GTK_DOC_TRUE@all-local: html-build.stamp
+ at ENABLE_GTK_DOC_FALSE@all-local:
+
+docs: html-build.stamp
+
+#### scan ####
+
+scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
+	@echo 'gtk-doc: Scanning header files'
+	@-chmod -R u+w $(srcdir)
+	if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
+	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+	else \
+	    cd $(srcdir) ; \
+	    for i in $(SCANOBJ_FILES) ; do \
+               test -f $$i || touch $$i ; \
+	    done \
+	fi
+	cd $(srcdir) && \
+	  gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
+	touch scan-build.stamp
+
+$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
+	@true
+
+#### templates ####
+
+tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+	@echo 'gtk-doc: Rebuilding template files'
+	@-chmod -R u+w $(srcdir)
+	cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+	touch tmpl-build.stamp
+
+tmpl.stamp: tmpl-build.stamp
+	@true
+
+#### xml ####
+
+sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
+	@echo 'gtk-doc: Building XML'
+	@-chmod -R u+w $(srcdir)
+	cd $(srcdir) && \
+	gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
+	touch sgml-build.stamp
+
+sgml.stamp: sgml-build.stamp
+	@true
+
+#### html ####
+
+html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+	@echo 'gtk-doc: Building HTML'
+	@-chmod -R u+w $(srcdir)
+	rm -rf $(srcdir)/html 
+	mkdir $(srcdir)/html
+	cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+	test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
+	@echo 'gtk-doc: Fixing cross-references' 
+	cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	touch html-build.stamp
+
+##############
+
+clean-local:
+	rm -f *~ *.bak
+	rm -rf .libs
+
+maintainer-clean-local: clean
+	cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+
+install-data-local:
+	installfiles=`echo $(srcdir)/html/*`; \
+	if test "$$installfiles" = '$(srcdir)/html/*'; \
+	then echo '-- Nothing to install' ; \
+	else \
+	  $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
+	  for i in $$installfiles; do \
+	    echo '-- Installing '$$i ; \
+	    $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
+	  done; \
+	  echo '-- Installing $(srcdir)/html/index.sgml' ; \
+	  $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
+	fi
+
+uninstall-local:
+	rm -f $(DESTDIR)$(TARGET_DIR)/*
+
+#
+# Require gtk-doc when making dist
+#
+ at ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc:
+ at ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc:
+ at ENABLE_GTK_DOC_FALSE@	@echo "*** gtk-doc must be installed and enabled in order to make dist"
+ at ENABLE_GTK_DOC_FALSE@	@false
+
+dist-hook: dist-check-gtkdoc dist-hook-local
+	mkdir $(distdir)/tmpl
+	mkdir $(distdir)/xml
+	mkdir $(distdir)/html
+	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
+	-cp $(srcdir)/xml/*.xml $(distdir)/xml
+	-cp $(srcdir)/html/* $(distdir)/html
+	if test -f $(srcdir)/$(DOC_MODULE).types; then \
+	  cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \
+	fi
+
+.PHONY : dist-hook-local docs
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: libgpod/branches/upstream/current/docs/reference/html/ch01.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/ch01.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/ch01.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>iPod database</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="index.html" title="libgpod Reference Manual">
+<link rel="prev" href="index.html" title="libgpod Reference Manual">
+<link rel="next" href="libgpod-The-Itdb-iTunesDB-structure.html" title="iPod database reading/writing">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
+<td><a accesskey="p" href="index.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td>&#160;</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-The-Itdb-iTunesDB-structure.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr></table>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="id2546593"></a>iPod database</h2></div></div></div>
+<div class="toc"><dl>
+<dt>
+<span class="refentrytitle"><a href="libgpod-The-Itdb-iTunesDB-structure.html">iPod database reading/writing</a></span><span class="refpurpose"> &#8212; Functions to create, read, write the iPod database</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-File-handling-functions.html">File handling functions</a></span><span class="refpurpose"> &#8212; Functions to copy new files to the iPod</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Time-handling.html">Time handling</a></span><span class="refpurpose"> &#8212; Helper functions to convert between Epoch time and Mac (iPod) time</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Low-level-functions.html">Low-level functions</a></span><span class="refpurpose"> &#8212; Low-level functions which shouldn't be needed in normal situations</span>
+</dt>
+</dl></div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/ch02.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/ch02.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/ch02.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>iPod database components</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="index.html" title="libgpod Reference Manual">
+<link rel="prev" href="libgpod-Low-level-functions.html" title="Low-level functions">
+<link rel="next" href="libgpod-Tracks.html" title="Tracks">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
+<td><a accesskey="p" href="libgpod-Low-level-functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td>&#160;</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-Tracks.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr></table>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="id2510305"></a>iPod database components</h2></div></div></div>
+<div class="toc"><dl>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Tracks.html">Tracks</a></span><span class="refpurpose"> &#8212; Data structure to store metadata about an iPod track</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Playlists.html">Playlists</a></span><span class="refpurpose"> &#8212; Data structure to represent an iPod playlist</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Artwork.html">Artwork</a></span><span class="refpurpose"> &#8212; Data structure to store iPod artwork (cover and photos)</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Device.html">Device</a></span><span class="refpurpose"> &#8212; Data structure holding information about the iPod (model, mount point, ...)</span>
+</dt>
+</dl></div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/home.png
===================================================================
(Binary files differ)


Property changes on: libgpod/branches/upstream/current/docs/reference/html/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: libgpod/branches/upstream/current/docs/reference/html/index.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/index.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/index.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>libgpod Reference Manual</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<meta name="description" content="This manual documents the interfaces of the libgpod library and has some short notes to help get you up to speed with using the library.">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="next" href="ch01.html" title="iPod database">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en">
+<div class="titlepage">
+<div>
+<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">libgpod Reference Manual</p></th></tr></table></div>
+<div><div class="authorgroup">
+<div class="author">
+<h3 class="author">
+<span class="firstname">Jorg</span> <span class="surname">Schuler</span>
+</h3>
+<div class="affiliation"><div class="address"><p><br>
+	&#160;&#160;&#160;&#160;<code class="email">&lt;<a href="mailto:jorg.schuler at gmx.de">jorg.schuler at gmx.de</a>&gt;</code><br>
+	&#160;&#160;</p></div></div>
+</div>
+<div class="author">
+<h3 class="author">
+<span class="firstname">Christophe</span> <span class="surname">Fergeau</span>
+</h3>
+<div class="affiliation"><div class="address"><p><br>
+	&#160;&#160;&#160;&#160;<code class="email">&lt;<a href="mailto:teuf at gnome.org">teuf at gnome.org</a>&gt;</code><br>
+	&#160;&#160;</p></div></div>
+</div>
+</div></div>
+<div><p class="releaseinfo">for libgpod <span>0.3.3</span></p></div>
+<div><p class="copyright">Copyright &#169; 2006 Christophe Fergeau</p></div>
+<div><div class="legalnotice">
+<a name="id2515455"></a><p>Permission is granted to copy, distribute and/or modify
+      this document under the terms of the <em class="citetitle">GNU Free
+      Documentation License</em>, Version 1.1 or any later
+      version published by the Free Software Foundation with no
+      Invariant Sections, no Front-Cover Texts, and no Back-Cover
+      Texts. You may obtain a copy of the <em class="citetitle">GNU Free
+      Documentation License</em> from the Free Software
+      Foundation by visiting <a href="http://www.fsf.org" target="_top">their Web site</a> or by writing
+      to: Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+      Boston, MA 02111-1307, USA.</p>
+<p>Many of the names used by companies to distinguish their
+      products and services are claimed as trademarks. Where those
+      names appear in any GNOME documentation, and those trademarks
+      are made aware to the members of the GNOME Documentation
+      Project, the names have been printed in caps or initial
+      caps.</p>
+</div></div>
+<div><div class="abstract">
+<p class="title"><b>Abstract</b></p>
+<p>This manual documents the interfaces of the libgpod
+      library and has some short notes to help get you up to speed
+      with using the library.</p>
+</div></div>
+</div>
+<hr>
+</div>
+<div class="toc"><dl>
+<dt><span class="chapter"><a href="ch01.html">iPod database</a></span></dt>
+<dd><dl>
+<dt>
+<span class="refentrytitle"><a href="libgpod-The-Itdb-iTunesDB-structure.html">iPod database reading/writing</a></span><span class="refpurpose"> &#8212; Functions to create, read, write the iPod database</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-File-handling-functions.html">File handling functions</a></span><span class="refpurpose"> &#8212; Functions to copy new files to the iPod</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Time-handling.html">Time handling</a></span><span class="refpurpose"> &#8212; Helper functions to convert between Epoch time and Mac (iPod) time</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Low-level-functions.html">Low-level functions</a></span><span class="refpurpose"> &#8212; Low-level functions which shouldn't be needed in normal situations</span>
+</dt>
+</dl></dd>
+<dt><span class="chapter"><a href="ch02.html">iPod database components</a></span></dt>
+<dd><dl>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Tracks.html">Tracks</a></span><span class="refpurpose"> &#8212; Data structure to store metadata about an iPod track</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Playlists.html">Playlists</a></span><span class="refpurpose"> &#8212; Data structure to represent an iPod playlist</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Artwork.html">Artwork</a></span><span class="refpurpose"> &#8212; Data structure to store iPod artwork (cover and photos)</span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="libgpod-Device.html">Device</a></span><span class="refpurpose"> &#8212; Data structure holding information about the iPod (model, mount point, ...)</span>
+</dt>
+</dl></dd>
+</dl></div>
+</div></body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/index.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/index.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/index.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,106 @@
+<ANCHOR id="libgpod-The-Itdb-iTunesDB-structure" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html">
+<ANCHOR id="Itdb-iTunesDB" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">
+<ANCHOR id="ItdbUserDataDestroyFunc" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc">
+<ANCHOR id="ItdbUserDataDuplicateFunc" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc">
+<ANCHOR id="itdb-new" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-new">
+<ANCHOR id="itdb-free" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-free">
+<ANCHOR id="itdb-parse" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse">
+<ANCHOR id="itdb-write" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-write">
+<ANCHOR id="itdb-set-mountpoint" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-set-mountpoint">
+<ANCHOR id="itdb-get-mountpoint" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-get-mountpoint">
+<ANCHOR id="itdb-tracks-number" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number">
+<ANCHOR id="itdb-tracks-number-nontransferred" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number-nontransferred">
+<ANCHOR id="itdb-playlists-number" href="libgpod/libgpod-The-Itdb-iTunesDB-structure.html#itdb-playlists-number">
+<ANCHOR id="libgpod-File-handling-functions" href="libgpod/libgpod-File-handling-functions.html">
+<ANCHOR id="itdb-cp-track-to-ipod" href="libgpod/libgpod-File-handling-functions.html#itdb-cp-track-to-ipod">
+<ANCHOR id="itdb-filename-fs2ipod" href="libgpod/libgpod-File-handling-functions.html#itdb-filename-fs2ipod">
+<ANCHOR id="itdb-filename-ipod2fs" href="libgpod/libgpod-File-handling-functions.html#itdb-filename-ipod2fs">
+<ANCHOR id="itdb-filename-on-ipod" href="libgpod/libgpod-File-handling-functions.html#itdb-filename-on-ipod">
+<ANCHOR id="itdb-musicdirs-number" href="libgpod/libgpod-File-handling-functions.html#itdb-musicdirs-number">
+<ANCHOR id="itdb-rename-files" href="libgpod/libgpod-File-handling-functions.html#itdb-rename-files">
+<ANCHOR id="libgpod-Time-handling" href="libgpod/libgpod-Time-handling.html">
+<ANCHOR id="itdb-time-get-mac-time" href="libgpod/libgpod-Time-handling.html#itdb-time-get-mac-time">
+<ANCHOR id="itdb-time-mac-to-host" href="libgpod/libgpod-Time-handling.html#itdb-time-mac-to-host">
+<ANCHOR id="itdb-time-host-to-mac" href="libgpod/libgpod-Time-handling.html#itdb-time-host-to-mac">
+<ANCHOR id="libgpod-Low-level-functions" href="libgpod/libgpod-Low-level-functions.html">
+<ANCHOR id="itdb-get-control-dir" href="libgpod/libgpod-Low-level-functions.html#itdb-get-control-dir">
+<ANCHOR id="itdb-get-itunes-dir" href="libgpod/libgpod-Low-level-functions.html#itdb-get-itunes-dir">
+<ANCHOR id="itdb-get-music-dir" href="libgpod/libgpod-Low-level-functions.html#itdb-get-music-dir">
+<ANCHOR id="itdb-get-artwork-dir" href="libgpod/libgpod-Low-level-functions.html#itdb-get-artwork-dir">
+<ANCHOR id="itdb-get-device-dir" href="libgpod/libgpod-Low-level-functions.html#itdb-get-device-dir">
+<ANCHOR id="itdb-get-itunesdb-path" href="libgpod/libgpod-Low-level-functions.html#itdb-get-itunesdb-path">
+<ANCHOR id="itdb-get-artworkdb-path" href="libgpod/libgpod-Low-level-functions.html#itdb-get-artworkdb-path">
+<ANCHOR id="itdb-get-path" href="libgpod/libgpod-Low-level-functions.html#itdb-get-path">
+<ANCHOR id="itdb-resolve-path" href="libgpod/libgpod-Low-level-functions.html#itdb-resolve-path">
+<ANCHOR id="itdb-shuffle-write" href="libgpod/libgpod-Low-level-functions.html#itdb-shuffle-write">
+<ANCHOR id="itdb-shuffle-write-file" href="libgpod/libgpod-Low-level-functions.html#itdb-shuffle-write-file">
+<ANCHOR id="itdb-cp" href="libgpod/libgpod-Low-level-functions.html#itdb-cp">
+<ANCHOR id="itdb-parse-file" href="libgpod/libgpod-Low-level-functions.html#itdb-parse-file">
+<ANCHOR id="itdb-write-file" href="libgpod/libgpod-Low-level-functions.html#itdb-write-file">
+<ANCHOR id="itdb-duplicate" href="libgpod/libgpod-Low-level-functions.html#itdb-duplicate">
+<ANCHOR id="libgpod-Tracks" href="libgpod/libgpod-Tracks.html">
+<ANCHOR id="Itdb-Track" href="libgpod/libgpod-Tracks.html#Itdb-Track">
+<ANCHOR id="itdb-track-new" href="libgpod/libgpod-Tracks.html#itdb-track-new">
+<ANCHOR id="itdb-track-free" href="libgpod/libgpod-Tracks.html#itdb-track-free">
+<ANCHOR id="itdb-track-add" href="libgpod/libgpod-Tracks.html#itdb-track-add">
+<ANCHOR id="itdb-track-remove" href="libgpod/libgpod-Tracks.html#itdb-track-remove">
+<ANCHOR id="itdb-track-unlink" href="libgpod/libgpod-Tracks.html#itdb-track-unlink">
+<ANCHOR id="itdb-track-duplicate" href="libgpod/libgpod-Tracks.html#itdb-track-duplicate">
+<ANCHOR id="itdb-track-by-id" href="libgpod/libgpod-Tracks.html#itdb-track-by-id">
+<ANCHOR id="itdb-track-id-tree-create" href="libgpod/libgpod-Tracks.html#itdb-track-id-tree-create">
+<ANCHOR id="itdb-track-id-tree-destroy" href="libgpod/libgpod-Tracks.html#itdb-track-id-tree-destroy">
+<ANCHOR id="itdb-track-id-tree-by-id" href="libgpod/libgpod-Tracks.html#itdb-track-id-tree-by-id">
+<ANCHOR id="itdb-track-set-thumbnails" href="libgpod/libgpod-Tracks.html#itdb-track-set-thumbnails">
+<ANCHOR id="itdb-track-remove-thumbnails" href="libgpod/libgpod-Tracks.html#itdb-track-remove-thumbnails">
+<ANCHOR id="ITDB-RATING-STEP:CAPS" href="libgpod/libgpod-Tracks.html#ITDB-RATING-STEP:CAPS">
+<ANCHOR id="libgpod-Playlists" href="libgpod/libgpod-Playlists.html">
+<ANCHOR id="Itdb-Playlist" href="libgpod/libgpod-Playlists.html#Itdb-Playlist">
+<ANCHOR id="ItdbPlaylistSortOrder" href="libgpod/libgpod-Playlists.html#ItdbPlaylistSortOrder">
+<ANCHOR id="itdb-playlist-new" href="libgpod/libgpod-Playlists.html#itdb-playlist-new">
+<ANCHOR id="itdb-playlist-free" href="libgpod/libgpod-Playlists.html#itdb-playlist-free">
+<ANCHOR id="itdb-playlist-duplicate" href="libgpod/libgpod-Playlists.html#itdb-playlist-duplicate">
+<ANCHOR id="itdb-playlist-add" href="libgpod/libgpod-Playlists.html#itdb-playlist-add">
+<ANCHOR id="itdb-playlist-move" href="libgpod/libgpod-Playlists.html#itdb-playlist-move">
+<ANCHOR id="itdb-playlist-remove" href="libgpod/libgpod-Playlists.html#itdb-playlist-remove">
+<ANCHOR id="itdb-playlist-unlink" href="libgpod/libgpod-Playlists.html#itdb-playlist-unlink">
+<ANCHOR id="itdb-playlist-add-track" href="libgpod/libgpod-Playlists.html#itdb-playlist-add-track">
+<ANCHOR id="itdb-playlist-remove-track" href="libgpod/libgpod-Playlists.html#itdb-playlist-remove-track">
+<ANCHOR id="itdb-playlist-contains-track" href="libgpod/libgpod-Playlists.html#itdb-playlist-contains-track">
+<ANCHOR id="itdb-playlist-contain-track-number" href="libgpod/libgpod-Playlists.html#itdb-playlist-contain-track-number">
+<ANCHOR id="itdb-playlist-tracks-number" href="libgpod/libgpod-Playlists.html#itdb-playlist-tracks-number">
+<ANCHOR id="itdb-playlist-mpl" href="libgpod/libgpod-Playlists.html#itdb-playlist-mpl">
+<ANCHOR id="itdb-playlist-is-mpl" href="libgpod/libgpod-Playlists.html#itdb-playlist-is-mpl">
+<ANCHOR id="itdb-playlist-set-mpl" href="libgpod/libgpod-Playlists.html#itdb-playlist-set-mpl">
+<ANCHOR id="itdb-playlist-podcasts" href="libgpod/libgpod-Playlists.html#itdb-playlist-podcasts">
+<ANCHOR id="itdb-playlist-is-podcasts" href="libgpod/libgpod-Playlists.html#itdb-playlist-is-podcasts">
+<ANCHOR id="itdb-playlist-set-podcasts" href="libgpod/libgpod-Playlists.html#itdb-playlist-set-podcasts">
+<ANCHOR id="itdb-playlist-exists" href="libgpod/libgpod-Playlists.html#itdb-playlist-exists">
+<ANCHOR id="itdb-playlist-by-id" href="libgpod/libgpod-Playlists.html#itdb-playlist-by-id">
+<ANCHOR id="itdb-playlist-by-nr" href="libgpod/libgpod-Playlists.html#itdb-playlist-by-nr">
+<ANCHOR id="itdb-playlist-by-name" href="libgpod/libgpod-Playlists.html#itdb-playlist-by-name">
+<ANCHOR id="itdb-playlist-randomize" href="libgpod/libgpod-Playlists.html#itdb-playlist-randomize">
+<ANCHOR id="libgpod-Artwork" href="libgpod/libgpod-Artwork.html">
+<ANCHOR id="Itdb-Artwork" href="libgpod/libgpod-Artwork.html#Itdb-Artwork">
+<ANCHOR id="Itdb-Thumb" href="libgpod/libgpod-Artwork.html#Itdb-Thumb">
+<ANCHOR id="ItdbThumbType" href="libgpod/libgpod-Artwork.html#ItdbThumbType">
+<ANCHOR id="itdb-artwork-new" href="libgpod/libgpod-Artwork.html#itdb-artwork-new">
+<ANCHOR id="itdb-artwork-duplicate" href="libgpod/libgpod-Artwork.html#itdb-artwork-duplicate">
+<ANCHOR id="itdb-artwork-free" href="libgpod/libgpod-Artwork.html#itdb-artwork-free">
+<ANCHOR id="itdb-artwork-add-thumbnail" href="libgpod/libgpod-Artwork.html#itdb-artwork-add-thumbnail">
+<ANCHOR id="itdb-artwork-remove-thumbnail" href="libgpod/libgpod-Artwork.html#itdb-artwork-remove-thumbnail">
+<ANCHOR id="itdb-artwork-remove-thumbnails" href="libgpod/libgpod-Artwork.html#itdb-artwork-remove-thumbnails">
+<ANCHOR id="itdb-artwork-get-thumb-by-type" href="libgpod/libgpod-Artwork.html#itdb-artwork-get-thumb-by-type">
+<ANCHOR id="itdb-thumb-get-gdk-pixbuf" href="libgpod/libgpod-Artwork.html#itdb-thumb-get-gdk-pixbuf">
+<ANCHOR id="itdb-thumb-duplicate" href="libgpod/libgpod-Artwork.html#itdb-thumb-duplicate">
+<ANCHOR id="itdb-thumb-free" href="libgpod/libgpod-Artwork.html#itdb-thumb-free">
+<ANCHOR id="itdb-thumb-new" href="libgpod/libgpod-Artwork.html#itdb-thumb-new">
+<ANCHOR id="itdb-thumb-get-filename" href="libgpod/libgpod-Artwork.html#itdb-thumb-get-filename">
+<ANCHOR id="libgpod-Device" href="libgpod/libgpod-Device.html">
+<ANCHOR id="Itdb-Device" href="libgpod/libgpod-Device.html#Itdb-Device">
+<ANCHOR id="itdb-device-new" href="libgpod/libgpod-Device.html#itdb-device-new">
+<ANCHOR id="itdb-device-free" href="libgpod/libgpod-Device.html#itdb-device-free">
+<ANCHOR id="itdb-device-set-mountpoint" href="libgpod/libgpod-Device.html#itdb-device-set-mountpoint">
+<ANCHOR id="itdb-device-read-sysinfo" href="libgpod/libgpod-Device.html#itdb-device-read-sysinfo">
+<ANCHOR id="itdb-device-get-sysinfo" href="libgpod/libgpod-Device.html#itdb-device-get-sysinfo">
+<ANCHOR id="Itdb-IpodModel" href="libgpod/libgpod-Device.html#Itdb-IpodModel">
+<ANCHOR id="Itdb-ArtworkFormat" href="libgpod/libgpod-Device.html#Itdb-ArtworkFormat">

Added: libgpod/branches/upstream/current/docs/reference/html/left.png
===================================================================
(Binary files differ)


Property changes on: libgpod/branches/upstream/current/docs/reference/html/left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-Artwork.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-Artwork.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-Artwork.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,497 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Artwork</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch02.html" title="iPod database components">
+<link rel="prev" href="libgpod-Playlists.html" title="Playlists">
+<link rel="next" href="libgpod-Device.html" title="Device">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libgpod-Playlists.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-Device.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2566586" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2596749" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-Artwork"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2566586"></a><span class="refentrytitle">Artwork</span>
+</h2>
+<p>Artwork &#8212; Data structure to store iPod artwork (cover and photos)</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+            <a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a>;
+            <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>;
+enum        <a href="libgpod-Artwork.html#ItdbThumbType">ItdbThumbType</a>;
+<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a>* <a href="libgpod-Artwork.html#itdb-artwork-new">itdb_artwork_new</a>              (void);
+<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a>* <a href="libgpod-Artwork.html#itdb-artwork-duplicate">itdb_artwork_duplicate</a>        (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork);
+void        <a href="libgpod-Artwork.html#itdb-artwork-free">itdb_artwork_free</a>               (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork);
+gboolean    <a href="libgpod-Artwork.html#itdb-artwork-add-thumbnail">itdb_artwork_add_thumbnail</a>      (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork,
+                                             <a href="libgpod-Artwork.html#ItdbThumbType">ItdbThumbType</a> type,
+                                             const gchar *filename);
+void        <a href="libgpod-Artwork.html#itdb-artwork-remove-thumbnail">itdb_artwork_remove_thumbnail</a>   (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork,
+                                             <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);
+void        <a href="libgpod-Artwork.html#itdb-artwork-remove-thumbnails">itdb_artwork_remove_thumbnails</a>  (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork);
+<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>* <a href="libgpod-Artwork.html#itdb-artwork-get-thumb-by-type">itdb_artwork_get_thumb_by_type</a>  (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork,
+                                             <a href="libgpod-Artwork.html#ItdbThumbType">ItdbThumbType</a> type);
+gpointer    <a href="libgpod-Artwork.html#itdb-thumb-get-gdk-pixbuf">itdb_thumb_get_gdk_pixbuf</a>       (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);
+<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>* <a href="libgpod-Artwork.html#itdb-thumb-duplicate">itdb_thumb_duplicate</a>            (<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);
+void        <a href="libgpod-Artwork.html#itdb-thumb-free">itdb_thumb_free</a>                 (<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);
+<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>* <a href="libgpod-Artwork.html#itdb-thumb-new">itdb_thumb_new</a>                  (void);
+gchar*      <a href="libgpod-Artwork.html#itdb-thumb-get-filename">itdb_thumb_get_filename</a>         (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2596749"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2596764"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2596775"></a><h3>
+<a name="Itdb-Artwork"></a>Itdb_Artwork</h3>
+<a class="indexterm" name="id2596788"></a><pre class="programlisting">typedef struct {
+    GList *thumbnails;    /* list of Itdb_Thumbs */
+    guint32 artwork_size; /* Size in bytes of the original source image */
+    guint32 id;           /* Artwork id used by photoalbums, starts at
+			   * 0x40... libgpod will set this on sync. */
+    gint32 creation_date; /* Date the image was created */
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_Artwork;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2598292"></a><h3>
+<a name="Itdb-Thumb"></a>Itdb_Thumb</h3>
+<a class="indexterm" name="id2574183"></a><pre class="programlisting">typedef struct {
+    ItdbThumbType type;
+    gchar *filename;
+    guchar *image_data;      /* holds the thumbnail data of
+				non-transfered thumbnails when
+				filename == NULL */
+    gsize  image_data_len;   /* length of data */
+    guint32 offset;
+    guint32 size;
+    gint16 width;
+    gint16 height;
+    gint16 horizontal_padding;
+    gint16 vertical_padding;
+} Itdb_Thumb;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2596819"></a><h3>
+<a name="ItdbThumbType"></a>enum ItdbThumbType</h3>
+<a class="indexterm" name="id2596832"></a><pre class="programlisting">typedef enum { 
+    ITDB_THUMB_COVER_SMALL,
+    ITDB_THUMB_COVER_LARGE,
+    ITDB_THUMB_PHOTO_SMALL,
+    ITDB_THUMB_PHOTO_LARGE,
+    ITDB_THUMB_PHOTO_FULL_SCREEN,
+    ITDB_THUMB_PHOTO_TV_SCREEN
+} ItdbThumbType;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2596851"></a><h3>
+<a name="itdb-artwork-new"></a>itdb_artwork_new ()</h3>
+<a class="indexterm" name="id2596863"></a><pre class="programlisting"><a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a>* itdb_artwork_new              (void);</pre>
+<p>
+Creates a new <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a new <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a> to be freed with <a href="libgpod-Artwork.html#itdb-artwork-free"><code class="function">itdb_artwork_free()</code></a> when
+no longer needed
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2604688"></a><h3>
+<a name="itdb-artwork-duplicate"></a>itdb_artwork_duplicate ()</h3>
+<a class="indexterm" name="id2604699"></a><pre class="programlisting"><a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a>* itdb_artwork_duplicate        (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork);</pre>
+<p>
+Duplicates <em class="parameter"><code>artwork</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>artwork</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a new copy of <em class="parameter"><code>artwork</code></em>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2604777"></a><h3>
+<a name="itdb-artwork-free"></a>itdb_artwork_free ()</h3>
+<a class="indexterm" name="id2604789"></a><pre class="programlisting">void        itdb_artwork_free               (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork);</pre>
+<p>
+Frees memory used by <em class="parameter"><code>artwork</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>artwork</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2604850"></a><h3>
+<a name="itdb-artwork-add-thumbnail"></a>itdb_artwork_add_thumbnail ()</h3>
+<a class="indexterm" name="id2604861"></a><pre class="programlisting">gboolean    itdb_artwork_add_thumbnail      (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork,
+                                             <a href="libgpod-Artwork.html#ItdbThumbType">ItdbThumbType</a> type,
+                                             const gchar *filename);</pre>
+<p>
+Appends a thumbnail of type <em class="parameter"><code>type</code></em> to existing thumbnails in <em class="parameter"><code>artwork</code></em>. No 
+data is read from <em class="parameter"><code>filename</code></em> yet, the file will be when <em class="parameter"><code>artwork</code></em> is saved to
+disk. <em class="parameter"><code>filename</code></em> must still exist when that happens.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>artwork</code></em>&#160;:</span></td>
+<td> an <span class="type">Itdb_Thumbnail</span>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></td>
+<td> thumbnail size
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> image file to use to create the thumbnail
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if the thumbnail could be successfully added, FALSE
+otherwise
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2591189"></a><h3>
+<a name="itdb-artwork-remove-thumbnail"></a>itdb_artwork_remove_thumbnail ()</h3>
+<a class="indexterm" name="id2591201"></a><pre class="programlisting">void        itdb_artwork_remove_thumbnail   (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork,
+                                             <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);</pre>
+<p>
+Removes <em class="parameter"><code>thumb</code></em> from <em class="parameter"><code>artwork</code></em>. The memory used by <em class="parameter"><code>thumb</code></em> isn't freed.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>artwork</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>thumb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2591305"></a><h3>
+<a name="itdb-artwork-remove-thumbnails"></a>itdb_artwork_remove_thumbnails ()</h3>
+<a class="indexterm" name="id2591318"></a><pre class="programlisting">void        itdb_artwork_remove_thumbnails  (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork);</pre>
+<p>
+Removes all thumbnails from <em class="parameter"><code>artwork</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>artwork</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2591381"></a><h3>
+<a name="itdb-artwork-get-thumb-by-type"></a>itdb_artwork_get_thumb_by_type ()</h3>
+<a class="indexterm" name="id2591394"></a><pre class="programlisting"><a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>* itdb_artwork_get_thumb_by_type  (<a href="libgpod-Artwork.html#Itdb-Artwork">Itdb_Artwork</a> *artwork,
+                                             <a href="libgpod-Artwork.html#ItdbThumbType">ItdbThumbType</a> type);</pre>
+<p>
+Searches <em class="parameter"><code>artwork</code></em> for an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a> of type <em class="parameter"><code>type</code></em>.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>artwork</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Artwork"><span class="type">Itdb_Artwork</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>type</code></em>&#160;:</span></td>
+<td> type of the <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a> to retrieve
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a> of type <em class="parameter"><code>type</code></em>, or NULL if such a thumbnail couldn't
+be found
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2591523"></a><h3>
+<a name="itdb-thumb-get-gdk-pixbuf"></a>itdb_thumb_get_gdk_pixbuf ()</h3>
+<a class="indexterm" name="id2591535"></a><pre class="programlisting">gpointer    itdb_thumb_get_gdk_pixbuf       (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);</pre>
+<p>
+Converts <em class="parameter"><code>thumb</code></em> to a <a
+href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
+><span class="type">GdkPixbuf</span></a>.
+Since we want to have gdk-pixbuf dependency optional, a generic
+gpointer is returned which you have to cast to a <a
+href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
+><span class="type">GdkPixbuf</span></a> using 
+<code class="function">GDK_PIXBUF()</code> yourself.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>device</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>thumb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a <a
+href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
+><span class="type">GdkPixbuf</span></a> that must be unreffed with <a
+href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-refcounting.html#gdk-pixbuf-unref"
+><code class="function">gdk_pixbuf_unref()</code></a>
+after use, or NULL if the creation of the gdk-pixbuf failed or if 
+libgpod was compiled without gdk-pixbuf support.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2608220"></a><h3>
+<a name="itdb-thumb-duplicate"></a>itdb_thumb_duplicate ()</h3>
+<a class="indexterm" name="id2608230"></a><pre class="programlisting"><a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>* itdb_thumb_duplicate            (<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);</pre>
+<p>
+Duplicates the data contained in <em class="parameter"><code>thumb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>thumb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly allocated copy of <em class="parameter"><code>thumb</code></em> to be freed with 
+<a href="libgpod-Artwork.html#itdb-thumb-free"><code class="function">itdb_thumb_free()</code></a> after use
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2608308"></a><h3>
+<a name="itdb-thumb-free"></a>itdb_thumb_free ()</h3>
+<a class="indexterm" name="id2608318"></a><pre class="programlisting">void        itdb_thumb_free                 (<a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);</pre>
+<p>
+Frees the memory used by <em class="parameter"><code>thumb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>thumb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2608373"></a><h3>
+<a name="itdb-thumb-new"></a>itdb_thumb_new ()</h3>
+<a class="indexterm" name="id2608383"></a><pre class="programlisting"><a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a>* itdb_thumb_new                  (void);</pre>
+<p>
+Creates a new <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> newly allocated <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a> to be freed with <a href="libgpod-Artwork.html#itdb-thumb-free"><code class="function">itdb_thumb_free()</code></a>
+after use
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2608438"></a><h3>
+<a name="itdb-thumb-get-filename"></a>itdb_thumb_get_filename ()</h3>
+<a class="indexterm" name="id2608449"></a><pre class="programlisting">gchar*      itdb_thumb_get_filename         (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             <a href="libgpod-Artwork.html#Itdb-Thumb">Itdb_Thumb</a> *thumb);</pre>
+<p>
+Get filename of thumbnail. If it's a thumbnail on the iPod, return
+the full path to the ithmb file. Otherwise return the full path to
+the original file.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>device</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>thumb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Artwork.html#Itdb-Thumb"><span class="type">Itdb_Thumb</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> newly allocated string containing the absolute path to the 
+thumbnail file. 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-Device.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-Device.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-Device.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,272 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Device</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch02.html" title="iPod database components">
+<link rel="prev" href="libgpod-Artwork.html" title="Artwork">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libgpod-Artwork.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td>&#160;</td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2593802" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2602112" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-Device"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2593802"></a><span class="refentrytitle">Device</span>
+</h2>
+<p>Device &#8212; Data structure holding information about the iPod (model, mount point, ...)</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+            <a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a>;
+<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a>* <a href="libgpod-Device.html#itdb-device-new">itdb_device_new</a>                (void);
+void        <a href="libgpod-Device.html#itdb-device-free">itdb_device_free</a>                (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device);
+void        <a href="libgpod-Device.html#itdb-device-set-mountpoint">itdb_device_set_mountpoint</a>      (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             const gchar *mp);
+gboolean    <a href="libgpod-Device.html#itdb-device-read-sysinfo">itdb_device_read_sysinfo</a>        (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device);
+gchar*      <a href="libgpod-Device.html#itdb-device-get-sysinfo">itdb_device_get_sysinfo</a>         (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             const gchar *field);
+enum        <a href="libgpod-Device.html#Itdb-IpodModel">Itdb_IpodModel</a>;
+            <a href="libgpod-Device.html#Itdb-ArtworkFormat">Itdb_ArtworkFormat</a>;
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2602112"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2602128"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2602138"></a><h3>
+<a name="Itdb-Device"></a>Itdb_Device</h3>
+<a class="indexterm" name="id2602150"></a><pre class="programlisting">typedef struct {
+    gchar *mountpoint;    /* mountpoint of the iPod */
+    gint   musicdirs;     /* number of /iPod_Control/Music/F.. dirs */
+    guint  byte_order;    /* G_LITTLE_ENDIAN "regular" endianness 
+			   * G_BIG_ENDIAN "reversed" endianness (e.g. mobile
+			   * phone iTunesDBs)
+			   */
+    GHashTable *sysinfo;  /* hash with value/key pairs of all entries
+			   * in Device/SysInfo */
+    gboolean sysinfo_changed; /* Has the sysinfo hash been changed by
+				 the user (itdb_set_sysinfo) */
+} Itdb_Device;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2564681"></a><h3>
+<a name="itdb-device-new"></a>itdb_device_new ()</h3>
+<a class="indexterm" name="id2589961"></a><pre class="programlisting"><a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a>* itdb_device_new                (void);</pre>
+<p>
+Creates a new <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a> structure</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly allocated <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a> which must be freed with
+<a href="libgpod-Device.html#itdb-device-free"><code class="function">itdb_device_free()</code></a> when no longer needed
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2596116"></a><h3>
+<a name="itdb-device-free"></a>itdb_device_free ()</h3>
+<a class="indexterm" name="id2596129"></a><pre class="programlisting">void        itdb_device_free                (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device);</pre>
+<p>
+Frees memory used by <em class="parameter"><code>device</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>device</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2596189"></a><h3>
+<a name="itdb-device-set-mountpoint"></a>itdb_device_set_mountpoint ()</h3>
+<a class="indexterm" name="id2596200"></a><pre class="programlisting">void        itdb_device_set_mountpoint      (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             const gchar *mp);</pre>
+<p>
+Sets the mountpoint of <em class="parameter"><code>device</code></em> to <em class="parameter"><code>mp</code></em> and update the cached device 
+information (in particular, re-read the SysInfo file)</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>device</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mp</code></em>&#160;:</span></td>
+<td> the new mount point
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2605941"></a><h3>
+<a name="itdb-device-read-sysinfo"></a>itdb_device_read_sysinfo ()</h3>
+<a class="indexterm" name="id2605953"></a><pre class="programlisting">gboolean    itdb_device_read_sysinfo        (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device);</pre>
+<p>
+Reads the SysInfo file and stores information in device-&gt;sysinfo for
+later use.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>device</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if file could be read, FALSE otherwise 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606021"></a><h3>
+<a name="itdb-device-get-sysinfo"></a>itdb_device_get_sysinfo ()</h3>
+<a class="indexterm" name="id2606032"></a><pre class="programlisting">gchar*      itdb_device_get_sysinfo         (<a href="libgpod-Device.html#Itdb-Device">Itdb_Device</a> *device,
+                                             const gchar *field);</pre>
+<p>
+Retrieve specified field from the SysInfo file.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>device</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Device.html#Itdb-Device"><span class="type">Itdb_Device</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>field</code></em>&#160;:</span></td>
+<td> field to retrive information from
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the information associated with <em class="parameter"><code>field</code></em>, or NULL if <em class="parameter"><code>field</code></em>
+couldn't be found. <code class="function">g_free()</code> after use
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606140"></a><h3>
+<a name="Itdb-IpodModel"></a>enum Itdb_IpodModel</h3>
+<a class="indexterm" name="id2596279"></a><pre class="programlisting">typedef enum {
+    ITDB_IPOD_MODEL_INVALID,
+    ITDB_IPOD_MODEL_UNKNOWN,
+    ITDB_IPOD_MODEL_COLOR,
+    ITDB_IPOD_MODEL_COLOR_U2,
+    ITDB_IPOD_MODEL_REGULAR,
+    ITDB_IPOD_MODEL_REGULAR_U2,
+    ITDB_IPOD_MODEL_MINI,
+    ITDB_IPOD_MODEL_MINI_BLUE,
+    ITDB_IPOD_MODEL_MINI_PINK,
+    ITDB_IPOD_MODEL_MINI_GREEN,
+    ITDB_IPOD_MODEL_MINI_GOLD,
+    ITDB_IPOD_MODEL_SHUFFLE,
+    ITDB_IPOD_MODEL_NANO_WHITE,
+    ITDB_IPOD_MODEL_NANO_BLACK,
+    ITDB_IPOD_MODEL_VIDEO_WHITE,
+    ITDB_IPOD_MODEL_VIDEO_BLACK,
+    ITDB_IPOD_MODEL_MOBILE_1,
+    ITDB_IPOD_MODEL_VIDEO_U2,
+    ITDB_IPOD_MODEL_NANO_SILVER,
+    ITDB_IPOD_MODEL_NANO_BLUE,
+    ITDB_IPOD_MODEL_NANO_GREEN,
+    ITDB_IPOD_MODEL_NANO_PINK
+} Itdb_IpodModel;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2596307"></a><h3>
+<a name="Itdb-ArtworkFormat"></a>Itdb_ArtworkFormat</h3>
+<a class="indexterm" name="id2596319"></a><pre class="programlisting">typedef struct {
+	ItdbThumbType type;
+	gint16 width;
+	gint16 height;
+	gint16 correlation_id;
+} Itdb_ArtworkFormat;
+</pre>
+<p>
+
+</p>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-File-handling-functions.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-File-handling-functions.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-File-handling-functions.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,289 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>File handling functions</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch01.html" title="iPod database">
+<link rel="prev" href="libgpod-The-Itdb-iTunesDB-structure.html" title="iPod database reading/writing">
+<link rel="next" href="libgpod-Time-handling.html" title="Time handling">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libgpod-The-Itdb-iTunesDB-structure.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-Time-handling.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2585793" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2584218" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-File-handling-functions"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2585793"></a><span class="refentrytitle">File handling functions</span>
+</h2>
+<p>File handling functions &#8212; Functions to copy new files to the iPod</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+gboolean    <a href="libgpod-File-handling-functions.html#itdb-cp-track-to-ipod">itdb_cp_track_to_ipod</a>           (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             gchar *filename,
+                                             GError **error);
+void        <a href="libgpod-File-handling-functions.html#itdb-filename-fs2ipod">itdb_filename_fs2ipod</a>           (gchar *filename);
+void        <a href="libgpod-File-handling-functions.html#itdb-filename-ipod2fs">itdb_filename_ipod2fs</a>           (gchar *ipod_file);
+gchar*      <a href="libgpod-File-handling-functions.html#itdb-filename-on-ipod">itdb_filename_on_ipod</a>           (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+gint        <a href="libgpod-File-handling-functions.html#itdb-musicdirs-number">itdb_musicdirs_number</a>           (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+gboolean    <a href="libgpod-File-handling-functions.html#itdb-rename-files">itdb_rename_files</a>               (const gchar *mp,
+                                             GError **error);
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2584218"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2584233"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2584244"></a><h3>
+<a name="itdb-cp-track-to-ipod"></a>itdb_cp_track_to_ipod ()</h3>
+<a class="indexterm" name="id2584255"></a><pre class="programlisting">gboolean    itdb_cp_track_to_ipod           (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             gchar *filename,
+                                             GError **error);</pre>
+<p>
+Copy one track to the iPod. The PC filename is <em class="parameter"><code>filename</code></em>
+and is taken literally.
+</p>
+<p>
+The mountpoint of the iPod (in local encoding) is expected in
+track-&gt;itdb-&gt;mountpoint.
+</p>
+<p>
+If <em class="parameter"><code>track</code></em>-&gt;transferred is set to TRUE, nothing is done. Upon
+successful transfer <em class="parameter"><code>track</code></em>-&gt;transferred is set to TRUE.
+</p>
+<p>
+For storage, the directories "f00 ... fnn" will be
+cycled through.
+</p>
+<p>
+The filename is constructed as "gtkpod"&lt;random number&gt; and copied
+to <em class="parameter"><code>track</code></em>-&gt;ipod_path. If this file already exists, &lt;random number&gt;
+is adjusted until an unused filename is found.
+</p>
+<p>
+If <em class="parameter"><code>track</code></em>-&gt;ipod_path is already set, this one will be used
+instead. If a file with this name already exists, it will be
+overwritten.
+</p>
+<p>
+<em class="parameter"><code>track</code></em>-&gt;filetype_marker is set according to the filename extension</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> the <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a> to copy (containing <em class="parameter"><code>filename</code></em> metadata)
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> the source file
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em> is
+set accordingly.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2577564"></a><h3>
+<a name="itdb-filename-fs2ipod"></a>itdb_filename_fs2ipod ()</h3>
+<a class="indexterm" name="id2577576"></a><pre class="programlisting">void        itdb_filename_fs2ipod           (gchar *filename);</pre>
+<p>
+Convert string from casual PC file name to iPod iTunesDB format using ':' 
+instead of G_DIR_SEPARATOR_S (ie slashes on Unix-like systems). <em class="parameter"><code>ipod_file</code></em>
+is modified in place.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> a filename 'PC-style' (eg /iPod_Control/Music/f00/test.mp3)
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2577632"></a><h3>
+<a name="itdb-filename-ipod2fs"></a>itdb_filename_ipod2fs ()</h3>
+<a class="indexterm" name="id2577643"></a><pre class="programlisting">void        itdb_filename_ipod2fs           (gchar *ipod_file);</pre>
+<p>
+Convert string from from iPod iTunesDB format to casual PC file name
+using G_DIR_SEPARATOR (ie slashes on Unix-like systems) instead of ':'.
+<em class="parameter"><code>ipod_file</code></em> is modified in place.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>ipod_file</code></em>&#160;:</span></td>
+<td> a filename 'PC-style' (eg /iPod_Control/Music/f00/test.mp3)
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2577700"></a><h3>
+<a name="itdb-filename-on-ipod"></a>itdb_filename_on_ipod ()</h3>
+<a class="indexterm" name="id2577712"></a><pre class="programlisting">gchar*      itdb_filename_on_ipod           (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Return the full iPod filename as stored in <em class="parameter"><code>track</code></em>.
+</p>
+<p>
+NOTE: NULL is returned when the file does not exist.
+</p>
+<p>
+NOTE: this code works around a problem on some systems (see
+<a href="libgpod-Low-level-functions.html#itdb-resolve-path"><code class="function">itdb_resolve_path()</code></a> ) and might return a filename with different
+case than the original filename. Don't copy it back to <em class="parameter"><code>track</code></em>
+unless you must</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> full filename to <em class="parameter"><code>track</code></em> on the iPod or NULL if no
+filename is set in <em class="parameter"><code>track</code></em>. Must be freed with <code class="function">g_free()</code> after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2583255"></a><h3>
+<a name="itdb-musicdirs-number"></a>itdb_musicdirs_number ()</h3>
+<a class="indexterm" name="id2583266"></a><pre class="programlisting">gint        itdb_musicdirs_number           (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Determine the number of F.. directories in iPod_Control/Music.
+</p>
+<p>
+If itdb-&gt;musicdirs is already set, simply return the previously
+determined number. Otherwise count the directories first and set
+itdb-&gt;musicdirs.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> max number of directories in iPod_Control/Music
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2583341"></a><h3>
+<a name="itdb-rename-files"></a>itdb_rename_files ()</h3>
+<a class="indexterm" name="id2583354"></a><pre class="programlisting">gboolean    itdb_rename_files               (const gchar *mp,
+                                             GError **error);</pre>
+<p>
+Renames/removes some files on the iPod (Playcounts, OTG
+semaphore). May have to be called if you write the iTunesDB not
+directly to the iPod but to some other location and then manually
+copy the file from there to the iPod.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mp</code></em>&#160;:</span></td>
+<td> mount point of the iPod
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> FALSE on error and sets <em class="parameter"><code>error</code></em> accordingly
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-Low-level-functions.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-Low-level-functions.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-Low-level-functions.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,608 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Low-level functions</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch01.html" title="iPod database">
+<link rel="prev" href="libgpod-Time-handling.html" title="Time handling">
+<link rel="next" href="ch02.html" title="iPod database components">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libgpod-Time-handling.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="ch02.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2563835" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2572170" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-Low-level-functions"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2563835"></a><span class="refentrytitle">Low-level functions</span>
+</h2>
+<p>Low-level functions &#8212; Low-level functions which shouldn't be needed in normal situations</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-control-dir">itdb_get_control_dir</a>            (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-itunes-dir">itdb_get_itunes_dir</a>             (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-music-dir">itdb_get_music_dir</a>              (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-artwork-dir">itdb_get_artwork_dir</a>            (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-device-dir">itdb_get_device_dir</a>             (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-itunesdb-path">itdb_get_itunesdb_path</a>          (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-artworkdb-path">itdb_get_artworkdb_path</a>         (const gchar *mountpoint);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-get-path">itdb_get_path</a>                   (const gchar *dir,
+                                             const gchar *file);
+gchar*      <a href="libgpod-Low-level-functions.html#itdb-resolve-path">itdb_resolve_path</a>               (const gchar *root,
+                                             const gchar * const *components);
+gboolean    <a href="libgpod-Low-level-functions.html#itdb-shuffle-write">itdb_shuffle_write</a>              (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             GError **error);
+gboolean    <a href="libgpod-Low-level-functions.html#itdb-shuffle-write-file">itdb_shuffle_write_file</a>         (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             const gchar *filename,
+                                             GError **error);
+gboolean    <a href="libgpod-Low-level-functions.html#itdb-cp">itdb_cp</a>                         (const gchar *from_file,
+                                             const gchar *to_file,
+                                             GError **error);
+<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* <a href="libgpod-Low-level-functions.html#itdb-parse-file">itdb_parse_file</a>              (const gchar *filename,
+                                             GError **error);
+gboolean    <a href="libgpod-Low-level-functions.html#itdb-write-file">itdb_write_file</a>                 (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             const gchar *filename,
+                                             GError **error);
+<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* <a href="libgpod-Low-level-functions.html#itdb-duplicate">itdb_duplicate</a>               (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2572170"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2572186"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2572196"></a><h3>
+<a name="itdb-get-control-dir"></a>itdb_get_control_dir ()</h3>
+<a class="indexterm" name="id2572208"></a><pre class="programlisting">gchar*      itdb_get_control_dir            (const gchar *mountpoint);</pre>
+<p>
+Get the i*_Control directory. Observed values are 'iPod_Control'
+for standard iPods and 'iTunes/iTunes_Control' for mobile
+applications.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the control dir or NULL of non-existent. Must
+<code class="function">g_free()</code> after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2572280"></a><h3>
+<a name="itdb-get-itunes-dir"></a>itdb_get_itunes_dir ()</h3>
+<a class="indexterm" name="id2572292"></a><pre class="programlisting">gchar*      itdb_get_itunes_dir             (const gchar *mountpoint);</pre>
+<p>
+Retrieve the iTunes directory (containing the iTunesDB) by first
+calling <a href="libgpod-Low-level-functions.html#itdb-get-control-dir"><code class="function">itdb_get_control_dir()</code></a> and then adding 'iTunes'</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the iTunes directory or NULL of non-existent.
+Must <code class="function">g_free()</code> after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2572372"></a><h3>
+<a name="itdb-get-music-dir"></a>itdb_get_music_dir ()</h3>
+<a class="indexterm" name="id2572384"></a><pre class="programlisting">gchar*      itdb_get_music_dir              (const gchar *mountpoint);</pre>
+<p>
+Retrieve the Music directory (containing the Fnn dirs) by first
+calling <a href="libgpod-Low-level-functions.html#itdb-get-control-dir"><code class="function">itdb_get_control_dir()</code></a> and then adding 'Music'</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the Music directory or NULL of
+non-existent. Must <code class="function">g_free()</code> after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2593290"></a><h3>
+<a name="itdb-get-artwork-dir"></a>itdb_get_artwork_dir ()</h3>
+<a class="indexterm" name="id2593302"></a><pre class="programlisting">gchar*      itdb_get_artwork_dir            (const gchar *mountpoint);</pre>
+<p>
+Retrieve the Artwork directory (containing the ArtworDB) by
+first calling <a href="libgpod-Low-level-functions.html#itdb-get-control-dir"><code class="function">itdb_get_control_dir()</code></a> and then adding 'Artwork'</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the Artwork directory or NULL of
+non-existent. Must <code class="function">g_free()</code> after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2593382"></a><h3>
+<a name="itdb-get-device-dir"></a>itdb_get_device_dir ()</h3>
+<a class="indexterm" name="id2593394"></a><pre class="programlisting">gchar*      itdb_get_device_dir             (const gchar *mountpoint);</pre>
+<p>
+Retrieve the Device directory (containing the SysInfo file) by
+first calling <a href="libgpod-Low-level-functions.html#itdb-get-control-dir"><code class="function">itdb_get_control_dir()</code></a> and then adding 'Device'</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the Device directory or NULL of
+non-existent. Must <code class="function">g_free()</code> after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2593474"></a><h3>
+<a name="itdb-get-itunesdb-path"></a>itdb_get_itunesdb_path ()</h3>
+<a class="indexterm" name="id2593485"></a><pre class="programlisting">gchar*      itdb_get_itunesdb_path          (const gchar *mountpoint);</pre>
+<p>
+Retrieve a path to the iTunesDB</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the iTunesDB or NULL if non-existent. Must <code class="function">g_free()</code>
+after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601088"></a><h3>
+<a name="itdb-get-artworkdb-path"></a>itdb_get_artworkdb_path ()</h3>
+<a class="indexterm" name="id2601098"></a><pre class="programlisting">gchar*      itdb_get_artworkdb_path         (const gchar *mountpoint);</pre>
+<p>
+Retrieve a path to the ArtworkDB</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mountpoint</code></em>&#160;:</span></td>
+<td> the iPod mountpoint
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the ArtworkDB or NULL if non-existent. Must <code class="function">g_free()</code> 
+after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601161"></a><h3>
+<a name="itdb-get-path"></a>itdb_get_path ()</h3>
+<a class="indexterm" name="id2601171"></a><pre class="programlisting">gchar*      itdb_get_path                   (const gchar *dir,
+                                             const gchar *file);</pre>
+<p>
+Retrieve a path to the <em class="parameter"><code>file</code></em> in <em class="parameter"><code>dir</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>dir</code></em>&#160;:</span></td>
+<td> a directory
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>file</code></em>&#160;:</span></td>
+<td> a file
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> path to the <em class="parameter"><code>file</code></em> or NULL if non-existent. Must be <code class="function">g_free()</code>'d 
+after use.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601249"></a><h3>
+<a name="itdb-resolve-path"></a>itdb_resolve_path ()</h3>
+<a class="indexterm" name="id2601259"></a><pre class="programlisting">gchar*      itdb_resolve_path               (const gchar *root,
+                                             const gchar * const *components);</pre>
+<p>
+We start by assuming that the ipod mount point exists.  Then, for
+each component c of track-&gt;ipod_path, we try to find an entry d in
+good_path that is case-insensitively equal to c.  If we find d, we
+append d to good_path and make the result the new good_path.
+Otherwise, we quit and return NULL.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>root</code></em>&#160;:</span></td>
+<td> in local encoding
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>components</code></em>&#160;:</span></td>
+<td> in utf8
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td>
+
+
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601337"></a><h3>
+<a name="itdb-shuffle-write"></a>itdb_shuffle_write ()</h3>
+<a class="indexterm" name="id2601347"></a><pre class="programlisting">gboolean    itdb_shuffle_write              (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             GError **error);</pre>
+<p>
+Write out an iTunesSD for the Shuffle.
+First reassigns unique IDs to all tracks.
+An existing "Play Counts" file is renamed to "Play Counts.bak" if
+the export was successful.
+An existing "OTGPlaylistInfo" file is removed if the export was
+successful.
+<em class="parameter"><code>itdb-&gt;mountpoint</code></em> must point to the mount point of the iPod,
+e.g. "/mnt/ipod" and be in local encoding.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> to write to disk
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em> is
+set accordingly.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601448"></a><h3>
+<a name="itdb-shuffle-write-file"></a>itdb_shuffle_write_file ()</h3>
+<a class="indexterm" name="id2601459"></a><pre class="programlisting">gboolean    itdb_shuffle_write_file         (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             const gchar *filename,
+                                             GError **error);</pre>
+<p>
+Do the actual writing to the iTunesSD</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> to write to disk
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> file to write to, cannot be NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em> is
+set accordingly.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601568"></a><h3>
+<a name="itdb-cp"></a>itdb_cp ()</h3>
+<a class="indexterm" name="id2601578"></a><pre class="programlisting">gboolean    itdb_cp                         (const gchar *from_file,
+                                             const gchar *to_file,
+                                             GError **error);</pre>
+<p>
+Copy file "from_file" to "to_file".</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>from_file</code></em>&#160;:</span></td>
+<td> source file
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>to_file</code></em>&#160;:</span></td>
+<td> destination file
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em> is
+set accordingly.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601683"></a><h3>
+<a name="itdb-parse-file"></a>itdb_parse_file ()</h3>
+<a class="indexterm" name="id2601693"></a><pre class="programlisting"><a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* itdb_parse_file              (const gchar *filename,
+                                             GError **error);</pre>
+<p>
+Same as <code class="function">itunesdb_parse()</code>, but filename is specified directly.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> path to a file in iTunesDB format
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly allocated <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> struct holding the tracks and
+the playlists present on the iPod at <em class="parameter"><code>mp</code></em>, NULL if <em class="parameter"><code>mp</code></em> isn't an iPod mount
+point. If non-NULL, the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> is to be freed with <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free"><code class="function">itdb_free()</code></a> when
+it's no longer needed
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601815"></a><h3>
+<a name="itdb-write-file"></a>itdb_write_file ()</h3>
+<a class="indexterm" name="id2601826"></a><pre class="programlisting">gboolean    itdb_write_file                 (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             const gchar *filename,
+                                             GError **error);</pre>
+<p>
+Write the content of <em class="parameter"><code>itdb</code></em> to <em class="parameter"><code>filename</code></em>. If <em class="parameter"><code>filename</code></em> is NULL, it attempts
+to write to itdb-&gt;filename.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> to save
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> filename to save <em class="parameter"><code>itdb</code></em> to
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if all went well, FALSE otherwise
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2601952"></a><h3>
+<a name="itdb-duplicate"></a>itdb_duplicate ()</h3>
+<a class="indexterm" name="id2601962"></a><pre class="programlisting"><a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* itdb_duplicate               (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Duplicate <em class="parameter"><code>itdb</code></em> 
+FIXME: not implemented yet</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> always return NULL since it's unimplemented
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-Playlists.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-Playlists.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-Playlists.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,860 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Playlists</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch02.html" title="iPod database components">
+<link rel="prev" href="libgpod-Tracks.html" title="Tracks">
+<link rel="next" href="libgpod-Artwork.html" title="Artwork">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libgpod-Tracks.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-Artwork.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2577099" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2602492" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-Playlists"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2577099"></a><span class="refentrytitle">Playlists</span>
+</h2>
+<p>Playlists &#8212; Data structure to represent an iPod playlist</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+            <a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>;
+enum        <a href="libgpod-Playlists.html#ItdbPlaylistSortOrder">ItdbPlaylistSortOrder</a>;
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-new">itdb_playlist_new</a>            (const gchar *title,
+                                             gboolean spl);
+void        <a href="libgpod-Playlists.html#itdb-playlist-free">itdb_playlist_free</a>              (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-duplicate">itdb_playlist_duplicate</a>      (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+void        <a href="libgpod-Playlists.html#itdb-playlist-add">itdb_playlist_add</a>               (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             <a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             gint32 pos);
+void        <a href="libgpod-Playlists.html#itdb-playlist-move">itdb_playlist_move</a>              (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             guint32 pos);
+void        <a href="libgpod-Playlists.html#itdb-playlist-remove">itdb_playlist_remove</a>            (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+void        <a href="libgpod-Playlists.html#itdb-playlist-unlink">itdb_playlist_unlink</a>            (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+void        <a href="libgpod-Playlists.html#itdb-playlist-add-track">itdb_playlist_add_track</a>         (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             gint32 pos);
+void        <a href="libgpod-Playlists.html#itdb-playlist-remove-track">itdb_playlist_remove_track</a>      (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+gboolean    <a href="libgpod-Playlists.html#itdb-playlist-contains-track">itdb_playlist_contains_track</a>    (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+guint32     <a href="libgpod-Playlists.html#itdb-playlist-contain-track-number">itdb_playlist_contain_track_number</a>
+                                            (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *tr);
+guint32     <a href="libgpod-Playlists.html#itdb-playlist-tracks-number">itdb_playlist_tracks_number</a>     (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-mpl">itdb_playlist_mpl</a>            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+gboolean    <a href="libgpod-Playlists.html#itdb-playlist-is-mpl">itdb_playlist_is_mpl</a>            (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+void        <a href="libgpod-Playlists.html#itdb-playlist-set-mpl">itdb_playlist_set_mpl</a>           (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-podcasts">itdb_playlist_podcasts</a>       (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+gboolean    <a href="libgpod-Playlists.html#itdb-playlist-is-podcasts">itdb_playlist_is_podcasts</a>       (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+void        <a href="libgpod-Playlists.html#itdb-playlist-set-podcasts">itdb_playlist_set_podcasts</a>      (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+gboolean    <a href="libgpod-Playlists.html#itdb-playlist-exists">itdb_playlist_exists</a>            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             <a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-by-id">itdb_playlist_by_id</a>          (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             guint64 id);
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-by-nr">itdb_playlist_by_nr</a>          (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             guint32 num);
+<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* <a href="libgpod-Playlists.html#itdb-playlist-by-name">itdb_playlist_by_name</a>        (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             gchar *name);
+void        <a href="libgpod-Playlists.html#itdb-playlist-randomize">itdb_playlist_randomize</a>         (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2602492"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2602508"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2602519"></a><h3>
+<a name="Itdb-Playlist"></a>Itdb_Playlist</h3>
+<a class="indexterm" name="id2602531"></a><pre class="programlisting">typedef struct {
+    Itdb_iTunesDB *itdb;  /* pointer to iTunesDB (for convenience) */
+    gchar *name;          /* name of playlist in UTF8              */
+    guint8 type;          /* ITDB_PL_TYPE_NORM/_MPL                */
+    guint8 flag1;         /* unknown, usually set to 0             */
+    guint8 flag2;         /* unknown, always set to 0              */
+    guint8 flag3;         /* unknown, always set to 0              */
+    gint  num;            /* number of tracks in playlist          */
+    GList *members;       /* tracks in playlist (Track *)          */
+    gboolean is_spl;      /* smart playlist?                       */
+    guint32 timestamp;    /* some timestamp                        */
+    guint64 id;           /* playlist ID                           */
+    guint32 mhodcount;    /* This appears to be the number of string
+			     MHODs (type &lt; 50) associated with this
+			     playlist (typically 0x01). Doesn't seem
+			     to be signficant unless you include Type
+			     52 MHODs. libgpod sets this to 1 when
+			     syncing */
+    guint16 libmhodcount; /* The number of Type 52 MHODs associated
+			     with this playlist. If you don't create
+			     Type 52 MHODs, this can be
+			     zero. Otherwise, if you have Type 52
+			     MHODs associated with this playlist and
+			     set this to zero, no songs appear on the
+			     iPod. jcsjcs: with iTunes 4.9 this seems
+			     to be set to 1 even without any Type 52
+			     MHODs present. libgpod sets this to 1
+			     when syncing */
+    guint32 sortorder;    /* How to sort playlist -- see below     */
+    guint32 podcastflag;  /* ITDB_PL_FLAG_NORM/_PODCAST            */
+    SPLPref splpref;      /* smart playlist prefs                  */
+    SPLRules splrules;    /* rules for smart playlists             */
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_Playlist;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2587305"></a><h3>
+<a name="ItdbPlaylistSortOrder"></a>enum ItdbPlaylistSortOrder</h3>
+<a class="indexterm" name="id2602934"></a><pre class="programlisting">typedef enum
+{
+    ITDB_PSO_MANUAL = 1,
+/*    ITDB_PSO_UNKNOWN = 2, */
+    ITDB_PSO_TITLE = 3,
+    ITDB_PSO_ALBUM = 4,
+    ITDB_PSO_ARTIST = 5,
+    ITDB_PSO_BIRATE = 6,
+    ITDB_PSO_GENRE = 7,
+    ITDB_PSO_FILETYPE = 8,
+    ITDB_PSO_TIME_MODIFIED = 9,
+    ITDB_PSO_TRACK_NR = 10,
+    ITDB_PSO_SIZE = 11,
+    ITDB_PSO_TIME = 12,  /* ? */
+    ITDB_PSO_YEAR = 13,
+    ITDB_PSO_SAMPLERATE = 14,
+    ITDB_PSO_COMMENT = 15,
+    ITDB_PSO_TIME_ADDED = 16,
+    ITDB_PSO_EQUALIZER = 17, /* ? */
+    ITDB_PSO_COMPOSER = 18,
+/*    ITDB_PSO_UNKNOWN = 19, */
+    ITDB_PSO_PLAYCOUNT = 20,
+    ITDB_PSO_TIME_PLAYED = 21,
+    ITDB_PSO_CD_NR = 22,
+    ITDB_PSO_RATING = 23,
+    ITDB_PSO_RELEASE_DATE = 24, /* used by podcasts */
+    ITDB_PSO_BPM = 25,
+    ITDB_PSO_GROUPING = 26,
+    ITDB_PSO_CATEGORY = 27,
+    ITDB_PSO_DESCRIPTION = 28
+} ItdbPlaylistSortOrder;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2587616"></a><h3>
+<a name="itdb-playlist-new"></a>itdb_playlist_new ()</h3>
+<a class="indexterm" name="id2602561"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_new            (const gchar *title,
+                                             gboolean spl);</pre>
+<p>
+Creates a new playlist. If <em class="parameter"><code>spl</code></em> is TRUE, a smart
+playlist is generated. pl-&gt;id is set by <a href="libgpod-Playlists.html#itdb-playlist-add"><code class="function">itdb_playlist_add()</code></a> when the 
+playlist is added to an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>title</code></em>&#160;:</span></td>
+<td> playlist title
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>spl</code></em>&#160;:</span></td>
+<td> smart playlist flag
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a new <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a> which must be freed with 
+<a href="libgpod-Playlists.html#itdb-playlist-free"><code class="function">itdb_playlist_free()</code></a> after use
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2600192"></a><h3>
+<a name="itdb-playlist-free"></a>itdb_playlist_free ()</h3>
+<a class="indexterm" name="id2600204"></a><pre class="programlisting">void        itdb_playlist_free              (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Frees the memory used by playlist <em class="parameter"><code>pl</code></em>.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2600266"></a><h3>
+<a name="itdb-playlist-duplicate"></a>itdb_playlist_duplicate ()</h3>
+<a class="indexterm" name="id2600277"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_duplicate      (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Duplicates an existing playlist. pl_dup-&gt;id is set to zero, so that
+it will be set to a unique value when adding it to an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>. The
+returned playlist won't be associated with an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly allocated <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a> that you'll have to free
+with <a href="libgpod-Playlists.html#itdb-playlist-free"><code class="function">itdb_playlist_free()</code></a> when you no longer need it. 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606229"></a><h3>
+<a name="itdb-playlist-add"></a>itdb_playlist_add ()</h3>
+<a class="indexterm" name="id2606239"></a><pre class="programlisting">void        itdb_playlist_add               (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             <a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             gint32 pos);</pre>
+<p>
+Adds playlist <em class="parameter"><code>pl</code></em> to the database <em class="parameter"><code>itdb</code></em> at position <em class="parameter"><code>pos</code></em> (-1 for
+"append to end"). A unique id is created if pl-&gt;id is equal to
+zero. After calling this function, <em class="parameter"><code>itdb</code></em> manages the memory of <em class="parameter"><code>pl</code></em>, which
+means you no longer need to explicitly call <a href="libgpod-Playlists.html#itdb-playlist-free"><code class="function">itdb_playlist_free()</code></a></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pos</code></em>&#160;:</span></td>
+<td> position to insert <em class="parameter"><code>pl</code></em> at
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606374"></a><h3>
+<a name="itdb-playlist-move"></a>itdb_playlist_move ()</h3>
+<a class="indexterm" name="id2606384"></a><pre class="programlisting">void        itdb_playlist_move              (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             guint32 pos);</pre>
+<p>
+Moves playlist <em class="parameter"><code>pl</code></em> to position <em class="parameter"><code>pos</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pos</code></em>&#160;:</span></td>
+<td> new position
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606462"></a><h3>
+<a name="itdb-playlist-remove"></a>itdb_playlist_remove ()</h3>
+<a class="indexterm" name="id2606472"></a><pre class="programlisting">void        itdb_playlist_remove            (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Removes <em class="parameter"><code>pl</code></em> from the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> it's associated with 
+and frees memory</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606533"></a><h3>
+<a name="itdb-playlist-unlink"></a>itdb_playlist_unlink ()</h3>
+<a class="indexterm" name="id2606543"></a><pre class="programlisting">void        itdb_playlist_unlink            (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Remove <em class="parameter"><code>pl</code></em> from the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> it's associated with but do not free 
+memory. pl-&gt;itdb is set to NULL after this function returns</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606606"></a><h3>
+<a name="itdb-playlist-add-track"></a>itdb_playlist_add_track ()</h3>
+<a class="indexterm" name="id2606617"></a><pre class="programlisting">void        itdb_playlist_add_track         (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             gint32 pos);</pre>
+<p>
+Adds <em class="parameter"><code>track</code></em> to <em class="parameter"><code>pl</code></em> at position <em class="parameter"><code>pos</code></em> (-1 for "append to
+end")</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pos</code></em>&#160;:</span></td>
+<td> position to insert <em class="parameter"><code>track</code></em> at
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606731"></a><h3>
+<a name="itdb-playlist-remove-track"></a>itdb_playlist_remove_track ()</h3>
+<a class="indexterm" name="id2606742"></a><pre class="programlisting">void        itdb_playlist_remove_track      (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Removes <em class="parameter"><code>track</code></em> from <em class="parameter"><code>pl</code></em>. If <em class="parameter"><code>pl</code></em> is NULL, removes <em class="parameter"><code>track</code></em> from the
+master playlist. If <em class="parameter"><code>track</code></em> can't be found in <em class="parameter"><code>pl</code></em>, nothing happens. If after
+removing <em class="parameter"><code>track</code></em>, <em class="parameter"><code>pl</code></em> is empty, it's not removed from the database
+The memory used by <em class="parameter"><code>track</code></em> isn't freed.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606866"></a><h3>
+<a name="itdb-playlist-contains-track"></a>itdb_playlist_contains_track ()</h3>
+<a class="indexterm" name="id2606877"></a><pre class="programlisting">gboolean    itdb_playlist_contains_track    (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Checks if <em class="parameter"><code>track</code></em> is in <em class="parameter"><code>pl</code></em>.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if <em class="parameter"><code>track</code></em> is in <em class="parameter"><code>pl</code></em>, FALSE otherwise
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2606984"></a><h3>
+<a name="itdb-playlist-contain-track-number"></a>itdb_playlist_contain_track_number ()</h3>
+<a class="indexterm" name="id2606997"></a><pre class="programlisting">guint32     itdb_playlist_contain_track_number
+                                            (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *tr);</pre>
+<p>
+Counts the number of playlist <em class="parameter"><code>track</code></em> is a member of (not including the 
+master playlist)</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>tr</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> number of playlist containing <em class="parameter"><code>track</code></em>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607070"></a><h3>
+<a name="itdb-playlist-tracks-number"></a>itdb_playlist_tracks_number ()</h3>
+<a class="indexterm" name="id2607081"></a><pre class="programlisting">guint32     itdb_playlist_tracks_number     (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Counts the number of tracks in <em class="parameter"><code>pl</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> track count
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607145"></a><h3>
+<a name="itdb-playlist-mpl"></a>itdb_playlist_mpl ()</h3>
+<a class="indexterm" name="id2607156"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_mpl            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Gets the master playlist of <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the master playlist of <em class="parameter"><code>itdb</code></em> 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607225"></a><h3>
+<a name="itdb-playlist-is-mpl"></a>itdb_playlist_is_mpl ()</h3>
+<a class="indexterm" name="id2607236"></a><pre class="programlisting">gboolean    itdb_playlist_is_mpl            (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Checks if <em class="parameter"><code>pl</code></em> is the master playlist</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if <em class="parameter"><code>pl</code></em> is the master playlist, FALSE otherwise 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607306"></a><h3>
+<a name="itdb-playlist-set-mpl"></a>itdb_playlist_set_mpl ()</h3>
+<a class="indexterm" name="id2607317"></a><pre class="programlisting">void        itdb_playlist_set_mpl           (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Sets <em class="parameter"><code>pl</code></em> to be a master playlist</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607372"></a><h3>
+<a name="itdb-playlist-podcasts"></a>itdb_playlist_podcasts ()</h3>
+<a class="indexterm" name="id2607382"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_podcasts       (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Gets the podcasts playlist of <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the podcasts playlist of <em class="parameter"><code>itdb</code></em>, or NULL if it's there is none
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607453"></a><h3>
+<a name="itdb-playlist-is-podcasts"></a>itdb_playlist_is_podcasts ()</h3>
+<a class="indexterm" name="id2607464"></a><pre class="programlisting">gboolean    itdb_playlist_is_podcasts       (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Checks if <em class="parameter"><code>pl</code></em> is the podcasts playlist</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if <em class="parameter"><code>pl</code></em> is the podcasts playlist, FALSE otherwise 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607535"></a><h3>
+<a name="itdb-playlist-set-podcasts"></a>itdb_playlist_set_podcasts ()</h3>
+<a class="indexterm" name="id2607546"></a><pre class="programlisting">void        itdb_playlist_set_podcasts      (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Set <em class="parameter"><code>pl</code></em> to be a podcasts playlist</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607601"></a><h3>
+<a name="itdb-playlist-exists"></a>itdb_playlist_exists ()</h3>
+<a class="indexterm" name="id2607611"></a><pre class="programlisting">gboolean    itdb_playlist_exists            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             <a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Checks if <em class="parameter"><code>pl</code></em> is present in <em class="parameter"><code>db</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if <em class="parameter"><code>pl</code></em> exists in <em class="parameter"><code>db</code></em>, FALSE otherwise 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607716"></a><h3>
+<a name="itdb-playlist-by-id"></a>itdb_playlist_by_id ()</h3>
+<a class="indexterm" name="id2607726"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_by_id          (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             guint64 id);</pre>
+<p>
+Looks up a playlist whose ID is <em class="parameter"><code>id</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>id</code></em>&#160;:</span></td>
+<td> ID of the playlist to look for
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a> with ID <em class="parameter"><code>id</code></em> or NULL if there is no such
+playlist.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607822"></a><h3>
+<a name="itdb-playlist-by-nr"></a>itdb_playlist_by_nr ()</h3>
+<a class="indexterm" name="id2607833"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_by_nr          (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             guint32 num);</pre>
+<p>
+Gets the playlist at the given position in <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>num</code></em>&#160;:</span></td>
+<td> the position of the playlist, counting from 0
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a>, or NULL if there is no playlist at <em class="parameter"><code>pos</code></em>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2607929"></a><h3>
+<a name="itdb-playlist-by-name"></a>itdb_playlist_by_name ()</h3>
+<a class="indexterm" name="id2607940"></a><pre class="programlisting"><a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a>* itdb_playlist_by_name        (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             gchar *name);</pre>
+<p>
+Searches a playlist whose name is <em class="parameter"><code>name</code></em> in <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></td>
+<td> name of the playlist to look for
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the first <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a> with name <em class="parameter"><code>name</code></em>, NULL if there is no
+such playlist
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2608041"></a><h3>
+<a name="itdb-playlist-randomize"></a>itdb_playlist_randomize ()</h3>
+<a class="indexterm" name="id2608052"></a><pre class="programlisting">void        itdb_playlist_randomize         (<a href="libgpod-Playlists.html#Itdb-Playlist">Itdb_Playlist</a> *pl);</pre>
+<p>
+Randomizes <em class="parameter"><code>pl</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>pl</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Playlists.html#Itdb-Playlist"><span class="type">Itdb_Playlist</span></a> to randomize
+</td>
+</tr></tbody>
+</table></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-The-Itdb-iTunesDB-structure.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-The-Itdb-iTunesDB-structure.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-The-Itdb-iTunesDB-structure.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,415 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>iPod database reading/writing</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch01.html" title="iPod database">
+<link rel="prev" href="ch01.html" title="iPod database">
+<link rel="next" href="libgpod-File-handling-functions.html" title="File handling functions">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-File-handling-functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2571146" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2510392" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-The-Itdb-iTunesDB-structure"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2571146"></a><span class="refentrytitle">iPod database reading/writing</span>
+</h2>
+<p>iPod database reading/writing &#8212; Functions to create, read, write the iPod database</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+            <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>;
+void        (<a href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc">*ItdbUserDataDestroyFunc</a>)      (gpointer userdata);
+gpointer    (<a href="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc">*ItdbUserDataDuplicateFunc</a>)    (gpointer userdata);
+<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-new">itdb_new</a>                     (void);
+void        <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free">itdb_free</a>                       (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse">itdb_parse</a>                   (const gchar *mp,
+                                             GError **error);
+gboolean    <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-write">itdb_write</a>                      (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *db,
+                                             GError **error);
+void        <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-set-mountpoint">itdb_set_mountpoint</a>             (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             const gchar *mp);
+const gchar* <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-get-mountpoint">itdb_get_mountpoint</a>            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+guint32     <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number">itdb_tracks_number</a>              (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+guint32     <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number-nontransferred">itdb_tracks_number_nontransferred</a>
+                                            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+guint32     <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-playlists-number">itdb_playlists_number</a>           (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2510392"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2510407"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2510418"></a><h3>
+<a name="Itdb-iTunesDB"></a>Itdb_iTunesDB</h3>
+<a class="indexterm" name="id2510431"></a><pre class="programlisting">typedef struct {
+    GList *tracks;
+    GList *playlists;
+    gchar *filename;    /* filename of iTunesDB */
+    Itdb_Device *device;/* iPod device info     */
+    guint32 version;
+    guint64 id;
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_iTunesDB;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2510454"></a><h3>
+<a name="ItdbUserDataDestroyFunc"></a>ItdbUserDataDestroyFunc ()</h3>
+<a class="indexterm" name="id2510466"></a><pre class="programlisting">void        (*ItdbUserDataDestroyFunc)      (gpointer userdata);</pre>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>userdata</code></em>&#160;:</span></td>
+<td>
+
+
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2574700"></a><h3>
+<a name="ItdbUserDataDuplicateFunc"></a>ItdbUserDataDuplicateFunc ()</h3>
+<a class="indexterm" name="id2574711"></a><pre class="programlisting">gpointer    (*ItdbUserDataDuplicateFunc)    (gpointer userdata);</pre>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>userdata</code></em>&#160;:</span></td>
+<td>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td>
+
+
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2574767"></a><h3>
+<a name="itdb-new"></a>itdb_new ()</h3>
+<a class="indexterm" name="id2574779"></a><pre class="programlisting"><a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* itdb_new                     (void);</pre>
+<p>
+Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable
+values.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly created Itdb_iTunesDB to be freed with <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free"><code class="function">itdb_free()</code></a>
+when it's no longer needed
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2574829"></a><h3>
+<a name="itdb-free"></a>itdb_free ()</h3>
+<a class="indexterm" name="id2574841"></a><pre class="programlisting">void        itdb_free                       (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Free the memory taken by <em class="parameter"><code>itdb</code></em>.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2574903"></a><h3>
+<a name="itdb-parse"></a>itdb_parse ()</h3>
+<a class="indexterm" name="id2574915"></a><pre class="programlisting"><a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a>* itdb_parse                   (const gchar *mp,
+                                             GError **error);</pre>
+<p>
+Parse the Itdb_iTunesDB of the iPod located at <em class="parameter"><code>mp</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mp</code></em>&#160;:</span></td>
+<td> mount point of the iPod (eg "/mnt/ipod) in local encoding
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly allocated <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> struct holding the tracks and
+the playlists present on the iPod at <em class="parameter"><code>mp</code></em>, NULL if <em class="parameter"><code>mp</code></em> isn't an iPod mount
+point. If non-NULL, the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> is to be freed with <a href="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free"><code class="function">itdb_free()</code></a> when
+it's no longer needed
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2514955"></a><h3>
+<a name="itdb-write"></a>itdb_write ()</h3>
+<a class="indexterm" name="id2514967"></a><pre class="programlisting">gboolean    itdb_write                      (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *db,
+                                             GError **error);</pre>
+<p>
+Write out an iTunesDB. It reassigns unique IDs to all tracks. 
+An existing "Play Counts" file is renamed to "Play Counts.bak" if
+the export was successful.
+An existing "OTGPlaylistInfo" file is removed if the export was
+successful.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>db</code></em>&#160;:</span></td>
+<td>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
+<td> return location for a <span class="type">GError</span> or NULL
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE on success, FALSE on error, in which case <em class="parameter"><code>error</code></em> is
+set accordingly.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2515065"></a><h3>
+<a name="itdb-set-mountpoint"></a>itdb_set_mountpoint ()</h3>
+<a class="indexterm" name="id2515077"></a><pre class="programlisting">void        itdb_set_mountpoint             (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             const gchar *mp);</pre>
+<p>
+Sets the mountpoint of <em class="parameter"><code>db</code></em>. Always use this function to set the mountpoint
+of an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> as it will reset the number of available 
+/iPod_Control/Music/F.. dirs. It doesn't attempt to parse an iPod database
+that may be present on the iPod at <em class="parameter"><code>mp</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mp</code></em>&#160;:</span></td>
+<td> new mount point
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2597709"></a><h3>
+<a name="itdb-get-mountpoint"></a>itdb_get_mountpoint ()</h3>
+<a class="indexterm" name="id2597720"></a><pre class="programlisting">const gchar* itdb_get_mountpoint            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Retrieve a reference to the mountpoint of <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the <em class="parameter"><code>itdb</code></em> mountpoint, this string shouldn't be freed nor 
+modified
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2597791"></a><h3>
+<a name="itdb-tracks-number"></a>itdb_tracks_number ()</h3>
+<a class="indexterm" name="id2597803"></a><pre class="programlisting">guint32     itdb_tracks_number              (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Counts the number of tracks stored in <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the number of tracks in <em class="parameter"><code>itdb</code></em>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2597882"></a><h3>
+<a name="itdb-tracks-number-nontransferred"></a>itdb_tracks_number_nontransferred ()</h3>
+<a class="indexterm" name="id2597896"></a><pre class="programlisting">guint32     itdb_tracks_number_nontransferred
+                                            (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Counts the number of non-transferred tracks in <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the number of tracks in <em class="parameter"><code>itdb</code></em> that haven't been transferred
+to the iPod yet (ie the number of <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a> in which the transferred field
+is false)
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2597982"></a><h3>
+<a name="itdb-playlists-number"></a>itdb_playlists_number ()</h3>
+<a class="indexterm" name="id2597994"></a><pre class="programlisting">guint32     itdb_playlists_number           (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Counts the number of playlists stored in <em class="parameter"><code>itdb</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the number of playlists in <em class="parameter"><code>itdb</code></em> (including the master 
+playlist)
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-Time-handling.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-Time-handling.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-Time-handling.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Time handling</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch01.html" title="iPod database">
+<link rel="prev" href="libgpod-File-handling-functions.html" title="File handling functions">
+<link rel="next" href="libgpod-Low-level-functions.html" title="Low-level functions">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="libgpod-File-handling-functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-Low-level-functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2557423" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2594077" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-Time-handling"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2557423"></a><span class="refentrytitle">Time handling</span>
+</h2>
+<p>Time handling &#8212; Helper functions to convert between Epoch time and Mac (iPod) time</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+guint64     <a href="libgpod-Time-handling.html#itdb-time-get-mac-time">itdb_time_get_mac_time</a>          (void);
+time_t      <a href="libgpod-Time-handling.html#itdb-time-mac-to-host">itdb_time_mac_to_host</a>           (guint64 mactime);
+guint64     <a href="libgpod-Time-handling.html#itdb-time-host-to-mac">itdb_time_host_to_mac</a>           (time_t time);
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2594077"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2594093"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2594104"></a><h3>
+<a name="itdb-time-get-mac-time"></a>itdb_time_get_mac_time ()</h3>
+<a class="indexterm" name="id2594115"></a><pre class="programlisting">guint64     itdb_time_get_mac_time          (void);</pre>
+<p>
+Gets the current time expressed in 'Mac' unit (ie in number of seconds since
+1/1/1904).</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> current time in 'Mac' unit.
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2594156"></a><h3>
+<a name="itdb-time-mac-to-host"></a>itdb_time_mac_to_host ()</h3>
+<a class="indexterm" name="id2594167"></a><pre class="programlisting">time_t      itdb_time_mac_to_host           (guint64 mactime);</pre>
+<p>
+Convert a Mac timestamp to host system time stamp -- modify
+this function if necessary to port to host systems with different
+start of Epoch.
+A "0" time will not be converted.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>mactime</code></em>&#160;:</span></td>
+<td> time expressed in 'Mac' unit
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> timestamp for the host system
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2589005"></a><h3>
+<a name="itdb-time-host-to-mac"></a>itdb_time_host_to_mac ()</h3>
+<a class="indexterm" name="id2589016"></a><pre class="programlisting">guint64     itdb_time_host_to_mac           (time_t time);</pre>
+<p>
+Convert host system timestamp to Mac time stamp -- modify
+this function if necessary to port to host systems with different
+start of Epoch</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>time</code></em>&#160;:</span></td>
+<td> time expressed in host unit
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a Mac timestamp
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod-Tracks.html
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod-Tracks.html	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod-Tracks.html	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,605 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Tracks</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
+<link rel="start" href="index.html" title="libgpod Reference Manual">
+<link rel="up" href="ch02.html" title="iPod database components">
+<link rel="prev" href="ch02.html" title="iPod database components">
+<link rel="next" href="libgpod-Playlists.html" title="Playlists">
+<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+<link rel="chapter" href="ch01.html" title="iPod database">
+<link rel="chapter" href="ch02.html" title="iPod database components">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="ch02.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">libgpod Reference Manual</th>
+<td><a accesskey="n" href="libgpod-Playlists.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+</tr>
+<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2590973" class="shortcut">Top</a>
+                  &#160;|&#160;
+                  <a href="#id2579784" class="shortcut">Description</a></nobr></td></tr>
+</table>
+<div class="refentry" lang="en">
+<a name="libgpod-Tracks"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2>
+<a name="id2590973"></a><span class="refentrytitle">Tracks</span>
+</h2>
+<p>Tracks &#8212; Data structure to store metadata about an iPod track</p>
+</td>
+<td valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<pre class="synopsis">
+
+
+
+            <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>;
+<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* <a href="libgpod-Tracks.html#itdb-track-new">itdb_track_new</a>                  (void);
+void        <a href="libgpod-Tracks.html#itdb-track-free">itdb_track_free</a>                 (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+void        <a href="libgpod-Tracks.html#itdb-track-add">itdb_track_add</a>                  (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             gint32 pos);
+void        <a href="libgpod-Tracks.html#itdb-track-remove">itdb_track_remove</a>               (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+void        <a href="libgpod-Tracks.html#itdb-track-unlink">itdb_track_unlink</a>               (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* <a href="libgpod-Tracks.html#itdb-track-duplicate">itdb_track_duplicate</a>            (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *tr);
+<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* <a href="libgpod-Tracks.html#itdb-track-by-id">itdb_track_by_id</a>                (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             guint32 id);
+GTree*      <a href="libgpod-Tracks.html#itdb-track-id-tree-create">itdb_track_id_tree_create</a>       (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);
+void        <a href="libgpod-Tracks.html#itdb-track-id-tree-destroy">itdb_track_id_tree_destroy</a>      (GTree *idtree);
+<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* <a href="libgpod-Tracks.html#itdb-track-id-tree-by-id">itdb_track_id_tree_by_id</a>        (GTree *idtree,
+                                             guint32 id);
+gboolean    <a href="libgpod-Tracks.html#itdb-track-set-thumbnails">itdb_track_set_thumbnails</a>       (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             const gchar *filename);
+void        <a href="libgpod-Tracks.html#itdb-track-remove-thumbnails">itdb_track_remove_thumbnails</a>    (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);
+#define     <a href="libgpod-Tracks.html#ITDB-RATING-STEP:CAPS">ITDB_RATING_STEP</a>
+</pre>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2579784"></a><h2>Description</h2>
+<p>
+
+</p>
+</div>
+<div class="refsect1" lang="en">
+<a name="id2579800"></a><h2>Details</h2>
+<div class="refsect2" lang="en">
+<a name="id2579811"></a><h3>
+<a name="Itdb-Track"></a>Itdb_Track</h3>
+<a class="indexterm" name="id2579823"></a><pre class="programlisting">typedef struct {
+  Itdb_iTunesDB *itdb;       /* pointer to iTunesDB (for convenience) */
+  gchar   *title;            /* title (utf8)           */
+  gchar   *ipod_path;        /* name of file on iPod: uses ":"
+				instead of "/"                        */
+  gchar   *album;            /* album (utf8)           */
+  gchar   *artist;           /* artist (utf8)          */
+  gchar   *genre;            /* genre (utf8)           */
+  gchar   *filetype;         /* eg. "MP3-File"...(utf8)*/
+  gchar   *comment;          /* comment (utf8)         */
+  gchar   *category;         /* Category for podcast   */
+  gchar   *composer;         /* Composer (utf8)        */
+  gchar   *grouping;         /* ? (utf8)               */
+  gchar   *description;      /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *podcasturl;       /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *podcastrss;       /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *chapterdata;      /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *subtitle;         /* see note for MHOD_ID in itdb_itunesdb.c */
+  guint32 id;                /* unique ID of track     */
+  gint32  size;              /* size of file in bytes  */
+  gint32  tracklen;          /* Length of track in ms  */
+  gint32  cd_nr;             /* CD number              */
+  gint32  cds;               /* number of CDs          */
+  gint32  track_nr;          /* track number           */
+  gint32  tracks;            /* number of tracks       */
+  gint32  bitrate;           /* bitrate                */
+  guint16 samplerate;        /* samplerate (CD: 44100) */
+  guint16 samplerate_low;    /* in the iTunesDB the samplerate is
+                                multiplied by 0x10000 -- these are the
+				lower 16 bit, which are usually 0 */
+  gint32  year;              /* year                   */
+  gint32  volume;            /* volume adjustment              */
+  guint32 soundcheck;        /* volume adjustment "soundcheck" */
+  guint32 time_added;        /* time when added (Mac type)          */
+  guint32 time_played;       /* time of last play (Mac type)        */
+  guint32 time_modified;     /* time of last modification (Mac type)*/
+  guint32 bookmark_time;     /* bookmark set for (AudioBook) in ms  */
+  guint32 rating;            /* star rating (stars * RATING_STEP (20))     */
+  guint32 playcount;         /* number of times track was played    */
+  guint32 playcount2;        /* Also stores the play count of the
+				song.  Don't know if it ever differs
+				from the above value. During sync itdb
+				sets playcount2 to the same value as
+				playcount. */
+  guint32 recent_playcount;  /* times track was played since last sync */
+  gboolean transferred;      /* has file been transferred to iPod?  */
+  gint16  BPM;               /* supposed to vary the playback speed */
+  guint8  app_rating;        /* star rating set by appl. (not
+			      * iPod). If the rating set on the iPod
+			        and the rating field above differ, the
+				original rating is copied here and the
+				new rating is stored above. */
+  guint8  type1;             /* CBR MP3s and AAC are 0x00, VBR MP3s are
+			        0x01 */
+  guint8  type2;             /* MP3s are 0x01, AAC are 0x00 */
+  guint8  compilation;
+  guint32 starttime;
+  guint32 stoptime;
+  guint8  checked;           /* 0x0: checkmark on track is set 0x1: not set */
+  guint64 dbid;              /* unique database ID */
+  guint32 drm_userid;        /* Apple Store/Audible User ID (for DRM'ed
+				files only, set to 0 otherwise). */
+  guint32 visible;           /*  If this value is 1, the song is visible
+				 on the iPod. All other values cause
+				 the file to be hidden. */
+  guint32 filetype_marker;   /* This appears to always be 0 on hard
+                                drive based iPods, but for the
+                                iTunesDB that is written to an iPod
+                                Shuffle, iTunes 4.7.1 writes out the
+                                file's type as an ANSI string(!). For
+                                example, a MP3 file has a filetype of
+                                0x4d503320 -&gt; 0x4d = 'M', 0x50 = 'P',
+                                0x33 = '3', 0x20 = &lt;space&gt;. (set to
+				the filename extension by itdb when
+				copying track to iPod)*/
+  guint16 artwork_count;     /* The number of album artwork items
+				associated with this song. libgpod
+				updates this value when syncing */
+  guint32 artwork_size;      /* The total size of artwork (in bytes)
+				attached to this song, when it is
+				converted to JPEG format. Observed in
+				iPodDB version 0x0b and with an iPod
+				Photo. libgpod updates this value when
+				syncing */
+  float samplerate2;         /* The sample rate of the song expressed
+				as an IEEE 32 bit floating point
+				number.  It's uncertain why this is
+				here.  itdb will set this when adding
+				a track */
+
+  guint16 unk126;     /* unknown, but always seems to be 0xffff for
+			 MP3/AAC songs, 0x0 for uncompressed songs
+			 (like WAVE format), 0x1 for Audible. itdb
+			 will try to set this when adding a new track */
+  guint32 unk132;     /* unknown */
+  guint32 time_released;/* date/time added to music store? definitely a
+			 timestamp, always appears to be a time of
+			 0700 GMT. For podcasts: release date as
+			 displayed next to the title in the Podcast
+			 playlist  */
+  guint16 unk144;     /* unknown, but MP3 songs appear to be always
+			 0x000c, AAC songs are always 0x0033, Audible
+			 files are 0x0029, WAV files are 0x0. itdb
+			 will attempt to set this value when adding a
+			 track. */  
+  guint16 unk146;     /* unknown, but appears to be 1 if played at
+			 least once in iTunes and 0 otherwise. */
+  guint32 unk148;     /* unknown - used for Apple Store DRM songs
+			 (always 0x01010100?), zero otherwise */
+  guint32 unk152;     /* unknown */
+  guint32 unk156, unk160;
+  guint8 has_artwork; /* 0x01: artwork is present. 0x02: no artwork is
+			 present for this track (used by the iPod to
+			 decide whether to display Artwork or not) */
+  guint8 skip_when_shuffling;/* "Skip when shuffling" when set to
+			 0x01, set to 0x00 otherwise. .m4b and .aa
+			 files always seem to be skipped when
+			 shuffling, however */
+  guint8 remember_playback_position;/* "Remember playback position"
+			 when set to 0x01, set to 0x00 otherwise. .m4b
+			 and .aa files always seem to remember the
+			 playback position, however. */
+  guint8 flag4;       /* Used for podcasts, 0x00 otherwise.  If set to
+			 0x01 the "Now Playing" page will show
+			 Title/Album, when set to 0x00 it will also
+			 show the Artist. When set to 0x02 a sub-page
+			 (middle button) with further information
+			 about the track will be shown. */
+  guint64 dbid2;      /* not clear. if not set, itdb will set this to
+			 the same value as dbid when adding a track */
+  guint8 lyrics_flag; /* set to 0x01 if lyrics are present in MP3 tag
+			 ("ULST"), 0x00 otherwise */
+  guint8 movie_flag;  /* set to 0x01 if it's a movie file, 0x00
+		         otherwise */
+  guint8 mark_unplayed; /* A value of 0x02 marks a podcast as unplayed
+			   on the iPod (bullet) once played it is set to
+			   0x01. Non-podcasts have this set to 0x01. */
+  guint8 unk179;      /* unknown (always 0x00 so far) */
+  guint32 unk180, unk184;
+  guint32 samplecount;/* Number of samples in the song. First observed
+			 in dbversion 0x0d, and only for AAC and WAV
+			 files (not MP3?!?). */
+  guint32 unk192, unk196, unk200;
+  guint32 unk204;     /*  unknown - added in dbversion 0x0c, first
+			  values observed in 0x0d. Observed to be 0x0
+			  or 0x1. */
+  guint32 unk208, unk212, unk216, unk220, unk224;
+  guint32 unk228, unk232, unk236, unk240;
+
+    /* Chapter data: defines where the chapter stops are in the track,
+       as well as what info should be displayed for each section of
+       the track. Until it can be parsed and interpreted, the
+       chapterdata will just be read as a block and written back on
+       sync. This will be changed at a later time */
+  void *chapterdata_raw;
+  guint32 chapterdata_raw_length;
+
+  /* This is for Cover Art support */
+  struct _Itdb_Artwork *artwork;
+
+  /* below is for use by application */
+  guint64 usertype;
+  gpointer userdata;
+  /* function called to duplicate userdata */
+  ItdbUserDataDuplicateFunc userdata_duplicate;
+  /* function called to free userdata */
+  ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_Track;
+</pre>
+<p>
+
+</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2596057"></a><h3>
+<a name="itdb-track-new"></a>itdb_track_new ()</h3>
+<a class="indexterm" name="id2559796"></a><pre class="programlisting"><a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* itdb_track_new                  (void);</pre>
+<p>
+Creates an empty <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the new <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>, free it with <a href="libgpod-Tracks.html#itdb-track-free"><code class="function">itdb_track_free()</code></a> when no
+longer needed
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2597275"></a><h3>
+<a name="itdb-track-free"></a>itdb_track_free ()</h3>
+<a class="indexterm" name="id2597288"></a><pre class="programlisting">void        itdb_track_free                 (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Frees the memory used by <em class="parameter"><code>track</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2597348"></a><h3>
+<a name="itdb-track-add"></a>itdb_track_add ()</h3>
+<a class="indexterm" name="id2597360"></a><pre class="programlisting">void        itdb_track_add                  (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             <a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             gint32 pos);</pre>
+<p>
+Adds <em class="parameter"><code>track</code></em> to <em class="parameter"><code>itdb-&gt;tracks</code></em> at position <em class="parameter"><code>pos</code></em> (or at the end if pos
+is -1). The application is responsible to also add it to the master
+playlist. The <em class="parameter"><code>itdb</code></em> gets ownership of the <em class="parameter"><code>track</code></em> and will take care of 
+freeing the memory it uses when it's no longer necessary.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>pos</code></em>&#160;:</span></td>
+<td> position of the track to add
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2598771"></a><h3>
+<a name="itdb-track-remove"></a>itdb_track_remove ()</h3>
+<a class="indexterm" name="id2598784"></a><pre class="programlisting">void        itdb_track_remove               (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Removes <em class="parameter"><code>track</code></em> from the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> it's associated with, and frees the
+memory it uses. It doesn't remove the track from the playlists it may have
+been added to, in particular it won't be removed from the master playlist.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2598855"></a><h3>
+<a name="itdb-track-unlink"></a>itdb_track_unlink ()</h3>
+<a class="indexterm" name="id2598868"></a><pre class="programlisting">void        itdb_track_unlink               (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Removes <em class="parameter"><code>track</code></em> from the <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a> it's associated with, but do not free
+memory. It doesn't remove the track from the playlists it may have been 
+added to, in particular it won't be removed from the master playlist.
+track-&gt;itdb is set to NULL.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603128"></a><h3>
+<a name="itdb-track-duplicate"></a>itdb_track_duplicate ()</h3>
+<a class="indexterm" name="id2603138"></a><pre class="programlisting"><a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* itdb_track_duplicate            (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *tr);</pre>
+<p>
+Duplicates an existing track</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>tr</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a newly allocated <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a> 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603204"></a><h3>
+<a name="itdb-track-by-id"></a>itdb_track_by_id ()</h3>
+<a class="indexterm" name="id2603214"></a><pre class="programlisting"><a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* itdb_track_by_id                (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb,
+                                             guint32 id);</pre>
+<p>
+Looks up a track using its ID in <em class="parameter"><code>itdb</code></em>. 
+Looking up tracks by ID is not really a good idea because the IDs
+are created by itdb just before export. The functions are here
+because they are needed during import of the iTunesDB which is
+referencing tracks by IDs.
+This function is very slow (linear in the number of tracks contained in the 
+database). If you need to lookup many IDs use <a href="libgpod-Tracks.html#itdb-track-id-tree-create"><code class="function">itdb_track_id_tree_create()</code></a>, 
+<a href="libgpod-Tracks.html#itdb-track-id-tree-destroy"><code class="function">itdb_track_id_tree_destroy()</code></a>, and <a href="libgpod-Tracks.html#itdb-track-id-tree-by-id"><code class="function">itdb_track_id_tree_by_id()</code></a>.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>id</code></em>&#160;:</span></td>
+<td> ID of the track to look for
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a> with the ID <em class="parameter"><code>id</code></em> or NULL if the ID cannot be
+found. 
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603341"></a><h3>
+<a name="itdb-track-id-tree-create"></a>itdb_track_id_tree_create ()</h3>
+<a class="indexterm" name="id2603352"></a><pre class="programlisting">GTree*      itdb_track_id_tree_create       (<a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB">Itdb_iTunesDB</a> *itdb);</pre>
+<p>
+Creates a balanced-binary tree for quick ID lookup that is used in
+<code class="function">itdb_track_by_id_tree()</code> function below</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>itdb</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"><span class="type">Itdb_iTunesDB</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> a <span class="type">GTree</span> indexed by track IDs to be freed with 
+<a href="libgpod-Tracks.html#itdb-track-id-tree-destroy"><code class="function">itdb_track_id_tree_destroy()</code></a> when no longer used
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603437"></a><h3>
+<a name="itdb-track-id-tree-destroy"></a>itdb_track_id_tree_destroy ()</h3>
+<a class="indexterm" name="id2603448"></a><pre class="programlisting">void        itdb_track_id_tree_destroy      (GTree *idtree);</pre>
+<p>
+Frees the memory used by <em class="parameter"><code>idtree</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>idtree</code></em>&#160;:</span></td>
+<td> a <span class="type">GTree</span>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603503"></a><h3>
+<a name="itdb-track-id-tree-by-id"></a>itdb_track_id_tree_by_id ()</h3>
+<a class="indexterm" name="id2603513"></a><pre class="programlisting"><a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a>* itdb_track_id_tree_by_id        (GTree *idtree,
+                                             guint32 id);</pre>
+<p>
+Lookup an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a> by <em class="parameter"><code>id</code></em> using <em class="parameter"><code>idtree</code></em> for faster lookup (compared to
+itdb_track_by_id)</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>idtree</code></em>&#160;:</span></td>
+<td> a <span class="type">GTree</span> created using <a href="libgpod-Tracks.html#itdb-track-id-tree-create"><code class="function">itdb_track_id_tree_create()</code></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>id</code></em>&#160;:</span></td>
+<td> the ID of the track to search for
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> the <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a> whose ID is <em class="parameter"><code>id</code></em>, or NULL if such a track 
+couldn't be found
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603630"></a><h3>
+<a name="itdb-track-set-thumbnails"></a>itdb_track_set_thumbnails ()</h3>
+<a class="indexterm" name="id2603641"></a><pre class="programlisting">gboolean    itdb_track_set_thumbnails       (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track,
+                                             const gchar *filename);</pre>
+<p>
+Uses the image contained in <em class="parameter"><code>filename</code></em> to generate iPod thumbnails. The image
+can be in any format supported by gdk-pixbuf. To save memory, the thumbnails
+will only be generated when necessary, ie when <code class="function">itdb_save()</code> or a similar 
+function is called.</p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><em class="parameter"><code>filename</code></em>&#160;:</span></td>
+<td> image file to use as a thumbnail
+</td>
+</tr>
+<tr>
+<td>
+<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
+<td> TRUE if the thumbnail could be added, FALSE otherwise.
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603740"></a><h3>
+<a name="itdb-track-remove-thumbnails"></a>itdb_track_remove_thumbnails ()</h3>
+<a class="indexterm" name="id2603752"></a><pre class="programlisting">void        itdb_track_remove_thumbnails    (<a href="libgpod-Tracks.html#Itdb-Track">Itdb_Track</a> *track);</pre>
+<p>
+Removes the thumbnails associated with <em class="parameter"><code>track</code></em></p>
+<p>
+
+</p>
+<div class="variablelist"><table border="0">
+<col align="left" valign="top">
+<tbody><tr>
+<td>
+<span class="term"><em class="parameter"><code>track</code></em>&#160;:</span></td>
+<td> an <a href="libgpod-Tracks.html#Itdb-Track"><span class="type">Itdb_Track</span></a>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<a name="id2603808"></a><h3>
+<a name="ITDB-RATING-STEP:CAPS"></a>ITDB_RATING_STEP</h3>
+<a class="indexterm" name="id2603818"></a><pre class="programlisting">#define ITDB_RATING_STEP 20
+</pre>
+<p>
+
+</p>
+</div>
+</div>
+</div>
+</body>
+</html>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
+<book xmlns="http://www.devhelp.net/book" title="libgpod Reference Manual" link="index.html" author="Jorg SchulerChristophe Fergeau" name="libgpod">
+  <chapters>
+    <sub name="iPod database" link="ch01.html">
+      <sub name="iPod database reading/writing" link="libgpod-The-Itdb-iTunesDB-structure.html"/>
+      <sub name="File handling functions" link="libgpod-File-handling-functions.html"/>
+      <sub name="Time handling" link="libgpod-Time-handling.html"/>
+      <sub name="Low-level functions" link="libgpod-Low-level-functions.html"/>
+    </sub>
+    <sub name="iPod database components" link="ch02.html">
+      <sub name="Tracks" link="libgpod-Tracks.html"/>
+      <sub name="Playlists" link="libgpod-Playlists.html"/>
+      <sub name="Artwork" link="libgpod-Artwork.html"/>
+      <sub name="Device" link="libgpod-Device.html"/>
+    </sub>
+  </chapters>
+  <functions>
+    <function name="Itdb_iTunesDB" link="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"/>
+    <function name="ItdbUserDataDestroyFunc ()" link="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc"/>
+    <function name="ItdbUserDataDuplicateFunc ()" link="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc"/>
+    <function name="itdb_new ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-new"/>
+    <function name="itdb_free ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free"/>
+    <function name="itdb_parse ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse"/>
+    <function name="itdb_write ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-write"/>
+    <function name="itdb_set_mountpoint ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-set-mountpoint"/>
+    <function name="itdb_get_mountpoint ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-get-mountpoint"/>
+    <function name="itdb_tracks_number ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number"/>
+    <function name="itdb_tracks_number_nontransferred ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number-nontransferred"/>
+    <function name="itdb_playlists_number ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-playlists-number"/>
+    <function name="itdb_cp_track_to_ipod ()" link="libgpod-File-handling-functions.html#itdb-cp-track-to-ipod"/>
+    <function name="itdb_filename_fs2ipod ()" link="libgpod-File-handling-functions.html#itdb-filename-fs2ipod"/>
+    <function name="itdb_filename_ipod2fs ()" link="libgpod-File-handling-functions.html#itdb-filename-ipod2fs"/>
+    <function name="itdb_filename_on_ipod ()" link="libgpod-File-handling-functions.html#itdb-filename-on-ipod"/>
+    <function name="itdb_musicdirs_number ()" link="libgpod-File-handling-functions.html#itdb-musicdirs-number"/>
+    <function name="itdb_rename_files ()" link="libgpod-File-handling-functions.html#itdb-rename-files"/>
+    <function name="itdb_time_get_mac_time ()" link="libgpod-Time-handling.html#itdb-time-get-mac-time"/>
+    <function name="itdb_time_mac_to_host ()" link="libgpod-Time-handling.html#itdb-time-mac-to-host"/>
+    <function name="itdb_time_host_to_mac ()" link="libgpod-Time-handling.html#itdb-time-host-to-mac"/>
+    <function name="itdb_get_control_dir ()" link="libgpod-Low-level-functions.html#itdb-get-control-dir"/>
+    <function name="itdb_get_itunes_dir ()" link="libgpod-Low-level-functions.html#itdb-get-itunes-dir"/>
+    <function name="itdb_get_music_dir ()" link="libgpod-Low-level-functions.html#itdb-get-music-dir"/>
+    <function name="itdb_get_artwork_dir ()" link="libgpod-Low-level-functions.html#itdb-get-artwork-dir"/>
+    <function name="itdb_get_device_dir ()" link="libgpod-Low-level-functions.html#itdb-get-device-dir"/>
+    <function name="itdb_get_itunesdb_path ()" link="libgpod-Low-level-functions.html#itdb-get-itunesdb-path"/>
+    <function name="itdb_get_artworkdb_path ()" link="libgpod-Low-level-functions.html#itdb-get-artworkdb-path"/>
+    <function name="itdb_get_path ()" link="libgpod-Low-level-functions.html#itdb-get-path"/>
+    <function name="itdb_resolve_path ()" link="libgpod-Low-level-functions.html#itdb-resolve-path"/>
+    <function name="itdb_shuffle_write ()" link="libgpod-Low-level-functions.html#itdb-shuffle-write"/>
+    <function name="itdb_shuffle_write_file ()" link="libgpod-Low-level-functions.html#itdb-shuffle-write-file"/>
+    <function name="itdb_cp ()" link="libgpod-Low-level-functions.html#itdb-cp"/>
+    <function name="itdb_parse_file ()" link="libgpod-Low-level-functions.html#itdb-parse-file"/>
+    <function name="itdb_write_file ()" link="libgpod-Low-level-functions.html#itdb-write-file"/>
+    <function name="itdb_duplicate ()" link="libgpod-Low-level-functions.html#itdb-duplicate"/>
+    <function name="Itdb_Track" link="libgpod-Tracks.html#Itdb-Track"/>
+    <function name="itdb_track_new ()" link="libgpod-Tracks.html#itdb-track-new"/>
+    <function name="itdb_track_free ()" link="libgpod-Tracks.html#itdb-track-free"/>
+    <function name="itdb_track_add ()" link="libgpod-Tracks.html#itdb-track-add"/>
+    <function name="itdb_track_remove ()" link="libgpod-Tracks.html#itdb-track-remove"/>
+    <function name="itdb_track_unlink ()" link="libgpod-Tracks.html#itdb-track-unlink"/>
+    <function name="itdb_track_duplicate ()" link="libgpod-Tracks.html#itdb-track-duplicate"/>
+    <function name="itdb_track_by_id ()" link="libgpod-Tracks.html#itdb-track-by-id"/>
+    <function name="itdb_track_id_tree_create ()" link="libgpod-Tracks.html#itdb-track-id-tree-create"/>
+    <function name="itdb_track_id_tree_destroy ()" link="libgpod-Tracks.html#itdb-track-id-tree-destroy"/>
+    <function name="itdb_track_id_tree_by_id ()" link="libgpod-Tracks.html#itdb-track-id-tree-by-id"/>
+    <function name="itdb_track_set_thumbnails ()" link="libgpod-Tracks.html#itdb-track-set-thumbnails"/>
+    <function name="itdb_track_remove_thumbnails ()" link="libgpod-Tracks.html#itdb-track-remove-thumbnails"/>
+    <function name="ITDB_RATING_STEP" link="libgpod-Tracks.html#ITDB-RATING-STEP:CAPS"/>
+    <function name="Itdb_Playlist" link="libgpod-Playlists.html#Itdb-Playlist"/>
+    <function name="enum ItdbPlaylistSortOrder" link="libgpod-Playlists.html#ItdbPlaylistSortOrder"/>
+    <function name="itdb_playlist_new ()" link="libgpod-Playlists.html#itdb-playlist-new"/>
+    <function name="itdb_playlist_free ()" link="libgpod-Playlists.html#itdb-playlist-free"/>
+    <function name="itdb_playlist_duplicate ()" link="libgpod-Playlists.html#itdb-playlist-duplicate"/>
+    <function name="itdb_playlist_add ()" link="libgpod-Playlists.html#itdb-playlist-add"/>
+    <function name="itdb_playlist_move ()" link="libgpod-Playlists.html#itdb-playlist-move"/>
+    <function name="itdb_playlist_remove ()" link="libgpod-Playlists.html#itdb-playlist-remove"/>
+    <function name="itdb_playlist_unlink ()" link="libgpod-Playlists.html#itdb-playlist-unlink"/>
+    <function name="itdb_playlist_add_track ()" link="libgpod-Playlists.html#itdb-playlist-add-track"/>
+    <function name="itdb_playlist_remove_track ()" link="libgpod-Playlists.html#itdb-playlist-remove-track"/>
+    <function name="itdb_playlist_contains_track ()" link="libgpod-Playlists.html#itdb-playlist-contains-track"/>
+    <function name="itdb_playlist_contain_track_number ()" link="libgpod-Playlists.html#itdb-playlist-contain-track-number"/>
+    <function name="itdb_playlist_tracks_number ()" link="libgpod-Playlists.html#itdb-playlist-tracks-number"/>
+    <function name="itdb_playlist_mpl ()" link="libgpod-Playlists.html#itdb-playlist-mpl"/>
+    <function name="itdb_playlist_is_mpl ()" link="libgpod-Playlists.html#itdb-playlist-is-mpl"/>
+    <function name="itdb_playlist_set_mpl ()" link="libgpod-Playlists.html#itdb-playlist-set-mpl"/>
+    <function name="itdb_playlist_podcasts ()" link="libgpod-Playlists.html#itdb-playlist-podcasts"/>
+    <function name="itdb_playlist_is_podcasts ()" link="libgpod-Playlists.html#itdb-playlist-is-podcasts"/>
+    <function name="itdb_playlist_set_podcasts ()" link="libgpod-Playlists.html#itdb-playlist-set-podcasts"/>
+    <function name="itdb_playlist_exists ()" link="libgpod-Playlists.html#itdb-playlist-exists"/>
+    <function name="itdb_playlist_by_id ()" link="libgpod-Playlists.html#itdb-playlist-by-id"/>
+    <function name="itdb_playlist_by_nr ()" link="libgpod-Playlists.html#itdb-playlist-by-nr"/>
+    <function name="itdb_playlist_by_name ()" link="libgpod-Playlists.html#itdb-playlist-by-name"/>
+    <function name="itdb_playlist_randomize ()" link="libgpod-Playlists.html#itdb-playlist-randomize"/>
+    <function name="Itdb_Artwork" link="libgpod-Artwork.html#Itdb-Artwork"/>
+    <function name="Itdb_Thumb" link="libgpod-Artwork.html#Itdb-Thumb"/>
+    <function name="enum ItdbThumbType" link="libgpod-Artwork.html#ItdbThumbType"/>
+    <function name="itdb_artwork_new ()" link="libgpod-Artwork.html#itdb-artwork-new"/>
+    <function name="itdb_artwork_duplicate ()" link="libgpod-Artwork.html#itdb-artwork-duplicate"/>
+    <function name="itdb_artwork_free ()" link="libgpod-Artwork.html#itdb-artwork-free"/>
+    <function name="itdb_artwork_add_thumbnail ()" link="libgpod-Artwork.html#itdb-artwork-add-thumbnail"/>
+    <function name="itdb_artwork_remove_thumbnail ()" link="libgpod-Artwork.html#itdb-artwork-remove-thumbnail"/>
+    <function name="itdb_artwork_remove_thumbnails ()" link="libgpod-Artwork.html#itdb-artwork-remove-thumbnails"/>
+    <function name="itdb_artwork_get_thumb_by_type ()" link="libgpod-Artwork.html#itdb-artwork-get-thumb-by-type"/>
+    <function name="itdb_thumb_get_gdk_pixbuf ()" link="libgpod-Artwork.html#itdb-thumb-get-gdk-pixbuf"/>
+    <function name="itdb_thumb_duplicate ()" link="libgpod-Artwork.html#itdb-thumb-duplicate"/>
+    <function name="itdb_thumb_free ()" link="libgpod-Artwork.html#itdb-thumb-free"/>
+    <function name="itdb_thumb_new ()" link="libgpod-Artwork.html#itdb-thumb-new"/>
+    <function name="itdb_thumb_get_filename ()" link="libgpod-Artwork.html#itdb-thumb-get-filename"/>
+    <function name="Itdb_Device" link="libgpod-Device.html#Itdb-Device"/>
+    <function name="itdb_device_new ()" link="libgpod-Device.html#itdb-device-new"/>
+    <function name="itdb_device_free ()" link="libgpod-Device.html#itdb-device-free"/>
+    <function name="itdb_device_set_mountpoint ()" link="libgpod-Device.html#itdb-device-set-mountpoint"/>
+    <function name="itdb_device_read_sysinfo ()" link="libgpod-Device.html#itdb-device-read-sysinfo"/>
+    <function name="itdb_device_get_sysinfo ()" link="libgpod-Device.html#itdb-device-get-sysinfo"/>
+    <function name="enum Itdb_IpodModel" link="libgpod-Device.html#Itdb-IpodModel"/>
+    <function name="Itdb_ArtworkFormat" link="libgpod-Device.html#Itdb-ArtworkFormat"/>
+  </functions>
+</book>

Added: libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp2
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp2	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/libgpod.devhelp2	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
+<book xmlns="http://www.devhelp.net/book" title="libgpod Reference Manual" link="index.html" author="Jorg SchulerChristophe Fergeau" name="libgpod" version="2">
+  <chapters>
+    <sub name="iPod database" link="ch01.html">
+      <sub name="iPod database reading/writing" link="libgpod-The-Itdb-iTunesDB-structure.html"/>
+      <sub name="File handling functions" link="libgpod-File-handling-functions.html"/>
+      <sub name="Time handling" link="libgpod-Time-handling.html"/>
+      <sub name="Low-level functions" link="libgpod-Low-level-functions.html"/>
+    </sub>
+    <sub name="iPod database components" link="ch02.html">
+      <sub name="Tracks" link="libgpod-Tracks.html"/>
+      <sub name="Playlists" link="libgpod-Playlists.html"/>
+      <sub name="Artwork" link="libgpod-Artwork.html"/>
+      <sub name="Device" link="libgpod-Device.html"/>
+    </sub>
+  </chapters>
+  <functions>
+    <keyword type="struct" name="Itdb_iTunesDB" link="libgpod-The-Itdb-iTunesDB-structure.html#Itdb-iTunesDB"/>
+    <keyword type="function" name="ItdbUserDataDestroyFunc ()" link="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDestroyFunc"/>
+    <keyword type="function" name="ItdbUserDataDuplicateFunc ()" link="libgpod-The-Itdb-iTunesDB-structure.html#ItdbUserDataDuplicateFunc"/>
+    <keyword type="function" name="itdb_new ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-new"/>
+    <keyword type="function" name="itdb_free ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-free"/>
+    <keyword type="function" name="itdb_parse ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-parse"/>
+    <keyword type="function" name="itdb_write ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-write"/>
+    <keyword type="function" name="itdb_set_mountpoint ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-set-mountpoint"/>
+    <keyword type="function" name="itdb_get_mountpoint ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-get-mountpoint"/>
+    <keyword type="function" name="itdb_tracks_number ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number"/>
+    <keyword type="function" name="itdb_tracks_number_nontransferred ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-tracks-number-nontransferred"/>
+    <keyword type="function" name="itdb_playlists_number ()" link="libgpod-The-Itdb-iTunesDB-structure.html#itdb-playlists-number"/>
+    <keyword type="function" name="itdb_cp_track_to_ipod ()" link="libgpod-File-handling-functions.html#itdb-cp-track-to-ipod"/>
+    <keyword type="function" name="itdb_filename_fs2ipod ()" link="libgpod-File-handling-functions.html#itdb-filename-fs2ipod"/>
+    <keyword type="function" name="itdb_filename_ipod2fs ()" link="libgpod-File-handling-functions.html#itdb-filename-ipod2fs"/>
+    <keyword type="function" name="itdb_filename_on_ipod ()" link="libgpod-File-handling-functions.html#itdb-filename-on-ipod"/>
+    <keyword type="function" name="itdb_musicdirs_number ()" link="libgpod-File-handling-functions.html#itdb-musicdirs-number"/>
+    <keyword type="function" name="itdb_rename_files ()" link="libgpod-File-handling-functions.html#itdb-rename-files"/>
+    <keyword type="function" name="itdb_time_get_mac_time ()" link="libgpod-Time-handling.html#itdb-time-get-mac-time"/>
+    <keyword type="function" name="itdb_time_mac_to_host ()" link="libgpod-Time-handling.html#itdb-time-mac-to-host"/>
+    <keyword type="function" name="itdb_time_host_to_mac ()" link="libgpod-Time-handling.html#itdb-time-host-to-mac"/>
+    <keyword type="function" name="itdb_get_control_dir ()" link="libgpod-Low-level-functions.html#itdb-get-control-dir"/>
+    <keyword type="function" name="itdb_get_itunes_dir ()" link="libgpod-Low-level-functions.html#itdb-get-itunes-dir"/>
+    <keyword type="function" name="itdb_get_music_dir ()" link="libgpod-Low-level-functions.html#itdb-get-music-dir"/>
+    <keyword type="function" name="itdb_get_artwork_dir ()" link="libgpod-Low-level-functions.html#itdb-get-artwork-dir"/>
+    <keyword type="function" name="itdb_get_device_dir ()" link="libgpod-Low-level-functions.html#itdb-get-device-dir"/>
+    <keyword type="function" name="itdb_get_itunesdb_path ()" link="libgpod-Low-level-functions.html#itdb-get-itunesdb-path"/>
+    <keyword type="function" name="itdb_get_artworkdb_path ()" link="libgpod-Low-level-functions.html#itdb-get-artworkdb-path"/>
+    <keyword type="function" name="itdb_get_path ()" link="libgpod-Low-level-functions.html#itdb-get-path"/>
+    <keyword type="function" name="itdb_resolve_path ()" link="libgpod-Low-level-functions.html#itdb-resolve-path"/>
+    <keyword type="function" name="itdb_shuffle_write ()" link="libgpod-Low-level-functions.html#itdb-shuffle-write"/>
+    <keyword type="function" name="itdb_shuffle_write_file ()" link="libgpod-Low-level-functions.html#itdb-shuffle-write-file"/>
+    <keyword type="function" name="itdb_cp ()" link="libgpod-Low-level-functions.html#itdb-cp"/>
+    <keyword type="function" name="itdb_parse_file ()" link="libgpod-Low-level-functions.html#itdb-parse-file"/>
+    <keyword type="function" name="itdb_write_file ()" link="libgpod-Low-level-functions.html#itdb-write-file"/>
+    <keyword type="function" name="itdb_duplicate ()" link="libgpod-Low-level-functions.html#itdb-duplicate"/>
+    <keyword type="struct" name="Itdb_Track" link="libgpod-Tracks.html#Itdb-Track"/>
+    <keyword type="function" name="itdb_track_new ()" link="libgpod-Tracks.html#itdb-track-new"/>
+    <keyword type="function" name="itdb_track_free ()" link="libgpod-Tracks.html#itdb-track-free"/>
+    <keyword type="function" name="itdb_track_add ()" link="libgpod-Tracks.html#itdb-track-add"/>
+    <keyword type="function" name="itdb_track_remove ()" link="libgpod-Tracks.html#itdb-track-remove"/>
+    <keyword type="function" name="itdb_track_unlink ()" link="libgpod-Tracks.html#itdb-track-unlink"/>
+    <keyword type="function" name="itdb_track_duplicate ()" link="libgpod-Tracks.html#itdb-track-duplicate"/>
+    <keyword type="function" name="itdb_track_by_id ()" link="libgpod-Tracks.html#itdb-track-by-id"/>
+    <keyword type="function" name="itdb_track_id_tree_create ()" link="libgpod-Tracks.html#itdb-track-id-tree-create"/>
+    <keyword type="function" name="itdb_track_id_tree_destroy ()" link="libgpod-Tracks.html#itdb-track-id-tree-destroy"/>
+    <keyword type="function" name="itdb_track_id_tree_by_id ()" link="libgpod-Tracks.html#itdb-track-id-tree-by-id"/>
+    <keyword type="function" name="itdb_track_set_thumbnails ()" link="libgpod-Tracks.html#itdb-track-set-thumbnails"/>
+    <keyword type="function" name="itdb_track_remove_thumbnails ()" link="libgpod-Tracks.html#itdb-track-remove-thumbnails"/>
+    <keyword type="macro" name="ITDB_RATING_STEP" link="libgpod-Tracks.html#ITDB-RATING-STEP:CAPS"/>
+    <keyword type="struct" name="Itdb_Playlist" link="libgpod-Playlists.html#Itdb-Playlist"/>
+    <keyword type="enum" name="enum ItdbPlaylistSortOrder" link="libgpod-Playlists.html#ItdbPlaylistSortOrder"/>
+    <keyword type="function" name="itdb_playlist_new ()" link="libgpod-Playlists.html#itdb-playlist-new"/>
+    <keyword type="function" name="itdb_playlist_free ()" link="libgpod-Playlists.html#itdb-playlist-free"/>
+    <keyword type="function" name="itdb_playlist_duplicate ()" link="libgpod-Playlists.html#itdb-playlist-duplicate"/>
+    <keyword type="function" name="itdb_playlist_add ()" link="libgpod-Playlists.html#itdb-playlist-add"/>
+    <keyword type="function" name="itdb_playlist_move ()" link="libgpod-Playlists.html#itdb-playlist-move"/>
+    <keyword type="function" name="itdb_playlist_remove ()" link="libgpod-Playlists.html#itdb-playlist-remove"/>
+    <keyword type="function" name="itdb_playlist_unlink ()" link="libgpod-Playlists.html#itdb-playlist-unlink"/>
+    <keyword type="function" name="itdb_playlist_add_track ()" link="libgpod-Playlists.html#itdb-playlist-add-track"/>
+    <keyword type="function" name="itdb_playlist_remove_track ()" link="libgpod-Playlists.html#itdb-playlist-remove-track"/>
+    <keyword type="function" name="itdb_playlist_contains_track ()" link="libgpod-Playlists.html#itdb-playlist-contains-track"/>
+    <keyword type="function" name="itdb_playlist_contain_track_number ()" link="libgpod-Playlists.html#itdb-playlist-contain-track-number"/>
+    <keyword type="function" name="itdb_playlist_tracks_number ()" link="libgpod-Playlists.html#itdb-playlist-tracks-number"/>
+    <keyword type="function" name="itdb_playlist_mpl ()" link="libgpod-Playlists.html#itdb-playlist-mpl"/>
+    <keyword type="function" name="itdb_playlist_is_mpl ()" link="libgpod-Playlists.html#itdb-playlist-is-mpl"/>
+    <keyword type="function" name="itdb_playlist_set_mpl ()" link="libgpod-Playlists.html#itdb-playlist-set-mpl"/>
+    <keyword type="function" name="itdb_playlist_podcasts ()" link="libgpod-Playlists.html#itdb-playlist-podcasts"/>
+    <keyword type="function" name="itdb_playlist_is_podcasts ()" link="libgpod-Playlists.html#itdb-playlist-is-podcasts"/>
+    <keyword type="function" name="itdb_playlist_set_podcasts ()" link="libgpod-Playlists.html#itdb-playlist-set-podcasts"/>
+    <keyword type="function" name="itdb_playlist_exists ()" link="libgpod-Playlists.html#itdb-playlist-exists"/>
+    <keyword type="function" name="itdb_playlist_by_id ()" link="libgpod-Playlists.html#itdb-playlist-by-id"/>
+    <keyword type="function" name="itdb_playlist_by_nr ()" link="libgpod-Playlists.html#itdb-playlist-by-nr"/>
+    <keyword type="function" name="itdb_playlist_by_name ()" link="libgpod-Playlists.html#itdb-playlist-by-name"/>
+    <keyword type="function" name="itdb_playlist_randomize ()" link="libgpod-Playlists.html#itdb-playlist-randomize"/>
+    <keyword type="struct" name="Itdb_Artwork" link="libgpod-Artwork.html#Itdb-Artwork"/>
+    <keyword type="struct" name="Itdb_Thumb" link="libgpod-Artwork.html#Itdb-Thumb"/>
+    <keyword type="enum" name="enum ItdbThumbType" link="libgpod-Artwork.html#ItdbThumbType"/>
+    <keyword type="function" name="itdb_artwork_new ()" link="libgpod-Artwork.html#itdb-artwork-new"/>
+    <keyword type="function" name="itdb_artwork_duplicate ()" link="libgpod-Artwork.html#itdb-artwork-duplicate"/>
+    <keyword type="function" name="itdb_artwork_free ()" link="libgpod-Artwork.html#itdb-artwork-free"/>
+    <keyword type="function" name="itdb_artwork_add_thumbnail ()" link="libgpod-Artwork.html#itdb-artwork-add-thumbnail"/>
+    <keyword type="function" name="itdb_artwork_remove_thumbnail ()" link="libgpod-Artwork.html#itdb-artwork-remove-thumbnail"/>
+    <keyword type="function" name="itdb_artwork_remove_thumbnails ()" link="libgpod-Artwork.html#itdb-artwork-remove-thumbnails"/>
+    <keyword type="function" name="itdb_artwork_get_thumb_by_type ()" link="libgpod-Artwork.html#itdb-artwork-get-thumb-by-type"/>
+    <keyword type="function" name="itdb_thumb_get_gdk_pixbuf ()" link="libgpod-Artwork.html#itdb-thumb-get-gdk-pixbuf"/>
+    <keyword type="function" name="itdb_thumb_duplicate ()" link="libgpod-Artwork.html#itdb-thumb-duplicate"/>
+    <keyword type="function" name="itdb_thumb_free ()" link="libgpod-Artwork.html#itdb-thumb-free"/>
+    <keyword type="function" name="itdb_thumb_new ()" link="libgpod-Artwork.html#itdb-thumb-new"/>
+    <keyword type="function" name="itdb_thumb_get_filename ()" link="libgpod-Artwork.html#itdb-thumb-get-filename"/>
+    <keyword type="struct" name="Itdb_Device" link="libgpod-Device.html#Itdb-Device"/>
+    <keyword type="function" name="itdb_device_new ()" link="libgpod-Device.html#itdb-device-new"/>
+    <keyword type="function" name="itdb_device_free ()" link="libgpod-Device.html#itdb-device-free"/>
+    <keyword type="function" name="itdb_device_set_mountpoint ()" link="libgpod-Device.html#itdb-device-set-mountpoint"/>
+    <keyword type="function" name="itdb_device_read_sysinfo ()" link="libgpod-Device.html#itdb-device-read-sysinfo"/>
+    <keyword type="function" name="itdb_device_get_sysinfo ()" link="libgpod-Device.html#itdb-device-get-sysinfo"/>
+    <keyword type="enum" name="enum Itdb_IpodModel" link="libgpod-Device.html#Itdb-IpodModel"/>
+    <keyword type="struct" name="Itdb_ArtworkFormat" link="libgpod-Device.html#Itdb-ArtworkFormat"/>
+  </functions>
+</book>

Added: libgpod/branches/upstream/current/docs/reference/html/right.png
===================================================================
(Binary files differ)


Property changes on: libgpod/branches/upstream/current/docs/reference/html/right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: libgpod/branches/upstream/current/docs/reference/html/style.css
===================================================================
--- libgpod/branches/upstream/current/docs/reference/html/style.css	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/html/style.css	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,88 @@
+.synopsis, .classsynopsis 
+{
+  background: #eeeeee;
+  border: solid 1px #aaaaaa;
+  padding: 0.5em;
+}
+.programlisting 
+{
+  background: #eeeeff;
+  border: solid 1px #aaaaff;
+  padding: 0.5em;
+}
+.variablelist 
+{
+  padding: 4px;
+  margin-left: 3em;
+}
+.variablelist td:first-child
+{
+  vertical-align: top;
+}
+div a[name]
+{
+  position: relative;
+  top: -4.5em;
+}
+table.navigation#top
+{
+  background: #ffeeee;
+  border: solid 1px #ffaaaa;
+  margin-top: 0;
+  margin-bottom: 0;
+  position: fixed;
+  top: 0;
+  left: 0;
+  height: 2em;
+  z-index: 1;
+}
+.navigation a 
+{
+  color: #770000;
+}
+.navigation a:visited 
+{
+  color: #550000;
+}
+.navigation .title 
+{
+  font-size: 200%;
+}
+td.shortcuts
+{
+  color: #770000;
+  font-size: 80%;
+}
+
+div.refentry, div.chapter, div.part, div.book, div.index, div.glossary, div.sect1
+{
+  position: relative;
+  top: 3em;
+  z-index: 0;
+}
+div.refnamediv 
+{
+  margin-top: 2em;
+}
+div.gallery-float 
+{
+  float: left;
+  padding: 10px;
+}
+div.gallery-float img 
+{
+  border-style: none;
+}
+div.gallery-spacer 
+{
+  clear: both;
+}
+a
+{
+  text-decoration: none;
+}
+a:hover
+{
+  text-decoration: underline;
+  color: #FF0000;
+}

Added: libgpod/branches/upstream/current/docs/reference/html/up.png
===================================================================
(Binary files differ)


Property changes on: libgpod/branches/upstream/current/docs/reference/html/up.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: libgpod/branches/upstream/current/docs/reference/libgpod-docs.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/libgpod-docs.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/libgpod-docs.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+  <bookinfo>
+    <title>libgpod Reference Manual</title>
+    <releaseinfo>for libgpod <xi:include href="version.xml"/></releaseinfo>
+    <authorgroup>
+      <author>
+	<firstname>Jorg</firstname>
+	<surname>Schuler</surname>
+	<affiliation>
+	  <address>
+	    <email>jorg.schuler at gmx.de</email>
+	  </address>
+	</affiliation>
+      </author>
+      <author>
+	<firstname>Christophe</firstname>
+	<surname>Fergeau</surname>
+	<affiliation>
+	  <address>
+	    <email>teuf at gnome.org</email>
+	  </address>
+	</affiliation>
+      </author>
+    </authorgroup>
+    <copyright>
+      <year>2006</year>
+      <holder>Christophe Fergeau</holder>
+    </copyright>
+
+    <legalnotice>
+      <para>Permission is granted to copy, distribute and/or modify
+      this document under the terms of the <citetitle>GNU Free
+      Documentation License</citetitle>, Version 1.1 or any later
+      version published by the Free Software Foundation with no
+      Invariant Sections, no Front-Cover Texts, and no Back-Cover
+      Texts. You may obtain a copy of the <citetitle>GNU Free
+      Documentation License</citetitle> from the Free Software
+      Foundation by visiting <ulink type="http"
+      url="http://www.fsf.org">their Web site</ulink> or by writing
+      to: Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+      Boston, MA 02111-1307, USA.</para>
+
+      <para>Many of the names used by companies to distinguish their
+      products and services are claimed as trademarks. Where those
+      names appear in any GNOME documentation, and those trademarks
+      are made aware to the members of the GNOME Documentation
+      Project, the names have been printed in caps or initial
+      caps.</para>
+    </legalnotice>
+
+    <abstract>
+      <para>This manual documents the interfaces of the libgpod
+      library and has some short notes to help get you up to speed
+      with using the library.</para>
+    </abstract>
+  </bookinfo>
+
+  <chapter>
+    <title>iPod database</title>
+    <xi:include href="xml/itunesdb-db.xml"/>
+    <xi:include href="xml/itunesdb-copying.xml"/>
+    <xi:include href="xml/itunesdb-time.xml"/>
+    <xi:include href="xml/itunesdb-lowlevel.xml"/>
+  </chapter>
+  <chapter>
+    <title>iPod database components</title>
+    <xi:include href="xml/track.xml"/>
+    <xi:include href="xml/playlists.xml"/>
+    <xi:include href="xml/artwork.xml"/>
+    <xi:include href="xml/device.xml"/>
+  </chapter>
+</book>

Added: libgpod/branches/upstream/current/docs/reference/libgpod-overrides.txt
===================================================================

Added: libgpod/branches/upstream/current/docs/reference/libgpod-sections.txt
===================================================================
--- libgpod/branches/upstream/current/docs/reference/libgpod-sections.txt	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/libgpod-sections.txt	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,266 @@
+<SECTION>
+<FILE>itunesdb-db</FILE>
+<TITLE>The Itdb_iTunesDB structure</TITLE>
+Itdb_iTunesDB
+ItdbUserDataDestroyFunc
+ItdbUserDataDuplicateFunc
+
+itdb_new
+itdb_free
+itdb_parse
+itdb_write
+itdb_set_mountpoint
+itdb_get_mountpoint
+
+itdb_tracks_number
+itdb_tracks_number_nontransferred
+itdb_playlists_number
+</SECTION>
+
+<SECTION>
+<FILE>itunesdb-copying</FILE>
+<TITLE>File handling functions</TITLE>
+itdb_cp_track_to_ipod
+itdb_filename_fs2ipod
+itdb_filename_ipod2fs
+itdb_filename_on_ipod
+itdb_musicdirs_number
+itdb_rename_files
+</SECTION>
+
+<SECTION>
+<FILE>itunesdb-lowlevel</FILE>
+<TITLE>Low-level functions</TITLE>
+itdb_get_control_dir
+itdb_get_itunes_dir
+itdb_get_music_dir
+itdb_get_artwork_dir
+itdb_get_device_dir
+itdb_get_itunesdb_path
+itdb_get_artworkdb_path
+itdb_get_path
+
+itdb_resolve_path
+itdb_shuffle_write
+itdb_shuffle_write_file
+itdb_cp
+itdb_parse_file
+itdb_write_file
+itdb_duplicate
+</SECTION>
+
+<SECTION>
+<FILE>itunesdb-time</FILE>
+<TITLE>Time handling</TITLE>
+itdb_time_get_mac_time
+itdb_time_mac_to_host
+itdb_time_host_to_mac
+</SECTION>
+
+<SECTION>
+<FILE>track</FILE>
+<TITLE>Tracks</TITLE>
+Itdb_Track
+itdb_track_new
+itdb_track_free
+itdb_track_add
+itdb_track_remove
+itdb_track_unlink
+itdb_track_duplicate
+itdb_track_by_id
+itdb_track_id_tree_create
+itdb_track_id_tree_destroy
+itdb_track_id_tree_by_id
+itdb_track_set_thumbnails
+itdb_track_remove_thumbnails
+ITDB_RATING_STEP
+</SECTION>
+
+
+<SECTION>
+<FILE>playlists</FILE>
+<TITLE>Playlists</TITLE>
+Itdb_Playlist
+ItdbPlaylistSortOrder
+itdb_playlist_new
+itdb_playlist_free
+itdb_playlist_duplicate
+itdb_playlist_add
+itdb_playlist_move
+itdb_playlist_remove
+itdb_playlist_unlink
+
+itdb_playlist_add_track
+itdb_playlist_remove_track
+itdb_playlist_contains_track
+itdb_playlist_contain_track_number
+itdb_playlist_tracks_number
+
+itdb_playlist_mpl
+itdb_playlist_is_mpl
+itdb_playlist_set_mpl
+itdb_playlist_podcasts
+itdb_playlist_is_podcasts
+itdb_playlist_set_podcasts
+itdb_playlist_exists
+itdb_playlist_by_id
+itdb_playlist_by_nr
+itdb_playlist_by_name
+
+itdb_playlist_randomize
+</SECTION>
+
+<SECTION>
+<FILE>smart-playlists</FILE>
+<TITLE>Smart Playlists</TITLE>
+SPLPref
+SPLRule
+SPLRules
+SPLAction
+SPLFieldType
+SPLActionType
+SPLField
+SPLDATE_IDENTIFIER
+SPL_MAXSTRINGLENGTH
+SPL_STRING_MAXLEN
+itdb_splr_get_field_type
+itdb_splr_get_action_type
+itdb_splr_validate
+itdb_splr_remove
+itdb_splr_new
+itdb_splr_add
+itdb_splr_add_new
+itdb_spl_copy_rules
+itdb_splr_eval
+itdb_spl_update
+itdb_spl_update_all
+itdb_spl_update_live
+</SECTION>
+
+<SECTION>
+<FILE>device</FILE>
+<TITLE>Device</TITLE>
+Itdb_Device
+itdb_device_new
+itdb_device_free
+itdb_device_set_mountpoint
+itdb_device_read_sysinfo
+itdb_device_get_sysinfo
+Itdb_IpodModel
+Itdb_ArtworkFormat
+Itdb_Generation
+Itdb_ModelType
+</SECTION>
+
+<SECTION>
+<FILE>artwork</FILE>
+<TITLE>Artwork</TITLE>
+Itdb_Artwork
+Itdb_Thumb
+ItdbThumbType
+itdb_artwork_new
+itdb_artwork_duplicate
+itdb_artwork_free
+itdb_artwork_add_thumbnail
+itdb_artwork_remove_thumbnail
+itdb_artwork_remove_thumbnails
+itdb_artwork_get_thumb_by_type
+itdb_thumb_get_gdk_pixbuf
+itdb_thumb_duplicate
+itdb_thumb_free
+itdb_thumb_new
+itdb_thumb_get_filename
+</SECTION>
+
+
+
+
+<SECTION>
+<FILE>Internal</FILE>
+<SUBSECTION Private>
+G_GNUC_INTERNAL
+g_stat
+g_mkdir
+g_rename
+g_printf
+G_IS_DIR_SEPARATOR
+dump_mhif
+dump_mhia
+dump_mhod_type_1
+dump_mhod_type_3
+dump_mhni
+dump_mhod
+dump_mhii
+dump_mhl
+dump_mhsd
+dump_mhfd
+dump_mhba
+ITUNESDB_MAX_SIZE
+MHeader
+MhlHeader
+MhbdHeader
+ArtworkDB_MhsdHeader
+MhltHeader
+MhlpHeader
+MhypHeader
+MhipHeader
+MhitHeader
+ArtworkDB_MhodHeader
+MhfdHeader
+MhliHeader
+MhiiHeader
+MhniHeader
+MhlaHeader
+MhbaHeader
+MhlfHeader
+MhifHeader
+MhiaHeader
+MhitHeader471
+ArtworkDB_MhodHeaderArtworkType3
+MhodHeaderString
+MhodHeaderArtworkType1
+MhodHeaderSmartPlaylistData
+MhodHeaderSmartPlaylistRuleString
+MhodHeaderSmartPlaylistRuleNonString
+MhodHeaderSmartPlaylistRule
+iTunesDB_MhsdHeader
+MhodHeader
+_MhodHeaderArtworkType1
+MhodHeaderArtworkType3
+playcount
+NO_PLAYCOUNT
+WCONTENTS_STEPSIZE
+RED_BITS
+RED_SHIFT
+RED_MASK
+GREEN_BITS
+GREEN_SHIFT
+GREEN_MASK
+BLUE_BITS
+BLUE_SHIFT
+BLUE_MASK
+DBParseContext
+db_parse_context_get_m_header
+iPodSong
+DB_TO_CPU_GET
+DB_TO_CPU_GET_DB
+ItdbFileError
+ITDB_FILE_ERROR
+itdb_file_error_quark
+
+SPLACTION_LAST_HOURS_VALUE
+SPLACTION_LAST_MINUTES_VALUE
+SPLACTION_LAST_YEARS_VALUE
+SPLACTION_LAST_LUNARCYCLE_VALUE
+SPLACTION_LAST_SIDEREAL_DAY
+SPLACTION_LAST_SWATCH_BEAT
+SPLACTION_LAST_MOMENT
+SPLACTION_LAST_OSTENT
+SPLACTION_LAST_FORTNIGHT
+SPLACTION_LAST_VINAL
+SPLACTION_LAST_QUARTER
+SPLACTION_LAST_SOLAR_YEAR
+SPLACTION_LAST_SIDEREAL_YEAR
+
+</SECTION>
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/Internal.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/Internal.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/Internal.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,19 @@
+<!-- ##### SECTION Title ##### -->
+Internal
+
+<!-- ##### SECTION Short_Description ##### -->
+Symbols to be hidden ;)
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/artwork.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/artwork.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/artwork.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,169 @@
+<!-- ##### SECTION Title ##### -->
+Artwork
+
+<!-- ##### SECTION Short_Description ##### -->
+Data structure to store iPod artwork (cover and photos)
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT Itdb_Artwork ##### -->
+<para>
+
+</para>
+
+ at thumbnails: 
+ at artwork_size: 
+ at id: 
+ at creation_date: 
+ at usertype: 
+ at userdata: 
+ at userdata_duplicate: 
+ at userdata_destroy: 
+
+<!-- ##### STRUCT Itdb_Thumb ##### -->
+<para>
+
+</para>
+
+ at type: 
+ at filename: 
+ at image_data: 
+ at image_data_len: 
+ at offset: 
+ at size: 
+ at width: 
+ at height: 
+ at horizontal_padding: 
+ at vertical_padding: 
+
+<!-- ##### ENUM ItdbThumbType ##### -->
+<para>
+
+</para>
+
+ at ITDB_THUMB_COVER_SMALL: 
+ at ITDB_THUMB_COVER_LARGE: 
+ at ITDB_THUMB_PHOTO_SMALL: 
+ at ITDB_THUMB_PHOTO_LARGE: 
+ at ITDB_THUMB_PHOTO_FULL_SCREEN: 
+ at ITDB_THUMB_PHOTO_TV_SCREEN: 
+
+<!-- ##### FUNCTION itdb_artwork_new ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_artwork_duplicate ##### -->
+<para>
+
+</para>
+
+ at artwork: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_artwork_free ##### -->
+<para>
+
+</para>
+
+ at artwork: 
+
+
+<!-- ##### FUNCTION itdb_artwork_add_thumbnail ##### -->
+<para>
+
+</para>
+
+ at artwork: 
+ at type: 
+ at filename: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_artwork_remove_thumbnail ##### -->
+<para>
+
+</para>
+
+ at artwork: 
+ at thumb: 
+
+
+<!-- ##### FUNCTION itdb_artwork_remove_thumbnails ##### -->
+<para>
+
+</para>
+
+ at artwork: 
+
+
+<!-- ##### FUNCTION itdb_artwork_get_thumb_by_type ##### -->
+<para>
+
+</para>
+
+ at artwork: 
+ at type: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_thumb_get_gdk_pixbuf ##### -->
+<para>
+
+</para>
+
+ at device: 
+ at thumb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_thumb_duplicate ##### -->
+<para>
+
+</para>
+
+ at thumb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_thumb_free ##### -->
+<para>
+
+</para>
+
+ at thumb: 
+
+
+<!-- ##### FUNCTION itdb_thumb_new ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_thumb_get_filename ##### -->
+<para>
+
+</para>
+
+ at device: 
+ at thumb: 
+ at Returns: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/device.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/device.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/device.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,112 @@
+<!-- ##### SECTION Title ##### -->
+Device
+
+<!-- ##### SECTION Short_Description ##### -->
+Data structure holding information about the iPod (model, mount point, ...)
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT Itdb_Device ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at musicdirs: 
+ at byte_order: 
+ at sysinfo: 
+ at sysinfo_changed: 
+
+<!-- ##### FUNCTION itdb_device_new ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_device_free ##### -->
+<para>
+
+</para>
+
+ at device: 
+
+
+<!-- ##### FUNCTION itdb_device_set_mountpoint ##### -->
+<para>
+
+</para>
+
+ at device: 
+ at mp: 
+
+
+<!-- ##### FUNCTION itdb_device_read_sysinfo ##### -->
+<para>
+
+</para>
+
+ at device: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_device_get_sysinfo ##### -->
+<para>
+
+</para>
+
+ at device: 
+ at field: 
+ at Returns: 
+
+
+<!-- ##### ENUM Itdb_IpodModel ##### -->
+<para>
+
+</para>
+
+ at ITDB_IPOD_MODEL_INVALID: 
+ at ITDB_IPOD_MODEL_UNKNOWN: 
+ at ITDB_IPOD_MODEL_COLOR: 
+ at ITDB_IPOD_MODEL_COLOR_U2: 
+ at ITDB_IPOD_MODEL_REGULAR: 
+ at ITDB_IPOD_MODEL_REGULAR_U2: 
+ at ITDB_IPOD_MODEL_MINI: 
+ at ITDB_IPOD_MODEL_MINI_BLUE: 
+ at ITDB_IPOD_MODEL_MINI_PINK: 
+ at ITDB_IPOD_MODEL_MINI_GREEN: 
+ at ITDB_IPOD_MODEL_MINI_GOLD: 
+ at ITDB_IPOD_MODEL_SHUFFLE: 
+ at ITDB_IPOD_MODEL_NANO_WHITE: 
+ at ITDB_IPOD_MODEL_NANO_BLACK: 
+ at ITDB_IPOD_MODEL_VIDEO_WHITE: 
+ at ITDB_IPOD_MODEL_VIDEO_BLACK: 
+ at ITDB_IPOD_MODEL_MOBILE_1: 
+ at ITDB_IPOD_MODEL_VIDEO_U2: 
+ at ITDB_IPOD_MODEL_NANO_SILVER: 
+ at ITDB_IPOD_MODEL_NANO_BLUE: 
+ at ITDB_IPOD_MODEL_NANO_GREEN: 
+ at ITDB_IPOD_MODEL_NANO_PINK: 
+
+<!-- ##### STRUCT Itdb_ArtworkFormat ##### -->
+<para>
+
+</para>
+
+ at type: 
+ at width: 
+ at height: 
+ at correlation_id: 
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-copying.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-copying.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-copying.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,74 @@
+<!-- ##### SECTION Title ##### -->
+File handling functions
+
+<!-- ##### SECTION Short_Description ##### -->
+Functions to copy new files to the iPod
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### FUNCTION itdb_cp_track_to_ipod ##### -->
+<para>
+
+</para>
+
+ at track: 
+ at filename: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_filename_fs2ipod ##### -->
+<para>
+
+</para>
+
+ at filename: 
+
+
+<!-- ##### FUNCTION itdb_filename_ipod2fs ##### -->
+<para>
+
+</para>
+
+ at ipod_file: 
+
+
+<!-- ##### FUNCTION itdb_filename_on_ipod ##### -->
+<para>
+
+</para>
+
+ at track: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_musicdirs_number ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_rename_files ##### -->
+<para>
+
+</para>
+
+ at mp: 
+ at error: 
+ at Returns: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-db.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-db.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-db.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,133 @@
+<!-- ##### SECTION Title ##### -->
+iPod database reading/writing
+
+<!-- ##### SECTION Short_Description ##### -->
+Functions to create, read, write the iPod database
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT Itdb_iTunesDB ##### -->
+<para>
+
+</para>
+
+ at tracks: 
+ at playlists: 
+ at filename: 
+ at device: 
+ at version: 
+ at id: 
+ at usertype: 
+ at userdata: 
+ at userdata_duplicate: 
+ at userdata_destroy: 
+
+<!-- ##### USER_FUNCTION ItdbUserDataDestroyFunc ##### -->
+<para>
+
+</para>
+
+ at userdata: 
+
+
+<!-- ##### USER_FUNCTION ItdbUserDataDuplicateFunc ##### -->
+<para>
+
+</para>
+
+ at userdata: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_new ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_free ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+
+
+<!-- ##### FUNCTION itdb_parse ##### -->
+<para>
+
+</para>
+
+ at mp: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_write ##### -->
+<para>
+
+</para>
+
+ at db: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_set_mountpoint ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at mp: 
+
+
+<!-- ##### FUNCTION itdb_get_mountpoint ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_tracks_number ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_tracks_number_nontransferred ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlists_number ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-lowlevel.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-lowlevel.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-lowlevel.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,164 @@
+<!-- ##### SECTION Title ##### -->
+Low-level functions
+
+<!-- ##### SECTION Short_Description ##### -->
+Low-level functions which shouldn't be needed in normal situations
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### FUNCTION itdb_get_control_dir ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_itunes_dir ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_music_dir ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_artwork_dir ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_device_dir ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_itunesdb_path ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_artworkdb_path ##### -->
+<para>
+
+</para>
+
+ at mountpoint: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_get_path ##### -->
+<para>
+
+</para>
+
+ at dir: 
+ at file: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_resolve_path ##### -->
+<para>
+
+</para>
+
+ at root: 
+ at components: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_shuffle_write ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_shuffle_write_file ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at filename: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_cp ##### -->
+<para>
+
+</para>
+
+ at from_file: 
+ at to_file: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_parse_file ##### -->
+<para>
+
+</para>
+
+ at filename: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_write_file ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at filename: 
+ at error: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_duplicate ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-time.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-time.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/itunesdb-time.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,45 @@
+<!-- ##### SECTION Title ##### -->
+Time handling
+
+<!-- ##### SECTION Short_Description ##### -->
+Helper functions to convert between Epoch time and Mac (iPod) time
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### FUNCTION itdb_time_get_mac_time ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_time_mac_to_host ##### -->
+<para>
+
+</para>
+
+ at mactime: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_time_host_to_mac ##### -->
+<para>
+
+</para>
+
+ at time: 
+ at Returns: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/libgpod-unused.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/libgpod-unused.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/libgpod-unused.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,162 @@
+<!-- ##### SECTION ./tmpl/itunesdb.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/itunesdb.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/itunesdb.sgml:Short_Description ##### -->
+Main data structure to manipulate an iPod content (songs, playlists, ...)
+
+
+<!-- ##### SECTION ./tmpl/itunesdb.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/itunesdb.sgml:Title ##### -->
+iTunesDB
+
+
+<!-- ##### MACRO ITDB_FILE_ERROR ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### ENUM ItdbFileError ##### -->
+<para>
+
+</para>
+
+ at ITDB_FILE_ERROR_SEEK: 
+ at ITDB_FILE_ERROR_CORRUPT: 
+ at ITDB_FILE_ERROR_NOTFOUND: 
+ at ITDB_FILE_ERROR_RENAME: 
+ at ITDB_FILE_ERROR_ITDB_CORRUPT: 
+
+<!-- ##### ENUM Itdb_Generation ##### -->
+<para>
+
+</para>
+
+ at UNKNOWN_GENERATION: 
+ at FIRST_GENERATION: 
+ at SECOND_GENERATION: 
+ at THIRD_GENERATION: 
+ at FOURTH_GENERATION: 
+ at FIFTH_GENERATION: 
+ at MOBILE_GENERATION: 
+
+<!-- ##### ENUM Itdb_ModelType ##### -->
+<para>
+
+</para>
+
+ at MODEL_TYPE_INVALID: 
+ at MODEL_TYPE_UNKNOWN: 
+ at MODEL_TYPE_COLOR: 
+ at MODEL_TYPE_COLOR_U2: 
+ at MODEL_TYPE_REGULAR: 
+ at MODEL_TYPE_REGULAR_U2: 
+ at MODEL_TYPE_MINI: 
+ at MODEL_TYPE_MINI_BLUE: 
+ at MODEL_TYPE_MINI_PINK: 
+ at MODEL_TYPE_MINI_GREEN: 
+ at MODEL_TYPE_MINI_GOLD: 
+ at MODEL_TYPE_SHUFFLE: 
+ at MODEL_TYPE_NANO_WHITE: 
+ at MODEL_TYPE_NANO_BLACK: 
+ at MODEL_TYPE_VIDEO_WHITE: 
+ at MODEL_TYPE_VIDEO_BLACK: 
+ at MODEL_TYPE_MOBILE_1: 
+
+<!-- ##### MACRO SPLACTION_LAST_FORTNIGHT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_HOURS_VALUE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_LUNARCYCLE_VALUE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_MINUTES_VALUE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_MOMENT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_OSTENT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_QUARTER ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_SIDEREAL_DAY ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_SIDEREAL_YEAR ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_SOLAR_YEAR ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_SWATCH_BEAT ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_VINAL ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### MACRO SPLACTION_LAST_YEARS_VALUE ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION itdb_file_error_quark ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/playlists.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/playlists.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/playlists.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,287 @@
+<!-- ##### SECTION Title ##### -->
+Playlists
+
+<!-- ##### SECTION Short_Description ##### -->
+Data structure to represent an iPod playlist
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT Itdb_Playlist ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at name: 
+ at type: 
+ at flag1: 
+ at flag2: 
+ at flag3: 
+ at num: 
+ at members: 
+ at is_spl: 
+ at timestamp: 
+ at id: 
+ at mhodcount: 
+ at libmhodcount: 
+ at sortorder: 
+ at podcastflag: 
+ at splpref: 
+ at splrules: 
+ at usertype: 
+ at userdata: 
+ at userdata_duplicate: 
+ at userdata_destroy: 
+
+<!-- ##### ENUM ItdbPlaylistSortOrder ##### -->
+<para>
+
+</para>
+
+ at ITDB_PSO_MANUAL: 
+ at ITDB_PSO_TITLE: 
+ at ITDB_PSO_ALBUM: 
+ at ITDB_PSO_ARTIST: 
+ at ITDB_PSO_BIRATE: 
+ at ITDB_PSO_GENRE: 
+ at ITDB_PSO_FILETYPE: 
+ at ITDB_PSO_TIME_MODIFIED: 
+ at ITDB_PSO_TRACK_NR: 
+ at ITDB_PSO_SIZE: 
+ at ITDB_PSO_TIME: 
+ at ITDB_PSO_YEAR: 
+ at ITDB_PSO_SAMPLERATE: 
+ at ITDB_PSO_COMMENT: 
+ at ITDB_PSO_TIME_ADDED: 
+ at ITDB_PSO_EQUALIZER: 
+ at ITDB_PSO_COMPOSER: 
+ at ITDB_PSO_PLAYCOUNT: 
+ at ITDB_PSO_TIME_PLAYED: 
+ at ITDB_PSO_CD_NR: 
+ at ITDB_PSO_RATING: 
+ at ITDB_PSO_RELEASE_DATE: 
+ at ITDB_PSO_BPM: 
+ at ITDB_PSO_GROUPING: 
+ at ITDB_PSO_CATEGORY: 
+ at ITDB_PSO_DESCRIPTION: 
+
+<!-- ##### FUNCTION itdb_playlist_new ##### -->
+<para>
+
+</para>
+
+ at title: 
+ at spl: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_free ##### -->
+<para>
+
+</para>
+
+ at pl: 
+
+
+<!-- ##### FUNCTION itdb_playlist_duplicate ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_add ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at pl: 
+ at pos: 
+
+
+<!-- ##### FUNCTION itdb_playlist_move ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at pos: 
+
+
+<!-- ##### FUNCTION itdb_playlist_remove ##### -->
+<para>
+
+</para>
+
+ at pl: 
+
+
+<!-- ##### FUNCTION itdb_playlist_unlink ##### -->
+<para>
+
+</para>
+
+ at pl: 
+
+
+<!-- ##### FUNCTION itdb_playlist_add_track ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at track: 
+ at pos: 
+
+
+<!-- ##### FUNCTION itdb_playlist_remove_track ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at track: 
+
+
+<!-- ##### FUNCTION itdb_playlist_contains_track ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at track: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_contain_track_number ##### -->
+<para>
+
+</para>
+
+ at tr: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_tracks_number ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_mpl ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_is_mpl ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_set_mpl ##### -->
+<para>
+
+</para>
+
+ at pl: 
+
+
+<!-- ##### FUNCTION itdb_playlist_podcasts ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_is_podcasts ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_set_podcasts ##### -->
+<para>
+
+</para>
+
+ at pl: 
+
+
+<!-- ##### FUNCTION itdb_playlist_exists ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at pl: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_by_id ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at id: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_by_nr ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at num: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_by_name ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at name: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_playlist_randomize ##### -->
+<para>
+
+</para>
+
+ at pl: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/smart-playlists.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/smart-playlists.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/smart-playlists.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,269 @@
+<!-- ##### SECTION Title ##### -->
+Smart Playlists
+
+<!-- ##### SECTION Short_Description ##### -->
+Data structures used to manipulate iPod smart playlists
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT SPLPref ##### -->
+<para>
+
+</para>
+
+ at liveupdate: 
+ at checkrules: 
+ at checklimits: 
+ at limittype: 
+ at limitsort: 
+ at limitvalue: 
+ at matchcheckedonly: 
+
+<!-- ##### STRUCT SPLRule ##### -->
+<para>
+
+</para>
+
+ at field: 
+ at action: 
+ at string: 
+ at fromvalue: 
+ at fromdate: 
+ at fromunits: 
+ at tovalue: 
+ at todate: 
+ at tounits: 
+ at unk052: 
+ at unk056: 
+ at unk060: 
+ at unk064: 
+ at unk068: 
+
+<!-- ##### STRUCT SPLRules ##### -->
+<para>
+
+</para>
+
+ at unk004: 
+ at match_operator: 
+ at rules: 
+
+<!-- ##### ENUM SPLAction ##### -->
+<para>
+
+</para>
+
+ at SPLACTION_IS_INT: 
+ at SPLACTION_IS_GREATER_THAN: 
+ at SPLACTION_IS_LESS_THAN: 
+ at SPLACTION_IS_IN_THE_RANGE: 
+ at SPLACTION_IS_IN_THE_LAST: 
+ at SPLACTION_IS_STRING: 
+ at SPLACTION_CONTAINS: 
+ at SPLACTION_STARTS_WITH: 
+ at SPLACTION_ENDS_WITH: 
+ at SPLACTION_IS_NOT_INT: 
+ at SPLACTION_IS_NOT_GREATER_THAN: 
+ at SPLACTION_IS_NOT_LESS_THAN: 
+ at SPLACTION_IS_NOT_IN_THE_RANGE: 
+ at SPLACTION_IS_NOT_IN_THE_LAST: 
+ at SPLACTION_IS_NOT: 
+ at SPLACTION_DOES_NOT_CONTAIN: 
+ at SPLACTION_DOES_NOT_START_WITH: 
+ at SPLACTION_DOES_NOT_END_WITH: 
+
+<!-- ##### ENUM SPLFieldType ##### -->
+<para>
+
+</para>
+
+ at splft_string: 
+ at splft_int: 
+ at splft_boolean: 
+ at splft_date: 
+ at splft_playlist: 
+ at splft_unknown: 
+
+<!-- ##### ENUM SPLActionType ##### -->
+<para>
+
+</para>
+
+ at splat_string: 
+ at splat_int: 
+ at splat_date: 
+ at splat_range_int: 
+ at splat_range_date: 
+ at splat_inthelast: 
+ at splat_playlist: 
+ at splat_none: 
+ at splat_invalid: 
+ at splat_unknown: 
+
+<!-- ##### ENUM SPLField ##### -->
+<para>
+
+</para>
+
+ at SPLFIELD_SONG_NAME: 
+ at SPLFIELD_ALBUM: 
+ at SPLFIELD_ARTIST: 
+ at SPLFIELD_BITRATE: 
+ at SPLFIELD_SAMPLE_RATE: 
+ at SPLFIELD_YEAR: 
+ at SPLFIELD_GENRE: 
+ at SPLFIELD_KIND: 
+ at SPLFIELD_DATE_MODIFIED: 
+ at SPLFIELD_TRACKNUMBER: 
+ at SPLFIELD_SIZE: 
+ at SPLFIELD_TIME: 
+ at SPLFIELD_COMMENT: 
+ at SPLFIELD_DATE_ADDED: 
+ at SPLFIELD_COMPOSER: 
+ at SPLFIELD_PLAYCOUNT: 
+ at SPLFIELD_LAST_PLAYED: 
+ at SPLFIELD_DISC_NUMBER: 
+ at SPLFIELD_RATING: 
+ at SPLFIELD_COMPILATION: 
+ at SPLFIELD_BPM: 
+ at SPLFIELD_GROUPING: 
+ at SPLFIELD_PLAYLIST: 
+
+<!-- ##### MACRO SPLDATE_IDENTIFIER ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### MACRO SPL_MAXSTRINGLENGTH ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### MACRO SPL_STRING_MAXLEN ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### FUNCTION itdb_splr_get_field_type ##### -->
+<para>
+
+</para>
+
+ at splr: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_splr_get_action_type ##### -->
+<para>
+
+</para>
+
+ at splr: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_splr_validate ##### -->
+<para>
+
+</para>
+
+ at splr: 
+
+
+<!-- ##### FUNCTION itdb_splr_remove ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at splr: 
+
+
+<!-- ##### FUNCTION itdb_splr_new ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_splr_add ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at splr: 
+ at pos: 
+
+
+<!-- ##### FUNCTION itdb_splr_add_new ##### -->
+<para>
+
+</para>
+
+ at pl: 
+ at pos: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_spl_copy_rules ##### -->
+<para>
+
+</para>
+
+ at dest: 
+ at src: 
+
+
+<!-- ##### FUNCTION itdb_splr_eval ##### -->
+<para>
+
+</para>
+
+ at splr: 
+ at track: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_spl_update ##### -->
+<para>
+
+</para>
+
+ at spl: 
+
+
+<!-- ##### FUNCTION itdb_spl_update_all ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+
+
+<!-- ##### FUNCTION itdb_spl_update_live ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+
+

Added: libgpod/branches/upstream/current/docs/reference/tmpl/track.sgml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/tmpl/track.sgml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/tmpl/track.sgml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,232 @@
+<!-- ##### SECTION Title ##### -->
+Tracks
+
+<!-- ##### SECTION Short_Description ##### -->
+Data structure to store metadata about an iPod track
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT Itdb_Track ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at title: 
+ at ipod_path: 
+ at album: 
+ at artist: 
+ at genre: 
+ at filetype: 
+ at comment: 
+ at category: 
+ at composer: 
+ at grouping: 
+ at description: 
+ at podcasturl: 
+ at podcastrss: 
+ at chapterdata: 
+ at subtitle: 
+ at id: 
+ at size: 
+ at tracklen: 
+ at cd_nr: 
+ at cds: 
+ at track_nr: 
+ at tracks: 
+ at bitrate: 
+ at samplerate: 
+ at samplerate_low: 
+ at year: 
+ at volume: 
+ at soundcheck: 
+ at time_added: 
+ at time_played: 
+ at time_modified: 
+ at bookmark_time: 
+ at rating: 
+ at playcount: 
+ at playcount2: 
+ at recent_playcount: 
+ at transferred: 
+ at BPM: 
+ at app_rating: 
+ at type1: 
+ at type2: 
+ at compilation: 
+ at starttime: 
+ at stoptime: 
+ at checked: 
+ at dbid: 
+ at drm_userid: 
+ at visible: 
+ at filetype_marker: 
+ at artwork_count: 
+ at artwork_size: 
+ at samplerate2: 
+ at unk126: 
+ at unk132: 
+ at time_released: 
+ at unk144: 
+ at unk146: 
+ at unk148: 
+ at unk152: 
+ at unk156: 
+ at unk160: 
+ at has_artwork: 
+ at skip_when_shuffling: 
+ at remember_playback_position: 
+ at flag4: 
+ at dbid2: 
+ at lyrics_flag: 
+ at movie_flag: 
+ at mark_unplayed: 
+ at unk179: 
+ at unk180: 
+ at unk184: 
+ at samplecount: 
+ at unk192: 
+ at unk196: 
+ at unk200: 
+ at unk204: 
+ at unk208: 
+ at unk212: 
+ at unk216: 
+ at unk220: 
+ at unk224: 
+ at unk228: 
+ at unk232: 
+ at unk236: 
+ at unk240: 
+ at chapterdata_raw: 
+ at chapterdata_raw_length: 
+ at artwork: 
+ at usertype: 
+ at userdata: 
+ at userdata_duplicate: 
+ at userdata_destroy: 
+
+<!-- ##### FUNCTION itdb_track_new ##### -->
+<para>
+
+</para>
+
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_track_free ##### -->
+<para>
+
+</para>
+
+ at track: 
+
+
+<!-- ##### FUNCTION itdb_track_add ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at track: 
+ at pos: 
+
+
+<!-- ##### FUNCTION itdb_track_remove ##### -->
+<para>
+
+</para>
+
+ at track: 
+
+
+<!-- ##### FUNCTION itdb_track_unlink ##### -->
+<para>
+
+</para>
+
+ at track: 
+
+
+<!-- ##### FUNCTION itdb_track_duplicate ##### -->
+<para>
+
+</para>
+
+ at tr: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_track_by_id ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at id: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_track_id_tree_create ##### -->
+<para>
+
+</para>
+
+ at itdb: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_track_id_tree_destroy ##### -->
+<para>
+
+</para>
+
+ at idtree: 
+
+
+<!-- ##### FUNCTION itdb_track_id_tree_by_id ##### -->
+<para>
+
+</para>
+
+ at idtree: 
+ at id: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_track_set_thumbnails ##### -->
+<para>
+
+</para>
+
+ at track: 
+ at filename: 
+ at Returns: 
+
+
+<!-- ##### FUNCTION itdb_track_remove_thumbnails ##### -->
+<para>
+
+</para>
+
+ at track: 
+
+
+<!-- ##### MACRO ITDB_RATING_STEP ##### -->
+<para>
+
+</para>
+
+
+

Added: libgpod/branches/upstream/current/docs/reference/version.xml.in
===================================================================
--- libgpod/branches/upstream/current/docs/reference/version.xml.in	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/version.xml.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,4 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<phrase>@LIBGPOD_VERSION@</phrase>

Added: libgpod/branches/upstream/current/docs/reference/xml/Internal.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/Internal.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/Internal.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Internal">
+<refmeta>
+<refentrytitle role="top_of_page">Internal</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Internal</refname>
+<refpurpose>Symbols to be hidden ;)</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/artwork.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/artwork.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/artwork.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,318 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Artwork">
+<refmeta>
+<refentrytitle role="top_of_page">Artwork</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Artwork</refname>
+<refpurpose>Data structure to store iPod artwork (cover and photos)</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+            <link linkend="Itdb-Artwork">Itdb_Artwork</link>;
+            <link linkend="Itdb-Thumb">Itdb_Thumb</link>;
+enum        <link linkend="ItdbThumbType">ItdbThumbType</link>;
+<link linkend="Itdb-Artwork">Itdb_Artwork</link>* <link linkend="itdb-artwork-new">itdb_artwork_new</link>              (void);
+<link linkend="Itdb-Artwork">Itdb_Artwork</link>* <link linkend="itdb-artwork-duplicate">itdb_artwork_duplicate</link>        (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork);
+<link linkend="void">void</link>        <link linkend="itdb-artwork-free">itdb_artwork_free</link>               (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-artwork-add-thumbnail">itdb_artwork_add_thumbnail</link>      (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork,
+                                             <link linkend="ItdbThumbType">ItdbThumbType</link> type,
+                                             const <link linkend="gchar">gchar</link> *filename);
+<link linkend="void">void</link>        <link linkend="itdb-artwork-remove-thumbnail">itdb_artwork_remove_thumbnail</link>   (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork,
+                                             <link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);
+<link linkend="void">void</link>        <link linkend="itdb-artwork-remove-thumbnails">itdb_artwork_remove_thumbnails</link>  (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork);
+<link linkend="Itdb-Thumb">Itdb_Thumb</link>* <link linkend="itdb-artwork-get-thumb-by-type">itdb_artwork_get_thumb_by_type</link>  (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork,
+                                             <link linkend="ItdbThumbType">ItdbThumbType</link> type);
+<link linkend="gpointer">gpointer</link>    <link linkend="itdb-thumb-get-gdk-pixbuf">itdb_thumb_get_gdk_pixbuf</link>       (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             <link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);
+<link linkend="Itdb-Thumb">Itdb_Thumb</link>* <link linkend="itdb-thumb-duplicate">itdb_thumb_duplicate</link>            (<link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);
+<link linkend="void">void</link>        <link linkend="itdb-thumb-free">itdb_thumb_free</link>                 (<link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);
+<link linkend="Itdb-Thumb">Itdb_Thumb</link>* <link linkend="itdb-thumb-new">itdb_thumb_new</link>                  (void);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-thumb-get-filename">itdb_thumb_get_filename</link>         (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             <link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="Itdb-Artwork" role="struct"/>Itdb_Artwork</title>
+<indexterm><primary>Itdb_Artwork</primary></indexterm><programlisting>typedef struct {
+    GList *thumbnails;    /* list of Itdb_Thumbs */
+    guint32 artwork_size; /* Size in bytes of the original source image */
+    guint32 id;           /* Artwork id used by photoalbums, starts at
+			   * 0x40... libgpod will set this on sync. */
+    gint32 creation_date; /* Date the image was created */
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_Artwork;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="Itdb-Thumb" role="struct"/>Itdb_Thumb</title>
+<indexterm><primary>Itdb_Thumb</primary></indexterm><programlisting>typedef struct {
+    ItdbThumbType type;
+    gchar *filename;
+    guchar *image_data;      /* holds the thumbnail data of
+				non-transfered thumbnails when
+				filename == NULL */
+    gsize  image_data_len;   /* length of data */
+    guint32 offset;
+    guint32 size;
+    gint16 width;
+    gint16 height;
+    gint16 horizontal_padding;
+    gint16 vertical_padding;
+} Itdb_Thumb;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="ItdbThumbType" role="enum"/>enum ItdbThumbType</title>
+<indexterm><primary>ItdbThumbType</primary></indexterm><programlisting>typedef enum { 
+    ITDB_THUMB_COVER_SMALL,
+    ITDB_THUMB_COVER_LARGE,
+    ITDB_THUMB_PHOTO_SMALL,
+    ITDB_THUMB_PHOTO_LARGE,
+    ITDB_THUMB_PHOTO_FULL_SCREEN,
+    ITDB_THUMB_PHOTO_TV_SCREEN
+} ItdbThumbType;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-new" role="function"/>itdb_artwork_new ()</title>
+<indexterm><primary>itdb_artwork_new</primary></indexterm><programlisting><link linkend="Itdb-Artwork">Itdb_Artwork</link>* itdb_artwork_new              (void);</programlisting>
+<para>
+Creates a new <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link> to be freed with <link linkend="itdb-artwork-free"><function>itdb_artwork_free()</function></link> when
+no longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-duplicate" role="function"/>itdb_artwork_duplicate ()</title>
+<indexterm><primary>itdb_artwork_duplicate</primary></indexterm><programlisting><link linkend="Itdb-Artwork">Itdb_Artwork</link>* itdb_artwork_duplicate        (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork);</programlisting>
+<para>
+Duplicates <parameter>artwork</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>artwork</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new copy of <parameter>artwork</parameter>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-free" role="function"/>itdb_artwork_free ()</title>
+<indexterm><primary>itdb_artwork_free</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_artwork_free               (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork);</programlisting>
+<para>
+Frees memory used by <parameter>artwork</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>artwork</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-add-thumbnail" role="function"/>itdb_artwork_add_thumbnail ()</title>
+<indexterm><primary>itdb_artwork_add_thumbnail</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_artwork_add_thumbnail      (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork,
+                                             <link linkend="ItdbThumbType">ItdbThumbType</link> type,
+                                             const <link linkend="gchar">gchar</link> *filename);</programlisting>
+<para>
+Appends a thumbnail of type <parameter>type</parameter> to existing thumbnails in <parameter>artwork</parameter>. No 
+data is read from <parameter>filename</parameter> yet, the file will be when <parameter>artwork</parameter> is saved to
+disk. <parameter>filename</parameter> must still exist when that happens.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>artwork</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Thumbnail"><type>Itdb_Thumbnail</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
+<listitem><simpara> thumbnail size
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> image file to use to create the thumbnail
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the thumbnail could be successfully added, FALSE
+otherwise
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-remove-thumbnail" role="function"/>itdb_artwork_remove_thumbnail ()</title>
+<indexterm><primary>itdb_artwork_remove_thumbnail</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_artwork_remove_thumbnail   (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork,
+                                             <link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);</programlisting>
+<para>
+Removes <parameter>thumb</parameter> from <parameter>artwork</parameter>. The memory used by <parameter>thumb</parameter> isn't freed.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>artwork</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>thumb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-remove-thumbnails" role="function"/>itdb_artwork_remove_thumbnails ()</title>
+<indexterm><primary>itdb_artwork_remove_thumbnails</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_artwork_remove_thumbnails  (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork);</programlisting>
+<para>
+Removes all thumbnails from <parameter>artwork</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>artwork</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-artwork-get-thumb-by-type" role="function"/>itdb_artwork_get_thumb_by_type ()</title>
+<indexterm><primary>itdb_artwork_get_thumb_by_type</primary></indexterm><programlisting><link linkend="Itdb-Thumb">Itdb_Thumb</link>* itdb_artwork_get_thumb_by_type  (<link linkend="Itdb-Artwork">Itdb_Artwork</link> *artwork,
+                                             <link linkend="ItdbThumbType">ItdbThumbType</link> type);</programlisting>
+<para>
+Searches <parameter>artwork</parameter> for an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link> of type <parameter>type</parameter>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>artwork</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Artwork"><type>Itdb_Artwork</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
+<listitem><simpara> type of the <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link> to retrieve
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link> of type <parameter>type</parameter>, or NULL if such a thumbnail couldn't
+be found
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-thumb-get-gdk-pixbuf" role="function"/>itdb_thumb_get_gdk_pixbuf ()</title>
+<indexterm><primary>itdb_thumb_get_gdk_pixbuf</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>    itdb_thumb_get_gdk_pixbuf       (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             <link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);</programlisting>
+<para>
+Converts <parameter>thumb</parameter> to a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>.
+Since we want to have gdk-pixbuf dependency optional, a generic
+gpointer is returned which you have to cast to a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> using 
+<link linkend="GDK-PIXBUF:CAPS"><function>GDK_PIXBUF()</function></link> yourself.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>device</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Device"><type>Itdb_Device</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>thumb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> that must be unreffed with <link linkend="gdk-pixbuf-unref"><function>gdk_pixbuf_unref()</function></link>
+after use, or NULL if the creation of the gdk-pixbuf failed or if 
+libgpod was compiled without gdk-pixbuf support.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-thumb-duplicate" role="function"/>itdb_thumb_duplicate ()</title>
+<indexterm><primary>itdb_thumb_duplicate</primary></indexterm><programlisting><link linkend="Itdb-Thumb">Itdb_Thumb</link>* itdb_thumb_duplicate            (<link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);</programlisting>
+<para>
+Duplicates the data contained in <parameter>thumb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>thumb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated copy of <parameter>thumb</parameter> to be freed with 
+<link linkend="itdb-thumb-free"><function>itdb_thumb_free()</function></link> after use
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-thumb-free" role="function"/>itdb_thumb_free ()</title>
+<indexterm><primary>itdb_thumb_free</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_thumb_free                 (<link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);</programlisting>
+<para>
+Frees the memory used by <parameter>thumb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>thumb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-thumb-new" role="function"/>itdb_thumb_new ()</title>
+<indexterm><primary>itdb_thumb_new</primary></indexterm><programlisting><link linkend="Itdb-Thumb">Itdb_Thumb</link>* itdb_thumb_new                  (void);</programlisting>
+<para>
+Creates a new <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> newly allocated <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link> to be freed with <link linkend="itdb-thumb-free"><function>itdb_thumb_free()</function></link>
+after use
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-thumb-get-filename" role="function"/>itdb_thumb_get_filename ()</title>
+<indexterm><primary>itdb_thumb_get_filename</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_thumb_get_filename         (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             <link linkend="Itdb-Thumb">Itdb_Thumb</link> *thumb);</programlisting>
+<para>
+Get filename of thumbnail. If it's a thumbnail on the iPod, return
+the full path to the ithmb file. Otherwise return the full path to
+the original file.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>device</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Device"><type>Itdb_Device</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>thumb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Thumb"><type>Itdb_Thumb</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> newly allocated string containing the absolute path to the 
+thumbnail file. 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/device.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/device.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/device.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,195 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Device">
+<refmeta>
+<refentrytitle role="top_of_page">Device</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Device</refname>
+<refpurpose>Data structure holding information about the iPod (model, mount point, ...)</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+            <link linkend="Itdb-Device">Itdb_Device</link>;
+<link linkend="Itdb-Device">Itdb_Device</link>* <link linkend="itdb-device-new">itdb_device_new</link>                (void);
+<link linkend="void">void</link>        <link linkend="itdb-device-free">itdb_device_free</link>                (<link linkend="Itdb-Device">Itdb_Device</link> *device);
+<link linkend="void">void</link>        <link linkend="itdb-device-set-mountpoint">itdb_device_set_mountpoint</link>      (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             const <link linkend="gchar">gchar</link> *mp);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-device-read-sysinfo">itdb_device_read_sysinfo</link>        (<link linkend="Itdb-Device">Itdb_Device</link> *device);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-device-get-sysinfo">itdb_device_get_sysinfo</link>         (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             const <link linkend="gchar">gchar</link> *field);
+enum        <link linkend="Itdb-IpodModel">Itdb_IpodModel</link>;
+            <link linkend="Itdb-ArtworkFormat">Itdb_ArtworkFormat</link>;
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="Itdb-Device" role="struct"/>Itdb_Device</title>
+<indexterm><primary>Itdb_Device</primary></indexterm><programlisting>typedef struct {
+    gchar *mountpoint;    /* mountpoint of the iPod */
+    gint   musicdirs;     /* number of /iPod_Control/Music/F.. dirs */
+    guint  byte_order;    /* G_LITTLE_ENDIAN "regular" endianness 
+			   * G_BIG_ENDIAN "reversed" endianness (e.g. mobile
+			   * phone iTunesDBs)
+			   */
+    GHashTable *sysinfo;  /* hash with value/key pairs of all entries
+			   * in Device/SysInfo */
+    gboolean sysinfo_changed; /* Has the sysinfo hash been changed by
+				 the user (itdb_set_sysinfo) */
+} Itdb_Device;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="itdb-device-new" role="function"/>itdb_device_new ()</title>
+<indexterm><primary>itdb_device_new</primary></indexterm><programlisting><link linkend="Itdb-Device">Itdb_Device</link>* itdb_device_new                (void);</programlisting>
+<para>
+Creates a new <link linkend="Itdb-Device"><type>Itdb_Device</type></link> structure</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated <link linkend="Itdb-Device"><type>Itdb_Device</type></link> which must be freed with
+<link linkend="itdb-device-free"><function>itdb_device_free()</function></link> when no longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-device-free" role="function"/>itdb_device_free ()</title>
+<indexterm><primary>itdb_device_free</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_device_free                (<link linkend="Itdb-Device">Itdb_Device</link> *device);</programlisting>
+<para>
+Frees memory used by <parameter>device</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>device</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Device"><type>Itdb_Device</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-device-set-mountpoint" role="function"/>itdb_device_set_mountpoint ()</title>
+<indexterm><primary>itdb_device_set_mountpoint</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_device_set_mountpoint      (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             const <link linkend="gchar">gchar</link> *mp);</programlisting>
+<para>
+Sets the mountpoint of <parameter>device</parameter> to <parameter>mp</parameter> and update the cached device 
+information (in particular, re-read the SysInfo file)</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>device</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Device"><type>Itdb_Device</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>mp</parameter>&nbsp;:</term>
+<listitem><simpara> the new mount point
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-device-read-sysinfo" role="function"/>itdb_device_read_sysinfo ()</title>
+<indexterm><primary>itdb_device_read_sysinfo</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_device_read_sysinfo        (<link linkend="Itdb-Device">Itdb_Device</link> *device);</programlisting>
+<para>
+Reads the SysInfo file and stores information in device->sysinfo for
+later use.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>device</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Device"><type>Itdb_Device</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if file could be read, FALSE otherwise 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-device-get-sysinfo" role="function"/>itdb_device_get_sysinfo ()</title>
+<indexterm><primary>itdb_device_get_sysinfo</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_device_get_sysinfo         (<link linkend="Itdb-Device">Itdb_Device</link> *device,
+                                             const <link linkend="gchar">gchar</link> *field);</programlisting>
+<para>
+Retrieve specified field from the SysInfo file.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>device</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Device"><type>Itdb_Device</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>field</parameter>&nbsp;:</term>
+<listitem><simpara> field to retrive information from
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the information associated with <parameter>field</parameter>, or NULL if <parameter>field</parameter>
+couldn't be found. <link linkend="g-free"><function>g_free()</function></link> after use
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="Itdb-IpodModel" role="enum"/>enum Itdb_IpodModel</title>
+<indexterm><primary>Itdb_IpodModel</primary></indexterm><programlisting>typedef enum {
+    ITDB_IPOD_MODEL_INVALID,
+    ITDB_IPOD_MODEL_UNKNOWN,
+    ITDB_IPOD_MODEL_COLOR,
+    ITDB_IPOD_MODEL_COLOR_U2,
+    ITDB_IPOD_MODEL_REGULAR,
+    ITDB_IPOD_MODEL_REGULAR_U2,
+    ITDB_IPOD_MODEL_MINI,
+    ITDB_IPOD_MODEL_MINI_BLUE,
+    ITDB_IPOD_MODEL_MINI_PINK,
+    ITDB_IPOD_MODEL_MINI_GREEN,
+    ITDB_IPOD_MODEL_MINI_GOLD,
+    ITDB_IPOD_MODEL_SHUFFLE,
+    ITDB_IPOD_MODEL_NANO_WHITE,
+    ITDB_IPOD_MODEL_NANO_BLACK,
+    ITDB_IPOD_MODEL_VIDEO_WHITE,
+    ITDB_IPOD_MODEL_VIDEO_BLACK,
+    ITDB_IPOD_MODEL_MOBILE_1,
+    ITDB_IPOD_MODEL_VIDEO_U2,
+    ITDB_IPOD_MODEL_NANO_SILVER,
+    ITDB_IPOD_MODEL_NANO_BLUE,
+    ITDB_IPOD_MODEL_NANO_GREEN,
+    ITDB_IPOD_MODEL_NANO_PINK
+} Itdb_IpodModel;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="Itdb-ArtworkFormat" role="struct"/>Itdb_ArtworkFormat</title>
+<indexterm><primary>Itdb_ArtworkFormat</primary></indexterm><programlisting>typedef struct {
+	ItdbThumbType type;
+	gint16 width;
+	gint16 height;
+	gint16 correlation_id;
+} Itdb_ArtworkFormat;
+</programlisting>
+<para>
+
+</para></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/itunesdb-copying.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/itunesdb-copying.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/itunesdb-copying.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,200 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-File-handling-functions">
+<refmeta>
+<refentrytitle role="top_of_page">File handling functions</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>File handling functions</refname>
+<refpurpose>Functions to copy new files to the iPod</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-cp-track-to-ipod">itdb_cp_track_to_ipod</link>           (<link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="void">void</link>        <link linkend="itdb-filename-fs2ipod">itdb_filename_fs2ipod</link>           (<link linkend="gchar">gchar</link> *filename);
+<link linkend="void">void</link>        <link linkend="itdb-filename-ipod2fs">itdb_filename_ipod2fs</link>           (<link linkend="gchar">gchar</link> *ipod_file);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-filename-on-ipod">itdb_filename_on_ipod</link>           (<link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="gint">gint</link>        <link linkend="itdb-musicdirs-number">itdb_musicdirs_number</link>           (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-rename-files">itdb_rename_files</link>               (const <link linkend="gchar">gchar</link> *mp,
+                                             <link linkend="GError">GError</link> **error);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="itdb-cp-track-to-ipod" role="function"/>itdb_cp_track_to_ipod ()</title>
+<indexterm><primary>itdb_cp_track_to_ipod</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_cp_track_to_ipod           (<link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Copy one track to the iPod. The PC filename is <parameter>filename</parameter>
+and is taken literally.
+</para>
+<para>
+The mountpoint of the iPod (in local encoding) is expected in
+track-&gt;itdb-&gt;mountpoint.
+</para>
+<para>
+If <parameter>track</parameter>-&gt;transferred is set to TRUE, nothing is done. Upon
+successful transfer <parameter>track</parameter>-&gt;transferred is set to TRUE.
+</para>
+<para>
+For storage, the directories "f00 ... fnn" will be
+cycled through.
+</para>
+<para>
+The filename is constructed as "gtkpod"&lt;random number&gt; and copied
+to <parameter>track</parameter>-&gt;ipod_path. If this file already exists, &lt;random number&gt;
+is adjusted until an unused filename is found.
+</para>
+<para>
+If <parameter>track</parameter>-&gt;ipod_path is already set, this one will be used
+instead. If a file with this name already exists, it will be
+overwritten.
+</para>
+<para>
+<parameter>track</parameter>-&gt;filetype_marker is set according to the filename extension</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> the <link linkend="Itdb-Track"><type>Itdb_Track</type></link> to copy (containing <parameter>filename</parameter> metadata)
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> the source file
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success, FALSE on error, in which case <parameter>error</parameter> is
+set accordingly.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-filename-fs2ipod" role="function"/>itdb_filename_fs2ipod ()</title>
+<indexterm><primary>itdb_filename_fs2ipod</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_filename_fs2ipod           (<link linkend="gchar">gchar</link> *filename);</programlisting>
+<para>
+Convert string from casual PC file name to iPod iTunesDB format using ':' 
+instead of G_DIR_SEPARATOR_S (ie slashes on Unix-like systems). <parameter>ipod_file</parameter>
+is modified in place.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> a filename 'PC-style' (eg /iPod_Control/Music/f00/test.mp3)
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-filename-ipod2fs" role="function"/>itdb_filename_ipod2fs ()</title>
+<indexterm><primary>itdb_filename_ipod2fs</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_filename_ipod2fs           (<link linkend="gchar">gchar</link> *ipod_file);</programlisting>
+<para>
+Convert string from from iPod iTunesDB format to casual PC file name
+using G_DIR_SEPARATOR (ie slashes on Unix-like systems) instead of ':'.
+<parameter>ipod_file</parameter> is modified in place.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>ipod_file</parameter>&nbsp;:</term>
+<listitem><simpara> a filename 'PC-style' (eg /iPod_Control/Music/f00/test.mp3)
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-filename-on-ipod" role="function"/>itdb_filename_on_ipod ()</title>
+<indexterm><primary>itdb_filename_on_ipod</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_filename_on_ipod           (<link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Return the full iPod filename as stored in <parameter>track</parameter>.
+</para>
+<para>
+NOTE: NULL is returned when the file does not exist.
+</para>
+<para>
+NOTE: this code works around a problem on some systems (see
+<link linkend="itdb-resolve-path"><function>itdb_resolve_path()</function></link> ) and might return a filename with different
+case than the original filename. Don't copy it back to <parameter>track</parameter>
+unless you must</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> full filename to <parameter>track</parameter> on the iPod or NULL if no
+filename is set in <parameter>track</parameter>. Must be freed with <link linkend="g-free"><function>g_free()</function></link> after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-musicdirs-number" role="function"/>itdb_musicdirs_number ()</title>
+<indexterm><primary>itdb_musicdirs_number</primary></indexterm><programlisting><link linkend="gint">gint</link>        itdb_musicdirs_number           (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Determine the number of F.. directories in iPod_Control/Music.
+</para>
+<para>
+If itdb->musicdirs is already set, simply return the previously
+determined number. Otherwise count the directories first and set
+itdb->musicdirs.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> max number of directories in iPod_Control/Music
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-rename-files" role="function"/>itdb_rename_files ()</title>
+<indexterm><primary>itdb_rename_files</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_rename_files               (const <link linkend="gchar">gchar</link> *mp,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Renames/removes some files on the iPod (Playcounts, OTG
+semaphore). May have to be called if you write the iTunesDB not
+directly to the iPod but to some other location and then manually
+copy the file from there to the iPod.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mp</parameter>&nbsp;:</term>
+<listitem><simpara> mount point of the iPod
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> FALSE on error and sets <parameter>error</parameter> accordingly
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/itunesdb-db.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/itunesdb-db.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/itunesdb-db.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,262 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-The-Itdb-iTunesDB-structure">
+<refmeta>
+<refentrytitle role="top_of_page">iPod database reading/writing</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>iPod database reading/writing</refname>
+<refpurpose>Functions to create, read, write the iPod database</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+            <link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>;
+<link linkend="void">void</link>        (<link linkend="ItdbUserDataDestroyFunc">*ItdbUserDataDestroyFunc</link>)      (<link linkend="gpointer">gpointer</link> userdata);
+<link linkend="gpointer">gpointer</link>    (<link linkend="ItdbUserDataDuplicateFunc">*ItdbUserDataDuplicateFunc</link>)    (<link linkend="gpointer">gpointer</link> userdata);
+<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* <link linkend="itdb-new">itdb_new</link>                     (void);
+<link linkend="void">void</link>        <link linkend="itdb-free">itdb_free</link>                       (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* <link linkend="itdb-parse">itdb_parse</link>                   (const <link linkend="gchar">gchar</link> *mp,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-write">itdb_write</link>                      (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *db,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="void">void</link>        <link linkend="itdb-set-mountpoint">itdb_set_mountpoint</link>             (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             const <link linkend="gchar">gchar</link> *mp);
+const <link linkend="gchar">gchar</link>* <link linkend="itdb-get-mountpoint">itdb_get_mountpoint</link>            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="guint32">guint32</link>     <link linkend="itdb-tracks-number">itdb_tracks_number</link>              (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="guint32">guint32</link>     <link linkend="itdb-tracks-number-nontransferred">itdb_tracks_number_nontransferred</link>
+                                            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="guint32">guint32</link>     <link linkend="itdb-playlists-number">itdb_playlists_number</link>           (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="Itdb-iTunesDB" role="struct"/>Itdb_iTunesDB</title>
+<indexterm><primary>Itdb_iTunesDB</primary></indexterm><programlisting>typedef struct {
+    GList *tracks;
+    GList *playlists;
+    gchar *filename;    /* filename of iTunesDB */
+    Itdb_Device *device;/* iPod device info     */
+    guint32 version;
+    guint64 id;
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_iTunesDB;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="ItdbUserDataDestroyFunc" role="function"/>ItdbUserDataDestroyFunc ()</title>
+<indexterm><primary>ItdbUserDataDestroyFunc</primary></indexterm><programlisting><link linkend="void">void</link>        (*ItdbUserDataDestroyFunc)      (<link linkend="gpointer">gpointer</link> userdata);</programlisting>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>userdata</parameter>&nbsp;:</term>
+<listitem><simpara>
+
+
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="ItdbUserDataDuplicateFunc" role="function"/>ItdbUserDataDuplicateFunc ()</title>
+<indexterm><primary>ItdbUserDataDuplicateFunc</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>    (*ItdbUserDataDuplicateFunc)    (<link linkend="gpointer">gpointer</link> userdata);</programlisting>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>userdata</parameter>&nbsp;:</term>
+<listitem><simpara>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>
+
+
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-new" role="function"/>itdb_new ()</title>
+<indexterm><primary>itdb_new</primary></indexterm><programlisting><link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* itdb_new                     (void);</programlisting>
+<para>
+Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable
+values.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly created Itdb_iTunesDB to be freed with <link linkend="itdb-free"><function>itdb_free()</function></link>
+when it's no longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-free" role="function"/>itdb_free ()</title>
+<indexterm><primary>itdb_free</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_free                       (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Free the memory taken by <parameter>itdb</parameter>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-parse" role="function"/>itdb_parse ()</title>
+<indexterm><primary>itdb_parse</primary></indexterm><programlisting><link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* itdb_parse                   (const <link linkend="gchar">gchar</link> *mp,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Parse the Itdb_iTunesDB of the iPod located at <parameter>mp</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mp</parameter>&nbsp;:</term>
+<listitem><simpara> mount point of the iPod (eg "/mnt/ipod) in local encoding
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> struct holding the tracks and
+the playlists present on the iPod at <parameter>mp</parameter>, NULL if <parameter>mp</parameter> isn't an iPod mount
+point. If non-NULL, the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> is to be freed with <link linkend="itdb-free"><function>itdb_free()</function></link> when
+it's no longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-write" role="function"/>itdb_write ()</title>
+<indexterm><primary>itdb_write</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_write                      (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *db,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Write out an iTunesDB. It reassigns unique IDs to all tracks. 
+An existing "Play Counts" file is renamed to "Play Counts.bak" if
+the export was successful.
+An existing "OTGPlaylistInfo" file is removed if the export was
+successful.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>db</parameter>&nbsp;:</term>
+<listitem><simpara>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success, FALSE on error, in which case <parameter>error</parameter> is
+set accordingly.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-set-mountpoint" role="function"/>itdb_set_mountpoint ()</title>
+<indexterm><primary>itdb_set_mountpoint</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_set_mountpoint             (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             const <link linkend="gchar">gchar</link> *mp);</programlisting>
+<para>
+Sets the mountpoint of <parameter>db</parameter>. Always use this function to set the mountpoint
+of an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> as it will reset the number of available 
+/iPod_Control/Music/F.. dirs. It doesn't attempt to parse an iPod database
+that may be present on the iPod at <parameter>mp</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>mp</parameter>&nbsp;:</term>
+<listitem><simpara> new mount point
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-mountpoint" role="function"/>itdb_get_mountpoint ()</title>
+<indexterm><primary>itdb_get_mountpoint</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>* itdb_get_mountpoint            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Retrieve a reference to the mountpoint of <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <parameter>itdb</parameter> mountpoint, this string shouldn't be freed nor 
+modified
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-tracks-number" role="function"/>itdb_tracks_number ()</title>
+<indexterm><primary>itdb_tracks_number</primary></indexterm><programlisting><link linkend="guint32">guint32</link>     itdb_tracks_number              (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Counts the number of tracks stored in <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of tracks in <parameter>itdb</parameter>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-tracks-number-nontransferred" role="function"/>itdb_tracks_number_nontransferred ()</title>
+<indexterm><primary>itdb_tracks_number_nontransferred</primary></indexterm><programlisting><link linkend="guint32">guint32</link>     itdb_tracks_number_nontransferred
+                                            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Counts the number of non-transferred tracks in <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of tracks in <parameter>itdb</parameter> that haven't been transferred
+to the iPod yet (ie the number of <link linkend="Itdb-Track"><type>Itdb_Track</type></link> in which the transferred field
+is false)
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlists-number" role="function"/>itdb_playlists_number ()</title>
+<indexterm><primary>itdb_playlists_number</primary></indexterm><programlisting><link linkend="guint32">guint32</link>     itdb_playlists_number           (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Counts the number of playlists stored in <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of playlists in <parameter>itdb</parameter> (including the master 
+playlist)
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/itunesdb-lowlevel.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/itunesdb-lowlevel.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/itunesdb-lowlevel.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,360 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Low-level-functions">
+<refmeta>
+<refentrytitle role="top_of_page">Low-level functions</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Low-level functions</refname>
+<refpurpose>Low-level functions which shouldn't be needed in normal situations</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-control-dir">itdb_get_control_dir</link>            (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-itunes-dir">itdb_get_itunes_dir</link>             (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-music-dir">itdb_get_music_dir</link>              (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-artwork-dir">itdb_get_artwork_dir</link>            (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-device-dir">itdb_get_device_dir</link>             (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-itunesdb-path">itdb_get_itunesdb_path</link>          (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-artworkdb-path">itdb_get_artworkdb_path</link>         (const <link linkend="gchar">gchar</link> *mountpoint);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-get-path">itdb_get_path</link>                   (const <link linkend="gchar">gchar</link> *dir,
+                                             const <link linkend="gchar">gchar</link> *file);
+<link linkend="gchar">gchar</link>*      <link linkend="itdb-resolve-path">itdb_resolve_path</link>               (const <link linkend="gchar">gchar</link> *root,
+                                             const <link linkend="gchar">gchar</link> * const *components);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-shuffle-write">itdb_shuffle_write</link>              (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-shuffle-write-file">itdb_shuffle_write_file</link>         (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             const <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-cp">itdb_cp</link>                         (const <link linkend="gchar">gchar</link> *from_file,
+                                             const <link linkend="gchar">gchar</link> *to_file,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* <link linkend="itdb-parse-file">itdb_parse_file</link>              (const <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-write-file">itdb_write_file</link>                 (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             const <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);
+<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* <link linkend="itdb-duplicate">itdb_duplicate</link>               (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="itdb-get-control-dir" role="function"/>itdb_get_control_dir ()</title>
+<indexterm><primary>itdb_get_control_dir</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_control_dir            (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Get the i*_Control directory. Observed values are 'iPod_Control'
+for standard iPods and 'iTunes/iTunes_Control' for mobile
+applications.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the control dir or NULL of non-existent. Must
+<link linkend="g-free"><function>g_free()</function></link> after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-itunes-dir" role="function"/>itdb_get_itunes_dir ()</title>
+<indexterm><primary>itdb_get_itunes_dir</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_itunes_dir             (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Retrieve the iTunes directory (containing the iTunesDB) by first
+calling <link linkend="itdb-get-control-dir"><function>itdb_get_control_dir()</function></link> and then adding 'iTunes'</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the iTunes directory or NULL of non-existent.
+Must <link linkend="g-free"><function>g_free()</function></link> after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-music-dir" role="function"/>itdb_get_music_dir ()</title>
+<indexterm><primary>itdb_get_music_dir</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_music_dir              (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Retrieve the Music directory (containing the Fnn dirs) by first
+calling <link linkend="itdb-get-control-dir"><function>itdb_get_control_dir()</function></link> and then adding 'Music'</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the Music directory or NULL of
+non-existent. Must <link linkend="g-free"><function>g_free()</function></link> after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-artwork-dir" role="function"/>itdb_get_artwork_dir ()</title>
+<indexterm><primary>itdb_get_artwork_dir</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_artwork_dir            (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Retrieve the Artwork directory (containing the ArtworDB) by
+first calling <link linkend="itdb-get-control-dir"><function>itdb_get_control_dir()</function></link> and then adding 'Artwork'</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the Artwork directory or NULL of
+non-existent. Must <link linkend="g-free"><function>g_free()</function></link> after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-device-dir" role="function"/>itdb_get_device_dir ()</title>
+<indexterm><primary>itdb_get_device_dir</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_device_dir             (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Retrieve the Device directory (containing the SysInfo file) by
+first calling <link linkend="itdb-get-control-dir"><function>itdb_get_control_dir()</function></link> and then adding 'Device'</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the Device directory or NULL of
+non-existent. Must <link linkend="g-free"><function>g_free()</function></link> after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-itunesdb-path" role="function"/>itdb_get_itunesdb_path ()</title>
+<indexterm><primary>itdb_get_itunesdb_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_itunesdb_path          (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Retrieve a path to the iTunesDB</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the iTunesDB or NULL if non-existent. Must <link linkend="g-free"><function>g_free()</function></link>
+after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-artworkdb-path" role="function"/>itdb_get_artworkdb_path ()</title>
+<indexterm><primary>itdb_get_artworkdb_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_artworkdb_path         (const <link linkend="gchar">gchar</link> *mountpoint);</programlisting>
+<para>
+Retrieve a path to the ArtworkDB</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mountpoint</parameter>&nbsp;:</term>
+<listitem><simpara> the iPod mountpoint
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the ArtworkDB or NULL if non-existent. Must <link linkend="g-free"><function>g_free()</function></link> 
+after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-get-path" role="function"/>itdb_get_path ()</title>
+<indexterm><primary>itdb_get_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_get_path                   (const <link linkend="gchar">gchar</link> *dir,
+                                             const <link linkend="gchar">gchar</link> *file);</programlisting>
+<para>
+Retrieve a path to the <parameter>file</parameter> in <parameter>dir</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>dir</parameter>&nbsp;:</term>
+<listitem><simpara> a directory
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>file</parameter>&nbsp;:</term>
+<listitem><simpara> a file
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> path to the <parameter>file</parameter> or NULL if non-existent. Must be <link linkend="g-free"><function>g_free()</function></link>'d 
+after use.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-resolve-path" role="function"/>itdb_resolve_path ()</title>
+<indexterm><primary>itdb_resolve_path</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      itdb_resolve_path               (const <link linkend="gchar">gchar</link> *root,
+                                             const <link linkend="gchar">gchar</link> * const *components);</programlisting>
+<para>
+We start by assuming that the ipod mount point exists.  Then, for
+each component c of track-&gt;ipod_path, we try to find an entry d in
+good_path that is case-insensitively equal to c.  If we find d, we
+append d to good_path and make the result the new good_path.
+Otherwise, we quit and return NULL.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>root</parameter>&nbsp;:</term>
+<listitem><simpara> in local encoding
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>components</parameter>&nbsp;:</term>
+<listitem><simpara> in utf8
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>
+
+
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-shuffle-write" role="function"/>itdb_shuffle_write ()</title>
+<indexterm><primary>itdb_shuffle_write</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_shuffle_write              (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Write out an iTunesSD for the Shuffle.
+First reassigns unique IDs to all tracks.
+An existing "Play Counts" file is renamed to "Play Counts.bak" if
+the export was successful.
+An existing "OTGPlaylistInfo" file is removed if the export was
+successful.
+<parameter>itdb->mountpoint</parameter> must point to the mount point of the iPod,
+e.g. "/mnt/ipod" and be in local encoding.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> to write to disk
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success, FALSE on error, in which case <parameter>error</parameter> is
+set accordingly.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-shuffle-write-file" role="function"/>itdb_shuffle_write_file ()</title>
+<indexterm><primary>itdb_shuffle_write_file</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_shuffle_write_file         (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             const <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Do the actual writing to the iTunesSD</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> to write to disk
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> file to write to, cannot be NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success, FALSE on error, in which case <parameter>error</parameter> is
+set accordingly.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-cp" role="function"/>itdb_cp ()</title>
+<indexterm><primary>itdb_cp</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_cp                         (const <link linkend="gchar">gchar</link> *from_file,
+                                             const <link linkend="gchar">gchar</link> *to_file,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Copy file "from_file" to "to_file".</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>from_file</parameter>&nbsp;:</term>
+<listitem><simpara> source file
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>to_file</parameter>&nbsp;:</term>
+<listitem><simpara> destination file
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success, FALSE on error, in which case <parameter>error</parameter> is
+set accordingly.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-parse-file" role="function"/>itdb_parse_file ()</title>
+<indexterm><primary>itdb_parse_file</primary></indexterm><programlisting><link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* itdb_parse_file              (const <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Same as <link linkend="itunesdb-parse"><function>itunesdb_parse()</function></link>, but filename is specified directly.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> path to a file in iTunesDB format
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> struct holding the tracks and
+the playlists present on the iPod at <parameter>mp</parameter>, NULL if <parameter>mp</parameter> isn't an iPod mount
+point. If non-NULL, the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> is to be freed with <link linkend="itdb-free"><function>itdb_free()</function></link> when
+it's no longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-write-file" role="function"/>itdb_write_file ()</title>
+<indexterm><primary>itdb_write_file</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_write_file                 (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             const <link linkend="gchar">gchar</link> *filename,
+                                             <link linkend="GError">GError</link> **error);</programlisting>
+<para>
+Write the content of <parameter>itdb</parameter> to <parameter>filename</parameter>. If <parameter>filename</parameter> is NULL, it attempts
+to write to itdb-&gt;filename.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> to save
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> filename to save <parameter>itdb</parameter> to
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
+<listitem><simpara> return location for a <link linkend="GError"><type>GError</type></link> or NULL
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if all went well, FALSE otherwise
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-duplicate" role="function"/>itdb_duplicate ()</title>
+<indexterm><primary>itdb_duplicate</primary></indexterm><programlisting><link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link>* itdb_duplicate               (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Duplicate <parameter>itdb</parameter> 
+FIXME: not implemented yet</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> always return NULL since it's unimplemented
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/itunesdb-time.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/itunesdb-time.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/itunesdb-time.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,98 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Time-handling">
+<refmeta>
+<refentrytitle role="top_of_page">Time handling</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Time handling</refname>
+<refpurpose>Helper functions to convert between Epoch time and Mac (iPod) time</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+<link linkend="guint64">guint64</link>     <link linkend="itdb-time-get-mac-time">itdb_time_get_mac_time</link>          (void);
+<link linkend="time-t">time_t</link>      <link linkend="itdb-time-mac-to-host">itdb_time_mac_to_host</link>           (<link linkend="guint64">guint64</link> mactime);
+<link linkend="guint64">guint64</link>     <link linkend="itdb-time-host-to-mac">itdb_time_host_to_mac</link>           (<link linkend="time-t">time_t</link> time);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="itdb-time-get-mac-time" role="function"/>itdb_time_get_mac_time ()</title>
+<indexterm><primary>itdb_time_get_mac_time</primary></indexterm><programlisting><link linkend="guint64">guint64</link>     itdb_time_get_mac_time          (void);</programlisting>
+<para>
+Gets the current time expressed in 'Mac' unit (ie in number of seconds since
+1/1/1904).</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> current time in 'Mac' unit.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-time-mac-to-host" role="function"/>itdb_time_mac_to_host ()</title>
+<indexterm><primary>itdb_time_mac_to_host</primary></indexterm><programlisting><link linkend="time-t">time_t</link>      itdb_time_mac_to_host           (<link linkend="guint64">guint64</link> mactime);</programlisting>
+<para>
+Convert a Mac timestamp to host system time stamp -- modify
+this function if necessary to port to host systems with different
+start of Epoch.
+A "0" time will not be converted.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>mactime</parameter>&nbsp;:</term>
+<listitem><simpara> time expressed in 'Mac' unit
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> timestamp for the host system
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-time-host-to-mac" role="function"/>itdb_time_host_to_mac ()</title>
+<indexterm><primary>itdb_time_host_to_mac</primary></indexterm><programlisting><link linkend="guint64">guint64</link>     itdb_time_host_to_mac           (<link linkend="time-t">time_t</link> time);</programlisting>
+<para>
+Convert host system timestamp to Mac time stamp -- modify
+this function if necessary to port to host systems with different
+start of Epoch</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>time</parameter>&nbsp;:</term>
+<listitem><simpara> time expressed in host unit
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a Mac timestamp
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/playlists.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/playlists.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/playlists.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,540 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Playlists">
+<refmeta>
+<refentrytitle role="top_of_page">Playlists</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Playlists</refname>
+<refpurpose>Data structure to represent an iPod playlist</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+            <link linkend="Itdb-Playlist">Itdb_Playlist</link>;
+enum        <link linkend="ItdbPlaylistSortOrder">ItdbPlaylistSortOrder</link>;
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-new">itdb_playlist_new</link>            (const <link linkend="gchar">gchar</link> *title,
+                                             <link linkend="gboolean">gboolean</link> spl);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-free">itdb_playlist_free</link>              (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-duplicate">itdb_playlist_duplicate</link>      (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-add">itdb_playlist_add</link>               (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="gint32">gint32</link> pos);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-move">itdb_playlist_move</link>              (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="guint32">guint32</link> pos);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-remove">itdb_playlist_remove</link>            (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-unlink">itdb_playlist_unlink</link>            (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-add-track">itdb_playlist_add_track</link>         (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             <link linkend="gint32">gint32</link> pos);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-remove-track">itdb_playlist_remove_track</link>      (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-playlist-contains-track">itdb_playlist_contains_track</link>    (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="guint32">guint32</link>     <link linkend="itdb-playlist-contain-track-number">itdb_playlist_contain_track_number</link>
+                                            (<link linkend="Itdb-Track">Itdb_Track</link> *tr);
+<link linkend="guint32">guint32</link>     <link linkend="itdb-playlist-tracks-number">itdb_playlist_tracks_number</link>     (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-mpl">itdb_playlist_mpl</link>            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-playlist-is-mpl">itdb_playlist_is_mpl</link>            (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-set-mpl">itdb_playlist_set_mpl</link>           (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-podcasts">itdb_playlist_podcasts</link>       (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-playlist-is-podcasts">itdb_playlist_is_podcasts</link>       (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-set-podcasts">itdb_playlist_set_podcasts</link>      (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-playlist-exists">itdb_playlist_exists</link>            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-by-id">itdb_playlist_by_id</link>          (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="guint64">guint64</link> id);
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-by-nr">itdb_playlist_by_nr</link>          (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="guint32">guint32</link> num);
+<link linkend="Itdb-Playlist">Itdb_Playlist</link>* <link linkend="itdb-playlist-by-name">itdb_playlist_by_name</link>        (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="gchar">gchar</link> *name);
+<link linkend="void">void</link>        <link linkend="itdb-playlist-randomize">itdb_playlist_randomize</link>         (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="Itdb-Playlist" role="struct"/>Itdb_Playlist</title>
+<indexterm><primary>Itdb_Playlist</primary></indexterm><programlisting>typedef struct {
+    Itdb_iTunesDB *itdb;  /* pointer to iTunesDB (for convenience) */
+    gchar *name;          /* name of playlist in UTF8              */
+    guint8 type;          /* ITDB_PL_TYPE_NORM/_MPL                */
+    guint8 flag1;         /* unknown, usually set to 0             */
+    guint8 flag2;         /* unknown, always set to 0              */
+    guint8 flag3;         /* unknown, always set to 0              */
+    gint  num;            /* number of tracks in playlist          */
+    GList *members;       /* tracks in playlist (Track *)          */
+    gboolean is_spl;      /* smart playlist?                       */
+    guint32 timestamp;    /* some timestamp                        */
+    guint64 id;           /* playlist ID                           */
+    guint32 mhodcount;    /* This appears to be the number of string
+			     MHODs (type &lt; 50) associated with this
+			     playlist (typically 0x01). Doesn't seem
+			     to be signficant unless you include Type
+			     52 MHODs. libgpod sets this to 1 when
+			     syncing */
+    guint16 libmhodcount; /* The number of Type 52 MHODs associated
+			     with this playlist. If you don't create
+			     Type 52 MHODs, this can be
+			     zero. Otherwise, if you have Type 52
+			     MHODs associated with this playlist and
+			     set this to zero, no songs appear on the
+			     iPod. jcsjcs: with iTunes 4.9 this seems
+			     to be set to 1 even without any Type 52
+			     MHODs present. libgpod sets this to 1
+			     when syncing */
+    guint32 sortorder;    /* How to sort playlist -- see below     */
+    guint32 podcastflag;  /* ITDB_PL_FLAG_NORM/_PODCAST            */
+    SPLPref splpref;      /* smart playlist prefs                  */
+    SPLRules splrules;    /* rules for smart playlists             */
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_Playlist;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="ItdbPlaylistSortOrder" role="enum"/>enum ItdbPlaylistSortOrder</title>
+<indexterm><primary>ItdbPlaylistSortOrder</primary></indexterm><programlisting>typedef enum
+{
+    ITDB_PSO_MANUAL = 1,
+/*    ITDB_PSO_UNKNOWN = 2, */
+    ITDB_PSO_TITLE = 3,
+    ITDB_PSO_ALBUM = 4,
+    ITDB_PSO_ARTIST = 5,
+    ITDB_PSO_BIRATE = 6,
+    ITDB_PSO_GENRE = 7,
+    ITDB_PSO_FILETYPE = 8,
+    ITDB_PSO_TIME_MODIFIED = 9,
+    ITDB_PSO_TRACK_NR = 10,
+    ITDB_PSO_SIZE = 11,
+    ITDB_PSO_TIME = 12,  /* ? */
+    ITDB_PSO_YEAR = 13,
+    ITDB_PSO_SAMPLERATE = 14,
+    ITDB_PSO_COMMENT = 15,
+    ITDB_PSO_TIME_ADDED = 16,
+    ITDB_PSO_EQUALIZER = 17, /* ? */
+    ITDB_PSO_COMPOSER = 18,
+/*    ITDB_PSO_UNKNOWN = 19, */
+    ITDB_PSO_PLAYCOUNT = 20,
+    ITDB_PSO_TIME_PLAYED = 21,
+    ITDB_PSO_CD_NR = 22,
+    ITDB_PSO_RATING = 23,
+    ITDB_PSO_RELEASE_DATE = 24, /* used by podcasts */
+    ITDB_PSO_BPM = 25,
+    ITDB_PSO_GROUPING = 26,
+    ITDB_PSO_CATEGORY = 27,
+    ITDB_PSO_DESCRIPTION = 28
+} ItdbPlaylistSortOrder;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-new" role="function"/>itdb_playlist_new ()</title>
+<indexterm><primary>itdb_playlist_new</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_new            (const <link linkend="gchar">gchar</link> *title,
+                                             <link linkend="gboolean">gboolean</link> spl);</programlisting>
+<para>
+Creates a new playlist. If <parameter>spl</parameter> is TRUE, a smart
+playlist is generated. pl->id is set by <link linkend="itdb-playlist-add"><function>itdb_playlist_add()</function></link> when the 
+playlist is added to an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>title</parameter>&nbsp;:</term>
+<listitem><simpara> playlist title
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>spl</parameter>&nbsp;:</term>
+<listitem><simpara> smart playlist flag
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link> which must be freed with 
+<link linkend="itdb-playlist-free"><function>itdb_playlist_free()</function></link> after use
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-free" role="function"/>itdb_playlist_free ()</title>
+<indexterm><primary>itdb_playlist_free</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_free              (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Frees the memory used by playlist <parameter>pl</parameter>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-duplicate" role="function"/>itdb_playlist_duplicate ()</title>
+<indexterm><primary>itdb_playlist_duplicate</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_duplicate      (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Duplicates an existing playlist. pl_dup-&gt;id is set to zero, so that
+it will be set to a unique value when adding it to an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>. The
+returned playlist won't be associated with an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link> that you'll have to free
+with <link linkend="itdb-playlist-free"><function>itdb_playlist_free()</function></link> when you no longer need it. 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-add" role="function"/>itdb_playlist_add ()</title>
+<indexterm><primary>itdb_playlist_add</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_add               (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="gint32">gint32</link> pos);</programlisting>
+<para>
+Adds playlist <parameter>pl</parameter> to the database <parameter>itdb</parameter> at position <parameter>pos</parameter> (-1 for
+"append to end"). A unique id is created if pl-&gt;id is equal to
+zero. After calling this function, <parameter>itdb</parameter> manages the memory of <parameter>pl</parameter>, which
+means you no longer need to explicitly call <link linkend="itdb-playlist-free"><function>itdb_playlist_free()</function></link></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
+<listitem><simpara> position to insert <parameter>pl</parameter> at
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-move" role="function"/>itdb_playlist_move ()</title>
+<indexterm><primary>itdb_playlist_move</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_move              (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="guint32">guint32</link> pos);</programlisting>
+<para>
+Moves playlist <parameter>pl</parameter> to position <parameter>pos</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
+<listitem><simpara> new position
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-remove" role="function"/>itdb_playlist_remove ()</title>
+<indexterm><primary>itdb_playlist_remove</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_remove            (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Removes <parameter>pl</parameter> from the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> it's associated with 
+and frees memory</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-unlink" role="function"/>itdb_playlist_unlink ()</title>
+<indexterm><primary>itdb_playlist_unlink</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_unlink            (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Remove <parameter>pl</parameter> from the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> it's associated with but do not free 
+memory. pl-&gt;itdb is set to NULL after this function returns</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-add-track" role="function"/>itdb_playlist_add_track ()</title>
+<indexterm><primary>itdb_playlist_add_track</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_add_track         (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             <link linkend="gint32">gint32</link> pos);</programlisting>
+<para>
+Adds <parameter>track</parameter> to <parameter>pl</parameter> at position <parameter>pos</parameter> (-1 for "append to
+end")</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
+<listitem><simpara> position to insert <parameter>track</parameter> at
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-remove-track" role="function"/>itdb_playlist_remove_track ()</title>
+<indexterm><primary>itdb_playlist_remove_track</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_remove_track      (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Removes <parameter>track</parameter> from <parameter>pl</parameter>. If <parameter>pl</parameter> is NULL, removes <parameter>track</parameter> from the
+master playlist. If <parameter>track</parameter> can't be found in <parameter>pl</parameter>, nothing happens. If after
+removing <parameter>track</parameter>, <parameter>pl</parameter> is empty, it's not removed from the database
+The memory used by <parameter>track</parameter> isn't freed.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-contains-track" role="function"/>itdb_playlist_contains_track ()</title>
+<indexterm><primary>itdb_playlist_contains_track</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_playlist_contains_track    (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Checks if <parameter>track</parameter> is in <parameter>pl</parameter>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if <parameter>track</parameter> is in <parameter>pl</parameter>, FALSE otherwise
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-contain-track-number" role="function"/>itdb_playlist_contain_track_number ()</title>
+<indexterm><primary>itdb_playlist_contain_track_number</primary></indexterm><programlisting><link linkend="guint32">guint32</link>     itdb_playlist_contain_track_number
+                                            (<link linkend="Itdb-Track">Itdb_Track</link> *tr);</programlisting>
+<para>
+Counts the number of playlist <parameter>track</parameter> is a member of (not including the 
+master playlist)</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>tr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> number of playlist containing <parameter>track</parameter>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-tracks-number" role="function"/>itdb_playlist_tracks_number ()</title>
+<indexterm><primary>itdb_playlist_tracks_number</primary></indexterm><programlisting><link linkend="guint32">guint32</link>     itdb_playlist_tracks_number     (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Counts the number of tracks in <parameter>pl</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> track count
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-mpl" role="function"/>itdb_playlist_mpl ()</title>
+<indexterm><primary>itdb_playlist_mpl</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_mpl            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Gets the master playlist of <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the master playlist of <parameter>itdb</parameter> 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-is-mpl" role="function"/>itdb_playlist_is_mpl ()</title>
+<indexterm><primary>itdb_playlist_is_mpl</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_playlist_is_mpl            (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Checks if <parameter>pl</parameter> is the master playlist</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if <parameter>pl</parameter> is the master playlist, FALSE otherwise 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-set-mpl" role="function"/>itdb_playlist_set_mpl ()</title>
+<indexterm><primary>itdb_playlist_set_mpl</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_set_mpl           (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Sets <parameter>pl</parameter> to be a master playlist</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-podcasts" role="function"/>itdb_playlist_podcasts ()</title>
+<indexterm><primary>itdb_playlist_podcasts</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_podcasts       (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Gets the podcasts playlist of <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the podcasts playlist of <parameter>itdb</parameter>, or NULL if it's there is none
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-is-podcasts" role="function"/>itdb_playlist_is_podcasts ()</title>
+<indexterm><primary>itdb_playlist_is_podcasts</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_playlist_is_podcasts       (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Checks if <parameter>pl</parameter> is the podcasts playlist</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if <parameter>pl</parameter> is the podcasts playlist, FALSE otherwise 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-set-podcasts" role="function"/>itdb_playlist_set_podcasts ()</title>
+<indexterm><primary>itdb_playlist_set_podcasts</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_set_podcasts      (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Set <parameter>pl</parameter> to be a podcasts playlist</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-exists" role="function"/>itdb_playlist_exists ()</title>
+<indexterm><primary>itdb_playlist_exists</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_playlist_exists            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Checks if <parameter>pl</parameter> is present in <parameter>db</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if <parameter>pl</parameter> exists in <parameter>db</parameter>, FALSE otherwise 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-by-id" role="function"/>itdb_playlist_by_id ()</title>
+<indexterm><primary>itdb_playlist_by_id</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_by_id          (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="guint64">guint64</link> id);</programlisting>
+<para>
+Looks up a playlist whose ID is <parameter>id</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>id</parameter>&nbsp;:</term>
+<listitem><simpara> ID of the playlist to look for
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link> with ID <parameter>id</parameter> or NULL if there is no such
+playlist.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-by-nr" role="function"/>itdb_playlist_by_nr ()</title>
+<indexterm><primary>itdb_playlist_by_nr</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_by_nr          (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="guint32">guint32</link> num);</programlisting>
+<para>
+Gets the playlist at the given position in <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>num</parameter>&nbsp;:</term>
+<listitem><simpara> the position of the playlist, counting from 0
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>, or NULL if there is no playlist at <parameter>pos</parameter>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-by-name" role="function"/>itdb_playlist_by_name ()</title>
+<indexterm><primary>itdb_playlist_by_name</primary></indexterm><programlisting><link linkend="Itdb-Playlist">Itdb_Playlist</link>* itdb_playlist_by_name        (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="gchar">gchar</link> *name);</programlisting>
+<para>
+Searches a playlist whose name is <parameter>name</parameter> in <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
+<listitem><simpara> name of the playlist to look for
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the first <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link> with name <parameter>name</parameter>, NULL if there is no
+such playlist
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-playlist-randomize" role="function"/>itdb_playlist_randomize ()</title>
+<indexterm><primary>itdb_playlist_randomize</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_playlist_randomize         (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl);</programlisting>
+<para>
+Randomizes <parameter>pl</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link> to randomize
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/smart-playlists.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/smart-playlists.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/smart-playlists.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,463 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Smart-Playlists">
+<refmeta>
+<refentrytitle role="top_of_page">Smart Playlists</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Smart Playlists</refname>
+<refpurpose>Data structures used to manipulate iPod smart playlists</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+            <link linkend="SPLPref">SPLPref</link>;
+            <link linkend="SPLRule">SPLRule</link>;
+            <link linkend="SPLRules">SPLRules</link>;
+enum        <link linkend="SPLAction">SPLAction</link>;
+enum        <link linkend="SPLFieldType">SPLFieldType</link>;
+enum        <link linkend="SPLActionType">SPLActionType</link>;
+enum        <link linkend="SPLField">SPLField</link>;
+#define     <link linkend="SPLDATE-IDENTIFIER:CAPS">SPLDATE_IDENTIFIER</link>
+#define     <link linkend="SPL-MAXSTRINGLENGTH:CAPS">SPL_MAXSTRINGLENGTH</link>
+#define     <link linkend="SPL-STRING-MAXLEN:CAPS">SPL_STRING_MAXLEN</link>
+<link linkend="SPLFieldType">SPLFieldType</link> <link linkend="itdb-splr-get-field-type">itdb_splr_get_field_type</link>       (const <link linkend="SPLRule">SPLRule</link> *splr);
+<link linkend="SPLActionType">SPLActionType</link> <link linkend="itdb-splr-get-action-type">itdb_splr_get_action_type</link>     (const <link linkend="SPLRule">SPLRule</link> *splr);
+<link linkend="void">void</link>        <link linkend="itdb-splr-validate">itdb_splr_validate</link>              (<link linkend="SPLRule">SPLRule</link> *splr);
+<link linkend="void">void</link>        <link linkend="itdb-splr-remove">itdb_splr_remove</link>                (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="SPLRule">SPLRule</link> *splr);
+<link linkend="SPLRule">SPLRule</link>*    <link linkend="itdb-splr-new">itdb_splr_new</link>                   (void);
+<link linkend="void">void</link>        <link linkend="itdb-splr-add">itdb_splr_add</link>                   (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="SPLRule">SPLRule</link> *splr,
+                                             <link linkend="gint">gint</link> pos);
+<link linkend="SPLRule">SPLRule</link>*    <link linkend="itdb-splr-add-new">itdb_splr_add_new</link>               (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="gint">gint</link> pos);
+<link linkend="void">void</link>        <link linkend="itdb-spl-copy-rules">itdb_spl_copy_rules</link>             (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *dest,
+                                             <link linkend="Itdb-Playlist">Itdb_Playlist</link> *src);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-splr-eval">itdb_splr_eval</link>                  (<link linkend="SPLRule">SPLRule</link> *splr,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="void">void</link>        <link linkend="itdb-spl-update">itdb_spl_update</link>                 (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *spl);
+<link linkend="void">void</link>        <link linkend="itdb-spl-update-all">itdb_spl_update_all</link>             (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="void">void</link>        <link linkend="itdb-spl-update-live">itdb_spl_update_live</link>            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="SPLPref" role="struct"/>SPLPref</title>
+<indexterm><primary>SPLPref</primary></indexterm><programlisting>typedef struct {
+    guint8  liveupdate;        /* "live Updating" check box */
+    guint8  checkrules;        /* "Match X of the following
+				  conditions" check box */
+    guint8  checklimits;       /* "Limit To..." check box */
+    guint32 limittype;         /* See types defined above */
+    guint32 limitsort;         /* See types defined above */
+    guint32 limitvalue;        /* The value typed next to "Limit
+				  type" */
+    guint8  matchcheckedonly;  /* "Match only checked songs" check
+				  box */
+} SPLPref;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLRule" role="struct"/>SPLRule</title>
+<indexterm><primary>SPLRule</primary></indexterm><programlisting>typedef struct {
+    guint32 field;
+    guint32 action;
+    gchar *string;             /* data in UTF8  */
+    /* from and to are pretty stupid.. if it's a date type of field,
+       then
+         value = 0x2dae2dae2dae2dae,
+         date = some number, like 2 or -2
+         units = unit in seconds, like 604800 = a week
+       but if this is actually some kind of integer comparison, like
+       rating = 60 (3 stars)
+         value = the value we care about
+	 date = 0
+	 units = 1 */
+    guint64 fromvalue;
+    gint64 fromdate;
+    guint64 fromunits;
+    guint64 tovalue;
+    gint64 todate;
+    guint64 tounits;
+    guint32 unk052;
+    guint32 unk056;
+    guint32 unk060;
+    guint32 unk064;
+    guint32 unk068;
+} SPLRule;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLRules" role="struct"/>SPLRules</title>
+<indexterm><primary>SPLRules</primary></indexterm><programlisting>typedef struct {
+    guint32 unk004;
+    guint32 match_operator;  /* "All" (logical AND): SPLMATCH_AND,
+				"Any" (logical OR): SPLMATCH_OR */
+    GList *rules;
+} SPLRules;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLAction" role="enum"/>enum SPLAction</title>
+<indexterm><primary>SPLAction</primary></indexterm><programlisting>typedef enum {
+    SPLACTION_IS_INT = 0x00000001,          /* "Is Set" in iTunes */
+    SPLACTION_IS_GREATER_THAN = 0x00000010, /* "Is After" in iTunes */
+    SPLACTION_IS_LESS_THAN = 0x00000040,    /* "Is Before" in iTunes */
+    SPLACTION_IS_IN_THE_RANGE = 0x00000100,
+    SPLACTION_IS_IN_THE_LAST = 0x00000200,
+
+    SPLACTION_IS_STRING = 0x01000001,
+    SPLACTION_CONTAINS = 0x01000002,
+    SPLACTION_STARTS_WITH = 0x01000004,
+    SPLACTION_ENDS_WITH = 0x01000008,
+
+    SPLACTION_IS_NOT_INT = 0x02000001,     /* "Is Not Set" in iTunes */
+
+    /* Note: Not available in iTunes 4.5 (untested on iPod) */
+    SPLACTION_IS_NOT_GREATER_THAN = 0x02000010,
+    /* Note: Not available in iTunes 4.5 (untested on iPod) */
+    SPLACTION_IS_NOT_LESS_THAN = 0x02000040,
+    /* Note: Not available in iTunes 4.5 (seems to work on iPod) */
+    SPLACTION_IS_NOT_IN_THE_RANGE = 0x02000100,
+
+    SPLACTION_IS_NOT_IN_THE_LAST = 0x02000200,
+    SPLACTION_IS_NOT = 0x03000001,
+    SPLACTION_DOES_NOT_CONTAIN = 0x03000002,
+
+    /* Note: Not available in iTunes 4.5 (seems to work on iPod) */
+    SPLACTION_DOES_NOT_START_WITH = 0x03000004,
+    /* Note: Not available in iTunes 4.5 (seems to work on iPod) */
+    SPLACTION_DOES_NOT_END_WITH = 0x03000008,
+} SPLAction;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLFieldType" role="enum"/>enum SPLFieldType</title>
+<indexterm><primary>SPLFieldType</primary></indexterm><programlisting>typedef enum
+{
+    splft_string = 1,
+    splft_int,
+    splft_boolean,
+    splft_date,
+    splft_playlist,
+    splft_unknown
+} SPLFieldType;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLActionType" role="enum"/>enum SPLActionType</title>
+<indexterm><primary>SPLActionType</primary></indexterm><programlisting>typedef enum
+{
+    splat_string = 1,
+    splat_int,
+    splat_date,
+    splat_range_int,
+    splat_range_date,
+    splat_inthelast,
+    splat_playlist,
+    splat_none,
+    splat_invalid,
+    splat_unknown
+} SPLActionType;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLField" role="enum"/>enum SPLField</title>
+<indexterm><primary>SPLField</primary></indexterm><programlisting>typedef enum {
+    SPLFIELD_SONG_NAME = 0x02,    /* String */
+    SPLFIELD_ALBUM = 0x03,        /* String */
+    SPLFIELD_ARTIST = 0x04,       /* String */
+    SPLFIELD_BITRATE = 0x05,      /* Int (e.g. from/to = 128) */
+    SPLFIELD_SAMPLE_RATE = 0x06,  /* Int  (e.g. from/to = 44100) */
+    SPLFIELD_YEAR = 0x07,         /* Int  (e.g. from/to = 2004) */
+    SPLFIELD_GENRE = 0x08,        /* String */
+    SPLFIELD_KIND = 0x09,         /* String */
+    SPLFIELD_DATE_MODIFIED = 0x0a,/* Int/Mac Timestamp (e.g. from/to =
+                                     bcf93280 == is before 6/19/2004)*/
+    SPLFIELD_TRACKNUMBER = 0x0b,  /* Int (e.g. from = 1, to = 2) */
+    SPLFIELD_SIZE = 0x0c,         /* Int (e.g. from/to = 0x00600000
+				     for 6MB) */
+    SPLFIELD_TIME = 0x0d,         /* Int (e.g. from/to = 83999 for
+				     1:23/83 seconds) */
+    SPLFIELD_COMMENT = 0x0e,      /* String */
+    SPLFIELD_DATE_ADDED = 0x10,   /* Int/Mac Timestamp (e.g. from/to =
+                                     bcfa83ff == is after 6/19/2004) */
+    SPLFIELD_COMPOSER = 0x12,     /* String */
+    SPLFIELD_PLAYCOUNT = 0x16,    /* Int  (e.g. from/to = 1) */
+    SPLFIELD_LAST_PLAYED = 0x17,  /* Int/Mac Timestamp (e.g. from =
+                                     bcfa83ff (6/19/2004) to =
+                                     0xbcfbd57f (6/20/2004)) */
+    SPLFIELD_DISC_NUMBER = 0x18,  /* Int  (e.g. from/to = 1) */
+    SPLFIELD_RATING = 0x19,       /* Int/Stars Rating (e.g. from/to =
+                                     60 (3 stars)) */
+    SPLFIELD_COMPILATION = 0x1f,  /* Int (e.g. is set -&gt;
+				     SPLACTION_IS_INT/from=1,
+				     is not set -&gt;
+				     SPLACTION_IS_NOT_INT/from=1) */
+    SPLFIELD_BPM = 0x23,          /* Int  (e.g. from/to = 60) */
+    SPLFIELD_GROUPING = 0x27,     /* String */
+    SPLFIELD_PLAYLIST = 0x28,     /* XXX - Unknown...not parsed
+				     correctly...from/to = 0xb6fbad5f
+				     for * "Purchased Music".  Extra
+				     data after * "to"... */
+} SPLField;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPLDATE-IDENTIFIER:CAPS" role="macro"/>SPLDATE_IDENTIFIER</title>
+<indexterm><primary>SPLDATE_IDENTIFIER</primary></indexterm><programlisting>#define SPLDATE_IDENTIFIER (G_GINT64_CONSTANT (0x2dae2dae2dae2daeU))
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPL-MAXSTRINGLENGTH:CAPS" role="macro"/>SPL_MAXSTRINGLENGTH</title>
+<indexterm><primary>SPL_MAXSTRINGLENGTH</primary></indexterm><programlisting>#define SPL_MAXSTRINGLENGTH 255
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="SPL-STRING-MAXLEN:CAPS" role="macro"/>SPL_STRING_MAXLEN</title>
+<indexterm><primary>SPL_STRING_MAXLEN</primary></indexterm><programlisting>#define SPL_STRING_MAXLEN 255
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-get-field-type" role="function"/>itdb_splr_get_field_type ()</title>
+<indexterm><primary>itdb_splr_get_field_type</primary></indexterm><programlisting><link linkend="SPLFieldType">SPLFieldType</link> itdb_splr_get_field_type       (const <link linkend="SPLRule">SPLRule</link> *splr);</programlisting>
+<para>
+Gets the type of the field of the <parameter>splr</parameter> rule</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>splr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="SPLRule"><type>SPLRule</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> an <link linkend="SPLFieldType"><type>SPLFieldType</type></link> corresponding to <parameter>splr</parameter> field type 
+(string, int, date, ...)
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-get-action-type" role="function"/>itdb_splr_get_action_type ()</title>
+<indexterm><primary>itdb_splr_get_action_type</primary></indexterm><programlisting><link linkend="SPLActionType">SPLActionType</link> itdb_splr_get_action_type     (const <link linkend="SPLRule">SPLRule</link> *splr);</programlisting>
+<para>
+Gets the type of the action associated with <parameter>splr</parameter>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>splr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="SPLRule"><type>SPLRule</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> type (range, date, string...) of the action field 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-validate" role="function"/>itdb_splr_validate ()</title>
+<indexterm><primary>itdb_splr_validate</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_splr_validate              (<link linkend="SPLRule">SPLRule</link> *splr);</programlisting>
+<para>
+Validates a rule</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>splr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="SPLRule"><type>SPLRule</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-remove" role="function"/>itdb_splr_remove ()</title>
+<indexterm><primary>itdb_splr_remove</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_splr_remove                (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="SPLRule">SPLRule</link> *splr);</programlisting>
+<para>
+Removes the smart playlist rule <parameter>splr</parameter> from playlist <parameter>pl</parameter>. The memory used by
+<parameter>splr</parameter> is freed.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>splr</parameter>&nbsp;:</term>
+<listitem><simpara> an SPLRule
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-new" role="function"/>itdb_splr_new ()</title>
+<indexterm><primary>itdb_splr_new</primary></indexterm><programlisting><link linkend="SPLRule">SPLRule</link>*    itdb_splr_new                   (void);</programlisting>
+<para>
+Creates a new default smart rule</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="SPLRule"><type>SPLRule</type></link> that must be freed with <link linkend="itdb-splr-free"><function>itdb_splr_free()</function></link> when 
+no longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-add" role="function"/>itdb_splr_add ()</title>
+<indexterm><primary>itdb_splr_add</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_splr_add                   (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="SPLRule">SPLRule</link> *splr,
+                                             <link linkend="gint">gint</link> pos);</programlisting>
+<para>
+Adds the smart rule <parameter>splr</parameter> to <parameter>pl</parameter> at position <parameter>pos</parameter>. If <parameter>pos</parameter> is -1, <parameter>splr</parameter> gets
+appended to the end. After this call, <parameter>splr</parameter> memory is managed by <parameter>pl</parameter>, so 
+you no longer need to call <link linkend="itdb-splr-free"><function>itdb_splr_free()</function></link></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>splr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="SPLRule"><type>SPLRule</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
+<listitem><simpara> position of the rule
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-add-new" role="function"/>itdb_splr_add_new ()</title>
+<indexterm><primary>itdb_splr_add_new</primary></indexterm><programlisting><link linkend="SPLRule">SPLRule</link>*    itdb_splr_add_new               (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *pl,
+                                             <link linkend="gint">gint</link> pos);</programlisting>
+<para>
+Creates a new smart rule and inserts it at position <parameter>pos</parameter> in <parameter>pl</parameter>. If <parameter>pos</parameter> is
+-1, the new rule gets appended to the end.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>pl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
+<listitem><simpara> position to insert the rule at
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> pointer to the newly created <link linkend="SPLRule"><type>SPLRule</type></link>. Its memory is handled 
+by <parameter>pl</parameter> though, so you don't need to explicitly call <link linkend="itdb-splr-free"><function>itdb_splr_free()</function></link> on it
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-spl-copy-rules" role="function"/>itdb_spl_copy_rules ()</title>
+<indexterm><primary>itdb_spl_copy_rules</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_spl_copy_rules             (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *dest,
+                                             <link linkend="Itdb-Playlist">Itdb_Playlist</link> *src);</programlisting>
+<para>
+Copy all relevant information for smart playlist from playlist <parameter>src</parameter>
+to playlist <parameter>dest</parameter>. If <parameter>dest</parameter> is already a smart playlist, the existing data
+is overwritten/deleted.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>dest</parameter>&nbsp;:</term>
+<listitem><simpara> destination <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>src</parameter>&nbsp;:</term>
+<listitem><simpara> source <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-splr-eval" role="function"/>itdb_splr_eval ()</title>
+<indexterm><primary>itdb_splr_eval</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_splr_eval                  (<link linkend="SPLRule">SPLRule</link> *splr,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Evaluates <parameter>splr</parameter>'s truth against <parameter>track</parameter>. track-&gt;itdb must be set.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>splr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="SPLRule"><type>SPLRule</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if <parameter>track</parameter> matches <parameter>splr</parameter>, FALSE otherwise.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-spl-update" role="function"/>itdb_spl_update ()</title>
+<indexterm><primary>itdb_spl_update</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_spl_update                 (<link linkend="Itdb-Playlist">Itdb_Playlist</link> *spl);</programlisting>
+<para>
+Updates the content of the smart playlist <parameter>spl</parameter> (meant to be called if the 
+tracks stored in the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> associated with <parameter>spl</parameter> have changed 
+somehow and you want spl-&gt;members to be accurate with regards to those 
+changes. Does nothing if <parameter>spl</parameter> isn't a smart playlist.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>spl</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Playlist"><type>Itdb_Playlist</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-spl-update-all" role="function"/>itdb_spl_update_all ()</title>
+<indexterm><primary>itdb_spl_update_all</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_spl_update_all             (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Updates all smart playlists contained in <parameter>itdb</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-spl-update-live" role="function"/>itdb_spl_update_live ()</title>
+<indexterm><primary>itdb_spl_update_live</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_spl_update_live            (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Updates all 'live' smart playlists contained in <parameter>itdb</parameter>, ie those which have 
+the 'live updating' flag set</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/docs/reference/xml/track.xml
===================================================================
--- libgpod/branches/upstream/current/docs/reference/xml/track.xml	                        (rev 0)
+++ libgpod/branches/upstream/current/docs/reference/xml/track.xml	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,447 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<refentry id="libgpod-Tracks">
+<refmeta>
+<refentrytitle role="top_of_page">Tracks</refentrytitle>
+<manvolnum>3</manvolnum>
+<refmiscinfo>LIBGPOD Library</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>Tracks</refname>
+<refpurpose>Data structure to store metadata about an iPod track</refpurpose>
+<!--[<xref linkend="desc" endterm="desc.title"/>]-->
+</refnamediv>
+
+<refsynopsisdiv role="synopsis">
+<title role="synopsis.title">Synopsis</title>
+
+<synopsis>
+
+
+
+            <link linkend="Itdb-Track">Itdb_Track</link>;
+<link linkend="Itdb-Track">Itdb_Track</link>* <link linkend="itdb-track-new">itdb_track_new</link>                  (void);
+<link linkend="void">void</link>        <link linkend="itdb-track-free">itdb_track_free</link>                 (<link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="void">void</link>        <link linkend="itdb-track-add">itdb_track_add</link>                  (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             <link linkend="gint32">gint32</link> pos);
+<link linkend="void">void</link>        <link linkend="itdb-track-remove">itdb_track_remove</link>               (<link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="void">void</link>        <link linkend="itdb-track-unlink">itdb_track_unlink</link>               (<link linkend="Itdb-Track">Itdb_Track</link> *track);
+<link linkend="Itdb-Track">Itdb_Track</link>* <link linkend="itdb-track-duplicate">itdb_track_duplicate</link>            (<link linkend="Itdb-Track">Itdb_Track</link> *tr);
+<link linkend="Itdb-Track">Itdb_Track</link>* <link linkend="itdb-track-by-id">itdb_track_by_id</link>                (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="guint32">guint32</link> id);
+<link linkend="GTree">GTree</link>*      <link linkend="itdb-track-id-tree-create">itdb_track_id_tree_create</link>       (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);
+<link linkend="void">void</link>        <link linkend="itdb-track-id-tree-destroy">itdb_track_id_tree_destroy</link>      (<link linkend="GTree">GTree</link> *idtree);
+<link linkend="Itdb-Track">Itdb_Track</link>* <link linkend="itdb-track-id-tree-by-id">itdb_track_id_tree_by_id</link>        (<link linkend="GTree">GTree</link> *idtree,
+                                             <link linkend="guint32">guint32</link> id);
+<link linkend="gboolean">gboolean</link>    <link linkend="itdb-track-set-thumbnails">itdb_track_set_thumbnails</link>       (<link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             const <link linkend="gchar">gchar</link> *filename);
+<link linkend="void">void</link>        <link linkend="itdb-track-remove-thumbnails">itdb_track_remove_thumbnails</link>    (<link linkend="Itdb-Track">Itdb_Track</link> *track);
+#define     <link linkend="ITDB-RATING-STEP:CAPS">ITDB_RATING_STEP</link>
+</synopsis>
+</refsynopsisdiv>
+
+
+
+
+
+
+
+
+
+<refsect1 role="desc">
+<title role="desc.title">Description</title>
+<para>
+
+</para>
+</refsect1>
+
+<refsect1 role="details">
+<title role="details.title">Details</title>
+<refsect2>
+<title><anchor id="Itdb-Track" role="struct"/>Itdb_Track</title>
+<indexterm><primary>Itdb_Track</primary></indexterm><programlisting>typedef struct {
+  Itdb_iTunesDB *itdb;       /* pointer to iTunesDB (for convenience) */
+  gchar   *title;            /* title (utf8)           */
+  gchar   *ipod_path;        /* name of file on iPod: uses ":"
+				instead of "/"                        */
+  gchar   *album;            /* album (utf8)           */
+  gchar   *artist;           /* artist (utf8)          */
+  gchar   *genre;            /* genre (utf8)           */
+  gchar   *filetype;         /* eg. "MP3-File"...(utf8)*/
+  gchar   *comment;          /* comment (utf8)         */
+  gchar   *category;         /* Category for podcast   */
+  gchar   *composer;         /* Composer (utf8)        */
+  gchar   *grouping;         /* ? (utf8)               */
+  gchar   *description;      /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *podcasturl;       /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *podcastrss;       /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *chapterdata;      /* see note for MHOD_ID in itdb_itunesdb.c */
+  gchar   *subtitle;         /* see note for MHOD_ID in itdb_itunesdb.c */
+  guint32 id;                /* unique ID of track     */
+  gint32  size;              /* size of file in bytes  */
+  gint32  tracklen;          /* Length of track in ms  */
+  gint32  cd_nr;             /* CD number              */
+  gint32  cds;               /* number of CDs          */
+  gint32  track_nr;          /* track number           */
+  gint32  tracks;            /* number of tracks       */
+  gint32  bitrate;           /* bitrate                */
+  guint16 samplerate;        /* samplerate (CD: 44100) */
+  guint16 samplerate_low;    /* in the iTunesDB the samplerate is
+                                multiplied by 0x10000 -- these are the
+				lower 16 bit, which are usually 0 */
+  gint32  year;              /* year                   */
+  gint32  volume;            /* volume adjustment              */
+  guint32 soundcheck;        /* volume adjustment "soundcheck" */
+  guint32 time_added;        /* time when added (Mac type)          */
+  guint32 time_played;       /* time of last play (Mac type)        */
+  guint32 time_modified;     /* time of last modification (Mac type)*/
+  guint32 bookmark_time;     /* bookmark set for (AudioBook) in ms  */
+  guint32 rating;            /* star rating (stars * RATING_STEP (20))     */
+  guint32 playcount;         /* number of times track was played    */
+  guint32 playcount2;        /* Also stores the play count of the
+				song.  Don't know if it ever differs
+				from the above value. During sync itdb
+				sets playcount2 to the same value as
+				playcount. */
+  guint32 recent_playcount;  /* times track was played since last sync */
+  gboolean transferred;      /* has file been transferred to iPod?  */
+  gint16  BPM;               /* supposed to vary the playback speed */
+  guint8  app_rating;        /* star rating set by appl. (not
+			      * iPod). If the rating set on the iPod
+			        and the rating field above differ, the
+				original rating is copied here and the
+				new rating is stored above. */
+  guint8  type1;             /* CBR MP3s and AAC are 0x00, VBR MP3s are
+			        0x01 */
+  guint8  type2;             /* MP3s are 0x01, AAC are 0x00 */
+  guint8  compilation;
+  guint32 starttime;
+  guint32 stoptime;
+  guint8  checked;           /* 0x0: checkmark on track is set 0x1: not set */
+  guint64 dbid;              /* unique database ID */
+  guint32 drm_userid;        /* Apple Store/Audible User ID (for DRM'ed
+				files only, set to 0 otherwise). */
+  guint32 visible;           /*  If this value is 1, the song is visible
+				 on the iPod. All other values cause
+				 the file to be hidden. */
+  guint32 filetype_marker;   /* This appears to always be 0 on hard
+                                drive based iPods, but for the
+                                iTunesDB that is written to an iPod
+                                Shuffle, iTunes 4.7.1 writes out the
+                                file's type as an ANSI string(!). For
+                                example, a MP3 file has a filetype of
+                                0x4d503320 -&gt; 0x4d = 'M', 0x50 = 'P',
+                                0x33 = '3', 0x20 = &lt;space&gt;. (set to
+				the filename extension by itdb when
+				copying track to iPod)*/
+  guint16 artwork_count;     /* The number of album artwork items
+				associated with this song. libgpod
+				updates this value when syncing */
+  guint32 artwork_size;      /* The total size of artwork (in bytes)
+				attached to this song, when it is
+				converted to JPEG format. Observed in
+				iPodDB version 0x0b and with an iPod
+				Photo. libgpod updates this value when
+				syncing */
+  float samplerate2;         /* The sample rate of the song expressed
+				as an IEEE 32 bit floating point
+				number.  It's uncertain why this is
+				here.  itdb will set this when adding
+				a track */
+
+  guint16 unk126;     /* unknown, but always seems to be 0xffff for
+			 MP3/AAC songs, 0x0 for uncompressed songs
+			 (like WAVE format), 0x1 for Audible. itdb
+			 will try to set this when adding a new track */
+  guint32 unk132;     /* unknown */
+  guint32 time_released;/* date/time added to music store? definitely a
+			 timestamp, always appears to be a time of
+			 0700 GMT. For podcasts: release date as
+			 displayed next to the title in the Podcast
+			 playlist  */
+  guint16 unk144;     /* unknown, but MP3 songs appear to be always
+			 0x000c, AAC songs are always 0x0033, Audible
+			 files are 0x0029, WAV files are 0x0. itdb
+			 will attempt to set this value when adding a
+			 track. */  
+  guint16 unk146;     /* unknown, but appears to be 1 if played at
+			 least once in iTunes and 0 otherwise. */
+  guint32 unk148;     /* unknown - used for Apple Store DRM songs
+			 (always 0x01010100?), zero otherwise */
+  guint32 unk152;     /* unknown */
+  guint32 unk156, unk160;
+  guint8 has_artwork; /* 0x01: artwork is present. 0x02: no artwork is
+			 present for this track (used by the iPod to
+			 decide whether to display Artwork or not) */
+  guint8 skip_when_shuffling;/* "Skip when shuffling" when set to
+			 0x01, set to 0x00 otherwise. .m4b and .aa
+			 files always seem to be skipped when
+			 shuffling, however */
+  guint8 remember_playback_position;/* "Remember playback position"
+			 when set to 0x01, set to 0x00 otherwise. .m4b
+			 and .aa files always seem to remember the
+			 playback position, however. */
+  guint8 flag4;       /* Used for podcasts, 0x00 otherwise.  If set to
+			 0x01 the "Now Playing" page will show
+			 Title/Album, when set to 0x00 it will also
+			 show the Artist. When set to 0x02 a sub-page
+			 (middle button) with further information
+			 about the track will be shown. */
+  guint64 dbid2;      /* not clear. if not set, itdb will set this to
+			 the same value as dbid when adding a track */
+  guint8 lyrics_flag; /* set to 0x01 if lyrics are present in MP3 tag
+			 ("ULST"), 0x00 otherwise */
+  guint8 movie_flag;  /* set to 0x01 if it's a movie file, 0x00
+		         otherwise */
+  guint8 mark_unplayed; /* A value of 0x02 marks a podcast as unplayed
+			   on the iPod (bullet) once played it is set to
+			   0x01. Non-podcasts have this set to 0x01. */
+  guint8 unk179;      /* unknown (always 0x00 so far) */
+  guint32 unk180, unk184;
+  guint32 samplecount;/* Number of samples in the song. First observed
+			 in dbversion 0x0d, and only for AAC and WAV
+			 files (not MP3?!?). */
+  guint32 unk192, unk196, unk200;
+  guint32 unk204;     /*  unknown - added in dbversion 0x0c, first
+			  values observed in 0x0d. Observed to be 0x0
+			  or 0x1. */
+  guint32 unk208, unk212, unk216, unk220, unk224;
+  guint32 unk228, unk232, unk236, unk240;
+
+    /* Chapter data: defines where the chapter stops are in the track,
+       as well as what info should be displayed for each section of
+       the track. Until it can be parsed and interpreted, the
+       chapterdata will just be read as a block and written back on
+       sync. This will be changed at a later time */
+  void *chapterdata_raw;
+  guint32 chapterdata_raw_length;
+
+  /* This is for Cover Art support */
+  struct _Itdb_Artwork *artwork;
+
+  /* below is for use by application */
+  guint64 usertype;
+  gpointer userdata;
+  /* function called to duplicate userdata */
+  ItdbUserDataDuplicateFunc userdata_duplicate;
+  /* function called to free userdata */
+  ItdbUserDataDestroyFunc userdata_destroy;
+} Itdb_Track;
+</programlisting>
+<para>
+
+</para></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-new" role="function"/>itdb_track_new ()</title>
+<indexterm><primary>itdb_track_new</primary></indexterm><programlisting><link linkend="Itdb-Track">Itdb_Track</link>* itdb_track_new                  (void);</programlisting>
+<para>
+Creates an empty <link linkend="Itdb-Track"><type>Itdb_Track</type></link></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the new <link linkend="Itdb-Track"><type>Itdb_Track</type></link>, free it with <link linkend="itdb-track-free"><function>itdb_track_free()</function></link> when no
+longer needed
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-free" role="function"/>itdb_track_free ()</title>
+<indexterm><primary>itdb_track_free</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_track_free                 (<link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Frees the memory used by <parameter>track</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-add" role="function"/>itdb_track_add ()</title>
+<indexterm><primary>itdb_track_add</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_track_add                  (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             <link linkend="gint32">gint32</link> pos);</programlisting>
+<para>
+Adds <parameter>track</parameter> to <parameter>itdb->tracks</parameter> at position <parameter>pos</parameter> (or at the end if pos
+is -1). The application is responsible to also add it to the master
+playlist. The <parameter>itdb</parameter> gets ownership of the <parameter>track</parameter> and will take care of 
+freeing the memory it uses when it's no longer necessary.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>pos</parameter>&nbsp;:</term>
+<listitem><simpara> position of the track to add
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-remove" role="function"/>itdb_track_remove ()</title>
+<indexterm><primary>itdb_track_remove</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_track_remove               (<link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Removes <parameter>track</parameter> from the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> it's associated with, and frees the
+memory it uses. It doesn't remove the track from the playlists it may have
+been added to, in particular it won't be removed from the master playlist.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-unlink" role="function"/>itdb_track_unlink ()</title>
+<indexterm><primary>itdb_track_unlink</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_track_unlink               (<link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Removes <parameter>track</parameter> from the <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link> it's associated with, but do not free
+memory. It doesn't remove the track from the playlists it may have been 
+added to, in particular it won't be removed from the master playlist.
+track->itdb is set to NULL.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-duplicate" role="function"/>itdb_track_duplicate ()</title>
+<indexterm><primary>itdb_track_duplicate</primary></indexterm><programlisting><link linkend="Itdb-Track">Itdb_Track</link>* itdb_track_duplicate            (<link linkend="Itdb-Track">Itdb_Track</link> *tr);</programlisting>
+<para>
+Duplicates an existing track</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>tr</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly allocated <link linkend="Itdb-Track"><type>Itdb_Track</type></link> 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-by-id" role="function"/>itdb_track_by_id ()</title>
+<indexterm><primary>itdb_track_by_id</primary></indexterm><programlisting><link linkend="Itdb-Track">Itdb_Track</link>* itdb_track_by_id                (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb,
+                                             <link linkend="guint32">guint32</link> id);</programlisting>
+<para>
+Looks up a track using its ID in <parameter>itdb</parameter>. 
+Looking up tracks by ID is not really a good idea because the IDs
+are created by itdb just before export. The functions are here
+because they are needed during import of the iTunesDB which is
+referencing tracks by IDs.
+This function is very slow (linear in the number of tracks contained in the 
+database). If you need to lookup many IDs use <link linkend="itdb-track-id-tree-create"><function>itdb_track_id_tree_create()</function></link>, 
+<link linkend="itdb-track-id-tree-destroy"><function>itdb_track_id_tree_destroy()</function></link>, and <link linkend="itdb-track-id-tree-by-id"><function>itdb_track_id_tree_by_id()</function></link>.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>id</parameter>&nbsp;:</term>
+<listitem><simpara> ID of the track to look for
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="Itdb-Track"><type>Itdb_Track</type></link> with the ID <parameter>id</parameter> or NULL if the ID cannot be
+found. 
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-id-tree-create" role="function"/>itdb_track_id_tree_create ()</title>
+<indexterm><primary>itdb_track_id_tree_create</primary></indexterm><programlisting><link linkend="GTree">GTree</link>*      itdb_track_id_tree_create       (<link linkend="Itdb-iTunesDB">Itdb_iTunesDB</link> *itdb);</programlisting>
+<para>
+Creates a balanced-binary tree for quick ID lookup that is used in
+<link linkend="itdb-track-by-id-tree"><function>itdb_track_by_id_tree()</function></link> function below</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>itdb</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-iTunesDB"><type>Itdb_iTunesDB</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GTree"><type>GTree</type></link> indexed by track IDs to be freed with 
+<link linkend="itdb-track-id-tree-destroy"><function>itdb_track_id_tree_destroy()</function></link> when no longer used
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-id-tree-destroy" role="function"/>itdb_track_id_tree_destroy ()</title>
+<indexterm><primary>itdb_track_id_tree_destroy</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_track_id_tree_destroy      (<link linkend="GTree">GTree</link> *idtree);</programlisting>
+<para>
+Frees the memory used by <parameter>idtree</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>idtree</parameter>&nbsp;:</term>
+<listitem><simpara> a <link linkend="GTree"><type>GTree</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-id-tree-by-id" role="function"/>itdb_track_id_tree_by_id ()</title>
+<indexterm><primary>itdb_track_id_tree_by_id</primary></indexterm><programlisting><link linkend="Itdb-Track">Itdb_Track</link>* itdb_track_id_tree_by_id        (<link linkend="GTree">GTree</link> *idtree,
+                                             <link linkend="guint32">guint32</link> id);</programlisting>
+<para>
+Lookup an <link linkend="Itdb-Track"><type>Itdb_Track</type></link> by <parameter>id</parameter> using <parameter>idtree</parameter> for faster lookup (compared to
+itdb_track_by_id)</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>idtree</parameter>&nbsp;:</term>
+<listitem><simpara> a <link linkend="GTree"><type>GTree</type></link> created using <link linkend="itdb-track-id-tree-create"><function>itdb_track_id_tree_create()</function></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>id</parameter>&nbsp;:</term>
+<listitem><simpara> the ID of the track to search for
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the <link linkend="Itdb-Track"><type>Itdb_Track</type></link> whose ID is <parameter>id</parameter>, or NULL if such a track 
+couldn't be found
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-set-thumbnails" role="function"/>itdb_track_set_thumbnails ()</title>
+<indexterm><primary>itdb_track_set_thumbnails</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    itdb_track_set_thumbnails       (<link linkend="Itdb-Track">Itdb_Track</link> *track,
+                                             const <link linkend="gchar">gchar</link> *filename);</programlisting>
+<para>
+Uses the image contained in <parameter>filename</parameter> to generate iPod thumbnails. The image
+can be in any format supported by gdk-pixbuf. To save memory, the thumbnails
+will only be generated when necessary, ie when <link linkend="itdb-save"><function>itdb_save()</function></link> or a similar 
+function is called.</para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
+<listitem><simpara> image file to use as a thumbnail
+</simpara></listitem></varlistentry>
+<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE if the thumbnail could be added, FALSE otherwise.
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="itdb-track-remove-thumbnails" role="function"/>itdb_track_remove_thumbnails ()</title>
+<indexterm><primary>itdb_track_remove_thumbnails</primary></indexterm><programlisting><link linkend="void">void</link>        itdb_track_remove_thumbnails    (<link linkend="Itdb-Track">Itdb_Track</link> *track);</programlisting>
+<para>
+Removes the thumbnails associated with <parameter>track</parameter></para>
+<para>
+
+</para><variablelist role="params">
+<varlistentry><term><parameter>track</parameter>&nbsp;:</term>
+<listitem><simpara> an <link linkend="Itdb-Track"><type>Itdb_Track</type></link>
+</simpara></listitem></varlistentry>
+</variablelist></refsect2>
+<refsect2>
+<title><anchor id="ITDB-RATING-STEP:CAPS" role="macro"/>ITDB_RATING_STEP</title>
+<indexterm><primary>ITDB_RATING_STEP</primary></indexterm><programlisting>#define ITDB_RATING_STEP 20
+</programlisting>
+<para>
+
+</para></refsect2>
+
+</refsect1>
+
+
+
+
+</refentry>

Added: libgpod/branches/upstream/current/gtk-doc.make
===================================================================
--- libgpod/branches/upstream/current/gtk-doc.make	                        (rev 0)
+++ libgpod/branches/upstream/current/gtk-doc.make	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,155 @@
+# -*- mode: makefile -*-
+
+####################################
+# Everything below here is generic #
+####################################
+
+if GTK_DOC_USE_LIBTOOL
+GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+else
+GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+endif
+
+# We set GPATH here; this gives us semantics for GNU make
+# which are more like other make's VPATH, when it comes to
+# whether a source that is a target of one rule is then
+# searched for in VPATH/GPATH.
+#
+GPATH = $(srcdir)
+
+TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
+
+EXTRA_DIST = 				\
+	$(content_files)		\
+	$(HTML_IMAGES)			\
+	$(DOC_MAIN_SGML_FILE)		\
+	$(DOC_MODULE)-sections.txt	\
+	$(DOC_MODULE)-overrides.txt
+
+DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
+	   $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
+
+SCANOBJ_FILES = 		 \
+	$(DOC_MODULE).args 	 \
+	$(DOC_MODULE).hierarchy  \
+	$(DOC_MODULE).interfaces \
+	$(DOC_MODULE).prerequisites \
+	$(DOC_MODULE).signals
+
+CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
+
+if ENABLE_GTK_DOC
+all-local: html-build.stamp
+else
+all-local:
+endif
+
+docs: html-build.stamp
+
+#### scan ####
+
+scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
+	@echo 'gtk-doc: Scanning header files'
+	@-chmod -R u+w $(srcdir)
+	if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
+	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+	else \
+	    cd $(srcdir) ; \
+	    for i in $(SCANOBJ_FILES) ; do \
+               test -f $$i || touch $$i ; \
+	    done \
+	fi
+	cd $(srcdir) && \
+	  gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
+	touch scan-build.stamp
+
+$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
+	@true
+
+#### templates ####
+
+tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+	@echo 'gtk-doc: Rebuilding template files'
+	@-chmod -R u+w $(srcdir)
+	cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+	touch tmpl-build.stamp
+
+tmpl.stamp: tmpl-build.stamp
+	@true
+
+#### xml ####
+
+sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
+	@echo 'gtk-doc: Building XML'
+	@-chmod -R u+w $(srcdir)
+	cd $(srcdir) && \
+	gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
+	touch sgml-build.stamp
+
+sgml.stamp: sgml-build.stamp
+	@true
+
+#### html ####
+
+html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+	@echo 'gtk-doc: Building HTML'
+	@-chmod -R u+w $(srcdir)
+	rm -rf $(srcdir)/html 
+	mkdir $(srcdir)/html
+	cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+	test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
+	@echo 'gtk-doc: Fixing cross-references' 
+	cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	touch html-build.stamp
+
+##############
+
+clean-local:
+	rm -f *~ *.bak
+	rm -rf .libs
+
+maintainer-clean-local: clean
+	cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+
+install-data-local:
+	installfiles=`echo $(srcdir)/html/*`; \
+	if test "$$installfiles" = '$(srcdir)/html/*'; \
+	then echo '-- Nothing to install' ; \
+	else \
+	  $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
+	  for i in $$installfiles; do \
+	    echo '-- Installing '$$i ; \
+	    $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
+	  done; \
+	  echo '-- Installing $(srcdir)/html/index.sgml' ; \
+	  $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
+	fi
+
+uninstall-local:
+	rm -f $(DESTDIR)$(TARGET_DIR)/*
+
+#
+# Require gtk-doc when making dist
+#
+if ENABLE_GTK_DOC
+dist-check-gtkdoc:
+else
+dist-check-gtkdoc:
+	@echo "*** gtk-doc must be installed and enabled in order to make dist"
+	@false
+endif
+
+dist-hook: dist-check-gtkdoc dist-hook-local
+	mkdir $(distdir)/tmpl
+	mkdir $(distdir)/xml
+	mkdir $(distdir)/html
+	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
+	-cp $(srcdir)/xml/*.xml $(distdir)/xml
+	-cp $(srcdir)/html/* $(distdir)/html
+	if test -f $(srcdir)/$(DOC_MODULE).types; then \
+	  cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \
+	fi
+
+.PHONY : dist-hook-local docs

Modified: libgpod/branches/upstream/current/intltool-extract.in
===================================================================
--- libgpod/branches/upstream/current/intltool-extract.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/intltool-extract.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -32,7 +32,7 @@
 ## Release information
 my $PROGRAM      = "intltool-extract";
 my $PACKAGE      = "intltool";
-my $VERSION      = "0.33";
+my $VERSION      = "0.35.0";
 
 ## Loaded modules
 use strict; 
@@ -59,6 +59,8 @@
 my %comments = ();
 my $strcount = 0;
 
+my $XMLCOMMENT = "";
+
 ## Use this instead of \w for XML files to handle more possible characters.
 my $w = "[-A-Za-z0-9._:]";
 
@@ -186,6 +188,7 @@
     &convert;
 
     open OUT, ">$OUTFILE";
+    binmode (OUT) if $^O eq 'MSWin32';
     &msg_write;
     close OUT;
 
@@ -266,24 +269,346 @@
 
 sub type_xml {
     ### For generic translatable XML files ###
-        
-    while ($input =~ /(?:<!--([^>]*?)-->[^\n]*\n?[^\n]*)?\s_$w+\s*=\s*\"([^"]*)\"/sg) { # "
-        $messages{entity_decode_minimal($2)} = [];
-        $comments{entity_decode_minimal($2)} = $1 if (defined($1));
-    }
+    my $tree = readXml($input);
+    parseTree(0, $tree);
+}
 
-    while ($input =~ /(?:<!--([^>]*?)-->\s*)?<_($w+)(?: xml:space="($w+)")?[^>]*>(.*?)<\/_\2>/sg) {
-        $_ = $4;
-        if (!defined($3) || $3 ne "preserve") {
-            s/\s+/ /g;
-            s/^ //;
-            s/ $//;
+sub print_var {
+    my $var = shift;
+    my $vartype = ref $var;
+    
+    if ($vartype =~ /ARRAY/) {
+        my @arr = @{$var};
+        print "[ ";
+        foreach my $el (@arr) {
+            print_var($el);
+            print ", ";
         }
-        $messages{$_} = [];
-        $comments{$_} = $1 if (defined($1));
+        print "] ";
+    } elsif ($vartype =~ /HASH/) {
+        my %hash = %{$var};
+        print "{ ";
+        foreach my $key (keys %hash) {
+            print "$key => ";
+            print_var($hash{$key});
+            print ", ";
+        }
+        print "} ";
+    } else {
+        print $var;
     }
 }
 
+# Same syntax as getAttributeString in intltool-merge.in.in, similar logic (look for ## differences comment)
+sub getAttributeString
+{
+    my $sub = shift;
+    my $do_translate = shift || 1;
+    my $language = shift || "";
+    my $translate = shift;
+    my $result = "";
+    foreach my $e (reverse(sort(keys %{ $sub }))) {
+	my $key    = $e;
+	my $string = $sub->{$e};
+	my $quote = '"';
+	
+	$string =~ s/^[\s]+//;
+	$string =~ s/[\s]+$//;
+	
+	if ($string =~ /^'.*'$/)
+	{
+	    $quote = "'";
+	}
+	$string =~ s/^['"]//g;
+	$string =~ s/['"]$//g;
+
+        ## differences from intltool-merge.in.in
+	if ($key =~ /^_/) {
+            $comments{entity_decode($string)} = $XMLCOMMENT if $XMLCOMMENT;
+            $messages{entity_decode($string)} = [];
+            $$translate = 2;
+	}
+        ## differences end here from intltool-merge.in.in
+	$result .= " $key=$quote$string$quote";
+    }
+    return $result;
+}
+
+# Verbatim copy from intltool-merge.in.in
+sub getXMLstring
+{
+    my $ref = shift;
+    my $spacepreserve = shift || 0;
+    my @list = @{ $ref };
+    my $result = "";
+
+    my $count = scalar(@list);
+    my $attrs = $list[0];
+    my $index = 1;
+
+    $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/));
+    $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/));
+
+    while ($index < $count) {
+	my $type = $list[$index];
+	my $content = $list[$index+1];
+        if (! $type ) {
+	    # We've got CDATA
+	    if ($content) {
+		# lets strip the whitespace here, and *ONLY* here
+                $content =~ s/\s+/ /gs if (!$spacepreserve);
+		$result .= $content;
+	    }
+	} elsif ( "$type" ne "1" ) {
+	    # We've got another element
+	    $result .= "<$type";
+	    $result .= getAttributeString(@{$content}[0], 0); # no nested translatable elements
+	    if ($content) {
+		my $subresult = getXMLstring($content, $spacepreserve);
+		if ($subresult) {
+		    $result .= ">".$subresult . "</$type>";
+		} else {
+		    $result .= "/>";
+		}
+	    } else {
+		$result .= "/>";
+	    }
+	}
+	$index += 2;
+    }
+    return $result;
+}
+
+# Verbatim copy from intltool-merge.in.in, except for MULTIPLE_OUTPUT handling removed
+# Translate list of nodes if necessary
+sub translate_subnodes
+{
+    my $fh = shift;
+    my $content = shift;
+    my $language = shift || "";
+    my $singlelang = shift || 0;
+    my $spacepreserve = shift || 0;
+
+    my @nodes = @{ $content };
+
+    my $count = scalar(@nodes);
+    my $index = 0;
+    while ($index < $count) {
+        my $type = $nodes[$index];
+        my $rest = $nodes[$index+1];
+        traverse($fh, $type, $rest, $language, $spacepreserve);
+        $index += 2;
+    }
+}
+
+# Based on traverse() in intltool-merge.in.in
+sub traverse
+{
+    my $fh = shift; # unused, to allow us to sync code between -merge and -extract
+    my $nodename = shift;
+    my $content = shift;
+    my $language = shift || "";
+    my $spacepreserve = shift || 0;
+
+    if ($nodename && "$nodename" eq "1") {
+        $XMLCOMMENT = $content;
+    } elsif ($nodename) {
+	# element
+	my @all = @{ $content };
+	my $attrs = shift @all;
+	my $translate = 0;
+	my $outattr = getAttributeString($attrs, 1, $language, \$translate);
+
+	if ($nodename =~ /^_/) {
+	    $translate = 1;
+	    $nodename =~ s/^_//;
+	}
+	my $lookup = '';
+
+        $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/));
+        $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/));
+
+	if ($translate) {
+	    $lookup = getXMLstring($content, $spacepreserve);
+            if (!$spacepreserve) {
+                $lookup =~ s/^\s+//s;
+                $lookup =~ s/\s+$//s;
+            }
+
+	    if ($lookup && $translate != 2) {
+                $comments{$lookup} = $XMLCOMMENT if $XMLCOMMENT;
+                $messages{$lookup} = [];
+            } elsif ($translate == 2) {
+                translate_subnodes($fh, \@all, $language, 1, $spacepreserve);
+	    }
+	} else {
+            $XMLCOMMENT = "";
+	    my $count = scalar(@all);
+	    if ($count > 0) {
+                my $index = 0;
+                while ($index < $count) {
+                    my $type = $all[$index];
+                    my $rest = $all[$index+1];
+                    traverse($fh, $type, $rest, $language, $spacepreserve);
+                    $index += 2;
+                }
+	    }
+	}
+        $XMLCOMMENT = "";
+    }
+}
+
+
+# Verbatim copy from intltool-merge.in.in, $fh for compatibility
+sub parseTree
+{
+    my $fh        = shift;
+    my $ref       = shift;
+    my $language  = shift || "";
+
+    my $name = shift @{ $ref };
+    my $cont = shift @{ $ref };
+
+    while (!$name || "$name" eq "1") {
+        $name = shift @{ $ref };
+        $cont = shift @{ $ref };
+    }
+
+    my $spacepreserve = 0;
+    my $attrs = @{$cont}[0];
+    $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/));
+
+    traverse($fh, $name, $cont, $language, $spacepreserve);
+}
+
+# Verbatim copy from intltool-merge.in.in
+sub intltool_tree_comment
+{
+    my $expat = shift;
+    my $data  = $expat->original_string();
+    my $clist = $expat->{Curlist};
+    my $pos   = $#$clist;
+
+    $data =~ s/^<!--//s;
+    $data =~ s/-->$//s;
+    push @$clist, 1 => $data;
+}
+
+# Verbatim copy from intltool-merge.in.in
+sub intltool_tree_cdatastart
+{
+    my $expat    = shift;
+    my $clist = $expat->{Curlist};
+    my $pos   = $#$clist;
+
+    push @$clist, 0 => $expat->original_string();
+}
+
+# Verbatim copy from intltool-merge.in.in
+sub intltool_tree_cdataend
+{
+    my $expat    = shift;
+    my $clist = $expat->{Curlist};
+    my $pos   = $#$clist;
+
+    $clist->[$pos] .= $expat->original_string();
+}
+
+# Verbatim copy from intltool-merge.in.in
+sub intltool_tree_char
+{
+    my $expat = shift;
+    my $text  = shift;
+    my $clist = $expat->{Curlist};
+    my $pos   = $#$clist;
+
+    # Use original_string so that we retain escaped entities
+    # in CDATA sections.
+    #
+    if ($pos > 0 and $clist->[$pos - 1] eq '0') {
+        $clist->[$pos] .= $expat->original_string();
+    } else {
+        push @$clist, 0 => $expat->original_string();
+    }
+}
+
+# Verbatim copy from intltool-merge.in.in
+sub intltool_tree_start
+{
+    my $expat    = shift;
+    my $tag      = shift;
+    my @origlist = ();
+
+    # Use original_string so that we retain escaped entities
+    # in attribute values.  We must convert the string to an
+    # @origlist array to conform to the structure of the Tree
+    # Style.
+    #
+    my @original_array = split /\x/, $expat->original_string();
+    my $source         = $expat->original_string();
+
+    # Remove leading tag.
+    #
+    $source =~ s|^\s*<\s*(\S+)||s;
+
+    # Grab attribute key/value pairs and push onto @origlist array.
+    #
+    while ($source)
+    {
+       if ($source =~ /^\s*([\w:-]+)\s*[=]\s*["]/)
+       {
+           $source =~ s|^\s*([\w:-]+)\s*[=]\s*["]([^"]*)["]||s;
+           push @origlist, $1;
+           push @origlist, '"' . $2 . '"';
+       }
+       elsif ($source =~ /^\s*([\w:-]+)\s*[=]\s*[']/)
+       {
+           $source =~ s|^\s*([\w:-]+)\s*[=]\s*[']([^']*)[']||s;
+           push @origlist, $1;
+           push @origlist, "'" . $2 . "'";
+       }
+       else
+       {
+           last;
+       }
+    }
+
+    my $ol = [ { @origlist } ];
+
+    push @{ $expat->{Lists} }, $expat->{Curlist};
+    push @{ $expat->{Curlist} }, $tag => $ol;
+    $expat->{Curlist} = $ol;
+}
+
+# Copied from intltool-merge.in.in and added comment handler.
+sub readXml
+{
+    my $xmldoc = shift || return;
+    my $ret = eval 'require XML::Parser';
+    if(!$ret) {
+        die "You must have XML::Parser installed to run $0\n\n";
+    }
+    my $xp = new XML::Parser(Style => 'Tree');
+    $xp->setHandlers(Char => \&intltool_tree_char);
+    $xp->setHandlers(Start => \&intltool_tree_start);
+    $xp->setHandlers(CdataStart => \&intltool_tree_cdatastart);
+    $xp->setHandlers(CdataEnd => \&intltool_tree_cdataend);
+
+    ## differences from intltool-merge.in.in
+    $xp->setHandlers(Comment => \&intltool_tree_comment);
+    ## differences end here from intltool-merge.in.in
+
+    my $tree = $xp->parse($xmldoc);
+    #print_var($tree);
+
+# <foo><!-- comment --><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo>
+# would be:
+# [foo, [{}, 1, "comment", head, [{id => "a"}, 0, "Hello ",  em, [{}, 0, "there"]], bar, 
+# [{}, 0, "Howdy",  ref, [{}]], 0, "do" ] ]
+
+    return $tree;
+}
+
 sub type_schemas {
     ### For schemas XML files ###
          

Modified: libgpod/branches/upstream/current/intltool-merge.in
===================================================================
--- libgpod/branches/upstream/current/intltool-merge.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/intltool-merge.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -35,7 +35,7 @@
 ## Release information
 my $PROGRAM = "intltool-merge";
 my $PACKAGE = "intltool";
-my $VERSION = "0.33";
+my $VERSION = "0.35.0";
 
 ## Loaded modules
 use strict; 
@@ -91,7 +91,8 @@
 
 my %po_files_by_lang = ();
 my %translations = ();
-my $iconv = $ENV{"ICONV"} || $ENV{"INTLTOOL_ICONV"} || "/usr/bin/iconv";
+my $iconv = $ENV{"ICONV"} || $ENV{"INTLTOOL_ICONV"} || "@INTLTOOL_ICONV@";
+my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
 
 # Use this instead of \w for XML files to handle more possible characters.
 my $w = "[-A-Za-z0-9._:]";
@@ -256,7 +257,7 @@
 sub get_local_charset
 {
     my ($encoding) = @_;
-    my $alias_file = $ENV{"G_CHARSET_ALIAS"} || "/usr/lib/charset.alias";
+    my $alias_file = $ENV{"G_CHARSET_ALIAS"} || "@INTLTOOL_LIBDIR@/charset.alias";
 
     # seek character encoding aliases in charset.alias (glib)
 
@@ -299,7 +300,7 @@
         $encoding = "ISO-8859-1";
     }
 
-    system ("$iconv -f $encoding -t UTF-8 </dev/null 2>/dev/null");
+    system ("$iconv -f $encoding -t UTF-8 <$devnull 2>$devnull");
     if ($?) {
 	$encoding = get_local_charset($encoding);
     }
@@ -394,7 +395,7 @@
             } 
             else 
             {
-		print STDERR "WARNING: $po_file is not in UTF-8 but $encoding, converting...\n" unless $QUIET_ARG;;
+		print "NOTICE: $po_file is not in UTF-8 but $encoding, converting...\n" unless $QUIET_ARG;;
 
                 open PO_FILE, "$iconv -f $encoding -t UTF-8 $po_file|";	
             }
@@ -542,6 +543,8 @@
     }
 
     open OUTPUT, ">$OUTFILE" or die "can't open $OUTFILE: $!";
+    # Binmode so that selftest works ok if using a native Win32 Perl...
+    binmode (OUTPUT) if $^O eq 'MSWin32';
 
     while ($source =~ s|^(.*?)([ \t]*<\s*$w+\s+($w+\s*=\s*"$q"\s*)+/?>)([ \t]*\n)?||s) 
     {
@@ -610,23 +613,16 @@
 	if ($do_translate && $key =~ /^_/) {
 	    $key =~ s|^_||g;
 	    if ($language) {
-		
 		# Handle translation
-		#
 		my $decode_string = entity_decode($string);
 		my $translation = $translations{$language, $decode_string};
 		if ($translation) {
 		    $translation = entity_encode($translation);
 		    $string = $translation;
-                    $$translate = 2;
-		} else {
-                    $$translate = 2; # we still want translations for deep nesting (FIXME: this will cause
-                                     # problems since we might get untranslated duplicated entries, but with xml:lang set)
-                    # Fix would be to set it here to eg. 3, and do a check in traverse() to see if any of the containing tags
-                    # really need translation, and only emit "translation" if there is (this means parsing same data twice)
                 }
+                $$translate = 2;
             } else {
-                 $$translate = 2 if ($translate && (!$$translate)); # watch not to "overwrite" if $translate == 2
+                 $$translate = 2 if ($translate && (!$$translate)); # watch not to "overwrite" $translate
             }
 	}
 	
@@ -636,13 +632,10 @@
 }
 
 # Returns a translatable string from XML node, it works on contents of every node in XML::Parser tree
-#   doesn't support nesting of translatable tags (i.e. <_blah>this <_doh>doesn't</_doh> work</_blah> -- besides
-#   can you define the correct semantics for this?)
-#
-
 sub getXMLstring
 {
     my $ref = shift;
+    my $spacepreserve = shift || 0;
     my @list = @{ $ref };
     my $result = "";
 
@@ -650,6 +643,9 @@
     my $attrs = $list[0];
     my $index = 1;
 
+    $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/));
+    $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/));
+
     while ($index < $count) {
 	my $type = $list[$index];
 	my $content = $list[$index+1];
@@ -657,19 +653,15 @@
 	    # We've got CDATA
 	    if ($content) {
 		# lets strip the whitespace here, and *ONLY* here
-                $content =~ s/\s+/ /gs if (!((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/)));
-		$result .= ($content);
-	    } else {
-		#print "no cdata content when expected it\n"; # is this possible, is this ok?
-		# what to do if this happens?
-		# Did I mention that I hate XML::Parser tree style?
+                $content =~ s/\s+/ /gs if (!$spacepreserve);
+		$result .= $content;
 	    }
-	} else {
+	} elsif ( "$type" ne "1" ) {
 	    # We've got another element
 	    $result .= "<$type";
 	    $result .= getAttributeString(@{$content}[0], 0); # no nested translatable elements
 	    if ($content) {
-		my $subresult = getXMLstring($content);
+		my $subresult = getXMLstring($content, $spacepreserve);
 		if ($subresult) {
 		    $result .= ">".$subresult . "</$type>";
 		} else {
@@ -691,6 +683,7 @@
     my $content = shift;
     my $language = shift || "";
     my $singlelang = shift || 0;
+    my $spacepreserve = shift || 0;
 
     my @nodes = @{ $content };
 
@@ -702,21 +695,39 @@
         if ($singlelang) {
             my $oldMO = $MULTIPLE_OUTPUT;
             $MULTIPLE_OUTPUT = 1;
-            traverse($fh, $type, $rest, $language);
+            traverse($fh, $type, $rest, $language, $spacepreserve);
             $MULTIPLE_OUTPUT = $oldMO;
         } else {
-            traverse($fh, $type, $rest, $language);
+            traverse($fh, $type, $rest, $language, $spacepreserve);
         }
         $index += 2;
     }
 }
 
+sub isWellFormedXmlFragment
+{
+    my $ret = eval 'require XML::Parser';
+    if(!$ret) {
+        die "You must have XML::Parser installed to run $0\n\n";
+    } 
+
+    my $fragment = shift;
+    return 0 if (!$fragment);
+
+    $fragment = "<root>$fragment</root>";
+    my $xp = new XML::Parser(Style => 'Tree');
+    my $tree = 0;
+    eval { $tree = $xp->parse($fragment); };
+    return $tree;
+}
+
 sub traverse
 {
     my $fh = shift; 
     my $nodename = shift;
     my $content = shift;
     my $language = shift || "";
+    my $spacepreserve = shift || 0;
 
     if (!$nodename) {
 	if ($content =~ /^[\s]*$/) {
@@ -735,22 +746,26 @@
 	    $nodename =~ s/^_//;
 	}
 	my $lookup = '';
+
+        $spacepreserve = 0 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?default["']?$/));
+        $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/));
+
 	print $fh "<$nodename", $outattr;
 	if ($translate) {
-	    $lookup = getXMLstring($content);
-            if (!((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/))) {
+	    $lookup = getXMLstring($content, $spacepreserve);
+            if (!$spacepreserve) {
                 $lookup =~ s/^\s+//s;
                 $lookup =~ s/\s+$//s;
             }
 
 	    if ($lookup || $translate == 2) {
-                my $translation = $translations{$language, $lookup};
+                my $translation = $translations{$language, $lookup} if isWellFormedXmlFragment($translations{$language, $lookup});
                 if ($MULTIPLE_OUTPUT && ($translation || $translate == 2)) {
                     $translation = $lookup if (!$translation);
                     print $fh " xml:lang=\"", $language, "\"" if $language;
                     print $fh ">";
                     if ($translate == 2) {
-                        translate_subnodes($fh, \@all, $language, 1);
+                        translate_subnodes($fh, \@all, $language, 1, $spacepreserve);
                     } else {
                         print $fh $translation;
                     }
@@ -761,7 +776,7 @@
                 } else {
                     print $fh ">";
                     if ($translate == 2) {
-                        translate_subnodes($fh, \@all, $language, 1);
+                        translate_subnodes($fh, \@all, $language, 1, $spacepreserve);
                     } else {
                         print $fh $lookup;
                     }
@@ -780,7 +795,7 @@
                         #
                         my $translate = 0;
                         my $localattrs = getAttributeString($attrs, 1, $lang, \$translate);
-                        my $translation = $translations{$lang, $lookup};
+                        my $translation = $translations{$lang, $lookup} if isWellFormedXmlFragment($translations{$lang, $lookup});
                         if ($translate && !$translation) {
                             $translation = $lookup;
                         }
@@ -791,7 +806,7 @@
 			    print $fh $leading_space;
  			    print $fh "<", $nodename, " xml:lang=\"", $lang, "\"", $localattrs, ">";
                             if ($translate == 2) {
-                               translate_subnodes($fh, \@all, $lang, 1);
+                               translate_subnodes($fh, \@all, $lang, 1, $spacepreserve);
                             } else {
                                 print $fh $translation;
                             }
@@ -808,7 +823,7 @@
                 while ($index < $count) {
                     my $type = $all[$index];
                     my $rest = $all[$index+1];
-                    traverse($fh, $type, $rest, $language);
+                    traverse($fh, $type, $rest, $language, $spacepreserve);
                     $index += 2;
                 }
 		print $fh "</$nodename>";
@@ -819,6 +834,16 @@
     }
 }
 
+sub intltool_tree_comment
+{
+    my $expat = shift;
+    my $data  = shift;
+    my $clist = $expat->{Curlist};
+    my $pos   = $#$clist;
+
+    push @$clist, 1 => $data;
+}
+
 sub intltool_tree_cdatastart
 {
     my $expat    = shift;
@@ -962,7 +987,17 @@
 
     my $name = shift @{ $ref };
     my $cont = shift @{ $ref };
-    traverse($fh, $name, $cont, $language);
+    
+    while (!$name || "$name" eq "1") {
+        $name = shift @{ $ref };
+        $cont = shift @{ $ref };
+    }
+
+    my $spacepreserve = 0;
+    my $attrs = @{$cont}[0];
+    $spacepreserve = 1 if ((exists $attrs->{"xml:space"}) && ($attrs->{"xml:space"} =~ /^["']?preserve["']?$/));
+
+    traverse($fh, $name, $cont, $language, $spacepreserve);
 }
 
 sub xml_merge_output
@@ -975,6 +1010,7 @@
 	        mkdir $lang or die "Cannot create subdirectory $lang: $!\n";
             }
             open OUTPUT, ">$lang/$OUTFILE" or die "Cannot open $lang/$OUTFILE: $!\n";
+            binmode (OUTPUT) if $^O eq 'MSWin32';
             my $tree = readXml($FILE);
             print_header($FILE, \*OUTPUT);
             parseTree(\*OUTPUT, $tree, $lang);
@@ -983,6 +1019,7 @@
         }
     } 
     open OUTPUT, ">$OUTFILE" or die "Cannot open $OUTFILE: $!\n";
+    binmode (OUTPUT) if $^O eq 'MSWin32';
     my $tree = readXml($FILE);
     print_header($FILE, \*OUTPUT);
     parseTree(\*OUTPUT, $tree);
@@ -994,6 +1031,7 @@
 {
     open INPUT, "<${FILE}" or die;
     open OUTPUT, ">${OUTFILE}" or die;
+    binmode (OUTPUT) if $^O eq 'MSWin32';
 
     while (<INPUT>) 
     {
@@ -1029,6 +1067,7 @@
 {
     open INPUT, "<${FILE}" or die;
     open OUTPUT, ">${OUTFILE}" or die;
+    binmode (OUTPUT) if $^O eq 'MSWin32';
 
     while (<INPUT>) 
     {
@@ -1072,6 +1111,7 @@
     }
 
     open OUTPUT, ">$OUTFILE" or die;
+    binmode (OUTPUT) if $^O eq 'MSWin32';
 
     # FIXME: support attribute translations
 
@@ -1173,6 +1213,7 @@
     }
 
     open OUTPUT, ">${OUTFILE}" or die;
+    binmode (OUTPUT) if $^O eq 'MSWin32';
 
     while ($source =~ /(^|\n+)(_*)([^:\s]+)(:[ \t]*)(.*?)(?=\n[\S\n]|$)/sg)
     {

Modified: libgpod/branches/upstream/current/intltool-update.in
===================================================================
--- libgpod/branches/upstream/current/intltool-update.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/intltool-update.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -30,7 +30,7 @@
 
 ## Release information
 my $PROGRAM = "intltool-update";
-my $VERSION = "0.33";
+my $VERSION = "0.35.0";
 my $PACKAGE = "intltool";
 
 ## Loaded modules
@@ -80,7 +80,8 @@
 "directory(?:\\.in)+|".	# http://www.freedesktop.org/Standards/menu-spec
 "soundlist(?:\\.in)+|".	# GNOME specific
 "keys(?:\\.in)+|".	# GNOME Mime database specific
-"theme(?:\\.in)+";	# http://www.freedesktop.org/Standards/icon-theme-spec
+"theme(?:\\.in)+|".	# http://www.freedesktop.org/Standards/icon-theme-spec
+"service(?:\\.in)+";    # DBus specific
 
 my $buildin_gettext_support = 
 "c|y|cs|cc|cpp|c\\+\\+|h|hh|gob|py";
@@ -95,6 +96,8 @@
 $SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"};
 $POTFILES_in = "<$SRCDIR/POTFILES.in";
 
+my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
+
 ## Handle options
 GetOptions 
 (
@@ -122,7 +125,7 @@
 &Console_Write_IntltoolHelp if $arg_count > 1;
 
 # --version and --help don't require a module name
-my $MODULE = $GETTEXT_PACKAGE || &FindPackageName;
+my $MODULE = $GETTEXT_PACKAGE || &FindPackageName || "unknown";
 
 if ($POT_ARG)
 {
@@ -442,7 +445,7 @@
 	while (<FILE>) 
 	{
 	    # FIXME: share the pattern matching code with intltool-extract
-	    if (/\s_(.*)=\"/ || /<_[^>]+>/ || /translatable=\"yes\"/)
+	    if (/\s_[-A-Za-z0-9._:]+\s*=\s*\"([^"]+)\"/ || /<_[^>]+>/ || /translatable=\"yes\"/)
 	    {
                 if (defined isNotValidMissing (unpack("x3 A*", $file))) {
                     push @buf_allfiles, unpack("x3 A*", $file) . "\n";
@@ -608,7 +611,7 @@
 #
 sub GeneratePOTemplate
 {
-    my $XGETTEXT = $ENV{"XGETTEXT"} || "/usr/bin/xgettext";
+    my $XGETTEXT = $ENV{"XGETTEXT"} || "@INTLTOOL_XGETTEXT@";
     my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || '';
     chomp $XGETTEXT;
 
@@ -628,7 +631,7 @@
     my $gettext_support_nonascii = 0;
 
     # checks for GNU gettext >= 0.12
-    my $dummy = `$XGETTEXT --version --from-code=UTF-8 >/dev/null 2>/dev/null`;
+    my $dummy = `$XGETTEXT --version --from-code=UTF-8 >$devnull 2>$devnull`;
     if ($? == 0)
     {
 	$gettext_support_nonascii = 1;
@@ -719,6 +722,8 @@
 			   "--files-from\=\.\/POTFILES\.in\.temp");
     my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
     push @xgettext_argument, $XGETTEXT_KEYWORDS;
+    my $MSGID_BUGS_ADDRESS = &FindMakevarsBugAddress;
+    push @xgettext_argument, "--msgid-bugs-address\=$MSGID_BUGS_ADDRESS" if $MSGID_BUGS_ADDRESS;
     push @xgettext_argument, "--from-code\=$encoding" if ($gettext_support_nonascii);
     push @xgettext_argument, $XGETTEXT_ARGS if $XGETTEXT_ARGS;
     my $xgettext_command = join ' ', @xgettext_argument;
@@ -779,7 +784,7 @@
 {
     -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n";
 
-    my $MSGMERGE = $ENV{"MSGMERGE"} || "/usr/bin/msgmerge";
+    my $MSGMERGE = $ENV{"MSGMERGE"} || "@INTLTOOL_MSGMERGE@";
     my ($lang, $outfile) = @_;
 
     print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE;
@@ -822,16 +827,16 @@
 sub Console_Write_TranslationStatus
 {
     my ($lang, $output_file) = @_;
-    my $MSGFMT = $ENV{"MSGFMT"} || "/usr/bin/msgfmt";
+    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
 
     $output_file = "$SRCDIR/$lang.po" if ($output_file eq "");
 
-    system ("$MSGFMT", "-o", "/dev/null", "--statistics", $output_file);
+    system ("$MSGFMT", "-o", "$devnull", "--verbose", $output_file);
 }
 
 sub Console_Write_CoverageReport
 {
-    my $MSGFMT = $ENV{"MSGFMT"} || "/usr/bin/msgfmt";
+    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
 
     &GatherPOFiles;
 
@@ -846,7 +851,7 @@
     foreach my $lang (@languages)
     {
 	print "$lang: ";
-	system ("$MSGFMT", "-o", "/dev/null", "--statistics", "$SRCDIR/$lang.po");
+	system ("$MSGFMT", "-o", "$devnull", "--verbose", "$SRCDIR/$lang.po");
     }
 }
 
@@ -871,8 +876,10 @@
     {
 	my $rest = $3;
 	my $untouched = $1;
-	my $sub = $varhash{$2};
-	
+	my $sub = "";
+        # Ignore recursive definitions of variables
+        $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/;
+
 	return SubstituteVariable ("$untouched$sub$rest");
     }
     
@@ -989,10 +996,10 @@
 	($name, $version) = ($1, $2);
 	$name    =~ s/[\[\]\s]//g;
 	$version =~ s/[\[\]\s]//g;
-	$varhash{"AC_PACKAGE_NAME"} = $name;
-	$varhash{"PACKAGE"} = $name;
-	$varhash{"AC_PACKAGE_VERSION"} = $version;
-	$varhash{"VERSION"} = $version;
+	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
     }
     
     if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)/m) 
@@ -1000,19 +1007,18 @@
 	($name, $version) = ($1, $2);
 	$name    =~ s/[\[\]\s]//g;
 	$version =~ s/[\[\]\s]//g;
-	$varhash{"AC_PACKAGE_NAME"} = $name;
-	$varhash{"PACKAGE"} = $name;
-	$varhash{"AC_PACKAGE_VERSION"} = $version;
-	$varhash{"VERSION"} = $version;
+	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
     }
 
     # \s makes this not work, why?
     $name = $1 if $conf_source =~ /^GETTEXT_PACKAGE=\[?([^\n\]]+)/m;
     
-    # prepend '$' to auto* internal variables, usually they are
-    # used in configure.in/ac without the '$'
-    $name =~ s/AC_/\$AC_/g;
-    $name =~ s/\$\$/\$/g;
+    # m4 macros AC_PACKAGE_NAME, AC_PACKAGE_VERSION etc. have same value
+    # as corresponding $PACKAGE_NAME, $PACKAGE_VERSION etc. shell variables.
+    $name =~ s/\bAC_PACKAGE_/\$PACKAGE_/g;
 
     $name = $domain if $domain;
 
@@ -1061,3 +1067,23 @@
     
     return $domain;
 }
+
+sub FindMakevarsBugAddress
+{
+
+    my $address = "";
+    my $makevars_source; { 
+	local (*IN);
+	open (IN, "<Makevars") || return undef;
+	seek (IN, 0, 0);
+	local $/; # slurp mode
+	$makevars_source = <IN>;
+	close IN;
+    }
+
+    $address = $1 if $makevars_source =~ /^MSGID_BUGS_ADDRESS[ ]*=\[?([^\n\]\$]+)/m;
+    $address =~ s/^\s+//;
+    $address =~ s/\s+$//;
+    
+    return $address;
+}

Modified: libgpod/branches/upstream/current/ltmain.sh
===================================================================
--- libgpod/branches/upstream/current/ltmain.sh	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/ltmain.sh	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,7 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 # Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 #
@@ -17,7 +17,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -43,9 +43,14 @@
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.6
-TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 224 $"
+VERSION="1.5.22 Debian 1.5.22-4"
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes.
+if test -n "${ZSH_VERSION+set}" ; then
+  setopt NO_GLOB_SUBST
+fi
 
 # Check that we have a working $echo.
 if test "X$1" = X--no-reexec; then
@@ -83,14 +88,15 @@
 Xsed="${SED}"' -e 1s/^X//'
 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
 # test EBCDIC or ASCII
-case `echo A|tr A '\301'` in
- A) # EBCDIC based system
-  SP2NL="tr '\100' '\n'"
-  NL2SP="tr '\r\n' '\100\100'"
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  SP2NL='tr \040 \012'
+  NL2SP='tr \015\012 \040\040'
   ;;
- *) # Assume ASCII based system
-  SP2NL="tr '\040' '\012'"
-  NL2SP="tr '\015\012' '\040\040'"
+ *) # EBCDIC based system
+  SP2NL='tr \100 \n'
+  NL2SP='tr \r\n \100\100'
   ;;
 esac
 
@@ -107,8 +113,9 @@
 fi
 
 # Make sure IFS has a sensible default
-: ${IFS=" 	
-"}
+lt_nl='
+'
+IFS=" 	$lt_nl"
 
 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   $echo "$modename: not configured to build any kind of library" 1>&2
@@ -125,6 +132,8 @@
 show="$echo"
 show_help=
 execute_dlfiles=
+duplicate_deps=no
+preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 
@@ -132,13 +141,51 @@
 # Shell function definitions:
 # This seems to be the best place for them
 
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+	# Failing that, at least try and use $RANDOM to avoid a race
+	my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+	save_mktempdir_umask=`umask`
+	umask 0077
+	$mkdir "$my_tmpdir"
+	umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || {
+        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+	exit $EXIT_FAILURE
+      }
+    fi
+
+    $echo "X$my_tmpdir" | $Xsed
+}
+
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
-func_win32_libid () {
+func_win32_libid ()
+{
   win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
@@ -149,12 +196,11 @@
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
-	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
-      if test "X$win32_nmres" = "Ximport" ; then
-        win32_libid_type="x86 archive import"
-      else
-        win32_libid_type="x86 archive static"
-      fi
+	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
     fi
     ;;
   *DLL*)
@@ -178,7 +224,8 @@
 # Only attempt this if the compiler in the base compile
 # command doesn't match the default compiler.
 # arg is usually of the form 'gcc ...'
-func_infer_tag () {
+func_infer_tag ()
+{
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -235,12 +282,116 @@
       esac
     fi
 }
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xdir="$my_gentop/$my_xlib"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+	exit $exit_status
+      fi
+      case $host in
+      *-darwin*)
+	$show "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	if test -z "$run"; then
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+	  if test -n "$darwin_arches"; then 
+	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      lipo -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    ${rm}r unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd "$darwin_orig_dir"
+ 	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	fi # $run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
 # End of Shell function definitions
 #####################################
 
 # Darwin sucks
 eval std_shrext=\"$shrext_cmds\"
 
+disable_libs=no
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -305,10 +456,10 @@
   --version)
     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
     $echo
-    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
     $echo "This is free software; see the source for copying conditions.  There is NO"
     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --config)
@@ -317,7 +468,7 @@
     for tagname in $taglist; do
       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
     done
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --debug)
@@ -342,7 +493,7 @@
     else
       $echo "disable static libraries"
     fi
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --finish) mode="finish" ;;
@@ -357,7 +508,11 @@
     preserve_args="$preserve_args $arg"
     ;;
 
-  --tag) prevopt="--tag" prev=tag ;;
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
   --tag=*)
     set tag "$optarg" ${1+"$@"}
     shift
@@ -389,6 +544,18 @@
   exit $EXIT_FAILURE
 fi
 
+case $disable_libs in
+no) 
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
@@ -399,7 +566,7 @@
   # Infer the operation mode.
   if test -z "$mode"; then
     $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
     case $nonopt in
     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
       mode=link
@@ -465,7 +632,7 @@
 
     for arg
     do
-      case "$arg_mode" in
+      case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
 	lastarg="$arg"
@@ -547,7 +714,10 @@
       case $lastarg in
       # Double-quote args containing other shell metacharacters.
       # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 	lastarg="\"$lastarg\""
 	;;
@@ -621,6 +791,14 @@
       esac
     done
 
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qlibobj="\"$qlibobj\"" ;;
+    esac
+    test "X$libobj" != "X$qlibobj" \
+	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
+	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
     if test "X$xdir" = "X$obj"; then
@@ -693,12 +871,17 @@
 	$run $rm $removelist
 	exit $EXIT_FAILURE
       fi
-      $echo $srcfile > "$lockfile"
+      $echo "$srcfile" > "$lockfile"
     fi
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
 
     $run $rm "$libobj" "${libobj}T"
 
@@ -720,18 +903,18 @@
       fbsd_hideous_sh_bug=$base_compile
 
       if test "$pic_mode" != no; then
-	command="$base_compile $srcfile $pic_flag"
+	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
-	command="$base_compile $srcfile"
+	command="$base_compile $qsrcfile"
       fi
 
       if test ! -d "${xdir}$objdir"; then
 	$show "$mkdir ${xdir}$objdir"
 	$run $mkdir ${xdir}$objdir
-	status=$?
-	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $status
+	exit_status=$?
+	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $exit_status
 	fi
       fi
 
@@ -803,9 +986,9 @@
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
 	# Don't build PIC code
-	command="$base_compile $srcfile"
+	command="$base_compile $qsrcfile"
       else
-	command="$base_compile $srcfile $pic_flag"
+	command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
 	command="$command -o $obj"
@@ -934,6 +1117,7 @@
     no_install=no
     objs=
     non_pic_objects=
+    notinst_path= # paths that contain not-installed libtool libraries
     precious_files_regex=
     prefer_static_libs=no
     preload=no
@@ -962,14 +1146,15 @@
 	  if test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
+	  prefer_static_libs=yes
 	else
 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
 	  fi
+	  prefer_static_libs=built
 	fi
 	build_libtool_libs=no
 	build_old_libs=yes
-	prefer_static_libs=yes
 	break
 	;;
       esac
@@ -1144,6 +1329,11 @@
 		  if test -z "$pic_object" || test "$pic_object" = none ; then
 		    arg="$non_pic_object"
 		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
 		fi
 	      else
 		# Only an error if not doing a dry-run.
@@ -1227,6 +1417,13 @@
 	  prev=
 	  continue
 	  ;;
+	darwin_framework|darwin_framework_skip)
+	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  prev=
+	  continue
+	  ;;
 	*)
 	  eval "$prev=\"\$arg\""
 	  prev=
@@ -1285,6 +1482,18 @@
 	continue
 	;;
 
+      -framework|-arch|-isysroot)
+	case " $CC " in
+	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
+		prev=darwin_framework_skip ;;
+	  *) compiler_flags="$compiler_flags $arg"
+	     prev=darwin_framework ;;
+	esac
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+	continue
+	;;
+
       -inst-prefix-dir)
 	prev=inst_prefix
 	continue
@@ -1311,7 +1520,8 @@
 	  absdir=`cd "$dir" && pwd`
 	  if test -z "$absdir"; then
 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    exit $EXIT_FAILURE
+	    absdir="$dir"
+	    notinst_path="$notinst_path $dir"
 	  fi
 	  dir="$absdir"
 	  ;;
@@ -1325,10 +1535,15 @@
 	esac
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
 	  *) dllsearchpath="$dllsearchpath:$dir";;
 	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
 	  ;;
 	esac
 	continue
@@ -1337,15 +1552,15 @@
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
-	  *-*-mingw* | *-*-os2*)
+	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
 	    test "X$arg" = "X-lc" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
 	    test "X$arg" = "X-lc" && continue
 	    ;;
@@ -1353,10 +1568,19 @@
 	    # Rhapsody C and math libraries are in the System framework
 	    deplibs="$deplibs -framework System"
 	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
 	  esac
 	elif test "X$arg" = "X-lc_r"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -1366,8 +1590,20 @@
 	continue
 	;;
 
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+	compile_command="$compile_command $arg"
+	compiler_flags="$compiler_flags $arg"
+	finalize_command="$finalize_command $arg"
+	prev=xcompiler
+	continue
+	;;
+
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-	deplibs="$deplibs $arg"
+	compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
 	continue
 	;;
 
@@ -1376,13 +1612,19 @@
 	continue
 	;;
 
-      # gcc -m* arguments should be passed to the linker via $compiler_flags
-      # in order to pass architecture information to the linker
-      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
-      # but this is not reliable with gcc because gcc may use -mfoo to
-      # select a different linker, different libraries, etc, while
-      # -Wl,-mfoo simply passes -mfoo to the linker.
-      -m*)
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -pg pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
+      -t[45]*|-txscale*|@*)
+
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
@@ -1393,9 +1635,7 @@
 	esac
         compile_command="$compile_command $arg"
         finalize_command="$finalize_command $arg"
-        if test "$with_gcc" = "yes" ; then
-          compiler_flags="$compiler_flags $arg"
-        fi
+        compiler_flags="$compiler_flags $arg"
         continue
         ;;
 
@@ -1633,6 +1873,11 @@
 	    if test -z "$pic_object" || test "$pic_object" = none ; then
 	      arg="$non_pic_object"
 	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
 	  fi
 	else
 	  # Only an error if not doing a dry-run.
@@ -1738,9 +1983,9 @@
     if test ! -d "$output_objdir"; then
       $show "$mkdir $output_objdir"
       $run $mkdir $output_objdir
-      status=$?
-      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $status
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $exit_status
       fi
     fi
 
@@ -1803,7 +2048,6 @@
     newlib_search_path=
     need_relink=no # whether we're linking any uninstalled libtool libraries
     notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
     case $linkmode in
     lib)
 	passes="conv link"
@@ -1858,7 +2102,7 @@
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	    deplibs="$deplib $deplibs"
+	    compiler_flags="$compiler_flags $deplib"
 	  fi
 	  continue
 	  ;;
@@ -1977,7 +2221,22 @@
 	  fi
 	  case $linkmode in
 	  lib)
-	    if test "$deplibs_check_method" != pass_all; then
+	    valid_a_lib=no
+	    case $deplibs_check_method in
+	      match_pattern*)
+		set dummy $deplibs_check_method
+	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+		if eval $echo \"$deplib\" 2>/dev/null \
+		    | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		  valid_a_lib=yes
+		fi
+		;;
+	      pass_all)
+		valid_a_lib=yes
+		;;
+            esac
+	    if test "$valid_a_lib" != yes; then
 	      $echo
 	      $echo "*** Warning: Trying to link with static lib archive $deplib."
 	      $echo "*** I have the capability to make that library automatically link in when"
@@ -2027,7 +2286,7 @@
 	esac # case $deplib
 	if test "$found" = yes || test -f "$lib"; then :
 	else
-	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
 	  exit $EXIT_FAILURE
 	fi
 
@@ -2051,7 +2310,9 @@
 	# it will not redefine variables installed, or shouldnotlink
 	installed=yes
 	shouldnotlink=no
+	avoidtemprpath=
 
+
 	# Read the .la file
 	case $lib in
 	*/* | *\\*) . $lib ;;
@@ -2149,11 +2410,19 @@
 	    dir="$libdir"
 	    absdir="$libdir"
 	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
 	else
-	  dir="$ladir/$objdir"
-	  absdir="$abs_ladir/$objdir"
-	  # Remove this search path later
-	  notinst_path="$notinst_path $abs_ladir"
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
 	fi # $installed = yes
 	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
 
@@ -2226,12 +2495,12 @@
 	  if test -n "$library_names" &&
 	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var"; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 	      # Make sure the rpath contains only unique directories.
 	      case "$temp_rpath " in
 	      *" $dir "*) ;;
 	      *" $absdir "*) ;;
-	      *) temp_rpath="$temp_rpath $dir" ;;
+	      *) temp_rpath="$temp_rpath $absdir" ;;
 	      esac
 	    fi
 
@@ -2268,8 +2537,12 @@
 	fi
 
 	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes ; then
+	  use_static_libs=no
+	fi
 	if test -n "$library_names" &&
-	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
 	  if test "$installed" = no; then
 	    notinst_deplibs="$notinst_deplibs $lib"
 	    need_relink=yes
@@ -2382,11 +2655,15 @@
 	      if test "$hardcode_direct" = no; then
 		add="$dir/$linklib"
 		case $host in
-		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
 		  *-*-darwin* )
 		    # if the lib is a module then we can not link against
 		    # it, someone is ignoring the new warnings I added
-		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+		    if /usr/bin/file -L $add 2> /dev/null |
+                      $EGREP ": [^:]* bundle" >/dev/null ; then
 		      $echo "** Warning, lib $linklib is a module, not a shared library"
 		      if test -z "$old_library" ; then
 		        $echo
@@ -2417,7 +2694,7 @@
 		add_dir="-L$dir"
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
-		  case "$libdir" in
+		  case $libdir in
 		    [\\/]*)
 		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
 		      ;;
@@ -2490,7 +2767,7 @@
 	      add_dir="-L$libdir"
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
-		case "$libdir" in
+		case $libdir in
 		  [\\/]*)
 		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
 		    ;;
@@ -2551,8 +2828,6 @@
 	      fi
 	    fi
 	  else
-	    convenience="$convenience $dir/$old_library"
-	    old_convenience="$old_convenience $dir/$old_library"
 	    deplibs="$dir/$old_library $deplibs"
 	    link_static=yes
 	  fi
@@ -2670,13 +2945,13 @@
 	      *) continue ;;
 	      esac
 	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	      case " $deplibs " in
 	      *" $depdepl "*) ;;
 	      *) deplibs="$depdepl $deplibs" ;;
 	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$deplibs $path" ;;
-	      esac
 	    done
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
@@ -2947,7 +3222,7 @@
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 	  exit $EXIT_FAILURE
 	  ;;
@@ -2956,7 +3231,7 @@
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 	  exit $EXIT_FAILURE
 	  ;;
@@ -2965,7 +3240,7 @@
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
 	  exit $EXIT_FAILURE
 	  ;;
@@ -2991,7 +3266,7 @@
 	  versuffix="$major.$age.$revision"
 	  # Darwin ld doesn't like 0 for these options...
 	  minor_current=`expr $current + 1`
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
 	  ;;
 
 	freebsd-aout)
@@ -3144,9 +3419,9 @@
 
       # Eliminate all temporary directories.
       for path in $notinst_path; do
-	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
-	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
-	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
       done
 
       if test -n "$xrpath"; then
@@ -3197,10 +3472,15 @@
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
 	    ;;
-	  *-*-openbsd* | *-*-freebsd*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
 	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
  	  *)
 	    # Add libc to deplibs on all other systems if necessary.
 	    if test "$build_libtool_need_lc" = "yes"; then
@@ -3243,11 +3523,11 @@
 	  int main() { return 0; }
 EOF
 	  $rm conftest
-	  $LTCC -o conftest conftest.c $deplibs
+	  $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
 	  if test "$?" -eq 0 ; then
 	    ldd_output=`ldd conftest`
 	    for i in $deplibs; do
-	      name="`expr $i : '-l\(.*\)'`"
+	      name=`expr $i : '-l\(.*\)'`
 	      # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" -ne "0"; then
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3284,11 +3564,11 @@
 	    # Error occurred in the first compile.  Let's try to salvage
 	    # the situation: Compile a separate program for each library.
 	    for i in $deplibs; do
-	      name="`expr $i : '-l\(.*\)'`"
+	      name=`expr $i : '-l\(.*\)'`
 	      # If $name is empty we are operating on a -L argument.
               if test "$name" != "" && test "$name" != "0"; then
 		$rm conftest
-		$LTCC -o conftest conftest.c $i
+		$LTCC $LTCFLAGS -o conftest conftest.c $i
 		# Did it work?
 		if test "$?" -eq 0 ; then
 		  ldd_output=`ldd conftest`
@@ -3336,7 +3616,7 @@
 	  set dummy $deplibs_check_method
 	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    name=`expr $a_deplib : '-l\(.*\)'`
 	    # If $name is empty we are operating on a -L argument.
             if test "$name" != "" && test  "$name" != "0"; then
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3405,7 +3685,7 @@
 	  set dummy $deplibs_check_method
 	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    name=`expr $a_deplib : '-l\(.*\)'`
 	    # If $name is empty we are operating on a -L argument.
 	    if test -n "$name" && test "$name" != "0"; then
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3535,6 +3815,35 @@
 	deplibs=$newdeplibs
       fi
 
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+
       # All the library-specific variables (install_libdir is set above).
       library_names=
       old_library=
@@ -3618,6 +3927,7 @@
 	fi
 
 	lib="$output_objdir/$realname"
+	linknames=
 	for link
 	do
 	  linknames="$linknames $link"
@@ -3646,6 +3956,9 @@
 	        # The command line is too long to execute in one step.
 	        $show "using reloadable object file for export list..."
 	        skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
 	      fi
 	    done
 	    IFS="$save_ifs"
@@ -3679,67 +3992,13 @@
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	  else
 	    gentop="$output_objdir/${outputname}x"
-	    $show "${rm}r $gentop"
-	    $run ${rm}r "$gentop"
-	    $show "$mkdir $gentop"
-	    $run $mkdir "$gentop"
-	    status=$?
-	    if test "$status" -ne 0 && test ! -d "$gentop"; then
-	      exit $status
-	    fi
 	    generated="$generated $gentop"
 
-	    for xlib in $convenience; do
-	      # Extract the objects.
-	      case $xlib in
-	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-	      *) xabs=`pwd`"/$xlib" ;;
-	      esac
-	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-	      xdir="$gentop/$xlib"
-
-	      $show "${rm}r $xdir"
-	      $run ${rm}r "$xdir"
-	      $show "$mkdir $xdir"
-	      $run $mkdir "$xdir"
-	      status=$?
-	      if test "$status" -ne 0 && test ! -d "$xdir"; then
-		exit $status
-	      fi
-	      # We will extract separately just the conflicting names and we will no
-	      # longer touch any unique names. It is faster to leave these extract
-	      # automatically by $AR in one run.
-	      $show "(cd $xdir && $AR x $xabs)"
-	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-		:
-	      else
-		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-		$AR t "$xabs" | sort | uniq -cd | while read -r count name
-		do
-		  i=1
-		  while test "$i" -le "$count"
-		  do
-		   # Put our $i before any first dot (extension)
-		   # Never overwrite any file
-		   name_to="$name"
-		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-		   do
-		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-		   done
-		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-		   i=`expr $i + 1`
-		  done
-		done
-	      fi
-
-	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-	    done
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
 	  fi
 	fi
-
+	
 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  linker_flags="$linker_flags $flag"
@@ -3769,7 +4028,8 @@
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
+	if test "X$skipped_export" != "X:" &&
+	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  :
 	else
@@ -3788,6 +4048,7 @@
 	    save_libobjs=$libobjs
 	  fi
 	  save_output=$output
+	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
 
 	  # Clear the reloadable object creation command queue and
 	  # initialize k to one.
@@ -3797,13 +4058,13 @@
 	  delfiles=
 	  last_robj=
 	  k=1
-	  output=$output_objdir/$save_output-${k}.$objext
+	  output=$output_objdir/$output_la-${k}.$objext
 	  # Loop over the list of objects to be linked.
 	  for obj in $save_libobjs
 	  do
 	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
 	    if test "X$objlist" = X ||
-	       { len=`expr "X$test_cmds" : ".*"` &&
+	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 		 test "$len" -le "$max_cmd_len"; }; then
 	      objlist="$objlist $obj"
 	    else
@@ -3817,9 +4078,9 @@
 		# the last one created.
 		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
 	      fi
-	      last_robj=$output_objdir/$save_output-${k}.$objext
+	      last_robj=$output_objdir/$output_la-${k}.$objext
 	      k=`expr $k + 1`
-	      output=$output_objdir/$save_output-${k}.$objext
+	      output=$output_objdir/$output_la-${k}.$objext
 	      objlist=$obj
 	      len=1
 	    fi
@@ -3839,13 +4100,13 @@
 	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
           fi
 
-	  # Set up a command to remove the reloadale object files
+	  # Set up a command to remove the reloadable object files
 	  # after they are used.
 	  i=0
 	  while test "$i" -lt "$k"
 	  do
 	    i=`expr $i + 1`
-	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
 	  done
 
 	  $echo "creating a temporary reloadable object file: $output"
@@ -3893,13 +4154,30 @@
 	  IFS="$save_ifs"
 	  eval cmd=\"$cmd\"
 	  $show "$cmd"
-	  $run eval "$cmd" || exit $?
+	  $run eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	    fi
+
+	    exit $lt_exit
+	  }
 	done
 	IFS="$save_ifs"
 
 	# Restore the uninstalled library and exit
 	if test "$mode" = relink; then
 	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      $show "${rm}r $gentop"
+	      $run ${rm}r "$gentop"
+	    fi
+	  fi
+
 	  exit $EXIT_SUCCESS
 	fi
 
@@ -3977,64 +4255,10 @@
 	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
 	else
 	  gentop="$output_objdir/${obj}x"
-	  $show "${rm}r $gentop"
-	  $run ${rm}r "$gentop"
-	  $show "$mkdir $gentop"
-	  $run $mkdir "$gentop"
-	  status=$?
-	  if test "$status" -ne 0 && test ! -d "$gentop"; then
-	    exit $status
-	  fi
 	  generated="$generated $gentop"
 
-	  for xlib in $convenience; do
-	    # Extract the objects.
-	    case $xlib in
-	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-	    *) xabs=`pwd`"/$xlib" ;;
-	    esac
-	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-	    xdir="$gentop/$xlib"
-
-	    $show "${rm}r $xdir"
-	    $run ${rm}r "$xdir"
-	    $show "$mkdir $xdir"
-	    $run $mkdir "$xdir"
-	    status=$?
-	    if test "$status" -ne 0 && test ! -d "$xdir"; then
-	      exit $status
-	    fi
-	    # We will extract separately just the conflicting names and we will no
-	    # longer touch any unique names. It is faster to leave these extract
-	    # automatically by $AR in one run.
-	    $show "(cd $xdir && $AR x $xabs)"
-	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-	      :
-	    else
-	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
-	      do
-		i=1
-		while test "$i" -le "$count"
-		do
-		 # Put our $i before any first dot (extension)
-		 # Never overwrite any file
-		 name_to="$name"
-		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-		 do
-		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-		 done
-		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-		 i=`expr $i + 1`
-		done
-	      done
-	    fi
-
-	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-	  done
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
 	fi
       fi
 
@@ -4135,6 +4359,35 @@
         ;;
       esac
 
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
@@ -4179,10 +4432,15 @@
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  *) dllsearchpath="$dllsearchpath:$libdir";;
 	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
 	  ;;
 	esac
       done
@@ -4296,13 +4554,25 @@
 
 	    # Prepare the list of exported symbols
 	    if test -z "$export_symbols"; then
-	      export_symbols="$output_objdir/$output.exp"
+	      export_symbols="$output_objdir/$outputname.exp"
 	      $run $rm $export_symbols
-	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
 	    else
-	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
-	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      $run eval 'mv "$nlist"T "$nlist"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
 	    fi
 	  fi
 
@@ -4353,7 +4623,26 @@
 #endif
 
 /* The mapping between symbol names and symbols. */
+"
+
+	    case $host in
+	    *cygwin* | *mingw* )
+	  $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+	      ;;
+	    * )
+	  $echo >> "$output_objdir/$dlsyms" "\
 const struct {
+"
+	      ;;
+	    esac
+
+
+	  $echo >> "$output_objdir/$dlsyms" "\
   const char *name;
   lt_ptr address;
 }
@@ -4400,16 +4689,29 @@
 	  esac
 
 	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
 	  # Clean up the generated files.
 	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
 	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
 
 	  # Transform the symbol file into the correct name.
-	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
-	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+          case $host in
+          *cygwin* | *mingw* )
+            if test -f "$output_objdir/${outputname}.def" ; then
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+            else
+              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+            ;;
+          esac
 	  ;;
 	*)
 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
@@ -4434,7 +4736,7 @@
 	# We have no uninstalled library dependencies, so finalize right now.
 	$show "$link_command"
 	$run eval "$link_command"
-	status=$?
+	exit_status=$?
 
 	# Delete the generated files.
 	if test -n "$dlsyms"; then
@@ -4442,7 +4744,7 @@
 	  $run $rm "$output_objdir/${outputname}S.${objext}"
 	fi
 
-	exit $status
+	exit $exit_status
       fi
 
       if test -n "$shlibpath_var"; then
@@ -4582,10 +4884,12 @@
 	esac
 	case $host in
 	  *cygwin* | *mingw* )
-	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
-	    cwrapper=`$echo ${output}.exe`
-	    $rm $cwrappersource $cwrapper
-	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+            output_name=`basename $output`
+            output_path=`dirname $output`
+            cwrappersource="$output_path/$objdir/lt-$output_name.c"
+            cwrapper="$output_path/$output_name.exe"
+            $rm $cwrappersource $cwrapper
+            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
 	    cat > $cwrappersource <<EOF
 
@@ -4610,6 +4914,9 @@
 #include <malloc.h>
 #include <stdarg.h>
 #include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
 
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
@@ -4620,16 +4927,20 @@
 #endif
 
 #ifndef DIR_SEPARATOR
-#define DIR_SEPARATOR '/'
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
 #endif
 
 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
   defined (__OS2__)
-#define HAVE_DOS_BASED_FILE_SYSTEM
-#ifndef DIR_SEPARATOR_2
-#define DIR_SEPARATOR_2 '\\'
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
 #endif
-#endif
 
 #ifndef DIR_SEPARATOR_2
 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
@@ -4638,17 +4949,32 @@
         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
 #endif /* DIR_SEPARATOR_2 */
 
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
+/* -DDEBUG is fairly common in CFLAGS.  */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
 const char *program_name = NULL;
 
 void * xmalloc (size_t num);
 char * xstrdup (const char *string);
-char * basename (const char *name);
-char * fnqualify(const char *path);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int    check_executable(const char *path);
 char * strendzap(char *str, const char *pat);
 void lt_fatal (const char *message, ...);
 
@@ -4658,29 +4984,51 @@
   char **newargz;
   int i;
 
-  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  DEBUG("(main) argv[0]      : %s\n",argv[0]);
+  DEBUG("(main) program_name : %s\n",program_name);
   newargz = XMALLOC(char *, argc+2);
 EOF
 
-	    cat >> $cwrappersource <<EOF
-  newargz[0] = "$SHELL";
+            cat >> $cwrappersource <<EOF
+  newargz[0] = (char *) xstrdup("$SHELL");
 EOF
 
-	    cat >> $cwrappersource <<"EOF"
-  newargz[1] = fnqualify(argv[0]);
+            cat >> $cwrappersource <<"EOF"
+  newargz[1] = find_executable(argv[0]);
+  if (newargz[1] == NULL)
+    lt_fatal("Couldn't find %s", argv[0]);
+  DEBUG("(main) found exe at : %s\n",newargz[1]);
   /* we know the script has the same name, without the .exe */
   /* so make sure newargz[1] doesn't end in .exe */
   strendzap(newargz[1],".exe");
   for (i = 1; i < argc; i++)
     newargz[i+1] = xstrdup(argv[i]);
   newargz[argc+1] = NULL;
+
+  for (i=0; i<argc+1; i++)
+  {
+    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
+    ;
+  }
+
 EOF
 
-	    cat >> $cwrappersource <<EOF
+            case $host_os in
+              mingw*)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",(char const **)newargz);
+EOF
+              ;;
+              *)
+                cat >> $cwrappersource <<EOF
   execv("$SHELL",newargz);
 EOF
+              ;;
+            esac
 
-	    cat >> $cwrappersource <<"EOF"
+            cat >> $cwrappersource <<"EOF"
+  return 127;
 }
 
 void *
@@ -4700,48 +5048,148 @@
 ;
 }
 
-char *
-basename (const char *name)
+const char *
+base_name (const char *name)
 {
   const char *base;
 
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
   /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha (name[0]) && name[1] == ':')
+  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
     name += 2;
 #endif
 
   for (base = name; *name; name++)
     if (IS_DIR_SEPARATOR (*name))
       base = name + 1;
-  return (char *) base;
+  return base;
 }
 
+int
+check_executable(const char * path)
+{
+  struct stat st;
+
+  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0) &&
+      (
+        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+       ((st.st_mode & S_IXUSR) == S_IXUSR))
+      )
+    return 1;
+  else
+    return 0;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise */
 char *
-fnqualify(const char *path)
+find_executable (const char* wrapper)
 {
-  size_t size;
-  char *p;
+  int has_slash = 0;
+  const char* p;
+  const char* p_next;
+  /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char* concat_name;
 
-  assert(path != NULL);
+  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
 
-  /* Is it qualified already? */
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha (path[0]) && path[1] == ':')
-    return xstrdup (path);
+  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+  {
+    concat_name = xstrdup (wrapper);
+    if (check_executable(concat_name))
+      return concat_name;
+    XFREE(concat_name);
+  }
+  else
+  {
 #endif
-  if (IS_DIR_SEPARATOR (path[0]))
-    return xstrdup (path);
+    if (IS_DIR_SEPARATOR (wrapper[0]))
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable(concat_name))
+        return concat_name;
+      XFREE(concat_name);
+    }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  }
+#endif
 
-  /* prepend the current directory */
-  /* doesn't handle '~' */
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+    {
+      has_slash = 1;
+      break;
+    }
+  if (!has_slash)
+  {
+    /* no slashes; search PATH */
+    const char* path = getenv ("PATH");
+    if (path != NULL)
+    {
+      for (p = path; *p; p = p_next)
+      {
+        const char* q;
+        size_t p_len;
+        for (q = p; *q; q++)
+          if (IS_PATH_SEPARATOR(*q))
+            break;
+        p_len = q - p;
+        p_next = (*q == '\0' ? q : q + 1);
+        if (p_len == 0)
+        {
+          /* empty path: current directory */
+          if (getcwd (tmp, LT_PATHMAX) == NULL)
+            lt_fatal ("getcwd failed");
+          tmp_len = strlen(tmp);
+          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, tmp, tmp_len);
+          concat_name[tmp_len] = '/';
+          strcpy (concat_name + tmp_len + 1, wrapper);
+        }
+        else
+        {
+          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, p, p_len);
+          concat_name[p_len] = '/';
+          strcpy (concat_name + p_len + 1, wrapper);
+        }
+        if (check_executable(concat_name))
+          return concat_name;
+        XFREE(concat_name);
+      }
+    }
+    /* not found in PATH; assume curdir */
+  }
+  /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
     lt_fatal ("getcwd failed");
-  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
-  p = XMALLOC(char, size);
-  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
-  return p;
+  tmp_len = strlen(tmp);
+  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable(concat_name))
+    return concat_name;
+  XFREE(concat_name);
+  return NULL;
 }
 
 char *
@@ -4785,16 +5233,16 @@
   va_end (ap);
 }
 EOF
-	  # we should really use a build-platform specific compiler
-	  # here, but OTOH, the wrappers (shell script and this C one)
-	  # are only useful if you want to execute the "real" binary.
-	  # Since the "real" binary is built for $host, then this
-	  # wrapper might as well be built for $host, too.
-	  $run $LTCC -s -o $cwrapper $cwrappersource
-	  ;;
-	esac
-	$rm $output
-	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # are only useful if you want to execute the "real" binary.
+          # Since the "real" binary is built for $host, then this
+          # wrapper might as well be built for $host, too.
+          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
 	$echo > $output "\
 #! $SHELL
@@ -4815,7 +5263,7 @@
 
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
-if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 relink_command=\"$relink_command\"
 
@@ -4944,13 +5392,13 @@
 	# Backslashes separate directories on plain windows
 	*-*-mingw | *-*-os2*)
 	  $echo >> $output "\
-      exec \$progdir\\\\\$program \${1+\"\$@\"}
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 "
 	  ;;
 
 	*)
 	  $echo >> $output "\
-      exec \$progdir/\$program \${1+\"\$@\"}
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 "
 	  ;;
 	esac
@@ -4960,7 +5408,7 @@
     fi
   else
     # The program doesn't exist.
-    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     \$echo \"This script is just a wrapper for \$program.\" 1>&2
     $echo \"See the $PACKAGE documentation for more information.\" 1>&2
     exit $EXIT_FAILURE
@@ -4992,71 +5440,73 @@
 
       if test -n "$addlibs"; then
 	gentop="$output_objdir/${outputname}x"
-	$show "${rm}r $gentop"
-	$run ${rm}r "$gentop"
-	$show "$mkdir $gentop"
-	$run $mkdir "$gentop"
-	status=$?
-	if test "$status" -ne 0 && test ! -d "$gentop"; then
-	  exit $status
-	fi
 	generated="$generated $gentop"
 
-	# Add in members from convenience archives.
-	for xlib in $addlibs; do
-	  # Extract the objects.
-	  case $xlib in
-	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
-	  *) xabs=`pwd`"/$xlib" ;;
-	  esac
-	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
-	  xdir="$gentop/$xlib"
-
-	  $show "${rm}r $xdir"
-	  $run ${rm}r "$xdir"
-	  $show "$mkdir $xdir"
-	  $run $mkdir "$xdir"
-	  status=$?
-	  if test "$status" -ne 0 && test ! -d "$xdir"; then
-	    exit $status
-	  fi
-	  # We will extract separately just the conflicting names and we will no
-	  # longer touch any unique names. It is faster to leave these extract
-	  # automatically by $AR in one run.
-	  $show "(cd $xdir && $AR x $xabs)"
-	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
-	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
-	    :
-	  else
-	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
-	    do
-	      i=1
-	      while test "$i" -le "$count"
-	      do
-	       # Put our $i before any first dot (extension)
-	       # Never overwrite any file
-	       name_to="$name"
-	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
-	       do
-		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-	       done
-	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
-	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
-	       i=`expr $i + 1`
-	      done
-	    done
-	  fi
-
-	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
-	done
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
       fi
 
       # Do each command in the archive commands.
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
        cmds=$old_archive_from_new_cmds
       else
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $echo "copying selected object files to avoid basename conflicts..."
+
+	  if test -z "$gentop"; then
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    exit_status=$?
+	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+	      exit $exit_status
+	    fi
+	  fi
+
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		counter=`expr $counter + 1`
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      $run ln "$obj" "$gentop/$newobj" ||
+	      $run cp "$obj" "$gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+
 	eval cmds=\"$old_archive_cmds\"
 
 	if len=`expr "X$cmds" : ".*"` &&
@@ -5070,20 +5520,7 @@
 	  objlist=
 	  concat_cmds=
 	  save_oldobjs=$oldobjs
-	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
-	  # encoded into archives.  This makes 'ar r' malfunction in
-	  # this piecewise linking case whenever conflicting object
-	  # names appear in distinct ar calls; check, warn and compensate.
-	    if (for obj in $save_oldobjs
-	    do
-	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	    :
-	  else
-	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
-	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
-	    AR_FLAGS=cq
-	  fi
+
 	  # Is there a better way of finding the last object in the list?
 	  for obj in $save_oldobjs
 	  do
@@ -5094,7 +5531,7 @@
 	    oldobjs="$objlist $obj"
 	    objlist="$objlist $obj"
 	    eval test_cmds=\"$old_archive_cmds\"
-	    if len=`expr "X$test_cmds" : ".*"` &&
+	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 	       test "$len" -le "$max_cmd_len"; then
 	      :
 	    else
@@ -5291,11 +5728,11 @@
     # install_prog (especially on Windows NT).
     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
        # Allow the use of GNU shtool's install command.
-       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+       $echo "X$nonopt" | grep shtool > /dev/null; then
       # Aesthetically quote it.
       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 	arg="\"$arg\""
 	;;
       esac
@@ -5304,14 +5741,14 @@
       shift
     else
       install_prog=
-      arg="$nonopt"
+      arg=$nonopt
     fi
 
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
     case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
       arg="\"$arg\""
       ;;
     esac
@@ -5329,28 +5766,31 @@
     do
       if test -n "$dest"; then
 	files="$files $dest"
-	dest="$arg"
+	dest=$arg
 	continue
       fi
 
       case $arg in
       -d) isdir=yes ;;
-      -f) prev="-f" ;;
-      -g) prev="-g" ;;
-      -m) prev="-m" ;;
-      -o) prev="-o" ;;
+      -f) 
+      	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o) prev=$arg ;;
       -s)
 	stripme=" -s"
 	continue
 	;;
-      -*) ;;
-
+      -*)
+	;;
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
 	  prev=
 	else
-	  dest="$arg"
+	  dest=$arg
 	  continue
 	fi
 	;;
@@ -5359,7 +5799,7 @@
       # Aesthetically quote the argument.
       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 	arg="\"$arg\""
 	;;
       esac
@@ -5528,11 +5968,14 @@
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
 	    for linkname
 	    do
 	      if test "$linkname" != "$realname"; then
-		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
-		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 	      fi
 	    done
 	  fi
@@ -5545,7 +5988,16 @@
 	    IFS="$save_ifs"
 	    eval cmd=\"$cmd\"
 	    $show "$cmd"
-	    $run eval "$cmd" || exit $?
+	    $run eval "$cmd" || {
+	      lt_exit=$?
+
+	      # Restore the uninstalled library and exit
+	      if test "$mode" = relink; then
+		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      fi
+
+	      exit $lt_exit
+	    }
 	  done
 	  IFS="$save_ifs"
 	fi
@@ -5639,17 +6091,15 @@
 	  notinst_deplibs=
 	  relink_command=
 
-	  # To insure that "foo" is sourced, and not "foo.exe",
-	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
-	  # which disallows the automatic-append-.exe behavior.
-	  case $build in
-	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-	  *) wrapperdot=${wrapper} ;;
-	  esac
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
 	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . ${wrapperdot} ;;
-	  *) . ./${wrapperdot} ;;
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
 	  esac
 
 	  # Check the variables that should have been set.
@@ -5677,34 +6127,21 @@
 	  done
 
 	  relink_command=
-	  # To insure that "foo" is sourced, and not "foo.exe",
-	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
-	  # which disallows the automatic-append-.exe behavior.
-	  case $build in
-	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
-	  *) wrapperdot=${wrapper} ;;
-	  esac
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
 	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . ${wrapperdot} ;;
-	  *) . ./${wrapperdot} ;;
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
 	  esac
 
 	  outputname=
 	  if test "$fast_install" = no && test -n "$relink_command"; then
 	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir="/tmp"
-	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
-	      tmpdir="$tmpdir/libtool-$$"
-	      save_umask=`umask`
-	      umask 0077
-	      if $mkdir "$tmpdir"; then
-	        umask $save_umask
-	      else
-	        umask $save_umask
-		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
-		continue
-	      fi
+	      tmpdir=`func_mktempdir`
 	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
 	      outputname="$tmpdir/$file"
 	      # Replace the output file specification.
@@ -5728,7 +6165,7 @@
 	fi
 
 	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyways
+	# one anyway 
 	case $install_prog,$host in
 	*/usr/bin/install*,*cygwin*)
 	  case $file:$destfile in
@@ -5828,7 +6265,7 @@
     # Exit here if they wanted silent mode.
     test "$show" = : && exit $EXIT_SUCCESS
 
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     $echo "Libraries have been installed in:"
     for libdir in $libdirs; do
       $echo "   $libdir"
@@ -5861,7 +6298,7 @@
     $echo
     $echo "See any operating system documentation about shared libraries for"
     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "----------------------------------------------------------------------"
+    $echo "X----------------------------------------------------------------------" | $Xsed
     exit $EXIT_SUCCESS
     ;;
 
@@ -6078,9 +6515,17 @@
 	    rmfiles="$rmfiles $objdir/$n"
 	  done
 	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
-	  if test "$mode" = uninstall; then
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
 	      cmds=$postuninstall_cmds
@@ -6113,7 +6558,8 @@
 	      IFS="$save_ifs"
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
-	  fi
+	    ;;
+	  esac
 	fi
 	;;
 
@@ -6398,7 +6844,7 @@
 $echo
 $echo "Try \`$modename --help' for more information about other modes."
 
-exit $EXIT_SUCCESS
+exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
@@ -6412,12 +6858,11 @@
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
+disable_libs=shared
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+disable_libs=static
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:

Added: libgpod/branches/upstream/current/m4/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/m4/Makefile.am	                        (rev 0)
+++ libgpod/branches/upstream/current/m4/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1 @@
+EXTRA_DIST = python.m4 swig.m4

Added: libgpod/branches/upstream/current/m4/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/m4/Makefile.in	                        (rev 0)
+++ libgpod/branches/upstream/current/m4/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,368 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@
+GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
+HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
+INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
+INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_ICONV = @INTLTOOL_ICONV@
+INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
+INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
+INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
+INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
+INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
+INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
+INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
+INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
+INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
+INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
+INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
+INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
+INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
+INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
+LDFLAGS = @LDFLAGS@
+LIBGPOD_AGE = @LIBGPOD_AGE@
+LIBGPOD_CFLAGS = @LIBGPOD_CFLAGS@
+LIBGPOD_CURRENT = @LIBGPOD_CURRENT@
+LIBGPOD_LIBS = @LIBGPOD_LIBS@
+LIBGPOD_REVISION = @LIBGPOD_REVISION@
+LIBGPOD_VERSION = @LIBGPOD_VERSION@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+EXTRA_DIST = python.m4 swig.m4
+subdir = m4
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  m4/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: libgpod/branches/upstream/current/m4/python.m4
===================================================================
--- libgpod/branches/upstream/current/m4/python.m4	                        (rev 0)
+++ libgpod/branches/upstream/current/m4/python.m4	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,140 @@
+dnl copied from pygtk
+dnl
+dnl a macro to check for ability to create python extensions
+dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for python development headers)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl copied and modified from gnome-python
+dnl http://cvs.gnome.org/viewcvs/*checkout*/gnome-python/pygtk/m4/python.m4
+dnl
+dnl AM_CHECK_PYMOD(MODNAME [,VERSION, VERSION_MATCHER [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module of a particular version is visible to python.
+AC_DEFUN([AM_CHECK_PYMOD],
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1`
+AC_MSG_CHECKING(for python module $1 ifelse([$2],[],,[>= $2]))
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+        import $1
+except ImportError:
+        sys.exit(1)
+except:
+        sys.exit(0)
+sys.exit(0)"], [prog="
+import sys, string, $1
+curverstr = $3
+# use method from AM_PYTHON_CHECK_VERSION
+minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
+minverhex = 0
+for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
+curver = map(int, string.split(curverstr, '.')) + [[0, 0, 0]]
+curverhex = 0
+for i in xrange(0, 4): curverhex = (curverhex << 8) + curver[[i]]
+if (curverhex >= minverhex):
+        sys.exit(0)
+else:
+        sys.exit(1)
+sys.exit(0)"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  AC_MSG_RESULT(yes)
+  ifelse([$4], [],, [$4
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$5], [],, [$5
+])dnl
+fi
+])
+
+dnl check for python
+AC_DEFUN([LIBGPOD_CHECK_PYTHON],
+[
+    dnl aclocal-1.7 is missing this when version is used in AM_PATH_PYTHON, fudge it
+    am_display_PYTHON=python
+
+    AC_ARG_WITH(python,
+        AC_HELP_STRING([--with-python=PATH],
+            [build python bindings [[default=yes]]]),
+        [with_python=$withval],[with_python=yes])
+
+    AC_MSG_CHECKING(whether to build python bindings)
+    if test "X$with_python" != Xno; then
+        if test "X$with_python" != Xyes; then
+            PYTHON=$with_python
+        fi
+        with_python=yes
+    fi
+    AC_MSG_RESULT($with_python)
+
+    if test "X$with_python" == Xyes; then
+        if test -z "$PYTHON"; then
+            AC_PATH_PROG(PYTHON, python)
+        fi
+    
+        if test -n "$PYTHON"; then
+            AM_PATH_PYTHON($PYTHON_MIN_VERSION)
+            AM_CHECK_PYTHON_HEADERS(with_python="yes",with_python="no")
+    
+            if test "X$with_python" == Xyes; then
+                dnl test for python ldflags
+                dnl copied from the Redland RDF bindings, http://librdf.org/
+                if test `uname` = Darwin; then
+                    PYTHON_LDFLAGS="-Wl,-F. -Wl,-F. -bundle"
+                    if $PYTHON -c 'import sys, string; sys.exit(string.find(sys.prefix,"Framework")+1)'; then
+                        :
+                    else
+                        PYTHON_LDFLAGS="$PYTHON_LDFLAGS -framework Python"
+                    fi
+                else
+                    PYTHON_LDFLAGS="-shared"
+                fi
+                AC_SUBST(PYTHON_LDFLAGS)
+
+                dnl check for eyeD3 module >= $PYTHON_EYED3_MIN_VERSION
+                AM_CHECK_PYMOD(eyeD3,$PYTHON_EYED3_MIN_VERSION,eyeD3.eyeD3Version,,with_python=no)
+
+                dnl check for swig
+                if test "X$with_python" == Xyes; then
+                    AC_PROG_SWIG($SWIG_MIN_VERSION)
+                    with_python="$has_swig"
+                fi
+            fi
+        else
+            AC_MSG_WARN(python not found.  try --with-python=/path/to/python)
+            with_python="no"
+        fi
+    fi
+    AM_CONDITIONAL(HAVE_PYTHON, test x$with_python = xyes)
+])dnl
+

Added: libgpod/branches/upstream/current/m4/swig.m4
===================================================================
--- libgpod/branches/upstream/current/m4/swig.m4	                        (rev 0)
+++ libgpod/branches/upstream/current/m4/swig.m4	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,156 @@
+dnl @synopsis AC_PROG_SWIG([major.minor.micro])
+dnl
+dnl This macro searches for a SWIG installation on your system. If
+dnl found you should call SWIG via $(SWIG). You can use the optional
+dnl first argument to check if the version of the available SWIG is
+dnl greater than or equal to the value of the argument. It should have
+dnl the format: N[.N[.N]] (N is a number between 0 and 999. Only the
+dnl first N is mandatory.)
+dnl
+dnl If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks
+dnl that the swig package is this version number or higher.
+dnl
+dnl In configure.in, use as:
+dnl
+dnl             AC_PROG_SWIG(1.3.17)
+dnl             SWIG_ENABLE_CXX
+dnl             SWIG_MULTI_MODULE_SUPPORT
+dnl             SWIG_PYTHON
+dnl
+dnl @category InstalledPackages
+dnl @author Sebastian Huber <sebastian-huber at web.de>
+dnl @author Alan W. Irwin <irwin at beluga.phys.uvic.ca>
+dnl @author Rafael Laboissiere <rafael at laboissiere.net>
+dnl @author Andrew Collier <abcollier at yahoo.com>
+dnl @version 2004-09-20
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_SWIG],[
+        AC_PATH_PROG([SWIG],[swig])
+        if test -z "$SWIG" ; then
+                AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
+                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
+        elif test -n "$1" ; then
+                AC_MSG_CHECKING([for SWIG version])
+                [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
+                AC_MSG_RESULT([$swig_version])
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        [required=$1]
+                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_major" ; then
+                                [required_major=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_minor" ; then
+                                [required_minor=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_patch" ; then
+                                [required_patch=0]
+                        fi
+                        # Calculate the available version number components
+                        [available=$swig_version]
+                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_major" ; then
+                                [available_major=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_minor" ; then
+                                [available_minor=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_patch" ; then
+                                [available_patch=0]
+                        fi
+                        if test $available_major -ne $required_major \
+                                -o $available_minor -ne $required_minor \
+                                -o $available_patch -lt $required_patch ; then
+                                AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
+                                SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+                                has_swig="no"
+                        else
+                                SWIG_LIB=`$SWIG -swiglib`
+                                has_swig="yes"
+                        fi
+                else
+                        AC_MSG_WARN([cannot determine SWIG version])
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                        has_swig="no"
+                fi
+        fi
+        AC_SUBST([SWIG_LIB])
+])
+
+# SWIG_ENABLE_CXX()
+#
+# Enable SWIG C++ support.  This affects all invocations of $(SWIG).
+AC_DEFUN([SWIG_ENABLE_CXX],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        AC_REQUIRE([AC_PROG_CXX])
+        SWIG="$SWIG -c++"
+])
+
+# SWIG_MULTI_MODULE_SUPPORT()
+#
+# Enable support for multiple modules.  This effects all invocations
+# of $(SWIG).  You have to link all generated modules against the
+# appropriate SWIG runtime library.  If you want to build Python
+# modules for example, use the SWIG_PYTHON() macro and link the
+# modules against $(SWIG_PYTHON_LIBS).
+#
+AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        SWIG="$SWIG -noruntime"
+])
+
+# SWIG_PYTHON([use-shadow-classes = {no, yes}])
+#
+# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
+# and $(SWIG_PYTHON_OPT) output variables.
+#
+# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate
+# code for Python.  Shadow classes are enabled unless the value of the
+# optional first argument is exactly 'no'.  If you need multi module
+# support (provided by the SWIG_MULTI_MODULE_SUPPORT() macro) use
+# $(SWIG_PYTHON_LIBS) to link against the appropriate library.  It
+# contains the SWIG Python runtime library that is needed by the type
+# check system for example.
+AC_DEFUN([SWIG_PYTHON],[
+        AC_REQUIRE([AC_PROG_SWIG])
+        AC_REQUIRE([AC_PYTHON_DEVEL])
+        test "x$1" != "xno" || swig_shadow=" -noproxy"
+        AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow])
+        AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
+])
+
+
+dnl @synopsis AC_LIB_WAD
+dnl
+dnl This macro searches for installed WAD library.
+dnl
+AC_DEFUN([AC_LIB_WAD],
+[
+        AC_REQUIRE([AC_PYTHON_DEVEL])
+        AC_ARG_ENABLE(wad,
+        AC_HELP_STRING([--enable-wad], [enable wad module]),
+        [
+                case "${enableval}" in
+                        no)     ;;
+                        *)      if test "x${enableval}" = xyes;
+                                then
+                                        check_wad="yes"
+                                fi ;;
+                esac
+        ], [])
+
+        if test -n "$check_wad";
+        then
+                AC_CHECK_LIB(wadpy, _init, [WADPY=-lwadpy], [], $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS)
+                AC_SUBST(WADPY)
+        fi
+])

Modified: libgpod/branches/upstream/current/po/Makefile.in.in
===================================================================
--- libgpod/branches/upstream/current/po/Makefile.in.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/Makefile.in.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -11,13 +11,17 @@
 #
 # - Modified by jacob berkman <jacob at ximian.com> to install
 #   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey at novell.com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
 
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
 
 SHELL = /bin/sh
- at SET_MAKE@
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -27,20 +31,19 @@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 datadir = @datadir@
+datarootdir = @datarootdir@
 libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
 subdir = po
 install_sh = @install_sh@
-mkdir_p = @mkdir_p@
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+# Automake >= 1.8 provides @mkdir_p at .
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 
-CC = @CC@
-GENCAT = @GENCAT@
 GMSGFMT = @GMSGFMT@
 MSGFMT = @MSGFMT@
 XGETTEXT = @XGETTEXT@
@@ -49,35 +52,26 @@
 MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
 GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
 
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
 
-INCLUDES = -I.. -I$(top_srcdir)/intl
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
 
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+POFILES=$(shell if test -n "$(PO_LINGUAS)"; then LINGUAS="$(PO_LINGUAS)"; else LINGUAS="$(ALL_LINGUAS)"; fi; for lang in $$LINGUAS; do printf "$$lang.po "; done)
 
-SOURCES = 
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
-$(POFILES) $(GMOFILES) $(SOURCES)
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
 
 POTFILES = \
+#This Gets Replace for some reason
 
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
+CATALOGS=$(shell if test -n "$(PO_LINGUAS)"; then LINGUAS="$(PO_LINGUAS)"; else LINGUAS="$(ALL_LINGUAS)"; fi; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
 
 .SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
 
-.c.o:
-	$(COMPILE) $<
-
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(MSGFMT) -o $@ $<
@@ -88,7 +82,7 @@
 
 .po.cat:
 	sed -f ../intl/po2msg.sed < $< > $*.msg \
-	  && rm -f $@ && $(GENCAT) $@ $*.msg
+	  && rm -f $@ && gencat $@ $*.msg
 
 
 all: all- at USE_NLS@
@@ -99,115 +93,98 @@
 $(GETTEXT_PACKAGE).pot: $(POTFILES)
 	$(GENPOT)
 
-install: install-exec install-data
-install-exec:
+install: install-data
 install-data: install-data- at USE_NLS@
 install-data-no: all
 install-data-yes: all
-	if test -n "$(MKINSTALLDIRS)"; then \
-	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	if test -n "$(PO_LINGUAS)"; then \
+	  linguas="$(PO_LINGUAS)"; \
 	else \
-	  $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
-	fi
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  case "$$cat" in \
-	    *.gmo) destdir=$(gnulocaledir);; \
-	    *)     destdir=$(localedir);; \
-	  esac; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $$dir; \
+	  linguas="$(ALL_LINGUAS)"; \
+	fi; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
 	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
 	  fi; \
-	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	    echo "installing $(srcdir)/$$cat as" \
-		 "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
-	  fi; \
-	  if test -r $$cat.m; then \
-	    $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	    echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
-	  else \
-	    if test -r $(srcdir)/$$cat.m ; then \
-	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
-		$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	      echo "installing $(srcdir)/$$cat as" \
-		   "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
 	    else \
 	      true; \
 	    fi; \
 	  fi; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  if test -n "$(MKINSTALLDIRS)"; then \
-	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
-	  else \
-	    $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
-	  fi; \
-	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
-			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	else \
-	  : ; \
-	fi
 
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
+
 # Define this as empty until I found a useful application.
 installcheck:
 
 uninstall:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
-	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
+	if test -n "$(PO_LINGUAS)"; then \
+	  linguas="$(PO_LINGUAS)"; \
+	else \
+	  linguas="$(ALL_LINGUAS)"; \
+	fi; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
-	if test "$(PACKAGE)" = "glib"; then \
-	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
-	fi
 
-check: all
+check: all $(GETTEXT_PACKAGE).pot
 
-dvi info tags TAGS ID:
-
 mostlyclean:
-	rm -f core core.* *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
-	rm -fr *.o
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
 	rm -f .intltool-merge-cache
 
 clean: mostlyclean
 
 distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
 
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f Makefile.in.in
 
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
 	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
 	for file in $$dists; do \
-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
-	    || cp -p $(srcdir)/$$file $(distdir); \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
 	done
 
 update-po: Makefile
 	$(MAKE) $(GETTEXT_PACKAGE).pot
 	tmpdir=`pwd`; \
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+	if test -n "$(PO_LINGUAS)"; then \
+	  linguas="$(PO_LINGUAS)"; \
+	else \
+	  linguas="$(ALL_LINGUAS)"; \
+	fi; \
+	for lang in $$linguas; do \
 	  echo "$$lang:"; \
 	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
 	  if $$result; then \
@@ -223,32 +200,20 @@
 	      fi; \
 	    fi; \
 	  else \
-	    echo "msgmerge for $$cat failed!"; \
+	    echo "msgmerge for $$lang.gmo failed!"; \
 	    rm -f $$tmpdir/$$lang.new.po; \
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( if test 'x$(srcdir)' != 'x.'; then \
-	    posrcprefix='$(top_srcdir)/'; \
-	  else \
-	    posrcprefix="../"; \
-	  fi; \
-	  rm -f $@-t $@ \
-	    && (sed -e '/^#/d' 						\
-		    -e "s/^\[.*\] +//" 					\
-		    -e '/^[ 	]*$$/d' 				\
-		    -e "s at .*@	$$posrcprefix& \\\\@" < $(srcdir)/$@.in	\
-		| sed -e '$$s/\\$$//') > $@-t \
-	    && chmod a-w $@-t \
-	    && mv $@-t $@ )
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
 
-Makefile: Makefile.in.in ../config.status POTFILES
+stamp-it: Makefile.in.in ../config.status POTFILES.in
 	cd .. \
-	  && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
 	       $(SHELL) ./config.status
 
 # Tell versions [3.59,3.63) of GNU make not to export all variables.

Modified: libgpod/branches/upstream/current/po/POTFILES.in
===================================================================
--- libgpod/branches/upstream/current/po/POTFILES.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/POTFILES.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,6 +1,21 @@
-src/itdb.h
+# List of source files containing translatable strings (output of
+# ls src/*.c tests/*.c)
+
+
+src/db-artwork-debug.c
+src/db-artwork-parser.c
+src/db-artwork-writer.c
+src/db-image-parser.c
+src/db-parse-context.c
+src/itdb_artwork.c
+src/itdb_device.c
 src/itdb_itunesdb.c
+src/itdb_photoalbum.c
 src/itdb_playlist.c
-src/itdb_private.h
 src/itdb_track.c
+src/ithumb-writer.c
 tests/itdb_main.c
+tests/test-covers.c
+tests/test-ls.c
+tests/test-photos.c
+tests/test-write-covers.c

Deleted: libgpod/branches/upstream/current/po/de.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/de.po
===================================================================
--- libgpod/branches/upstream/current/po/de.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/de.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: gtkpod 0.52\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-09-14 21:51+0900\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
 "PO-Revision-Date: 2005-09-14 22:01+0900\n"
 "Last-Translator: Jörg Schuler <jcsjcs at users.sourceforge.net>\n"
 "Language-Team: none\n"
@@ -16,33 +16,205 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
-#: ../src/itdb_itunesdb.c:313
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr ""
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:387
+#, fuzzy, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "Datei nicht gefunden: '%s'."
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr ""
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr ""
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr ""
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr ""
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr ""
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr ""
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr ""
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr ""
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr ""
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+msgid "Nano (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:189
+msgid "Nano (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:190
+msgid "Nano (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:191
+msgid "Nano (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:203
+msgid "Sixth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr ""
+
+#: ../src/itdb_device.c:449
+#, fuzzy, c-format
+msgid "Could not open '%s' for writing."
+msgstr "Fehler beim Öffnen von '%s' zum Schreiben (%s)."
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
 msgstr "Illegaler seek bei Offset %ld (Länge %ld) in Datei '%s'."
 
-#: ../src/itdb_itunesdb.c:521
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
 msgstr "Keine Play Counts Datei: '%s' (mhdp-Header fehlt)."
 
-#: ../src/itdb_itunesdb.c:535
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
 msgstr "Play Counts Datei ('%s'): Headerlänge kleiner als erwarted (%d<96)."
 
-#: ../src/itdb_itunesdb.c:548
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
 msgstr ""
 "Play Counts Datei ('%s'): Länge der Einträge kleiner als erwartet (%d<12)."
 
-#: ../src/itdb_itunesdb.c:803
+#: ../src/itdb_itunesdb.c:931
+#, fuzzy, c-format
+msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
+msgstr ""
+"Play Counts Datei ('%s'): Länge der Einträge kleiner als erwartet (%d<12)."
+
+#: ../src/itdb_itunesdb.c:1250
 #, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
 msgstr "iTunesDB beschädigt: kein MHOD bei Offset %ld in Datei '%s'."
 
-#: ../src/itdb_itunesdb.c:923
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
@@ -51,13 +223,12 @@
 "Die Länge einer Regel (%d) einer intelligenten Wiedergabeliste weicht von "
 "der erwarteten Länge ab. Es wird versucht fortzufahren.\n"
 
-#: ../src/itdb_itunesdb.c:966
-msgid "Did not find SLst hunk as expected. Trying to continue.\n"
-msgstr ""
-"Es wurde nicht wie erwarted ein 'SLst'-Hunk gefunden. Es wird trotzdem "
-"versucht, weiterzumachen.\n"
+#: ../src/itdb_itunesdb.c:1439
+#, fuzzy, c-format
+msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
+msgstr "iTunesDB beschädigt: kein MHOD bei Offset %ld in Datei '%s'."
 
-#: ../src/itdb_itunesdb.c:972
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
@@ -67,49 +238,98 @@
 "versucht fortzufahren.\n"
 "\n"
 
-#: ../src/itdb_itunesdb.c:1053 ../src/itdb_itunesdb.c:1744
-#: ../src/itdb_itunesdb.c:1779
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
 msgstr ""
 "iTunesDB beschädigt: Hunklänge ist Null für den Hunk an Offset %ld in Datei "
 "'%s'."
 
-#: ../src/itdb_itunesdb.c:1148
-msgid "Master-PL"
-msgstr "Haupt-PL"
+#: ../src/itdb_itunesdb.c:1527
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
+msgstr "iTunesDB beschädigt: kein MHOD bei Offset %ld in Datei '%s'."
 
-#: ../src/itdb_itunesdb.c:1150
-msgid "Playlist"
-msgstr "Wiedergabeliste"
+#: ../src/itdb_itunesdb.c:1541
+#, fuzzy, c-format
+msgid ""
+"header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
+"'%s'."
+msgstr ""
+"iTunesDB ('%s'): Headerlänge des mhsd-Hunks is kleiner als erwartet (%"
+"ld<32). Breche ab."
 
-#: ../src/itdb_itunesdb.c:1175
+#: ../src/itdb_itunesdb.c:1626
 #, c-format
-msgid "iTunesDB corrupt: found mhyp at %ld in file '%s'."
+msgid "Not a iTunesDB: '%s' (missing mhdb header)."
+msgstr "Keine iTunesDB Datei: '%s' (kein mhdb-Header)."
+
+#: ../src/itdb_itunesdb.c:1643
+#, fuzzy, c-format
+msgid ""
+"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
+"Aborting."
+msgstr ""
+"iTunesDB ('%s'): Headerlänge des mhsd-Hunks is kleiner als erwartet (%"
+"ld<32). Breche ab."
+
+#: ../src/itdb_itunesdb.c:1664
+#, fuzzy, c-format
+msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
 msgstr "iTunesDB beschädigt: mhyp bei Offset %ld in Datei '%s' gefunden."
 
-#: ../src/itdb_itunesdb.c:1223
+#: ../src/itdb_itunesdb.c:1781
 #, c-format
+msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1799
+#, c-format
 msgid "Itdb_Track ID '%d' not found.\n"
 msgstr "Itdb_Track ID '%d' nicht gefunden.\n"
 
-#: ../src/itdb_itunesdb.c:1487
+#: ../src/itdb_itunesdb.c:1956
+#, fuzzy, c-format
+msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
+msgstr "iTunesDB beschädigt: mhyp bei Offset %ld in Datei '%s' gefunden."
+
+#: ../src/itdb_itunesdb.c:1966
+msgid "Master-PL"
+msgstr "Haupt-PL"
+
+#: ../src/itdb_itunesdb.c:1970
+msgid "Podcasts"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1972
+msgid "Playlist"
+msgstr "Wiedergabeliste"
+
+#: ../src/itdb_itunesdb.c:1994
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
+"ld in file '%s'."
+msgstr "iTunesDB beschädigt: mhyp bei Offset %ld in Datei '%s' gefunden."
+
+#: ../src/itdb_itunesdb.c:2279
 msgid "OTG Playlist"
 msgstr "OTG-Wiedergabeliste"
 
-#: ../src/itdb_itunesdb.c:1501
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
 msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
 msgstr "Keine OTG (On-The-Go) Wiedergabelistendatei: '%s' (mhpo-Header fehlt)."
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
 msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
 msgstr ""
 "OTG (On-The-Go) Wiedergabelistendatei ('%s'): Headerlänger kleiner als "
 "erwartet (%d<20)."
 
-#: ../src/itdb_itunesdb.c:1527
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
 msgid ""
 "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
@@ -117,50 +337,30 @@
 "OTG (On-The-Go) Wiedergabelistendatei ('%s'): Länge der Einträge kleiner als "
 "erwartet (%d<4)."
 
-#: ../src/itdb_itunesdb.c:1562
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
 msgid "OTG playlist file '%s': reference to non-existent track (%d)."
 msgstr ""
 "OTG (On-The-Go) Wiedergabelistendateii '%s' bezieht sich auf ein nicht "
 "existierendes Stück (%d)."
 
-#: ../src/itdb_itunesdb.c:1607
+#: ../src/itdb_itunesdb.c:2403
 #, c-format
 msgid "OTG Playlist %d"
 msgstr "OTG-Wiedergabeliste %d"
 
-#: ../src/itdb_itunesdb.c:1650
-#, c-format
-msgid "Not a iTunesDB: '%s' (missing mhdb header)."
-msgstr "Keine iTunesDB Datei: '%s' (kein mhdb-Header)."
-
-#: ../src/itdb_itunesdb.c:1666
-#, c-format
-msgid ""
-"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%ld<32). "
-"Aborting."
-msgstr ""
-"iTunesDB ('%s'): Headerlänge des mhsd-Hunks is kleiner als erwartet (%"
-"ld<32). Breche ab."
-
-#: ../src/itdb_itunesdb.c:1698
-#, c-format
-msgid "iTunesDB '%s' corrupt: already found two playlist mhsds -- giving up."
-msgstr ""
-"iTunesDB '%s' beschädigt: bereits zwei Wiedergabelisten mhsds-Hunks "
-"gefunden. Breche ab."
-
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1759
+#: ../src/itdb_itunesdb.c:2471
+#, fuzzy
 msgid ""
-"iTunesDB possibly corrupt: number of tracks (mhit hunks) inconsistent. "
-"Trying to continue.\n"
+"iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
+"continue.\n"
 msgstr ""
 "iTunesDB möglicherweise beschädigt: Anzahl der Stücke (mhit-Hunks) ist nicht "
 "konsistent. Versuche fortzufahren.\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1841
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
@@ -168,92 +368,203 @@
 "iTunesDB möglicherweise beschädigt: Anzahl der Wiedergabelisten (mhyp-Hunks) "
 "ist nicht konsistent. Versuche fortzufahren.\n"
 
-#: ../src/itdb_itunesdb.c:1879
+#: ../src/itdb_itunesdb.c:2581
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
+"found)"
+msgstr ""
+"iTunesDB '%s' beschädigt: bereits zwei Wiedergabelisten mhsds-Hunks "
+"gefunden. Breche ab."
+
+#: ../src/itdb_itunesdb.c:2610
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
+"sections found)"
+msgstr ""
+"iTunesDB '%s' beschädigt: bereits zwei Wiedergabelisten mhsds-Hunks "
+"gefunden. Breche ab."
+
+#: ../src/itdb_itunesdb.c:2632
 #, c-format
-msgid "File not found: '%s'."
-msgstr "Datei nicht gefunden: '%s'."
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr ""
 
-#: ../src/itdb_itunesdb.c:2396
+#: ../src/itdb_itunesdb.c:2649
 #, c-format
-msgid "Cannot write mhod of type %d\n"
-msgstr "Schreiben eines mhod-Hunks vom Typ %d ist nicht unterstützt.\n"
-
-#: ../src/itdb_itunesdb.c:2522 ../src/itdb_itunesdb.c:2635
-msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+msgid "Music directory not found: '%s' (or similar)."
 msgstr ""
-"Datenbank im Speicher beschädigt (Zeiger auf Stück == NULL). Der Export wird "
-"abgebrochen."
 
-#: ../src/itdb_itunesdb.c:2678
-msgid "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#: ../src/itdb_itunesdb.c:2667
+#, c-format
+msgid "Control directory not found: '%s' (or similar)."
 msgstr ""
-"Datenbank im Speicher beschädigt (Zeiger auf Wiedergabeliste == NULL). Der "
-"Export wird abgebrochen."
 
-#: ../src/itdb_itunesdb.c:2718
+#: ../src/itdb_itunesdb.c:2740
 #, c-format
-msgid "Opening of '%s' for writing failed."
-msgstr "Öffnen der Datei '%s' zum Schreiben ist fehlgeschlagen."
+msgid "File not found: '%s'."
+msgstr "Datei nicht gefunden: '%s'."
 
-#: ../src/itdb_itunesdb.c:2729
+#: ../src/itdb_itunesdb.c:3542
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "Fehler beim Schreiben in die Datei '%s'."
+msgid "Cannot write mhod of type %d\n"
+msgstr "Schreiben eines mhod-Hunks vom Typ %d ist nicht unterstützt.\n"
 
-#: ../src/itdb_itunesdb.c:2740
+#: ../src/itdb_itunesdb.c:4098
+#, fuzzy, c-format
+msgid "Opening of '%s' for writing failed (%s)."
+msgstr "Öffnen der Datei '%s' zum Schreiben ist fehlgeschlagen."
+
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
 #, c-format
 msgid "Writing to '%s' failed (%s)."
 msgstr "Schreiben in die Datei '%s' ist fehlgeschlagen (%s)."
 
-#: ../src/itdb_itunesdb.c:2881 ../src/itdb_itunesdb.c:3052
-#: ../src/itdb_itunesdb.c:3245 ../src/itdb_itunesdb.c:3451
-#, c-format
-msgid "Path not found: '%s'."
+#: ../src/itdb_itunesdb.c:4470
+#, fuzzy, c-format
+msgid "Path not found: '%s' (or similar)."
 msgstr "Pfad nicht gefunden: '%s'."
 
-#: ../src/itdb_itunesdb.c:3265
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "Fehler beim Umbenennen von '%s' nach '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3282
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
 msgstr "Fehler beim Entfernen von '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3426
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
 msgstr "No 'F..' directories were found in '%s'."
 
-#: ../src/itdb_itunesdb.c:3589
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "Pfad nicht gefunden: '%s'."
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
 msgstr "Fehler beim Öffnen von '%s' zum Lesen (%s)."
 
-#: ../src/itdb_itunesdb.c:3600
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
 msgstr "Fehler beim Öffnen von '%s' zum Schreiben (%s)."
 
-#: ../src/itdb_itunesdb.c:3617
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
 msgstr "Fehler beim Lesen aus '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3633
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
 msgstr "Fehler beim Schreiben in die Datei '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3646 ../src/itdb_itunesdb.c:3656
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "Fehler beim Schließen der Datei '%s' (%s)."
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr ""
+
+#: ../src/itdb_photoalbum.c:25
+#, fuzzy, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "Pfad nicht gefunden: '%s'."
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
 msgstr ""
 "Unbekannte Aktion (%d) in intelligenter Wiedergabeliste wird ignoriert.\n"
+
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr ""
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:133
+#, fuzzy, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "Fehler beim Entfernen von '%s' (%s)."
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr ""
+
+#: ../tests/test-photos.c:148
+#, fuzzy, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "Fehler beim Umbenennen von '%s' nach '%s' (%s)."
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+
+#~ msgid "Writing to '%s' failed."
+#~ msgstr "Fehler beim Schreiben in die Datei '%s'."
+
+#~ msgid "Did not find SLst hunk as expected. Trying to continue.\n"
+#~ msgstr ""
+#~ "Es wurde nicht wie erwarted ein 'SLst'-Hunk gefunden. Es wird trotzdem "
+#~ "versucht, weiterzumachen.\n"
+
+#~ msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+#~ msgstr ""
+#~ "Datenbank im Speicher beschädigt (Zeiger auf Stück == NULL). Der Export "
+#~ "wird abgebrochen."
+
+#~ msgid ""
+#~ "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#~ msgstr ""
+#~ "Datenbank im Speicher beschädigt (Zeiger auf Wiedergabeliste == NULL). "
+#~ "Der Export wird abgebrochen."

Deleted: libgpod/branches/upstream/current/po/es.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/es.po
===================================================================
--- libgpod/branches/upstream/current/po/es.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/es.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,238 +1,580 @@
-# translation of es.po to Español
-# Azael Avalos <coproscefalo at gmail.com>, 2006.
+# translation of es.po to 
+# translation of gtkpod.po to Spanish
+# This file is distributed under the same license as the gtkpod package.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
+# Alejandro Lamas Daviña <alejandro.lamas at ific.uv.es>, 2006.
 #
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: es\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-09-14 21:51+0900\n"
-"PO-Revision-Date: 2006-02-23 14:42-0700\n"
-"Last-Translator: Azael Avalos\n"
-"Language-Team: Español\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
+"PO-Revision-Date: 2006-07-29 22:01+0200\n"
+"Last-Translator: Alejandro Lamas Daviña <alejandro.lamas at ific.uv.es>\n"
+"Language-Team:  <es_ES>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: KBabel 1.11.2\n"
+"X-Generator: KBabel 1.9.1\n"
 
-#: ../src/itdb_itunesdb.c:313
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr "Tipo de cadena mhod3 no esperado: %d\n"
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+"El tamaño de las carátulas de iTunesDB y ArtworkDB no es consistente (%d+%d !"
+"= %d)"
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr "Índice mhsd no esperado: %d\n"
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+"Tipo de imágen en mhni no esperado: tamaño: %ux%u (%d), desplazamiento: %d\n"
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr "Nombre de fichero no válido: '%s'.\n"
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr "Punto de montaje no configurado.\n"
+
+#: ../src/itdb_artwork.c:387
+#, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "Fichero no encontrado en el iPod: '%s'\n"
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+"Imposible cargar el thumbnail (parece estar en el iPod, pero no hay "
+"información disponible de la imagen): tipo: %d, nombre de fichero: '%s'\n"
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr "Inválido"
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr "Desconocido"
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr "Color"
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr "Color U2"
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr "Escala de grises"
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr "Escala de grises U2"
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr "Mini (Plata)"
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr "Mini (Azul)"
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr "Mini (Rosa)"
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr "Mini (Verde)"
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr "Mini (Oro)"
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr "Shuffle"
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr "Nano (Blanco)"
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr "Nano (Negro)"
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr "Video (Blanco)"
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr "Video (Negro)"
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr "Móvil (1)"
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+#, fuzzy
+msgid "Nano (Silver)"
+msgstr "Mini (Plata)"
+
+#: ../src/itdb_device.c:189
+#, fuzzy
+msgid "Nano (Blue)"
+msgstr "Nano (Negro)"
+
+#: ../src/itdb_device.c:190
+#, fuzzy
+msgid "Nano (Green)"
+msgstr "Mini (Verde)"
+
+#: ../src/itdb_device.c:191
+#, fuzzy
+msgid "Nano (Pink)"
+msgstr "Mini (Rosa)"
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr "Primera generación"
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr "Segunda generación"
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr "Tercera generación"
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr "Cuarta generación"
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr "Quinta generación"
+
+#: ../src/itdb_device.c:203
+#, fuzzy
+msgid "Sixth Generation"
+msgstr "Quinta generación"
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr "Teléfono móvil"
+
+#: ../src/itdb_device.c:449
+#, c-format
+msgid "Could not open '%s' for writing."
+msgstr "Error al abrir '%s' para su escritura."
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr "No existe el directorio del dispositivo."
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
-msgstr "Busqueda ilegal en el offset %ld (tamaño %ld) en el archivo '%s'."
+msgstr "Acceso ilegal al desplazamiento %ld (tamaño %ld) en el fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:521
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
-msgstr "No es un archivo de Cuentas de Reproducción: '%s' (falta el encabezado mhdp)."
+msgstr "No es un fichero cuenta reproducciones: '%s' (falta cabecera mhdp)."
 
-#: ../src/itdb_itunesdb.c:535
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
-msgstr "El archivo de Cuentas de Reproducción ('%s'): el tamaño del encabezado es mas pequeño de lo esperado (%d<96)."
+msgstr ""
+"Fichero cuenta reproducciones ('%s'): tamaño de la cabecera menor del "
+"esperado (%d<96)."
 
-#: ../src/itdb_itunesdb.c:548
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
-msgstr "El archivo de Cuentas de Reproducción ('%s'): el tamaño de la entrada es mas pequeña de lo esperado (%d<12)."
+msgstr ""
+"Fichero cuenta reproducciones ('%s'): tamaño de la entrada menor del "
+"esperado (%d<12)."
 
-#: ../src/itdb_itunesdb.c:803
+#: ../src/itdb_itunesdb.c:931
 #, c-format
+msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
+msgstr ""
+"Fichero cuenta reproducciones ('%s'): tamaño de la entrada menor del "
+"esperado (%d<18)."
+
+#: ../src/itdb_itunesdb.c:1250
+#, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
-msgstr "iTunesDB corrupta: no se encontró MHOD en el offset %ld del archivo '%s'."
+msgstr ""
+"iTunesDB corrupta: no hay MHOD en el desplazamiento %ld del fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:923
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
 "anyhow.\n"
-msgstr "El tamaño de el campo de reglas de la lista de reproducción inteligente (%d) no es el esperado. Intentando continuar de todas formas.\n"
+msgstr ""
+"La longitud del campo de reglas (%d) de la lista de reproducción inteligente "
+"no es la esperada. Intentando continuar.\n"
 
-#: ../src/itdb_itunesdb.c:966
-#, fuzzy
-msgid "Did not find SLst hunk as expected. Trying to continue.\n"
-msgstr "No se encontró el SLst hunk como se esperaba. Intentando continuar.\n"
+#: ../src/itdb_itunesdb.c:1439
+#, c-format
+msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
+msgstr ""
+"iTunesDB corrupta: no hay SLst en el desplazamiento %ld del fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:972
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
 "\n"
 msgstr ""
-"Se encontró un tipo desconocido de MHOD (%d) al intentar análizar el iTunesDB. Ignorando.\n"
+"Se ha encontrado un tipo MHOD desconocido (%d) al analizar la iTunesDB. "
+"Ignorando.\n"
 "\n"
 
-#: ../src/itdb_itunesdb.c:1053 ../src/itdb_itunesdb.c:1744
-#: ../src/itdb_itunesdb.c:1779
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
-#, fuzzy
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
-msgstr "iTunesDB corrupta: el tamaño del hunk es 0 en el hunk %ld en el archivo '%s'."
+msgstr "iTunesDB corrupta: tamaño 0 para la zona %ld en el fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:1148
-msgid "Master-PL"
-msgstr "Lista de Reproducción Maestra"
+#: ../src/itdb_itunesdb.c:1527
+#, c-format
+msgid ""
+"iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
+msgstr ""
+"iTunesDB corrupta: no se ha encontrado la sección '%s' en la sección '%s' "
+"empezando en %ld."
 
-#: ../src/itdb_itunesdb.c:1150
-msgid "Playlist"
-msgstr "Lista de Reproducción"
+#: ../src/itdb_itunesdb.c:1541
+#, c-format
+msgid ""
+"header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
+"'%s'."
+msgstr ""
+"Tamaño de la cabecera de '%s' menor del esperado (%d<%d). en el "
+"desplazamiento %ld del fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:1175
+#: ../src/itdb_itunesdb.c:1626
 #, c-format
-msgid "iTunesDB corrupt: found mhyp at %ld in file '%s'."
-msgstr "iTunesDB corrupta: se encontró mhyp en %ld en el archivo '%s'."
+msgid "Not a iTunesDB: '%s' (missing mhdb header)."
+msgstr "No es un fichero iTunesDB: '%s' (falta la cabecera mhdb)."
 
-#: ../src/itdb_itunesdb.c:1223
+#: ../src/itdb_itunesdb.c:1643
 #, c-format
-msgid "Itdb_Track ID '%d' not found.\n"
-msgstr "No se encontró el ID '%d' del Itdb_Track.\n"
+msgid ""
+"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
+"Aborting."
+msgstr ""
+"iTunesDB ('%s'): tamaño de la cabecera de la zona mhsd menor del esperado (%"
+"d<32). Cancelando."
 
-#: ../src/itdb_itunesdb.c:1487
-msgid "OTG Playlist"
-msgstr "Lista de Reproducción OTG"
+#: ../src/itdb_itunesdb.c:1664
+#, c-format
+msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
+msgstr "iTunesDB '%s' corrupta: se esperaba mhsd en %ld."
 
-#: ../src/itdb_itunesdb.c:1501
+#: ../src/itdb_itunesdb.c:1781
 #, c-format
-msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
-msgstr "No es un archivo de la lista de reproducción OTG: '%s' (falta el encabezado mhpo)."
+msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
+msgstr ""
+"El número de MHODs en mhip en %ld no es consistente en el fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:1799
 #, c-format
-msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
-msgstr "El archivo de la lista de reproducción OTG ('%s'): el tamaño del encabezado es mas pequeño de lo esperado (%d<20)."
+msgid "Itdb_Track ID '%d' not found.\n"
+msgstr "Itdb_Track ID '%d' no encontrada.\n"
 
-#: ../src/itdb_itunesdb.c:1527
+#: ../src/itdb_itunesdb.c:1956
 #, c-format
-msgid "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
-msgstr "El archivo de la lista de reproducción OTG ('%s'): el tamaño de la entrada es mas pequeño de lo esperado (%d<4)."
+msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
+msgstr ""
+"El número de MHODs en mhyp en %ld no es consistente en el fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:1562
+#: ../src/itdb_itunesdb.c:1966
+msgid "Master-PL"
+msgstr "Lista de reproducción principal"
+
+#: ../src/itdb_itunesdb.c:1970
+msgid "Podcasts"
+msgstr "Podcasts"
+
+#: ../src/itdb_itunesdb.c:1972
+msgid "Playlist"
+msgstr "Lista de reproducción"
+
+#: ../src/itdb_itunesdb.c:1994
 #, c-format
-msgid "OTG playlist file '%s': reference to non-existent track (%d)."
-msgstr "El archivo de la lista de reproducción OTG '%s': referencia a una pista no existente (%d)."
+msgid ""
+"iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
+"ld in file '%s'."
+msgstr ""
+"iTunesDB corrupta: el número de secciones mhip no es consistente en mhyp "
+"empezando en %ld en el fichero '%s'."
 
-#: ../src/itdb_itunesdb.c:1607
+#: ../src/itdb_itunesdb.c:2279
+msgid "OTG Playlist"
+msgstr "Lista de reproducción OTG"
+
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
-msgid "OTG Playlist %d"
-msgstr "Lista de Reproducción OTG %d"
+msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
+msgstr "No es una lista de reproducción: '%s' (falta la cabecera mhpo)."
 
-#: ../src/itdb_itunesdb.c:1650
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
-msgid "Not a iTunesDB: '%s' (missing mhdb header)."
-msgstr "No es una iTunesDB: '%s' (falta el encabezado mhdb)."
+msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
+msgstr ""
+"Fichero de lista de reproducción OTG ('%s'): tamaño de la cabecera menor del "
+"esperado (%d<20)."
 
-#: ../src/itdb_itunesdb.c:1666
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
-#, fuzzy
 msgid ""
-"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%ld<32). "
-"Aborting."
-msgstr "iTunesDB ('%s'): el tamaño del encabezado mhsd del hunk es mas pequeño del esperado (%ld<32). Abortando."
+"OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
+msgstr ""
+"Fichero de lista de reproducción OTG ('%s'): tamaño de la entrada menor del "
+"esperado (%d<4)."
 
-#: ../src/itdb_itunesdb.c:1698
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
-#, fuzzy
-msgid "iTunesDB '%s' corrupt: already found two playlist mhsds -- giving up."
-msgstr "iTunesDB '%s' corrupta: se han encontrado dos lista de reproducción mhsds -- ."
+msgid "OTG playlist file '%s': reference to non-existent track (%d)."
+msgstr ""
+"La lista de reproducción OTG '%s': hace referencia a una pista no existente "
+"(%d)."
 
+#: ../src/itdb_itunesdb.c:2403
+#, c-format
+msgid "OTG Playlist %d"
+msgstr "Lista de reproducción OTG %d"
+
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1759
-#, fuzzy
+#: ../src/itdb_itunesdb.c:2471
 msgid ""
-"iTunesDB possibly corrupt: number of tracks (mhit hunks) inconsistent. "
-"Trying to continue.\n"
-msgstr "iTunesDB posiblemente corrupta: el número de pistas (mhit hunks) es inconsistente. Intentando continuar.\n"
+"iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
+"continue.\n"
+msgstr ""
+"iTunesDB esté corrupta: el número de pistas (zonas mhit) no es consistente. "
+"Intentando continuar.\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1841
-#, fuzzy
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
-msgstr "iTunesDB posiblemente corrupta: el número de listas de reproducción (mhyp hunks) es inconsistente. Intentando continuar.\n"
+msgstr ""
+"Es posible que iTunesDB esté corrupta: el número de listas de reproducción "
+"(zonas mhyp) no es consistente. Intentando continuar.\n"
 
-#: ../src/itdb_itunesdb.c:1879
+#: ../src/itdb_itunesdb.c:2581
 #, c-format
-msgid "File not found: '%s'."
-msgstr "Archivo no encontrado: '%s'."
+msgid ""
+"iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
+"found)"
+msgstr ""
+"iTunesDB '%s' corrputa: No se ha encontrado la lista de pistas (no se ha "
+"encontrado la sección mhsd de tipo 1)"
 
-#: ../src/itdb_itunesdb.c:2396
+#: ../src/itdb_itunesdb.c:2610
 #, c-format
-msgid "Cannot write mhod of type %d\n"
-msgstr "No se pudo escribir mhod del tipo %d\n"
+msgid ""
+"iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
+"sections found)"
+msgstr ""
+"iTunesDB '%s' corrputa: No se han encontrado las listas de reproducción (no "
+"se han encontrado las secciones mhsd de tipo 2 o tipo 3)"
 
-#: ../src/itdb_itunesdb.c:2522 ../src/itdb_itunesdb.c:2635
-msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
-msgstr "La base de datos en la memoria esta corrupta (apuntador de la pista == NULL). Abortando la exportación."
+#: ../src/itdb_itunesdb.c:2632
+#, c-format
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr "Directorio 'iTunes' no encontrado: '%s' (o similar)."
 
-#: ../src/itdb_itunesdb.c:2678
-msgid "Database in memory corrupt (playlist pointer == NULL). Aborting export."
-msgstr "La base de datos en la memoria esta corrupta (apuntador de la lista de reproducción == NULL). Abortando exportación."
-
-#: ../src/itdb_itunesdb.c:2718
+#: ../src/itdb_itunesdb.c:2649
 #, c-format
-msgid "Opening of '%s' for writing failed."
-msgstr "Fallo al abrir '%s' para escritura."
+msgid "Music directory not found: '%s' (or similar)."
+msgstr "Directorio 'Music' no encontrado: '%s' (o similar)"
 
-#: ../src/itdb_itunesdb.c:2729
+#: ../src/itdb_itunesdb.c:2667
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "Fallo al escribir a '%s'."
+msgid "Control directory not found: '%s' (or similar)."
+msgstr "Directorio 'iPod Control' no encontrado: '%s' (o similar)."
 
 #: ../src/itdb_itunesdb.c:2740
 #, c-format
+msgid "File not found: '%s'."
+msgstr "Fichero no encontrado: '%s'."
+
+#: ../src/itdb_itunesdb.c:3542
+#, c-format
+msgid "Cannot write mhod of type %d\n"
+msgstr "No se puede escribir el mhod de tipo %d\n"
+
+#: ../src/itdb_itunesdb.c:4098
+#, c-format
+msgid "Opening of '%s' for writing failed (%s)."
+msgstr "No se ha podido abrir '%s' para su escritura (%s)."
+
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
+#, c-format
 msgid "Writing to '%s' failed (%s)."
-msgstr "Fallo al escribir a '%s' (%s)."
+msgstr "No se ha podido escribir '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:2881 ../src/itdb_itunesdb.c:3052
-#: ../src/itdb_itunesdb.c:3245 ../src/itdb_itunesdb.c:3451
+#: ../src/itdb_itunesdb.c:4470
 #, c-format
-#, fuzzy
-msgid "Path not found: '%s'."
-msgstr "No se encontró: '%s'."
+msgid "Path not found: '%s' (or similar)."
+msgstr "Ruta no encontrada: '%s' (o similar)."
 
-#: ../src/itdb_itunesdb.c:3265
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "Error al renombrar '%s' a '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3282
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
-msgstr "Error al remover '%s' (%s)."
+msgstr "Error al borrar '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3426
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
-msgstr "No se encontró ningún directorio 'F..' en '%s'."
+msgstr "No se ha encontrado ningún directorio en '%s'."
 
-#: ../src/itdb_itunesdb.c:3589
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "Ruta no encontrada: '%s'."
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
-msgstr "Error al abrir '%s' para lectura (%s)."
+msgstr "Error al abrir '%s' para su lectura (%s)."
 
-#: ../src/itdb_itunesdb.c:3600
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
-msgstr "Error al abrir '%s' para escritura (%s)."
+msgstr "Error al abrir '%s' para su escritura (%s)."
 
-#: ../src/itdb_itunesdb.c:3617
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
-msgstr "Error leyendo de '%s' (%s)."
+msgstr "Error durante la lectura de '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3633
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
-msgstr "Error escribiendo a '%s' (%s)."
+msgstr "Error durante la escritura de '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3646 ../src/itdb_itunesdb.c:3656
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "Error al cerrar '%s' (%s)."
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr "iPod"
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr "Problema al crear el directorio iPod o el fichero: '%s'."
+
+#: ../src/itdb_photoalbum.c:25
+#, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "Directorio 'Photos' no encontrado: '%s' (o similar)."
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
-msgstr "La acción desconocida (%d) en la lista de reproducción inteligente sera ignorada.\n"
+msgstr ""
+"Acción desconocida (%d) en la lista de reproducción inteligente. Será "
+"ignorada.\n"
 
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr "Uso para añadir fotos:\n"
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr "%s <punto de montaje> <nombre del álbum> <fichero(s)>\n"
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+"'Nombre del álbum' debe marcarse como 'maestro' para añadir fotos al álbum "
+"de fotos maestro\n"
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr "\n"
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr "Uso para volcar todas las fotos a <directorio de salida>:\n"
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr "%s volcar <punto de montaje> <directorio de salida>\n"
+
+#: ../tests/test-photos.c:133
+#, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "Error al crear '%s' (mkdir)\n"
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr "Error: '%s' no es un directorio\n"
+
+#: ../tests/test-photos.c:148
+#, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "Error al leer la base de datos de fotos del iPod (%s).\n"
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr "Error al leer la base de datos de fotos del iPod.\n"
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+"Error al leer la base de datos de fotos del iPod (%s).\n"
+"Se intentará crear una nueva base de datos.\n"
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+"Error al leer la base de datos de fotos del iPod, se intentará crear una "
+"nueva base de datos\n"

Deleted: libgpod/branches/upstream/current/po/fr.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/fr.po
===================================================================
--- libgpod/branches/upstream/current/po/fr.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/fr.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -9,7 +9,7 @@
 msgstr ""
 "Project-Id-Version: gtkpod 0.94\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-09-14 21:51+0900\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
 "PO-Revision-Date: 2005-09-14 21:46+0900\n"
 "Last-Translator: Éric Lassauge <lassauge at users.sf.net>\n"
 "Language-Team: FR\n"
@@ -18,36 +18,209 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=n>1;\n"
 
-#: ../src/itdb_itunesdb.c:313
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr ""
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:387
+#, fuzzy, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "Fichier introuvable : «%s»."
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr ""
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr ""
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr ""
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr ""
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr ""
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr ""
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr ""
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr ""
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr ""
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+msgid "Nano (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:189
+msgid "Nano (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:190
+msgid "Nano (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:191
+msgid "Nano (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:203
+msgid "Sixth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr ""
+
+#: ../src/itdb_device.c:449
+#, fuzzy, c-format
+msgid "Could not open '%s' for writing."
+msgstr "Ne peut ouvrir en écriture le fichier «%s» (%s)."
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
 msgstr "Erreur de flux à l'offset %ld (longueur %ld) dans le fichier «%s»."
 
-#: ../src/itdb_itunesdb.c:521
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
 msgstr "«%s» n»est pas un fichier de compteurs (entête mhdp manquant)"
 
-#: ../src/itdb_itunesdb.c:535
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
 msgstr ""
 "Fichier de compteurs ('%s') : longueur de l'entête plus petite que prévue (%"
 "d<96)."
 
-#: ../src/itdb_itunesdb.c:548
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
 msgstr ""
 "Fichier de compteur ('%s') : longueur des données plus petite que prévue (%"
 "d<12)."
 
-#: ../src/itdb_itunesdb.c:803
+#: ../src/itdb_itunesdb.c:931
+#, fuzzy, c-format
+msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
+msgstr ""
+"Fichier de compteur ('%s') : longueur des données plus petite que prévue (%"
+"d<12)."
+
+#: ../src/itdb_itunesdb.c:1250
 #, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
 msgstr "Corruption d'iTunesDB : pas de MHOD à l'offset %ld du fichier «%s»."
 
-#: ../src/itdb_itunesdb.c:923
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
@@ -56,12 +229,12 @@
 "Longueur du champ de la règle (%d) de la liste intelligente inattendue. "
 "Tentative pour continuer quand même.\n"
 
-#: ../src/itdb_itunesdb.c:966
-msgid "Did not find SLst hunk as expected. Trying to continue.\n"
-msgstr ""
-"Ne peut trouver le SLst attendu. Tentative pour continuer quand même.\n"
+#: ../src/itdb_itunesdb.c:1439
+#, fuzzy, c-format
+msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
+msgstr "Corruption d'iTunesDB : pas de MHOD à l'offset %ld du fichier «%s»."
 
-#: ../src/itdb_itunesdb.c:972
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
@@ -69,46 +242,95 @@
 msgstr ""
 "Type MHOD inconnu (%d) lors du parcours de iTunesDB. Ignorance de l'erreur.\n"
 
-#: ../src/itdb_itunesdb.c:1053 ../src/itdb_itunesdb.c:1744
-#: ../src/itdb_itunesdb.c:1779
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
 msgstr "Corruption d'iTunesDB : longueur 0 à %ld du fichier «%s»."
 
-#: ../src/itdb_itunesdb.c:1148
-msgid "Master-PL"
-msgstr "Liste principale"
+#: ../src/itdb_itunesdb.c:1527
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
+msgstr "Corruption d'iTunesDB : pas de MHOD à l'offset %ld du fichier «%s»."
 
-#: ../src/itdb_itunesdb.c:1150
-msgid "Playlist"
-msgstr "Liste de lecture"
+#: ../src/itdb_itunesdb.c:1541
+#, fuzzy, c-format
+msgid ""
+"header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
+"'%s'."
+msgstr ""
+"iTunesDB ('%s') : longueur de l'entête mhsd plus petite que prévue (%ld<32). "
+"Interruption."
 
-#: ../src/itdb_itunesdb.c:1175
+#: ../src/itdb_itunesdb.c:1626
 #, c-format
-msgid "iTunesDB corrupt: found mhyp at %ld in file '%s'."
+msgid "Not a iTunesDB: '%s' (missing mhdb header)."
+msgstr "«%s» n»est pas un fichier iTunesDB (entête mhdb manquante)"
+
+#: ../src/itdb_itunesdb.c:1643
+#, fuzzy, c-format
+msgid ""
+"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
+"Aborting."
+msgstr ""
+"iTunesDB ('%s') : longueur de l'entête mhsd plus petite que prévue (%ld<32). "
+"Interruption."
+
+#: ../src/itdb_itunesdb.c:1664
+#, fuzzy, c-format
+msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
 msgstr "Corruption d'iTunesDB : trouvé mhyp à %ld du fichier «%s»."
 
-#: ../src/itdb_itunesdb.c:1223
+#: ../src/itdb_itunesdb.c:1781
 #, c-format
+msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1799
+#, c-format
 msgid "Itdb_Track ID '%d' not found.\n"
 msgstr "Itdb_Track ID «%d» non trouvé.\n"
 
-#: ../src/itdb_itunesdb.c:1487
+#: ../src/itdb_itunesdb.c:1956
+#, fuzzy, c-format
+msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
+msgstr "Corruption d'iTunesDB : trouvé mhyp à %ld du fichier «%s»."
+
+#: ../src/itdb_itunesdb.c:1966
+msgid "Master-PL"
+msgstr "Liste principale"
+
+#: ../src/itdb_itunesdb.c:1970
+msgid "Podcasts"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1972
+msgid "Playlist"
+msgstr "Liste de lecture"
+
+#: ../src/itdb_itunesdb.c:1994
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
+"ld in file '%s'."
+msgstr "Corruption d'iTunesDB : trouvé mhyp à %ld du fichier «%s»."
+
+#: ../src/itdb_itunesdb.c:2279
 msgid "OTG Playlist"
 msgstr "Liste de lecture OTG"
 
-#: ../src/itdb_itunesdb.c:1501
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
 msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
 msgstr ""
 "Le fichier '%s' n'est pas un fichier de liste OTG (entête mhpo manquant)."
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
 msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
 msgstr "Fichier de liste OTG («%s») : entête plus petit que prévu (%d<20)."
 
-#: ../src/itdb_itunesdb.c:1527
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
 msgid ""
 "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
@@ -116,47 +338,28 @@
 "Fichier de liste OTG ('%s') : longueur de données plus petite que prévue (%"
 "d<4)."
 
-#: ../src/itdb_itunesdb.c:1562
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
 msgid "OTG playlist file '%s': reference to non-existent track (%d)."
 msgstr "Fichier de liste OTG «%s» : référence à un morceau inexistant (%d)."
 
-#: ../src/itdb_itunesdb.c:1607
+#: ../src/itdb_itunesdb.c:2403
 #, c-format
 msgid "OTG Playlist %d"
 msgstr "Liste de lecture OTG %d"
 
-#: ../src/itdb_itunesdb.c:1650
-#, c-format
-msgid "Not a iTunesDB: '%s' (missing mhdb header)."
-msgstr "«%s» n»est pas un fichier iTunesDB (entête mhdb manquante)"
-
-#: ../src/itdb_itunesdb.c:1666
-#, c-format
-msgid ""
-"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%ld<32). "
-"Aborting."
-msgstr ""
-"iTunesDB ('%s') : longueur de l'entête mhsd plus petite que prévue (%ld<32). "
-"Interruption."
-
-#: ../src/itdb_itunesdb.c:1698
-#, c-format
-msgid "iTunesDB '%s' corrupt: already found two playlist mhsds -- giving up."
-msgstr ""
-"Corruption de iTunesDB ('%s') : déjà trouvés deux listes mhsds -- abandon."
-
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1759
+#: ../src/itdb_itunesdb.c:2471
+#, fuzzy
 msgid ""
-"iTunesDB possibly corrupt: number of tracks (mhit hunks) inconsistent. "
-"Trying to continue.\n"
+"iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
+"continue.\n"
 msgstr ""
 "Corruption possible de iTunesDB : nombre de fichiers (mhit) incohérent. "
 "Tentative pour continuer quand même.\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1841
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
@@ -164,91 +367,199 @@
 "Corruption possible d'iTunesDB : nombre de listes (mhyp) incohérent. "
 "Tentative pour continuer quand même.\n"
 
-#: ../src/itdb_itunesdb.c:1879
+#: ../src/itdb_itunesdb.c:2581
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
+"found)"
+msgstr ""
+"Corruption de iTunesDB ('%s') : déjà trouvés deux listes mhsds -- abandon."
+
+#: ../src/itdb_itunesdb.c:2610
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
+"sections found)"
+msgstr ""
+"Corruption de iTunesDB ('%s') : déjà trouvés deux listes mhsds -- abandon."
+
+#: ../src/itdb_itunesdb.c:2632
 #, c-format
-msgid "File not found: '%s'."
-msgstr "Fichier introuvable : «%s»."
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr ""
 
-#: ../src/itdb_itunesdb.c:2396
+#: ../src/itdb_itunesdb.c:2649
 #, c-format
-msgid "Cannot write mhod of type %d\n"
-msgstr "Impossible d'écrire mhod du type %d\n"
-
-#: ../src/itdb_itunesdb.c:2522 ../src/itdb_itunesdb.c:2635
-msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+msgid "Music directory not found: '%s' (or similar)."
 msgstr ""
-"Base de données en mémoire corrompue (track pointer == NULL). Abandon de "
-"l'export."
 
-#: ../src/itdb_itunesdb.c:2678
-msgid "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#: ../src/itdb_itunesdb.c:2667
+#, c-format
+msgid "Control directory not found: '%s' (or similar)."
 msgstr ""
-"Base de données en mémoire corrompue (playlist pointer == NULL). Abandon de "
-"l'export."
 
-#: ../src/itdb_itunesdb.c:2718
+#: ../src/itdb_itunesdb.c:2740
 #, c-format
-msgid "Opening of '%s' for writing failed."
-msgstr "Échec de l'ouverture en écriture de «%s»."
+msgid "File not found: '%s'."
+msgstr "Fichier introuvable : «%s»."
 
-#: ../src/itdb_itunesdb.c:2729
+#: ../src/itdb_itunesdb.c:3542
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "Erreur d'écriture du fichier «%s»."
+msgid "Cannot write mhod of type %d\n"
+msgstr "Impossible d'écrire mhod du type %d\n"
 
-#: ../src/itdb_itunesdb.c:2740
+#: ../src/itdb_itunesdb.c:4098
+#, fuzzy, c-format
+msgid "Opening of '%s' for writing failed (%s)."
+msgstr "Échec de l'ouverture en écriture de «%s»."
+
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
 #, c-format
 msgid "Writing to '%s' failed (%s)."
 msgstr "Échec de l'écriture dans «%s» (%s)."
 
-#: ../src/itdb_itunesdb.c:2881 ../src/itdb_itunesdb.c:3052
-#: ../src/itdb_itunesdb.c:3245 ../src/itdb_itunesdb.c:3451
-#, c-format
-msgid "Path not found: '%s'."
+#: ../src/itdb_itunesdb.c:4470
+#, fuzzy, c-format
+msgid "Path not found: '%s' (or similar)."
 msgstr "Chemin non trouvé : «%s»."
 
-#: ../src/itdb_itunesdb.c:3265
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "Impossible de renommer «%s» en «%s» (%s)."
 
-#: ../src/itdb_itunesdb.c:3282
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
 msgstr "Erreur de suppression du fichier «%s» (%s)."
 
-#: ../src/itdb_itunesdb.c:3426
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
 msgstr ""
 
-#: ../src/itdb_itunesdb.c:3589
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "Chemin non trouvé : «%s»."
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
 msgstr "Ne peut ouvrir en lecture le fichier «%s» (%s)."
 
-#: ../src/itdb_itunesdb.c:3600
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
 msgstr "Ne peut ouvrir en écriture le fichier «%s» (%s)."
 
-#: ../src/itdb_itunesdb.c:3617
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
 msgstr "Erreur lors de la lecture à partir de : %s (%s)."
 
-#: ../src/itdb_itunesdb.c:3633
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
 msgstr "Erreur d'écriture dans «%s» (%s)."
 
-#: ../src/itdb_itunesdb.c:3646 ../src/itdb_itunesdb.c:3656
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "Erreur à la fermeture «%s» (%s)."
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr ""
+
+#: ../src/itdb_photoalbum.c:25
+#, fuzzy, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "Chemin non trouvé : «%s»."
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
 msgstr "L'action inconnue (%d) dans la liste intelligente sera ignorée.\n"
+
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr ""
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:133
+#, fuzzy, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "Erreur de suppression du fichier «%s» (%s)."
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr ""
+
+#: ../tests/test-photos.c:148
+#, fuzzy, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "Impossible de renommer «%s» en «%s» (%s)."
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+
+#~ msgid "Writing to '%s' failed."
+#~ msgstr "Erreur d'écriture du fichier «%s»."
+
+#~ msgid "Did not find SLst hunk as expected. Trying to continue.\n"
+#~ msgstr ""
+#~ "Ne peut trouver le SLst attendu. Tentative pour continuer quand même.\n"
+
+#~ msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+#~ msgstr ""
+#~ "Base de données en mémoire corrompue (track pointer == NULL). Abandon de "
+#~ "l'export."
+
+#~ msgid ""
+#~ "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#~ msgstr ""
+#~ "Base de données en mémoire corrompue (playlist pointer == NULL). Abandon "
+#~ "de l'export."

Deleted: libgpod/branches/upstream/current/po/he.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/he.po
===================================================================
--- libgpod/branches/upstream/current/po/he.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/he.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: gtkpod\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-09-14 21:51+0900\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
 "PO-Revision-Date: 2005-08-02 21:19+0300\n"
 "Last-Translator: Assaf Gillat\n"
 "Language-Team: HEBREW <kde-il at yahoogroups.com>\n"
@@ -17,32 +17,203 @@
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 "X-Generator: KBabel 1.9.1\n"
 
-#: ../src/itdb_itunesdb.c:313
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr ""
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:387
+#, fuzzy, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "קובץ לא קיים: '%s'."
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr ""
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr ""
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr ""
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr ""
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr ""
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr ""
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr ""
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr ""
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr ""
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+msgid "Nano (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:189
+msgid "Nano (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:190
+msgid "Nano (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:191
+msgid "Nano (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:203
+msgid "Sixth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr ""
+
+#: ../src/itdb_device.c:449
+#, fuzzy, c-format
+msgid "Could not open '%s' for writing."
+msgstr "תקלה בפתיחת '%s' לכתיבה (%s)."
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
 msgstr "חיפוש לא חוקי בהיסט %ld (אורך %ld) בקובץ '%s'."
 
-#: ../src/itdb_itunesdb.c:521
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
 msgstr "זהו לא קובץ ספירת השמעה: '%s' (חסר תחילית mhdp)"
 
-#: ../src/itdb_itunesdb.c:535
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
 msgstr "קובץ ספירת השמעה ('%s'): אורך תחילית קטן מהצפוי (%d<96)."
 
-#: ../src/itdb_itunesdb.c:548
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
 msgstr "קובץ ספירת השמעה ('%s'): אורך רשומה קטן מהצפוי (%d<12)."
 
-#: ../src/itdb_itunesdb.c:803
+#: ../src/itdb_itunesdb.c:931
+#, fuzzy, c-format
+msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
+msgstr "קובץ ספירת השמעה ('%s'): אורך רשומה קטן מהצפוי (%d<12)."
+
+#: ../src/itdb_itunesdb.c:1250
 #, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
 msgstr "iTunesDB שבור: אין MHOD בהיסט %ld בקובץ '%s'."
 
-#: ../src/itdb_itunesdb.c:923
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
@@ -50,11 +221,12 @@
 msgstr ""
 "אורך שדה של חוק (%d) רשימת השמעה חכמה הוא לא כצפוי. מנסה להמשיך בכל זאת.\n"
 
-#: ../src/itdb_itunesdb.c:966
-msgid "Did not find SLst hunk as expected. Trying to continue.\n"
-msgstr "לא נמצאה חתיכת SLst כצפוי. מנסה להמשיך.\n"
+#: ../src/itdb_itunesdb.c:1439
+#, fuzzy, c-format
+msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
+msgstr "iTunesDB שבור: אין MHOD בהיסט %ld בקובץ '%s'."
 
-#: ../src/itdb_itunesdb.c:972
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
@@ -63,89 +235,119 @@
 "נתקלנו בסוג לא ידוע של MHOD (%d) בזמן ניתוח ה-iTuneDB. מתעלם.\n"
 "\n"
 
-#: ../src/itdb_itunesdb.c:1053 ../src/itdb_itunesdb.c:1744
-#: ../src/itdb_itunesdb.c:1779
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
 msgstr "iTunesDB שבור: אורך חתיכה 0 בחתיכה  %ld בקובץ '%s'."
 
-#: ../src/itdb_itunesdb.c:1148
-msgid "Master-PL"
-msgstr "רשימת ראשית"
+#: ../src/itdb_itunesdb.c:1527
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
+msgstr "iTunesDB שבור: אין MHOD בהיסט %ld בקובץ '%s'."
 
-#: ../src/itdb_itunesdb.c:1150
-msgid "Playlist"
-msgstr "רשימת השמעה"
+#: ../src/itdb_itunesdb.c:1541
+#, fuzzy, c-format
+msgid ""
+"header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
+"'%s'."
+msgstr ""
+"iTunesDB ('%s'): גודל תחילית של החתיכה mhsd קטנה מהצפוי (%ld<32). מבטל."
 
-#: ../src/itdb_itunesdb.c:1175
+#: ../src/itdb_itunesdb.c:1626
 #, c-format
-msgid "iTunesDB corrupt: found mhyp at %ld in file '%s'."
+msgid "Not a iTunesDB: '%s' (missing mhdb header)."
+msgstr "זהו לא iTunesDB: '%s' (חסרה תחילית mhdb)."
+
+#: ../src/itdb_itunesdb.c:1643
+#, fuzzy, c-format
+msgid ""
+"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
+"Aborting."
+msgstr ""
+"iTunesDB ('%s'): גודל תחילית של החתיכה mhsd קטנה מהצפוי (%ld<32). מבטל."
+
+#: ../src/itdb_itunesdb.c:1664
+#, fuzzy, c-format
+msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
 msgstr "iTunesDB שבור: נמצא mhyp ב %ld בקובץ '%s'."
 
-#: ../src/itdb_itunesdb.c:1223
+#: ../src/itdb_itunesdb.c:1781
 #, c-format
+msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1799
+#, c-format
 msgid "Itdb_Track ID '%d' not found.\n"
 msgstr "מזהה Itdb_Track '%d' לא נמצא.\n"
 
-#: ../src/itdb_itunesdb.c:1487
+#: ../src/itdb_itunesdb.c:1956
+#, fuzzy, c-format
+msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
+msgstr "iTunesDB שבור: נמצא mhyp ב %ld בקובץ '%s'."
+
+#: ../src/itdb_itunesdb.c:1966
+msgid "Master-PL"
+msgstr "רשימת ראשית"
+
+#: ../src/itdb_itunesdb.c:1970
+msgid "Podcasts"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1972
+msgid "Playlist"
+msgstr "רשימת השמעה"
+
+#: ../src/itdb_itunesdb.c:1994
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
+"ld in file '%s'."
+msgstr "iTunesDB שבור: נמצא mhyp ב %ld בקובץ '%s'."
+
+#: ../src/itdb_itunesdb.c:2279
 msgid "OTG Playlist"
 msgstr "רשימת השמעה OTG"
 
-#: ../src/itdb_itunesdb.c:1501
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
 msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
 msgstr "זהו לא קובץ רשימת השמעה OTG: '%s' (חסרה תחילת קובץ mhpo)."
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
 msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
 msgstr "קובץ רשימת השמעה OTG ('%s'): גודל תחילית קטן מהצפוי (%d<20)."
 
-#: ../src/itdb_itunesdb.c:1527
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
 msgid ""
 "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
 msgstr "קובץ רשימת השמעה OTG ('%s'): גודל רשומה קטן מהצפוי (%d<4)."
 
-#: ../src/itdb_itunesdb.c:1562
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
 msgid "OTG playlist file '%s': reference to non-existent track (%d)."
 msgstr "רשימת השמעה OTG '%s': התייחסות לרצועה לא קיימת (%d)."
 
-#: ../src/itdb_itunesdb.c:1607
+#: ../src/itdb_itunesdb.c:2403
 #, c-format
 msgid "OTG Playlist %d"
 msgstr "רשימת השמעה OTG %d"
 
-#: ../src/itdb_itunesdb.c:1650
-#, c-format
-msgid "Not a iTunesDB: '%s' (missing mhdb header)."
-msgstr "זהו לא iTunesDB: '%s' (חסרה תחילית mhdb)."
-
-#: ../src/itdb_itunesdb.c:1666
-#, c-format
-msgid ""
-"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%ld<32). "
-"Aborting."
-msgstr ""
-"iTunesDB ('%s'): גודל תחילית של החתיכה mhsd קטנה מהצפוי (%ld<32). מבטל."
-
-#: ../src/itdb_itunesdb.c:1698
-#, c-format
-msgid "iTunesDB '%s' corrupt: already found two playlist mhsds -- giving up."
-msgstr "iTunesDB '%s' שבור: כבר מצאנו mhsds של שתי רשימות השמעה -- מוותר."
-
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1759
+#: ../src/itdb_itunesdb.c:2471
+#, fuzzy
 msgid ""
-"iTunesDB possibly corrupt: number of tracks (mhit hunks) inconsistent. "
-"Trying to continue.\n"
+"iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
+"continue.\n"
 msgstr ""
 "יכול להיות ש-iTuneDB שבור: מספר רצועות (mhit חתיכות) לא עקביות. מנסה "
 "להמשיך.\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1841
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
@@ -153,87 +355,192 @@
 "יכול להיות ש-iTuneDB שבור: מספר רשימות השמעה (mhyp חתיכות) לא עקביות. מנסה "
 "להמשיך.\n"
 
-#: ../src/itdb_itunesdb.c:1879
+#: ../src/itdb_itunesdb.c:2581
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
+"found)"
+msgstr "iTunesDB '%s' שבור: כבר מצאנו mhsds של שתי רשימות השמעה -- מוותר."
+
+#: ../src/itdb_itunesdb.c:2610
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
+"sections found)"
+msgstr "iTunesDB '%s' שבור: כבר מצאנו mhsds של שתי רשימות השמעה -- מוותר."
+
+#: ../src/itdb_itunesdb.c:2632
 #, c-format
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:2649
+#, c-format
+msgid "Music directory not found: '%s' (or similar)."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:2667
+#, c-format
+msgid "Control directory not found: '%s' (or similar)."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:2740
+#, c-format
 msgid "File not found: '%s'."
 msgstr "קובץ לא קיים: '%s'."
 
-#: ../src/itdb_itunesdb.c:2396
+#: ../src/itdb_itunesdb.c:3542
 #, c-format
 msgid "Cannot write mhod of type %d\n"
 msgstr "לא יכול לכתוב mhod של סוג %d\n"
 
-#: ../src/itdb_itunesdb.c:2522 ../src/itdb_itunesdb.c:2635
-msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
-msgstr "מסד הנתונים בזיכרון שבור (מצביע רצועה == NULL). מבטל ייצוא."
-
-#: ../src/itdb_itunesdb.c:2678
-msgid "Database in memory corrupt (playlist pointer == NULL). Aborting export."
-msgstr "מסד הנתונים בזיכרון שבור (מצביע רשימת השמעה == NULL). מבטל ייצוא."
-
-#: ../src/itdb_itunesdb.c:2718
-#, c-format
-msgid "Opening of '%s' for writing failed."
+#: ../src/itdb_itunesdb.c:4098
+#, fuzzy, c-format
+msgid "Opening of '%s' for writing failed (%s)."
 msgstr "פתיחת '%s' לכתיבה נכשלה."
 
-#: ../src/itdb_itunesdb.c:2729
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "נכשלה כתיבה ל '%s'."
-
-#: ../src/itdb_itunesdb.c:2740
-#, c-format
 msgid "Writing to '%s' failed (%s)."
 msgstr "נכשלה כתיבה ל '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:2881 ../src/itdb_itunesdb.c:3052
-#: ../src/itdb_itunesdb.c:3245 ../src/itdb_itunesdb.c:3451
-#, c-format
-msgid "Path not found: '%s'."
+#: ../src/itdb_itunesdb.c:4470
+#, fuzzy, c-format
+msgid "Path not found: '%s' (or similar)."
 msgstr "נתיב לא נמצא: '%s'."
 
-#: ../src/itdb_itunesdb.c:3265
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "תקלה בשינוי שם '%s' ל '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3282
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
 msgstr "תקלה בהסרת '%s' (%s)"
 
-#: ../src/itdb_itunesdb.c:3426
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
 msgstr ""
 
-#: ../src/itdb_itunesdb.c:3589
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "נתיב לא נמצא: '%s'."
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
 msgstr "תקלה בפתיחת '%s' לקריאה (%s)."
 
-#: ../src/itdb_itunesdb.c:3600
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
 msgstr "תקלה בפתיחת '%s' לכתיבה (%s)."
 
-#: ../src/itdb_itunesdb.c:3617
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
 msgstr "תקלה בזמן קריאה מ '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3633
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
 msgstr "תקלה בזמן כתיבה ל '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3646 ../src/itdb_itunesdb.c:3656
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "תקלה בזמן סגירה '%s' (%s)."
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr ""
+
+#: ../src/itdb_photoalbum.c:25
+#, fuzzy, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "נתיב לא נמצא: '%s'."
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
 msgstr "התעלמות מפעולה לא ידועה (%d) ברשימת השמעה חכמה.\n"
+
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr ""
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:133
+#, fuzzy, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "תקלה בהסרת '%s' (%s)"
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr ""
+
+#: ../tests/test-photos.c:148
+#, fuzzy, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "תקלה בשינוי שם '%s' ל '%s' (%s)."
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+
+#~ msgid "Writing to '%s' failed."
+#~ msgstr "נכשלה כתיבה ל '%s'."
+
+#~ msgid "Did not find SLst hunk as expected. Trying to continue.\n"
+#~ msgstr "לא נמצאה חתיכת SLst כצפוי. מנסה להמשיך.\n"
+
+#~ msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+#~ msgstr "מסד הנתונים בזיכרון שבור (מצביע רצועה == NULL). מבטל ייצוא."
+
+#~ msgid ""
+#~ "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#~ msgstr "מסד הנתונים בזיכרון שבור (מצביע רשימת השמעה == NULL). מבטל ייצוא."

Deleted: libgpod/branches/upstream/current/po/it.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/it.po
===================================================================
--- libgpod/branches/upstream/current/po/it.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/it.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -11,7 +11,7 @@
 msgstr ""
 "Project-Id-Version: it2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-09-14 21:51+0900\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
 "PO-Revision-Date: 2005-06-20 23:25+0900\n"
 "Last-Translator: \n"
 "Language-Team:  <it at li.org>\n"
@@ -21,36 +21,209 @@
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 "X-Generator: KBabel 1.9.1\n"
 
-#: ../src/itdb_itunesdb.c:313
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr ""
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:387
+#, fuzzy, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "file non trovato: '%s'."
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr ""
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr ""
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr ""
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr ""
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr ""
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr ""
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr ""
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr ""
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr ""
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+msgid "Nano (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:189
+msgid "Nano (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:190
+msgid "Nano (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:191
+msgid "Nano (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:203
+msgid "Sixth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr ""
+
+#: ../src/itdb_device.c:449
+#, fuzzy, c-format
+msgid "Could not open '%s' for writing."
+msgstr "Errore nell'apertura in scrittura di '%s' (%s)."
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
 msgstr "ricerca illegale all'offest %ld (lunghezza %ld) nel file '%s'"
 
-#: ../src/itdb_itunesdb.c:521
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
 msgstr "Non è un file conta riproduzioni: '%s' (intestazione mhdp mancante)"
 
-#: ../src/itdb_itunesdb.c:535
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
 msgstr ""
 "File conta-riproduzioni ('%s'): lunghezza della intestazione più piccolo di "
 "quanto ci si aspettava (%d<96)"
 
-#: ../src/itdb_itunesdb.c:548
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
 msgstr ""
 "File conta-riproduzioni ('%s'): lunghezza della voce più piccoladi quanto ci "
 "si aspettava (%d<12)"
 
-#: ../src/itdb_itunesdb.c:803
+#: ../src/itdb_itunesdb.c:931
+#, fuzzy, c-format
+msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
+msgstr ""
+"File conta-riproduzioni ('%s'): lunghezza della voce più piccoladi quanto ci "
+"si aspettava (%d<12)"
+
+#: ../src/itdb_itunesdb.c:1250
 #, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
 msgstr "iTunesDB corrotto: nessun MHOD all'offest %ld nel file '%s'."
 
-#: ../src/itdb_itunesdb.c:923
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
@@ -59,12 +232,12 @@
 "La lunghezza del campo della regola della playlist intelligente (%d) non è "
 "come la si aspettava. Si prova a continuare.\n"
 
-#: ../src/itdb_itunesdb.c:966
-msgid "Did not find SLst hunk as expected. Trying to continue.\n"
-msgstr ""
-"Impossibile trovare hunk SLst come ci si aspettava. Si prova a continuare.\n"
+#: ../src/itdb_itunesdb.c:1439
+#, fuzzy, c-format
+msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
+msgstr "iTunesDB corrotto: nessun MHOD all'offest %ld nel file '%s'."
 
-#: ../src/itdb_itunesdb.c:972
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
@@ -74,47 +247,96 @@
 "Ignorato.\n"
 "\n"
 
-#: ../src/itdb_itunesdb.c:1053 ../src/itdb_itunesdb.c:1744
-#: ../src/itdb_itunesdb.c:1779
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
 msgstr "iTunesDB corrotto: hunk di lunghezza 0 per l'hunk %ld nel file '%s'."
 
-#: ../src/itdb_itunesdb.c:1148
-msgid "Master-PL"
-msgstr "PL principale"
+#: ../src/itdb_itunesdb.c:1527
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
+msgstr "iTunesDB corrotto: nessun MHOD all'offest %ld nel file '%s'."
 
-#: ../src/itdb_itunesdb.c:1150
-msgid "Playlist"
-msgstr "Playlist"
+#: ../src/itdb_itunesdb.c:1541
+#, fuzzy, c-format
+msgid ""
+"header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
+"'%s'."
+msgstr ""
+"iTunesDB ('%s'): lunghezza della intestazione del hunk mhsd più piccolo "
+"delle aspettative (%ld<32). Interrompo."
 
-#: ../src/itdb_itunesdb.c:1175
+#: ../src/itdb_itunesdb.c:1626
 #, c-format
-msgid "iTunesDB corrupt: found mhyp at %ld in file '%s'."
+msgid "Not a iTunesDB: '%s' (missing mhdb header)."
+msgstr "Non è un file iTunesDB: '%s' (intestazione mhdb mancante)"
+
+#: ../src/itdb_itunesdb.c:1643
+#, fuzzy, c-format
+msgid ""
+"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
+"Aborting."
+msgstr ""
+"iTunesDB ('%s'): lunghezza della intestazione del hunk mhsd più piccolo "
+"delle aspettative (%ld<32). Interrompo."
+
+#: ../src/itdb_itunesdb.c:1664
+#, fuzzy, c-format
+msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
 msgstr "iTunesDB corrotto: trovato mhyp a %ld nel file '%s'."
 
-#: ../src/itdb_itunesdb.c:1223
+#: ../src/itdb_itunesdb.c:1781
 #, c-format
+msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1799
+#, c-format
 msgid "Itdb_Track ID '%d' not found.\n"
 msgstr "itDB_Track ID '%d' non trovato.\n"
 
-#: ../src/itdb_itunesdb.c:1487
+#: ../src/itdb_itunesdb.c:1956
+#, fuzzy, c-format
+msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
+msgstr "iTunesDB corrotto: trovato mhyp a %ld nel file '%s'."
+
+#: ../src/itdb_itunesdb.c:1966
+msgid "Master-PL"
+msgstr "PL principale"
+
+#: ../src/itdb_itunesdb.c:1970
+msgid "Podcasts"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:1972
+msgid "Playlist"
+msgstr "Playlist"
+
+#: ../src/itdb_itunesdb.c:1994
+#, fuzzy, c-format
+msgid ""
+"iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
+"ld in file '%s'."
+msgstr "iTunesDB corrotto: trovato mhyp a %ld nel file '%s'."
+
+#: ../src/itdb_itunesdb.c:2279
 msgid "OTG Playlist"
 msgstr "Playlist OTG"
 
-#: ../src/itdb_itunesdb.c:1501
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
 msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
 msgstr "Non è una file playlist OTG: '%s' (manca l'intestazione mhpo)"
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
 msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
 msgstr ""
 "File playlist OTG ('%s'): lunghezza della intestazione più piccola delle "
 "aspettative (%d<20)"
 
-#: ../src/itdb_itunesdb.c:1527
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
 msgid ""
 "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
@@ -122,46 +344,28 @@
 "File playlist OTG ('%s'): lunghezza della voce più piccola delle aspettative "
 "(%d<4)"
 
-#: ../src/itdb_itunesdb.c:1562
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
 msgid "OTG playlist file '%s': reference to non-existent track (%d)."
 msgstr "Playlist OTG '%s': Punta ad una traccia non esistente (%d)."
 
-#: ../src/itdb_itunesdb.c:1607
+#: ../src/itdb_itunesdb.c:2403
 #, c-format
 msgid "OTG Playlist %d"
 msgstr "Playlist OTG %d"
 
-#: ../src/itdb_itunesdb.c:1650
-#, c-format
-msgid "Not a iTunesDB: '%s' (missing mhdb header)."
-msgstr "Non è un file iTunesDB: '%s' (intestazione mhdb mancante)"
-
-#: ../src/itdb_itunesdb.c:1666
-#, c-format
-msgid ""
-"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%ld<32). "
-"Aborting."
-msgstr ""
-"iTunesDB ('%s'): lunghezza della intestazione del hunk mhsd più piccolo "
-"delle aspettative (%ld<32). Interrompo."
-
-#: ../src/itdb_itunesdb.c:1698
-#, c-format
-msgid "iTunesDB '%s' corrupt: already found two playlist mhsds -- giving up."
-msgstr "iTunesDB '%s' corrotto: trovate già due playlist mhsds -- ci rinuncio."
-
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1759
+#: ../src/itdb_itunesdb.c:2471
+#, fuzzy
 msgid ""
-"iTunesDB possibly corrupt: number of tracks (mhit hunks) inconsistent. "
-"Trying to continue.\n"
+"iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
+"continue.\n"
 msgstr ""
 "L'iTunes è probabilmente corrotto: il numero di tracce (mhit hunks) è "
 "inconsistente. Provo a continuare.\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1841
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
@@ -169,91 +373,198 @@
 "L'iTunes è probabilmente corrotto: il numero di playlist (mhyp hunks) è "
 "inconsistente. Provo a continuare.\n"
 
-#: ../src/itdb_itunesdb.c:1879
+#: ../src/itdb_itunesdb.c:2581
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
+"found)"
+msgstr "iTunesDB '%s' corrotto: trovate già due playlist mhsds -- ci rinuncio."
+
+#: ../src/itdb_itunesdb.c:2610
+#, fuzzy, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
+"sections found)"
+msgstr "iTunesDB '%s' corrotto: trovate già due playlist mhsds -- ci rinuncio."
+
+#: ../src/itdb_itunesdb.c:2632
 #, c-format
-msgid "File not found: '%s'."
-msgstr "file non trovato: '%s'."
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr ""
 
-#: ../src/itdb_itunesdb.c:2396
+#: ../src/itdb_itunesdb.c:2649
 #, c-format
-msgid "Cannot write mhod of type %d\n"
-msgstr "Impossibile scrivere il mhod del tipo %d\n"
-
-#: ../src/itdb_itunesdb.c:2522 ../src/itdb_itunesdb.c:2635
-msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+msgid "Music directory not found: '%s' (or similar)."
 msgstr ""
-"Database in memoria corrotto (track pointer == NULl). Esportazione "
-"interrotta."
 
-#: ../src/itdb_itunesdb.c:2678
-msgid "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#: ../src/itdb_itunesdb.c:2667
+#, c-format
+msgid "Control directory not found: '%s' (or similar)."
 msgstr ""
-"Database in memoria corrotto (playlist pointer == NULL). Esportazione "
-"Interrotta."
 
-#: ../src/itdb_itunesdb.c:2718
+#: ../src/itdb_itunesdb.c:2740
 #, c-format
-msgid "Opening of '%s' for writing failed."
-msgstr "Apertura di '%s' in scrittura fallita."
+msgid "File not found: '%s'."
+msgstr "file non trovato: '%s'."
 
-#: ../src/itdb_itunesdb.c:2729
+#: ../src/itdb_itunesdb.c:3542
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "Scrittura verso '%s' fallita."
+msgid "Cannot write mhod of type %d\n"
+msgstr "Impossibile scrivere il mhod del tipo %d\n"
 
-#: ../src/itdb_itunesdb.c:2740
+#: ../src/itdb_itunesdb.c:4098
+#, fuzzy, c-format
+msgid "Opening of '%s' for writing failed (%s)."
+msgstr "Apertura di '%s' in scrittura fallita."
+
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
 #, c-format
 msgid "Writing to '%s' failed (%s)."
 msgstr "Scrittura verso '%s' falita (%s)."
 
-#: ../src/itdb_itunesdb.c:2881 ../src/itdb_itunesdb.c:3052
-#: ../src/itdb_itunesdb.c:3245 ../src/itdb_itunesdb.c:3451
-#, c-format
-msgid "Path not found: '%s'."
+#: ../src/itdb_itunesdb.c:4470
+#, fuzzy, c-format
+msgid "Path not found: '%s' (or similar)."
 msgstr "Percorso non trovato: '%s'."
 
-#: ../src/itdb_itunesdb.c:3265
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "Errore nella rinominazione da '%s' a '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3282
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
 msgstr "Errore nella rimozione di '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3426
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
 msgstr "Nessuna directory 'F..' trovata in '%s'"
 
-#: ../src/itdb_itunesdb.c:3589
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "Percorso non trovato: '%s'."
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
 msgstr "Errore nell'apertura in lettura di '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3600
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
 msgstr "Errore nell'apertura in scrittura di '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3617
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
 msgstr "Errore nella lettura da '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3633
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
 msgstr "Errore nella scrittura verso '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3646 ../src/itdb_itunesdb.c:3656
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "Errore nella chiusura di '%s' (%s)."
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr ""
+
+#: ../src/itdb_photoalbum.c:25
+#, fuzzy, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "Percorso non trovato: '%s'."
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
 msgstr "Azione sconosciuta (%d) nella playlist intelligente verrà ignorata.\n"
+
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr ""
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:133
+#, fuzzy, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "Errore nella rimozione di '%s' (%s)."
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr ""
+
+#: ../tests/test-photos.c:148
+#, fuzzy, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "Errore nella rinominazione da '%s' a '%s' (%s)."
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+
+#~ msgid "Writing to '%s' failed."
+#~ msgstr "Scrittura verso '%s' fallita."
+
+#~ msgid "Did not find SLst hunk as expected. Trying to continue.\n"
+#~ msgstr ""
+#~ "Impossibile trovare hunk SLst come ci si aspettava. Si prova a "
+#~ "continuare.\n"
+
+#~ msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
+#~ msgstr ""
+#~ "Database in memoria corrotto (track pointer == NULl). Esportazione "
+#~ "interrotta."
+
+#~ msgid ""
+#~ "Database in memory corrupt (playlist pointer == NULL). Aborting export."
+#~ msgstr ""
+#~ "Database in memoria corrotto (playlist pointer == NULL). Esportazione "
+#~ "Interrotta."

Deleted: libgpod/branches/upstream/current/po/ja.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/ja.po
===================================================================
--- libgpod/branches/upstream/current/po/ja.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/ja.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: gtkpod 0.40\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2006-02-11 08:51+0900\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
 "PO-Revision-Date: 2006-02-14 16:48+0900\n"
 "Last-Translator: Kentaro Fukuchi <fukuchi at users.sourceforge.net>\n"
 "Language-Team: n/a\n"
@@ -16,39 +16,205 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
 
-#: ../src/itdb_itunesdb.c:358
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr ""
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:387
+#, fuzzy, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó: '%s'"
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr ""
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr ""
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr ""
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr ""
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr ""
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr ""
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr ""
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr ""
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr ""
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+msgid "Nano (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:189
+msgid "Nano (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:190
+msgid "Nano (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:191
+msgid "Nano (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:203
+msgid "Sixth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr ""
+
+#: ../src/itdb_device.c:449
+#, fuzzy, c-format
+msgid "Could not open '%s' for writing."
+msgstr "'%s' ¤ò½ñ¤­¹þ¤ßÍѤ˳«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£(%s)"
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
 msgstr "ÉÔÀµ¤Ê¥·¡¼¥¯: '%3$s', ¥ª¥Õ¥»¥Ã¥È %1$ld, Ťµ (%2$ld)"
 
-#: ../src/itdb_itunesdb.c:604
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
 msgstr "ºÆÀ¸²ó¿ô¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó: '%s' (mhdp ¥Ø¥Ã¥À¤¬Ìµ¤¤)"
 
-#: ../src/itdb_itunesdb.c:618
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
 msgstr "ºÆÀ¸²ó¿ô¥Õ¥¡¥¤¥ë ('%s'): ¥Ø¥Ã¥À¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó¡£(%d<96)"
 
-#: ../src/itdb_itunesdb.c:631
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
 msgstr "ºÆÀ¸²ó¿ô¥Õ¥¡¥¤¥ë ('%s'): ¥¨¥ó¥È¥ê¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó¡£(%d<12)"
 
-#: ../src/itdb_itunesdb.c:709
+#: ../src/itdb_itunesdb.c:931
 #, c-format
 msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
 msgstr "iTunesStats ¥Õ¥¡¥¤¥ë ('%s'): ¥¨¥ó¥È¥ê¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó¡£(%d<18)"
 
-#: ../src/itdb_itunesdb.c:986
+#: ../src/itdb_itunesdb.c:1250
 #, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
 msgstr ""
 "iTunesDB ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: MHOD ¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£(¥Õ¥¡¥¤¥ë '%2$s', ¥ª¥Õ¥»¥Ã¥È "
 "%1$ld)"
 
-#: ../src/itdb_itunesdb.c:1128
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
@@ -57,14 +223,14 @@
 "¥¹¥Þ¡¼¥È¥×¥ì¥¤¥ê¥¹¥È¤Î¥ë¡¼¥ë¤ÎŤµ (%d) ¤¬´üÂÔ¤µ¤ì¤ëŤµ¤È°Û¤Ê¤ê¤Þ¤¹¡£½èÍý¤ò"
 "³¤±¤Þ¤¹¡£\n"
 
-#: ../src/itdb_itunesdb.c:1160
+#: ../src/itdb_itunesdb.c:1439
 #, c-format
 msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
 msgstr ""
 "iTunesDB ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: SLst ¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£(¥Õ¥¡¥¤¥ë '%2$s', ¥ª¥Õ¥»¥Ã¥È "
 "%1$ld)"
 
-#: ../src/itdb_itunesdb.c:1173
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
@@ -74,14 +240,14 @@
 "¤¹¡£\n"
 "\n"
 
-#: ../src/itdb_itunesdb.c:1235
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
 msgstr ""
 "iTunesDB ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: hunk ¤ÎŤµ¤¬ 0 ¤Ç¤¹¡£(¥Õ¥¡¥¤¥ë '%2$s', ¥ª¥Õ¥»¥Ã¥È %"
 "1$ld)"
 
-#: ../src/itdb_itunesdb.c:1248
+#: ../src/itdb_itunesdb.c:1527
 #, c-format
 msgid ""
 "iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
@@ -89,60 +255,62 @@
 "iTunesDB ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: %3$ld ¤Î°ÌÃ֤ˤ¢¤ë¥»¥¯¥·¥ç¥ó '%2$s' ¤ÎÃæ¤Ë¥»¥¯¥·¥ç"
 "¥ó '%1$s' ¤Ï¤¢¤ê¤Þ¤»¤ó¡£"
 
-#: ../src/itdb_itunesdb.c:1262
+#: ../src/itdb_itunesdb.c:1541
 #, c-format
 msgid ""
 "header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
 "'%s'."
-msgstr "'%1$s' ¤Î¥Ø¥Ã¥À¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó (%2$d < %3$d) (¥Õ¥¡¥¤¥ë '%5$s', ¥ª¥Õ¥»¥Ã¥È %4$ld)"
+msgstr ""
+"'%1$s' ¤Î¥Ø¥Ã¥À¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó (%2$d < %3$d) (¥Õ¥¡¥¤¥ë '%5$s', ¥ª¥Õ¥»¥Ã¥È "
+"%4$ld)"
 
-#: ../src/itdb_itunesdb.c:1343
+#: ../src/itdb_itunesdb.c:1626
 #, c-format
 msgid "Not a iTunesDB: '%s' (missing mhdb header)."
 msgstr "iTunesDB ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó: '%s' (mhdb ¥Ø¥Ã¥À¤¬Ìµ¤¤)"
 
-#: ../src/itdb_itunesdb.c:1359
+#: ../src/itdb_itunesdb.c:1643
 #, c-format
 msgid ""
 "iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
 "Aborting."
 msgstr "iTunesDB ('%s'): mhsd ¤Î¥Ø¥Ã¥À¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó(%d<32)¡£Ãæ»ß¤·¤Þ¤¹¡£"
 
-#: ../src/itdb_itunesdb.c:1380
+#: ../src/itdb_itunesdb.c:1664
 #, c-format
 msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
 msgstr "iTunesDB '%s' ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: mhsd ¤¬ %ld ¤Î°ÌÃ֤˸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£"
 
-#: ../src/itdb_itunesdb.c:1497
+#: ../src/itdb_itunesdb.c:1781
 #, c-format
 msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
 msgstr ""
 "mhip ¤ÎÃæ¤Î MHOD ¤Î¿ô¤¬¿©¤¤°ã¤Ã¤Æ¤¤¤Þ¤¹¡£(¥Õ¥¡¥¤¥ë '%2$s', ¥ª¥Õ¥»¥Ã¥È %1$ld)"
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:1799
 #, c-format
 msgid "Itdb_Track ID '%d' not found.\n"
 msgstr "Itdb_Track ID '%d' ¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£\n"
 
-#: ../src/itdb_itunesdb.c:1669
+#: ../src/itdb_itunesdb.c:1956
 #, c-format
 msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
 msgstr ""
 "mhyp ¤ÎÃæ¤Î MHOD ¤Î¿ô¤¬¿©¤¤°ã¤Ã¤Æ¤¤¤Þ¤¹¡£(¥Õ¥¡¥¤¥ë '%2$s', ¥ª¥Õ¥»¥Ã¥È %1$ld)"
 
-#: ../src/itdb_itunesdb.c:1679
+#: ../src/itdb_itunesdb.c:1966
 msgid "Master-PL"
 msgstr ""
 
-#: ../src/itdb_itunesdb.c:1683
+#: ../src/itdb_itunesdb.c:1970
 msgid "Podcasts"
 msgstr ""
 
-#: ../src/itdb_itunesdb.c:1685
+#: ../src/itdb_itunesdb.c:1972
 msgid "Playlist"
 msgstr "¥×¥ì¥¤¥ê¥¹¥È"
 
-#: ../src/itdb_itunesdb.c:1707
+#: ../src/itdb_itunesdb.c:1994
 #, c-format
 msgid ""
 "iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
@@ -151,39 +319,39 @@
 "iTunesDB ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: mhyp ¤ÎÃæ¤Î mhip ¥»¥¯¥·¥ç¥ó¤Î¿ô¤¬¿©¤¤°ã¤Ã¤Æ¤¤¤Þ¤¹¡£"
 "(¥Õ¥¡¥¤¥ë '%2$s', ¥ª¥Õ¥»¥Ã¥È %1$ld)"
 
-#: ../src/itdb_itunesdb.c:1981
+#: ../src/itdb_itunesdb.c:2279
 msgid "OTG Playlist"
 msgstr "OTG ¥×¥ì¥¤¥ê¥¹¥È"
 
-#: ../src/itdb_itunesdb.c:1995
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
 msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
 msgstr "OTG ¥×¥ì¥¤¥ê¥¹¥È¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó: '%s' (mhpo ¥Ø¥Ã¥À¤¬Ìµ¤¤)"
 
-#: ../src/itdb_itunesdb.c:2009
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
 msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
 msgstr "OTG ¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë ('%s'): ¥Ø¥Ã¥À¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó¡£(%d<20)"
 
-#: ../src/itdb_itunesdb.c:2021
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
 msgid ""
 "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
 msgstr "OTG ¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë ('%s'): ¥¨¥ó¥È¥ê¤ÎŤµ¤¬Â­¤ê¤Þ¤»¤ó¡£(%d<4)"
 
-#: ../src/itdb_itunesdb.c:2056
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
 msgid "OTG playlist file '%s': reference to non-existent track (%d)."
 msgstr ""
 "OTG ¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë ('%s'): ¸ºß¤·¤Ê¤¤¶ÊÈÖ¹æ (%d) ¤Ø¤Î»²¾È¤¬¤¢¤ê¤Þ¤¹¡£"
 
-#: ../src/itdb_itunesdb.c:2101
+#: ../src/itdb_itunesdb.c:2403
 #, c-format
 msgid "OTG Playlist %d"
 msgstr "OTG ¥×¥ì¥¤¥ê¥¹¥È %d"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:2169
+#: ../src/itdb_itunesdb.c:2471
 msgid ""
 "iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
 "continue.\n"
@@ -192,7 +360,7 @@
 "¤¹¡£\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:2232
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
@@ -200,7 +368,7 @@
 "iTunesDB ¤¬Â¿Ê¬²õ¤ì¤Æ¤¤¤Þ¤¹: ¥×¥ì¥¤¥ê¥¹¥È¤Î¿ô (mhyp ¤Î¿ô) ¤¬¿©¤¤°ã¤Ã¤Æ¤¤¤Þ"
 "¤¹¡£½èÍý¤ò³¤±¤Þ¤¹¡£\n"
 
-#: ../src/itdb_itunesdb.c:2279
+#: ../src/itdb_itunesdb.c:2581
 #, c-format
 msgid ""
 "iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
@@ -209,7 +377,7 @@
 "iTunesDB '%s' ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: ¶Ê¥ê¥¹¥È¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£(mhsd ¥¿¥¤¥× 1 ¥»¥¯"
 "¥·¥ç¥ó¤¬¸«ÉÕ¤«¤é¤Ê¤¤)"
 
-#: ../src/itdb_itunesdb.c:2297
+#: ../src/itdb_itunesdb.c:2610
 #, c-format
 msgid ""
 "iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
@@ -218,79 +386,168 @@
 "iTunesDB '%s' ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹: ¥×¥ì¥¤¥ê¥¹¥È¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£(mhsd ¥¿¥¤¥× 2 "
 "¤È ¥¿¥¤¥× 3 ¤Î¥»¥¯¥·¥ç¥ó¤¬¸«ÉÕ¤«¤é¤Ê¤¤)"
 
-#: ../src/itdb_itunesdb.c:2356
+#: ../src/itdb_itunesdb.c:2632
 #, c-format
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:2649
+#, c-format
+msgid "Music directory not found: '%s' (or similar)."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:2667
+#, c-format
+msgid "Control directory not found: '%s' (or similar)."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:2740
+#, c-format
 msgid "File not found: '%s'."
 msgstr "¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó: '%s'"
 
-#: ../src/itdb_itunesdb.c:2939
+#: ../src/itdb_itunesdb.c:3542
 #, c-format
 msgid "Cannot write mhod of type %d\n"
 msgstr "mhod ¥¿¥¤¥× %d ¤¬½ñ¤­¹þ¤á¤Þ¤»¤ó¡£\n"
 
-#: ../src/itdb_itunesdb.c:3485
-#, c-format
-msgid "Opening of '%s' for writing failed."
+#: ../src/itdb_itunesdb.c:4098
+#, fuzzy, c-format
+msgid "Opening of '%s' for writing failed (%s)."
 msgstr "'%s' ¤ò½ñ¤­¹þ¤ßÍѤ˳«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£"
 
-#: ../src/itdb_itunesdb.c:3496
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "'%s'¤Î½ñ¤­¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£"
-
-#: ../src/itdb_itunesdb.c:3507
-#, c-format
 msgid "Writing to '%s' failed (%s)."
 msgstr "'%s'¤Î½ñ¤­¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:3679 ../src/itdb_itunesdb.c:3841
-#: ../src/itdb_itunesdb.c:4029 ../src/itdb_itunesdb.c:4265
-#, c-format
-msgid "Path not found: '%s'."
+#: ../src/itdb_itunesdb.c:4470
+#, fuzzy, c-format
+msgid "Path not found: '%s' (or similar)."
 msgstr "¥Ñ¥¹¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó: '%s'"
 
-#: ../src/itdb_itunesdb.c:4050
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "'%s' ¤ò '%s' ¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:4067 ../src/itdb_itunesdb.c:4084
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
 msgstr "'%s' ¤Îºï½üÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:4240
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
 msgstr "'F..' ¥Ç¥£¥ì¥¯¥È¥ê¤¬ '%s' ¤ÎÃæ¤Ë¤¢¤ê¤Þ¤»¤ó¡£"
 
-#: ../src/itdb_itunesdb.c:4403
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "¥Ñ¥¹¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó: '%s'"
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
 msgstr "'%s' ¤òÆɤ߹þ¤ßÍѤ˳«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:4414
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
 msgstr "'%s' ¤ò½ñ¤­¹þ¤ßÍѤ˳«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:4431
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
 msgstr "'%s' ¤ÎÆɤ߹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:4447
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
 msgstr "'%s' ¤Î½ñ¤­¹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£(%s)"
 
-#: ../src/itdb_itunesdb.c:4460 ../src/itdb_itunesdb.c:4470
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "'%s' ¤òÊĤ¸¤ëºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£(%s)"
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr ""
+
+#: ../src/itdb_photoalbum.c:25
+#, fuzzy, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "¥Ñ¥¹¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó: '%s'"
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
 msgstr "¥¹¥Þ¡¼¥È¥×¥ì¥¤¥ê¥¹¥ÈÆâ¤Î̤ÃΤΥ¢¥¯¥·¥ç¥ó (%d) ¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£\n"
+
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr ""
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:133
+#, fuzzy, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "'%s' ¤Îºï½üÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£(%s)"
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr ""
+
+#: ../tests/test-photos.c:148
+#, fuzzy, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "'%s' ¤ò '%s' ¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£(%s)"
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+
+#~ msgid "Writing to '%s' failed."
+#~ msgstr "'%s'¤Î½ñ¤­¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£"

Deleted: libgpod/branches/upstream/current/po/sv.gmo
===================================================================
(Binary files differ)

Modified: libgpod/branches/upstream/current/po/sv.po
===================================================================
--- libgpod/branches/upstream/current/po/sv.po	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/po/sv.po	2006-09-29 21:50:32 UTC (rev 134)
@@ -6,42 +6,217 @@
 msgstr ""
 "Project-Id-Version: sv\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-09-14 21:51+0900\n"
-"PO-Revision-Date: 2005-06-22 17:56+0200\n"
+"POT-Creation-Date: 2006-09-24 18:02+0900\n"
+"PO-Revision-Date: 2006-05-26 00:41+0900\n"
 "Last-Translator: Stefan Asserhäll <stefan.asserhall at comhem.se>\n"
 "Language-Team: Svenska <sv at li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms:  nplurals=2; plural=(n != 1);\n"
-"X-Generator: KBabel 1.11\n"
+"X-Generator: KBabel 1.11.2\n"
 
-#: ../src/itdb_itunesdb.c:313
+#: ../src/db-artwork-parser.c:133
 #, c-format
+msgid "Unexpected mhod3 string type: %d\n"
+msgstr "Oväntad mhod3 strängtyp; %d\n"
+
+#: ../src/db-artwork-parser.c:360
+#, c-format
+msgid "iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"
+msgstr ""
+"Grafikstorlekar i iTunes databas och grafikdatabas inte konseventa (%d + %d !"
+"= %d)"
+
+#: ../src/db-artwork-parser.c:515
+#, c-format
+msgid "Unexpected mhsd index: %d\n"
+msgstr "Oväntat mhsd index: %d\n"
+
+#: ../src/db-image-parser.c:118
+#, c-format
+msgid "Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"
+msgstr ""
+
+#: ../src/itdb_artwork.c:306
+#, c-format
+msgid "Illegal filename: '%s'.\n"
+msgstr "Ogiltigt filnamn: '%s'.\n"
+
+#: ../src/itdb_artwork.c:312
+msgid "Mountpoint not set.\n"
+msgstr "Monteringsplats inte inställd.\n"
+
+#: ../src/itdb_artwork.c:387
+#, c-format
+msgid "Could not find on iPod: '%s'\n"
+msgstr "Kunde inte hitta på iPod: '%s'\n"
+
+#: ../src/itdb_artwork.c:587
+#, c-format
+msgid ""
+"Unable to retreive thumbnail (appears to be on iPod, but no image info "
+"available): type: %d, filename: '%s'\n"
+msgstr ""
+"Kunde inte hämta miniatyrbild (verkar finnas på iPod, men någon "
+"bildinformation är inte tillgänglig): typ: %d, filnamne: '%s'\n"
+
+#: ../src/itdb_device.c:170
+msgid "Invalid"
+msgstr ""
+
+#: ../src/itdb_device.c:171 ../src/itdb_device.c:197
+msgid "Unknown"
+msgstr ""
+
+#: ../src/itdb_device.c:172
+msgid "Color"
+msgstr ""
+
+#: ../src/itdb_device.c:173
+msgid "Color U2"
+msgstr ""
+
+#: ../src/itdb_device.c:174
+msgid "Grayscale"
+msgstr ""
+
+#: ../src/itdb_device.c:175
+msgid "Grayscale U2"
+msgstr ""
+
+#: ../src/itdb_device.c:176
+msgid "Mini (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:177
+msgid "Mini (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:178
+msgid "Mini (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:179
+msgid "Mini (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:180
+msgid "Mini (Gold)"
+msgstr ""
+
+#: ../src/itdb_device.c:181
+msgid "Shuffle"
+msgstr ""
+
+#: ../src/itdb_device.c:182
+msgid "Nano (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:183
+msgid "Nano (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:184
+msgid "Video (White)"
+msgstr ""
+
+#: ../src/itdb_device.c:185
+msgid "Video (Black)"
+msgstr ""
+
+#: ../src/itdb_device.c:186
+msgid "Mobile (1)"
+msgstr ""
+
+#: ../src/itdb_device.c:187
+msgid "Video U2"
+msgstr ""
+
+#: ../src/itdb_device.c:188
+msgid "Nano (Silver)"
+msgstr ""
+
+#: ../src/itdb_device.c:189
+msgid "Nano (Blue)"
+msgstr ""
+
+#: ../src/itdb_device.c:190
+msgid "Nano (Green)"
+msgstr ""
+
+#: ../src/itdb_device.c:191
+msgid "Nano (Pink)"
+msgstr ""
+
+#: ../src/itdb_device.c:198
+msgid "First Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:199
+msgid "Second Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:200
+msgid "Third Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:201
+msgid "Fourth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:202
+msgid "Fifth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:203
+msgid "Sixth Generation"
+msgstr ""
+
+#: ../src/itdb_device.c:204
+msgid "Mobile Phone"
+msgstr ""
+
+#: ../src/itdb_device.c:449
+#, fuzzy, c-format
+msgid "Could not open '%s' for writing."
+msgstr "Fel när '%s' skulle öppnas för skrivning (%s)."
+
+#: ../src/itdb_device.c:458
+msgid "Device directory does not exist."
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:371
+#, c-format
 msgid "Illegal seek to offset %ld (length %ld) in file '%s'."
 msgstr "Ogiltig sökning till position %ld (längd %ld) i filen '%s'."
 
-#: ../src/itdb_itunesdb.c:521
+#: ../src/itdb_itunesdb.c:825
 #, c-format
 msgid "Not a Play Counts file: '%s' (missing mhdp header)."
 msgstr "Inte en uppspelningsdatafil: '%s' (saknar mhdp-huvud)."
 
-#: ../src/itdb_itunesdb.c:535
+#: ../src/itdb_itunesdb.c:840
 #, c-format
 msgid "Play Counts file ('%s'): header length smaller than expected (%d<96)."
 msgstr "Uppspelningsdatafil ('%s'): Huvudlängd mindre än väntat (%d < 96)"
 
-#: ../src/itdb_itunesdb.c:548
+#: ../src/itdb_itunesdb.c:853
 #, c-format
 msgid "Play Counts file ('%s'): entry length smaller than expected (%d<12)."
 msgstr "Uppspelningsdatafil ('%s'): Postlängd mindre än väntat (%d < 12)"
 
-#: ../src/itdb_itunesdb.c:803
+#: ../src/itdb_itunesdb.c:931
 #, c-format
+msgid "iTunesStats file ('%s'): entry length smaller than expected (%d<18)."
+msgstr "iTunes statistikfil ('%s'): Postlängd mindre än väntat (%d < 18)"
+
+#: ../src/itdb_itunesdb.c:1250
+#, c-format
 msgid "iTunesDB corrupt: no MHOD at offset %ld in file '%s'."
 msgstr "iTunes databas skadad: Ingen MHOD på position %ld i filen '%s'."
 
-#: ../src/itdb_itunesdb.c:923
+#: ../src/itdb_itunesdb.c:1407
 #, c-format
 msgid ""
 "Length of smart playlist rule field (%d) not as expected. Trying to continue "
@@ -50,11 +225,12 @@
 "Regelfältets längd (%d) i den smarta spellistan är inte den förväntade. "
 "Försöker fortsätta ändå.\n"
 
-#: ../src/itdb_itunesdb.c:966
-msgid "Did not find SLst hunk as expected. Trying to continue.\n"
-msgstr "Hittade inte SLst data som förväntat. Försöker fortsätta ändå.\n"
+#: ../src/itdb_itunesdb.c:1439
+#, c-format
+msgid "iTunesDB corrupt: no SLst at offset %ld in file '%s'."
+msgstr "iTunes databas skadad: Ingen SLst på position %ld i filen '%s'."
 
-#: ../src/itdb_itunesdb.c:972
+#: ../src/itdb_itunesdb.c:1452
 #, c-format
 msgid ""
 "Encountered unknown MHOD type (%d) while parsing the iTunesDB. Ignoring.\n"
@@ -64,92 +240,124 @@
 "den.\n"
 "\n"
 
-#: ../src/itdb_itunesdb.c:1053 ../src/itdb_itunesdb.c:1744
-#: ../src/itdb_itunesdb.c:1779
+#: ../src/itdb_itunesdb.c:1514
 #, c-format
 msgid "iTunesDB corrupt: hunk length 0 for hunk at %ld in file '%s'."
 msgstr ""
 "iTunes databas skadad: Datalängd 0 för data på position %ld i filen '%s'."
 
-#: ../src/itdb_itunesdb.c:1148
+#: ../src/itdb_itunesdb.c:1527
+#, c-format
+msgid ""
+"iTunesDB corrupt: no section '%s' found in section '%s' starting at %ld."
+msgstr ""
+"iTunes databas skadad: NÃ¥gon sektion '%s' hittades inte i sektion '%s' med "
+"början på %ld."
+
+#: ../src/itdb_itunesdb.c:1541
+#, c-format
+msgid ""
+"header length of '%s' smaller than expected (%d < %d) at offset %ld in file "
+"'%s'."
+msgstr ""
+"Huvudlängd för '%s' mindre än väntat (%d < %d) på position %ld i filen '%s'."
+
+#: ../src/itdb_itunesdb.c:1626
+#, c-format
+msgid "Not a iTunesDB: '%s' (missing mhdb header)."
+msgstr "Inte en iTunes databas: '%s' (saknar mhdb-huvud)."
+
+#: ../src/itdb_itunesdb.c:1643
+#, c-format
+msgid ""
+"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%d<32). "
+"Aborting."
+msgstr ""
+"iTunes databas ('%s'): Huvudlängd för mhsd-data mindre än väntat (%d < 32). "
+"Avbryter."
+
+#: ../src/itdb_itunesdb.c:1664
+#, c-format
+msgid "iTunesDB '%s' corrupt: mhsd expected at %ld."
+msgstr "iTunes databas '%s' skadad: Förväntade mhsd på position %ld."
+
+#: ../src/itdb_itunesdb.c:1781
+#, c-format
+msgid "Number of MHODs in mhip at %ld inconsistent in file '%s'."
+msgstr "Antal MHOD i mhip på position %ld inte konsekvent i filen '%s'."
+
+#: ../src/itdb_itunesdb.c:1799
+#, c-format
+msgid "Itdb_Track ID '%d' not found.\n"
+msgstr "ITunes databas spår-id '%d' hittades inte.\n"
+
+#: ../src/itdb_itunesdb.c:1956
+#, c-format
+msgid "Number of MHODs in mhyp at %ld inconsistent in file '%s'."
+msgstr "Antal MHOD i mhyp på position %ld inte konsekvent i filen '%s'."
+
+#: ../src/itdb_itunesdb.c:1966
 msgid "Master-PL"
 msgstr "Huvudspellista"
 
-#: ../src/itdb_itunesdb.c:1150
+#: ../src/itdb_itunesdb.c:1970
+msgid "Podcasts"
+msgstr "Podradiosändningar"
+
+#: ../src/itdb_itunesdb.c:1972
 msgid "Playlist"
 msgstr "Spellista"
 
-#: ../src/itdb_itunesdb.c:1175
+#: ../src/itdb_itunesdb.c:1994
 #, c-format
-msgid "iTunesDB corrupt: found mhyp at %ld in file '%s'."
-msgstr "iTunes databas skadad: Hittade mhyp på position %ld i filen '%s'."
+msgid ""
+"iTunesDB corrupt: number of mhip sections inconsistent in mhyp starting at %"
+"ld in file '%s'."
+msgstr ""
+"iTunes databas skadad: Antal mhip sektioner inte konsekvent i mhyp med "
+"början på %ld i filen '%s'."
 
-#: ../src/itdb_itunesdb.c:1223
-#, c-format
-msgid "Itdb_Track ID '%d' not found.\n"
-msgstr "ITunes databas spår-id '%d' hittades inte.\n"
-
-#: ../src/itdb_itunesdb.c:1487
+#: ../src/itdb_itunesdb.c:2279
 msgid "OTG Playlist"
 msgstr "OTG-spellista"
 
-#: ../src/itdb_itunesdb.c:1501
+#: ../src/itdb_itunesdb.c:2297
 #, c-format
 msgid "Not a OTG playlist file: '%s' (missing mhpo header)."
 msgstr "Inte en OTG-spellistefil: '%s' (saknar mhpo-huvud)."
 
-#: ../src/itdb_itunesdb.c:1515
+#: ../src/itdb_itunesdb.c:2311
 #, c-format
 msgid "OTG playlist file ('%s'): header length smaller than expected (%d<20)."
 msgstr "OTG-spellistefil ('%s'): Huvudlängd mindre än väntat (%d < 20)"
 
-#: ../src/itdb_itunesdb.c:1527
+#: ../src/itdb_itunesdb.c:2323
 #, c-format
 msgid ""
 "OTG playlist file file ('%s'): entry length smaller than expected (%d<4)."
 msgstr "OTG-spellistefil ('%s'): Postlängd mindre än väntat (%d < 4)"
 
-#: ../src/itdb_itunesdb.c:1562
+#: ../src/itdb_itunesdb.c:2358
 #, c-format
 msgid "OTG playlist file '%s': reference to non-existent track (%d)."
 msgstr "OTG-spellistefil '%s': Referens till spår som inte finns (%d)."
 
-#: ../src/itdb_itunesdb.c:1607
+#: ../src/itdb_itunesdb.c:2403
 #, c-format
 msgid "OTG Playlist %d"
 msgstr "OTG-spellista %d"
 
-#: ../src/itdb_itunesdb.c:1650
-#, c-format
-msgid "Not a iTunesDB: '%s' (missing mhdb header)."
-msgstr "Inte en iTunes databas: '%s' (saknar mhdb-huvud)."
-
-#: ../src/itdb_itunesdb.c:1666
-#, c-format
-msgid ""
-"iTunesDB ('%s'): header length of mhsd hunk smaller than expected (%ld<32). "
-"Aborting."
-msgstr ""
-"iTunes databas (%s): Huvudlängd för mhsd-data mindre än väntat (%ld < 32). "
-"Avbryter."
-
-#: ../src/itdb_itunesdb.c:1698
-#, c-format
-msgid "iTunesDB '%s' corrupt: already found two playlist mhsds -- giving up."
-msgstr ""
-"iTunes databas '%s' skadad: Två mhsd för spellistor redan hittade. Ger upp."
-
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1759
+#: ../src/itdb_itunesdb.c:2471
 msgid ""
-"iTunesDB possibly corrupt: number of tracks (mhit hunks) inconsistent. "
-"Trying to continue.\n"
+"iTunesDB corrupt: number of tracks (mhit hunks) inconsistent. Trying to "
+"continue.\n"
 msgstr ""
-"iTunes databas möjligen skadad: Antal spår (mhit-data) inte konsekvent. "
-"Försöker fortsätta.\n"
+"iTunes databas skadad: Antal spår (mhit-data) inte konsekvent. Försöker "
+"fortsätta.\n"
 
 #. this should not be -- issue warning
-#: ../src/itdb_itunesdb.c:1841
+#: ../src/itdb_itunesdb.c:2534
 msgid ""
 "iTunesDB possibly corrupt: number of playlists (mhyp hunks) inconsistent. "
 "Trying to continue.\n"
@@ -157,87 +365,186 @@
 "iTunes databas möjligen skadad: Antal spellistor (mhyp-data) inte "
 "konsekvent. Försöker fortsätta.\n"
 
-#: ../src/itdb_itunesdb.c:1879
+#: ../src/itdb_itunesdb.c:2581
 #, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find tracklist (no mhsd type 1 section "
+"found)"
+msgstr ""
+"iTunes databas '%s' skadad: Kunde inte hitta spårlista (någon mhsd av typ 1 "
+"hittades inte)"
+
+#: ../src/itdb_itunesdb.c:2610
+#, c-format
+msgid ""
+"iTunesDB '%s' corrupt: Could not find playlists (no mhsd type 2 or type 3 "
+"sections found)"
+msgstr ""
+"iTunes databas '%s' skadad: Kunde inte hitta spellistor (någon mhsd av typ 2 "
+"eller typ 3 hittades)"
+
+#: ../src/itdb_itunesdb.c:2632
+#, c-format
+msgid "iTunes directory not found: '%s' (or similar)."
+msgstr "iTunes katalog hittades inte: '%s' (eller liknande)."
+
+#: ../src/itdb_itunesdb.c:2649
+#, c-format
+msgid "Music directory not found: '%s' (or similar)."
+msgstr "Musikkatalog hittades inte: '%s' (eller liknande)."
+
+#: ../src/itdb_itunesdb.c:2667
+#, c-format
+msgid "Control directory not found: '%s' (or similar)."
+msgstr "Styrkatalog hittades inte: '%s' (eller liknande)."
+
+#: ../src/itdb_itunesdb.c:2740
+#, c-format
 msgid "File not found: '%s'."
 msgstr "Filen hittades inte: '%s'."
 
-#: ../src/itdb_itunesdb.c:2396
+#: ../src/itdb_itunesdb.c:3542
 #, c-format
 msgid "Cannot write mhod of type %d\n"
 msgstr "Kan inte skriva mhod av typen %d\n"
 
-#: ../src/itdb_itunesdb.c:2522 ../src/itdb_itunesdb.c:2635
-msgid "Database in memory corrupt (track pointer == NULL). Aborting export."
-msgstr "Databas i minnet skadad (spårpekare == NULL). Avbryter export."
-
-#: ../src/itdb_itunesdb.c:2678
-msgid "Database in memory corrupt (playlist pointer == NULL). Aborting export."
-msgstr "Databas i minnet skadad (spårlistepekare == NULL). Avbryter export."
-
-#: ../src/itdb_itunesdb.c:2718
-#, c-format
-msgid "Opening of '%s' for writing failed."
+#: ../src/itdb_itunesdb.c:4098
+#, fuzzy, c-format
+msgid "Opening of '%s' for writing failed (%s)."
 msgstr "Fel när '%s' skulle öppnas för skrivning."
 
-#: ../src/itdb_itunesdb.c:2729
+#: ../src/itdb_itunesdb.c:4109 ../src/itdb_itunesdb.c:4120
 #, c-format
-msgid "Writing to '%s' failed."
-msgstr "Fel vid skrivning till '%s'."
-
-#: ../src/itdb_itunesdb.c:2740
-#, c-format
 msgid "Writing to '%s' failed (%s)."
 msgstr "Fel vid skrivning till '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:2881 ../src/itdb_itunesdb.c:3052
-#: ../src/itdb_itunesdb.c:3245 ../src/itdb_itunesdb.c:3451
+#: ../src/itdb_itunesdb.c:4470
 #, c-format
-msgid "Path not found: '%s'."
-msgstr "Sökväg hittades inte: '%s'."
+msgid "Path not found: '%s' (or similar)."
+msgstr "Sökväg hittades inte: '%s' (eller liknande)."
 
-#: ../src/itdb_itunesdb.c:3265
+#: ../src/itdb_itunesdb.c:4689
 #, c-format
 msgid "Error renaming '%s' to '%s' (%s)."
 msgstr "Fel vid byte av namn på '%s' till '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3282
+#: ../src/itdb_itunesdb.c:4706 ../src/itdb_itunesdb.c:4723
 #, c-format
 msgid "Error removing '%s' (%s)."
 msgstr "Fel vid borttagning av '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3426
+#: ../src/itdb_itunesdb.c:4909
 #, c-format
 msgid "No 'F..' directories found in '%s'."
-msgstr ""
+msgstr "NÃ¥gra 'F..'-kataloger hittades inte i '%s'."
 
-#: ../src/itdb_itunesdb.c:3589
+#: ../src/itdb_itunesdb.c:4937
 #, c-format
+msgid "Path not found: '%s'."
+msgstr "Sökväg hittades inte: '%s'."
+
+#: ../src/itdb_itunesdb.c:5096
+#, c-format
 msgid "Error opening '%s' for reading (%s)."
 msgstr "Fel när '%s' skulle öppnas för läsning (%s)."
 
-#: ../src/itdb_itunesdb.c:3600
+#: ../src/itdb_itunesdb.c:5107
 #, c-format
 msgid "Error opening '%s' for writing (%s)."
 msgstr "Fel när '%s' skulle öppnas för skrivning (%s)."
 
-#: ../src/itdb_itunesdb.c:3617
+#: ../src/itdb_itunesdb.c:5124
 #, c-format
 msgid "Error while reading from '%s' (%s)."
 msgstr "Fel vid läsning från '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3633
+#: ../src/itdb_itunesdb.c:5140
 #, c-format
 msgid "Error while writing to '%s' (%s)."
 msgstr "Fel vid skrivning till '%s' (%s)."
 
-#: ../src/itdb_itunesdb.c:3646 ../src/itdb_itunesdb.c:3656
+#: ../src/itdb_itunesdb.c:5153 ../src/itdb_itunesdb.c:5163
 #, c-format
 msgid "Error when closing '%s' (%s)."
 msgstr "Fel när '%s' skulle stängas (%s)."
 
+#: ../src/itdb_itunesdb.c:5526
+msgid "iPod"
+msgstr ""
+
+#: ../src/itdb_itunesdb.c:5919
+#, c-format
+msgid "Problem creating iPod directory or file: '%s'."
+msgstr ""
+
+#: ../src/itdb_photoalbum.c:25
+#, fuzzy, c-format
+msgid "Photos directory not found: '%s' (or similar)."
+msgstr "Styrkatalog hittades inte: '%s' (eller liknande)."
+
 #. New action!
-#: ../src/itdb_playlist.c:71
+#: ../src/itdb_playlist.c:78
 #, c-format
 msgid "Unknown action (%d) in smart playlist will be ignored.\n"
 msgstr "Okänd åtgärd (%d) i smart spellista kommer att ignoreras.\n"
+
+#: ../tests/test-photos.c:116
+msgid "Usage to add photos:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:117
+#, c-format
+msgid "%s <mountpoint> <albumname> <filename(s)>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:118
+msgid ""
+"albumname should be set to 'master' to add photos to the master photo album\n"
+msgstr ""
+
+#: ../tests/test-photos.c:119
+msgid "\n"
+msgstr ""
+
+#: ../tests/test-photos.c:120
+msgid "Usage to dump all photos to <output_dir>:\n"
+msgstr ""
+
+#: ../tests/test-photos.c:121
+#, c-format
+msgid "%s dump <mountpoint> <output_dir>\n"
+msgstr ""
+
+#: ../tests/test-photos.c:133
+#, fuzzy, c-format
+msgid "Error creating '%s' (mkdir)\n"
+msgstr "Fel vid borttagning av '%s' (%s)."
+
+#: ../tests/test-photos.c:139
+#, c-format
+msgid "Error: '%s' is not a directory\n"
+msgstr ""
+
+#: ../tests/test-photos.c:148
+#, fuzzy, c-format
+msgid "Error reading iPod photo database (%s).\n"
+msgstr "Fel vid byte av namn på '%s' till '%s' (%s)."
+
+#: ../tests/test-photos.c:154
+msgid "Error reading iPod photo database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:168
+#, c-format
+msgid ""
+"Error reading iPod photo database (%s).\n"
+"Will attempt to create a new database.\n"
+msgstr ""
+
+#: ../tests/test-photos.c:174
+msgid ""
+"Error reading iPod photo database, will attempt to create a new database\n"
+msgstr ""
+
+#~ msgid "Writing to '%s' failed."
+#~ msgstr "Fel vid skrivning till '%s'."

Modified: libgpod/branches/upstream/current/src/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/src/Makefile.am	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -6,6 +6,7 @@
 	itdb_itunesdb.c  \
 	itdb_playlist.c  \
 	itdb_private.h   \
+	itdb_photoalbum.c \
 	itdb_track.c     \
 	db-artwork-parser.c \
 	db-artwork-parser.h \
@@ -18,14 +19,13 @@
 	db-itunes-parser.h  \
 	db-artwork-writer.c \
 	ithumb-writer.c \
-	ipod-device.c \
-	ipod-device.h \
-	hal-common.c \
-	hal-common.h \
+	itdb_device.c \
+	itdb_device.h \
+	itdb_endianness.h \
 	glib-compat.h
 
 
-libgpod_la_headers = itdb.h ipod-device.h
+libgpod_la_headers = itdb.h
 libgpod_la_noinst_headers = itdb_private.h hal-common.h
 libgpod_la_LDFLAGS = -version-info $(LIBGPOD_CURRENT):$(LIBGPOD_REVISION):$(LIBGPOD_AGE) \
         -no-undefined

Modified: libgpod/branches/upstream/current/src/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/src/Makefile.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -38,6 +38,7 @@
 host_triplet = @host@
 ACLOCAL = @ACLOCAL@
 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
@@ -66,7 +67,8 @@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-EJECT_PATH = @EJECT_PATH@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
@@ -75,10 +77,16 @@
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
 GMOFILES = @GMOFILES@
 GMSGFMT = @GMSGFMT@
-HAL_CFLAGS = @HAL_CFLAGS@
-HAL_LIBS = @HAL_LIBS@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
 HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
 HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -101,6 +109,7 @@
 INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
 INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
 INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
 INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
 INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
 INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
@@ -141,22 +150,27 @@
 POSUB = @POSUB@
 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-UNMOUNT_PATH = @UNMOUNT_PATH@
-UNMOUNT_PATH_ALT = @UNMOUNT_PATH_ALT@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -171,23 +185,33 @@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
-mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
@@ -200,6 +224,7 @@
 	itdb_itunesdb.c  \
 	itdb_playlist.c  \
 	itdb_private.h   \
+	itdb_photoalbum.c \
 	itdb_track.c     \
 	db-artwork-parser.c \
 	db-artwork-parser.h \
@@ -212,14 +237,13 @@
 	db-itunes-parser.h  \
 	db-artwork-writer.c \
 	ithumb-writer.c \
-	ipod-device.c \
-	ipod-device.h \
-	hal-common.c \
-	hal-common.h \
+	itdb_device.c \
+	itdb_device.h \
+	itdb_endianness.h \
 	glib-compat.h
 
 
-libgpod_la_headers = itdb.h ipod-device.h
+libgpod_la_headers = itdb.h
 libgpod_la_noinst_headers = itdb_private.h hal-common.h
 libgpod_la_LDFLAGS = -version-info $(LIBGPOD_CURRENT):$(LIBGPOD_REVISION):$(LIBGPOD_AGE) \
         -no-undefined
@@ -238,10 +262,10 @@
 
 libgpod_la_LIBADD =
 am_libgpod_la_OBJECTS = itdb_artwork.lo itdb_itunesdb.lo \
-	itdb_playlist.lo itdb_track.lo db-artwork-parser.lo \
-	db-parse-context.lo db-artwork-debug.lo db-image-parser.lo \
-	db-artwork-writer.lo ithumb-writer.lo ipod-device.lo \
-	hal-common.lo
+	itdb_playlist.lo itdb_photoalbum.lo itdb_track.lo \
+	db-artwork-parser.lo db-parse-context.lo db-artwork-debug.lo \
+	db-image-parser.lo db-artwork-writer.lo ithumb-writer.lo \
+	itdb_device.lo
 libgpod_la_OBJECTS = $(am_libgpod_la_OBJECTS)
 
 DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
@@ -252,10 +276,10 @@
 @AMDEP_TRUE@	./$(DEPDIR)/db-artwork-writer.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/db-image-parser.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/db-parse-context.Plo \
- at AMDEP_TRUE@	./$(DEPDIR)/hal-common.Plo \
- at AMDEP_TRUE@	./$(DEPDIR)/ipod-device.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/itdb_artwork.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/itdb_device.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/itdb_itunesdb.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/itdb_photoalbum.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/itdb_playlist.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/itdb_track.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/ithumb-writer.Plo
@@ -324,10 +348,10 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/db-artwork-writer.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/db-image-parser.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/db-parse-context.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hal-common.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ipod-device.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_artwork.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_device.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_itunesdb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_photoalbum.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_playlist.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_track.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ithumb-writer.Plo at am__quote@

Modified: libgpod/branches/upstream/current/src/db-artwork-debug.c
===================================================================
--- libgpod/branches/upstream/current/src/db-artwork-debug.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-artwork-debug.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -24,6 +24,8 @@
 
 #include "db-artwork-debug.h"
 
+/* FIXME: endianness (whole file) */
+
 #ifdef DEBUG_ARTWORKDB
 G_GNUC_INTERNAL void
 dump_mhif (MhifHeader *mhif)
@@ -74,7 +76,8 @@
 	g_print ("MHOD [artwork type 1] (%d):\n", sizeof (MhodHeaderArtworkType1));
 	g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhod1->header_len));
 	g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhod1->total_len));
-	g_print ("\tType: %08x\n", GINT_FROM_LE (mhod1->type));
+	g_print ("\tPadding: %04x\n", GINT_FROM_LE (mhod1->padding));
+	g_print ("\tType: %04x\n", GINT_FROM_LE (mhod1->type));
 	g_print ("\tUnknown1: %08x\n", GINT_FROM_LE (mhod1->unknown1));
 	g_print ("\tUnknown2: %08x\n", GINT_FROM_LE (mhod1->unknown2));
 	g_print ("\tString length: %u\n", GINT_FROM_LE (mhod1->string_len));
@@ -85,14 +88,15 @@
 }
 
 G_GNUC_INTERNAL void 
-dump_mhod_type_3 (MhodHeaderArtworkType3 *mhod3) 
+dump_mhod_type_3 (ArtworkDB_MhodHeaderArtworkType3 *mhod3) 
 {
 	gchar *str;
 
-	g_print ("MHOD [artwork type 3] (%d):\n", sizeof (MhodHeaderArtworkType3));
+	g_print ("MHOD [artwork type 3] (%d):\n", sizeof (ArtworkDB_MhodHeaderArtworkType3));
 	g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhod3->header_len));
 	g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhod3->total_len));
-	g_print ("\tType: %08x\n", GINT_FROM_LE (mhod3->type));
+	g_print ("\tPadding: %04x\n", GINT_FROM_LE (mhod3->padding));
+	g_print ("\tType: %04x\n", GINT_FROM_LE (mhod3->type));
 	g_print ("\tUnknown1: %08x\n", GINT_FROM_LE (mhod3->unknown1));
 	g_print ("\tUnknown2: %08x\n", GINT_FROM_LE (mhod3->unknown2));
 	g_print ("\tString length: %u\n", GINT_FROM_LE (mhod3->string_len));
@@ -118,14 +122,15 @@
 		 GINT_FROM_LE (mhni->correlation_id));
 	g_print ("\tithmb offset: %u bytes\n", GINT_FROM_LE (mhni->ithmb_offset));
 	g_print ("\tImage size: %u bytes\n", GINT_FROM_LE (mhni->image_size));
-	g_print ("\tUnknown3: %08x\n", GINT_FROM_LE (mhni->unknown3));
+	g_print ("\tVertical padding: %d\n", GINT_FROM_LE (mhni->vertical_padding));
+	g_print ("\tHorizontal padding: %d\n", GINT_FROM_LE (mhni->horizontal_padding));
 	g_print ("\tImage dimensions: %ux%u\n", width, height);
 }
 
 G_GNUC_INTERNAL void
-dump_mhod (MhodHeader *mhod) 
+dump_mhod (ArtworkDB_MhodHeader *mhod) 
 {
-	g_print ("MHOD (%d):\n", sizeof (MhodHeader));
+	g_print ("MHOD (%d):\n", sizeof (ArtworkDB_MhodHeader));
 	g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhod->header_len));
 	g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhod->total_len));
 	g_print ("\tType: %08x\n", GINT_FROM_LE (mhod->type));
@@ -145,8 +150,8 @@
 	g_print ("\tUnknown4: %08x\n", GINT_FROM_LE (mhii->unknown4));
 	g_print ("\tUnknown5: %08x\n", GINT_FROM_LE (mhii->unknown5));
 	g_print ("\tUnknown6: %08x\n", GINT_FROM_LE (mhii->unknown6));
-	g_print ("\tUnknown7: %08x\n", GINT_FROM_LE (mhii->unknown7));
-	g_print ("\tUnknown8: %08x\n", GINT_FROM_LE (mhii->unknown8));
+	g_print ("\tOrig Date: %08x\n", GINT_FROM_LE (mhii->orig_date));
+	g_print ("\tDigitised Date: %08x\n", GINT_FROM_LE (mhii->digitised_date));
 	g_print ("\tImage size: %d bytes\n", GINT_FROM_LE (mhii->orig_img_size));
 }
 
@@ -164,13 +169,13 @@
 }
 
 G_GNUC_INTERNAL void
-dump_mhsd (MhsdHeader *mhsd)
+dump_mhsd (ArtworkDB_MhsdHeader *mhsd)
 {
-	g_print ("MHSD (%d):\n", sizeof (MhsdHeader));
+	g_print ("MHSD (%d):\n", sizeof (ArtworkDB_MhsdHeader));
 	g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhsd->header_len));
 	g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhsd->total_len));
-	g_print ("\tIndex: %d ", GINT_FROM_LE (mhsd->index));
-	switch (GINT_FROM_LE (mhsd->index)) {
+	g_print ("\tIndex: %d ", GINT16_FROM_LE (mhsd->index));
+	switch (GINT16_FROM_LE (mhsd->index)) {
 	case MHSD_IMAGE_LIST:
 		g_print ("(Image list)\n");
 		break;
@@ -197,10 +202,10 @@
 	g_print ("\tUnknown2: %08x\n", GINT_FROM_LE (mhfd->unknown2));
 	g_print ("\tNumber of children: %d\n", GINT_FROM_LE (mhfd->num_children));
 	g_print ("\tUnknown3: %08x\n", GINT_FROM_LE (mhfd->unknown3));
-	g_print ("\tUnknown4: %08x\n", GINT_FROM_LE (mhfd->unknown4));
+	g_print ("\tNext id: %08x\n", GINT_FROM_LE (mhfd->next_id));
 	g_print ("\tUnknown5: %016llx\n", GINT64_FROM_LE (mhfd->unknown5));
 	g_print ("\tUnknown6: %016llx\n", GINT64_FROM_LE (mhfd->unknown6));
-	g_print ("\tUnknown7: %08x\n", GINT_FROM_LE (mhfd->unknown7));
+	g_print ("\tunknown_flag1: %04x\n", GINT_FROM_LE (mhfd->unknown_flag1));
 	g_print ("\tUnknown8: %08x\n", GINT_FROM_LE (mhfd->unknown8));
 	g_print ("\tUnknown9: %08x\n", GINT_FROM_LE (mhfd->unknown9));
 	g_print ("\tUnknown10: %08x\n", GINT_FROM_LE (mhfd->unknown10));
@@ -210,8 +215,6 @@
 G_GNUC_INTERNAL void
 dump_mhba (MhbaHeader *mhba)
 {
-	int i;
-
 	g_print ("MHBA (%d):\n", sizeof (MhbaHeader));
 	g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhba->header_len));
 	g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhba->total_len));
@@ -219,9 +222,12 @@
 	g_print ("\tNumber of pictures in the album: %d\n", GINT_FROM_LE (mhba->num_mhias));
 	g_print ("\tPlaylist ID: %08x\n", GINT_FROM_LE (mhba->playlist_id));
 	g_print ("\tUnknown2: %08x\n", GINT_FROM_LE (mhba->unknown2));
-	g_print ("\tUnknown3: %08x\n", GINT_FROM_LE (mhba->unknown3));
-	for (i = 0; i < 7; i++)
-		g_print ("\tUnknown[%d]: %08x\n", i, GINT_FROM_LE (mhba->unknown[i]));
+	g_print ("\tUnknown3: %04x\n", GINT_FROM_LE (mhba->unknown3));
+	g_print ("\tMaster playlist: %02x\n", GINT_FROM_LE (mhba->master));
+	g_print ("\tRepeat: %02x\n", GINT_FROM_LE (mhba->repeat));
+	g_print ("\tRandom: %02x\n", GINT_FROM_LE (mhba->random));
+	g_print ("\tTransition direction: %02x\n", GINT_FROM_LE (mhba->transition_direction));
+	g_print ("\tSlide duration: %08x\n", GINT_FROM_LE (mhba->slide_duration));
 	g_print ("\tPrev playlist ID: %08x\n", GINT_FROM_LE (mhba->prev_playlist_id));
 }
 

Modified: libgpod/branches/upstream/current/src/db-artwork-debug.h
===================================================================
--- libgpod/branches/upstream/current/src/db-artwork-debug.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-artwork-debug.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -20,6 +20,7 @@
  * 
  *  This product is not supported/written/published by Apple!
  *
+ *  $Id: db-artwork-debug.h,v 1.4 2006/06/04 16:24:44 jcsjcs Exp $
  */
 #ifndef DB_ARTWORK_DEBUG_H
 #define DB_ARTWORK_DEBUG_H
@@ -32,12 +33,12 @@
 extern G_GNUC_INTERNAL void dump_mhif (MhifHeader *mhif);
 extern G_GNUC_INTERNAL void dump_mhia (MhiaHeader *mhia);
 extern G_GNUC_INTERNAL void dump_mhod_type_1 (MhodHeaderArtworkType1 *mhod);
-extern G_GNUC_INTERNAL void dump_mhod_type_3 (MhodHeaderArtworkType3 *mhod);
+extern G_GNUC_INTERNAL void dump_mhod_type_3 (ArtworkDB_MhodHeaderArtworkType3 *mhod);
 extern G_GNUC_INTERNAL void dump_mhni (MhniHeader *mhni);
-extern G_GNUC_INTERNAL void dump_mhod (MhodHeader *mhod);
+extern G_GNUC_INTERNAL void dump_mhod (ArtworkDB_MhodHeader *mhod);
 extern G_GNUC_INTERNAL void dump_mhii (MhiiHeader *mhii);
 extern G_GNUC_INTERNAL void dump_mhl (MhlHeader *mhl, const char *id);
-extern G_GNUC_INTERNAL void dump_mhsd (MhsdHeader *mhsd);
+extern G_GNUC_INTERNAL void dump_mhsd (ArtworkDB_MhsdHeader *mhsd);
 extern G_GNUC_INTERNAL void dump_mhfd (MhfdHeader *mhfd);
 extern G_GNUC_INTERNAL void dump_mhba (MhbaHeader *mhba);
 #else 

Modified: libgpod/branches/upstream/current/src/db-artwork-parser.c
===================================================================
--- libgpod/branches/upstream/current/src/db-artwork-parser.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-artwork-parser.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -27,8 +27,12 @@
 #endif
 
 #include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "itdb.h"
+#include "itdb_private.h"
+#include "itdb_endianness.h"
 #include "db-artwork-debug.h"
 #include "db-artwork-parser.h"
 #include "db-image-parser.h"
@@ -36,9 +40,9 @@
 #include "db-parse-context.h"
 #include <glib/gi18n-lib.h>
 
-typedef int (*ParseListItem)(DBParseContext *ctx, Itdb_iTunesDB *db, GError *error);
+typedef int (*ParseListItem)(DBParseContext *ctx, GError *error);
 
-#ifndef DEBUG_ARTWORKDB
+#ifndef NOT_DEFINED_DEBUG_ARTWORKDB
 static Itdb_Track *
 get_song_by_dbid (Itdb_iTunesDB *db, guint64 id)
 {
@@ -58,7 +62,7 @@
 
 
 static int
-parse_mhif (DBParseContext *ctx, Itdb_iTunesDB *db, GError *error)
+parse_mhif (DBParseContext *ctx, GError *error)
 {
 	MhifHeader *mhif;
 
@@ -67,26 +71,31 @@
 		return -1;
 	}
 	dump_mhif (mhif);
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhif->total_len));
+	db_parse_context_set_total_len (ctx, get_gint32 (mhif->total_len, ctx->byte_order));
 	return 0;
 }
 
 static int
-parse_mhia (DBParseContext *ctx, Itdb_iTunesDB *db, GError *error)
+parse_mhia (DBParseContext *ctx, Itdb_PhotoAlbum *photo_album, GError *error)
 {
 	MhiaHeader *mhia;
+	gint image_id;
 
 	mhia = db_parse_context_get_m_header (ctx, MhiaHeader, "mhia");
 	if (mhia == NULL) {
 		return -1;
 	}
 	dump_mhia (mhia);
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhia->total_len));
+	image_id = get_gint32 (mhia->image_id, ctx->byte_order);
+	photo_album->members = g_list_append (photo_album->members,
+					      GINT_TO_POINTER(image_id));
+	db_parse_context_set_total_len (ctx,
+					get_gint32_db (ctx->db, mhia->total_len));
 	return 0;
 }
 
 static char *
-get_utf16_string (void* buffer, gint length)
+get_utf16_string (void* buffer, gint length, guint byte_order)
 {
 	char *result;
 	gunichar2 *tmp;
@@ -96,7 +105,7 @@
 	 */
 	tmp = g_memdup (buffer, length);
 	for (i = 0; i < length/2; i++) {
-		tmp[i] = GINT16_FROM_LE (tmp[i]);
+		tmp[i] = get_gint16 (tmp[i], byte_order);
 	}
 	result = g_utf16_to_utf8 (tmp, length/2, NULL, NULL, NULL);
 	g_free (tmp);
@@ -106,46 +115,56 @@
 }
 
 static char *
-mhod3_get_ithmb_filename (MhodHeaderArtworkType3 *mhod3, 
-			  Itdb_iTunesDB *db) 
+mhod3_get_ithmb_filename (DBParseContext *ctx, ArtworkDB_MhodHeaderArtworkType3 *mhod3)
 {
-       char *filename;
+       char *filename=NULL;
 
        g_assert (mhod3 != NULL);
-       g_assert (db != NULL);
-       
-       filename = get_utf16_string (mhod3->string, mhod3->string_len);
+
+       if (mhod3->mhod_version == 2)
+	   filename = get_utf16_string ((gunichar2 *)mhod3->string,
+					get_gint32 (mhod3->string_len, ctx->byte_order),
+					ctx->byte_order);
+       else if ((mhod3->mhod_version == 0) ||
+		(mhod3->mhod_version == 1))
+	   filename = g_strndup (mhod3->string,
+				 get_gint32 (mhod3->string_len, ctx->byte_order));
+       else
+	   g_warning (_("Unexpected mhod3 string type: %d\n"),
+		      mhod3->mhod_version);
        return filename;
 }
 
 
 static int
-parse_mhod_3 (DBParseContext *ctx, Itdb_iTunesDB *db, 
+parse_mhod_3 (DBParseContext *ctx,
 	      Itdb_Thumb *thumb, GError *error)
 {
-	MhodHeader *mhod;
-	MhodHeaderArtworkType3 *mhod3;
+	ArtworkDB_MhodHeader *mhod;
+	ArtworkDB_MhodHeaderArtworkType3 *mhod3;
+	gint32 mhod3_type;
 
-	mhod = db_parse_context_get_m_header (ctx, MhodHeader, "mhod");
+	mhod = db_parse_context_get_m_header (ctx, ArtworkDB_MhodHeader, "mhod");
 	if (mhod == NULL) {
 		return -1;
 	}
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhod->total_len));
+	db_parse_context_set_total_len (ctx, get_gint32 (mhod->total_len, ctx->byte_order));
 	
-	if (GINT_FROM_LE (mhod->total_len) < sizeof (MhodHeaderArtworkType3)){
+	if (get_gint32 (mhod->total_len, ctx->byte_order) < sizeof (ArtworkDB_MhodHeaderArtworkType3)){
 		return -1;
 	}
-	mhod3 = (MhodHeaderArtworkType3*)mhod;
-	if ((GINT_FROM_LE (mhod3->type) & 0x00FFFFFF) != MHOD_ARTWORK_TYPE_FILE_NAME) {
+	mhod3 = (ArtworkDB_MhodHeaderArtworkType3*)mhod;
+	mhod3_type = get_gint16 (mhod3->type, ctx->byte_order);
+	if (mhod3_type != MHOD_ARTWORK_TYPE_FILE_NAME) {
 		return -1;
 	}
-	thumb->filename = mhod3_get_ithmb_filename (mhod3, db);
+	thumb->filename = mhod3_get_ithmb_filename (ctx, mhod3);
 	dump_mhod_type_3 (mhod3);
 	return 0;
 }
 
 static int
-parse_mhni (DBParseContext *ctx, iPodSong *song, GError *error)
+parse_photo_mhni (DBParseContext *ctx, Itdb_Artwork *artwork, GError *error)
 {
 	MhniHeader *mhni;
 	DBParseContext *mhod_ctx; 
@@ -155,14 +174,44 @@
 	if (mhni == NULL) {
 		return -1;
 	}
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhni->total_len));
+	db_parse_context_set_total_len (ctx, get_gint32 (mhni->total_len, ctx->byte_order));
 	dump_mhni (mhni);
 
-	thumb = ipod_image_new_from_mhni (mhni, song->itdb);
+	thumb = ipod_image_new_from_mhni (mhni, ctx->db);
 	if (thumb == NULL) {
 		return 0;
 	}
 
+	artwork->thumbnails = g_list_append (artwork->thumbnails, thumb);
+
+	mhod_ctx = db_parse_context_get_sub_context (ctx, ctx->header_len);
+	if (mhod_ctx == NULL) {
+	  return -1;
+	}
+	parse_mhod_3 (mhod_ctx, thumb, error);
+	g_free (mhod_ctx);
+
+	return 0;
+}
+
+static int
+parse_mhni (DBParseContext *ctx, iPodSong *song, GError *error)
+{
+	MhniHeader *mhni;
+	DBParseContext *mhod_ctx; 
+	Itdb_Thumb *thumb;
+
+	mhni = db_parse_context_get_m_header (ctx, MhniHeader, "mhni");
+	if (mhni == NULL) {
+		return -1;
+	}
+	db_parse_context_set_total_len (ctx, get_gint32 (mhni->total_len, ctx->byte_order));
+	dump_mhni (mhni);
+	thumb = ipod_image_new_from_mhni (mhni, ctx->db);
+	if (thumb == NULL) {
+		return 0;
+	}
+
 	song->artwork->thumbnails =
 		g_list_append (song->artwork->thumbnails, thumb);
 
@@ -170,24 +219,24 @@
 	if (mhod_ctx == NULL) {
 	  return -1;
 	}
-	parse_mhod_3 (mhod_ctx, song->itdb, thumb, error);
+	parse_mhod_3 (mhod_ctx, thumb, error);
 	g_free (mhod_ctx);
 
 	return 0;
 }
 
 static int
-parse_mhod (DBParseContext *ctx, iPodSong *song, GError *error)
+parse_photo_mhod (DBParseContext *ctx, Itdb_Artwork *artwork, GError *error)
 {
-	MhodHeader *mhod;
+	ArtworkDB_MhodHeader *mhod;
 	DBParseContext *mhni_ctx;
 	int type;
 
-	mhod = db_parse_context_get_m_header (ctx, MhodHeader, "mhod");
+	mhod = db_parse_context_get_m_header (ctx, ArtworkDB_MhodHeader, "mhod");
 	if (mhod == NULL) {
 		return -1;
 	}
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhod->total_len));
+	db_parse_context_set_total_len (ctx, get_gint32 (mhod->total_len, ctx->byte_order));
 
 	/* The MHODs found in the ArtworkDB and Photo Database files are
 	 * significantly different than those found in the iTunesDB.
@@ -195,11 +244,13 @@
 	 * - low 3 bytes are actual type;
 	 * - high byte is padding length of string (0-3).
 	 */
-	type = GINT_FROM_LE (mhod->type) & 0x00FFFFFF;
-	if (type == MHOD_ARTWORK_TYPE_ALBUM_NAME)
+	type = get_gint16 (mhod->type, ctx->byte_order) & 0x00FFFFFF;
+
+	if ( type == MHOD_ARTWORK_TYPE_ALBUM_NAME) {
 		dump_mhod_type_1 ((MhodHeaderArtworkType1 *)mhod);
-	else
+	} else {
 		dump_mhod (mhod);
+	}
 
 	/* if this is a container... */
 	if (type == MHOD_ARTWORK_TYPE_THUMBNAIL) {
@@ -207,6 +258,41 @@
 		if (mhni_ctx == NULL) {
 			return -1;
 		}
+		parse_photo_mhni (mhni_ctx, artwork, NULL);
+		g_free (mhni_ctx);
+	}
+
+	return 0;
+}
+static int
+parse_mhod (DBParseContext *ctx, iPodSong *song, GError *error)
+{
+	ArtworkDB_MhodHeader *mhod;
+	DBParseContext *mhni_ctx;
+	int type;
+	gint32 total_len;
+
+	mhod = db_parse_context_get_m_header (ctx, ArtworkDB_MhodHeader, "mhod");
+	if (mhod == NULL) {
+		return -1;
+	}
+	total_len = get_gint32 (mhod->total_len, ctx->byte_order);
+	db_parse_context_set_total_len (ctx, total_len);
+
+	type = get_gint16 (mhod->type, ctx->byte_order);
+
+	if ( type == MHOD_ARTWORK_TYPE_ALBUM_NAME) {
+		dump_mhod_type_1 ((MhodHeaderArtworkType1 *)mhod);
+	} else {
+		dump_mhod (mhod);
+	}
+
+	/* if this is a container... */
+	if (type == MHOD_ARTWORK_TYPE_THUMBNAIL) {
+		mhni_ctx = db_parse_context_get_sub_context (ctx, ctx->header_len);
+		if (mhni_ctx == NULL) {
+			return -1;
+		}
 		parse_mhni (mhni_ctx, song, NULL);
 		g_free (mhni_ctx);
 	}
@@ -216,60 +302,92 @@
 
 
 static int
-parse_mhii (DBParseContext *ctx, Itdb_iTunesDB *db, GError *error)
+parse_mhii (DBParseContext *ctx, GError *error)
 {
 	MhiiHeader *mhii;
 	DBParseContext *mhod_ctx;
 	int num_children;
 	off_t cur_offset;
 	iPodSong *song;
+	Itdb_Artwork *artwork;
+	Itdb_PhotoDB *photodb;
+	Itdb_iTunesDB *itunesdb;
 
 	mhii = db_parse_context_get_m_header (ctx, MhiiHeader, "mhii");
 	if (mhii == NULL) {
 		return -1;
 	}
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhii->total_len));
-
+	db_parse_context_set_total_len (ctx, get_gint32 (mhii->total_len, ctx->byte_order));
 	dump_mhii (mhii);
 
-#ifdef DEBUG_ARTWORKDB
-	song = NULL;
+	switch (ctx->db->db_type) {
+	case DB_TYPE_PHOTO:
+		artwork = g_new0( Itdb_Artwork, 1 );
+		artwork->artwork_size = get_gint32 (mhii->orig_img_size, ctx->byte_order);
+		artwork->id = get_gint32 (mhii->image_id, ctx->byte_order);
+		artwork->creation_date = itdb_time_mac_to_host( get_gint32 (mhii->digitised_date, ctx->byte_order) );
+
+		cur_offset = ctx->header_len;
+		mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
+		num_children = get_gint32 (mhii->num_children, ctx->byte_order);
+		while ((num_children > 0) && (mhod_ctx != NULL)) {
+			parse_photo_mhod (mhod_ctx, artwork, NULL);
+			num_children--;
+			cur_offset += mhod_ctx->total_len;
+			g_free (mhod_ctx);
+			mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
+		}
+		photodb = db_get_photodb (ctx->db);
+		g_return_val_if_fail (photodb, -1);
+		photodb->photos = g_list_append (photodb->photos,
+						 artwork);
+		break;
+	case DB_TYPE_ITUNES:
+#ifdef NOT_DEFINED_DEBUG_ARTWORKDB
+		song = NULL;
 #else
-	song = get_song_by_dbid (db, GINT64_FROM_LE (mhii->song_id));
-	if (song == NULL) {
-		return -1;
-	}
-
-	song->artwork->artwork_size = GINT_FROM_LE (mhii->orig_img_size);
-	if ((song->artwork_size+song->artwork_count) !=
-	    song->artwork->artwork_size) {
-		g_warning (_("iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"), song->artwork_size, song->artwork_count, song->artwork->artwork_size);
-	}
-
-	song->artwork->id = GINT_FROM_LE (mhii->image_id);
+		itunesdb = db_get_itunesdb (ctx->db);
+		g_return_val_if_fail (itunesdb, -1);
+		song = get_song_by_dbid (itunesdb,
+					 get_gint64 (mhii->song_id,
+						     ctx->byte_order));
+		if (song == NULL) {
+			return -1;
+		}
+		song->artwork->artwork_size = get_gint32 (mhii->orig_img_size, ctx->byte_order);
+		if ((song->artwork_size+song->artwork_count) !=
+				song->artwork->artwork_size) {
+			g_warning (_("iTunesDB and ArtworkDB artwork sizes inconsistent (%d+%d != %d)"), song->artwork_size, song->artwork_count, song->artwork->artwork_size);
+		}
+		song->artwork->id = get_gint32 (mhii->image_id, ctx->byte_order);
 #endif
 
-	cur_offset = ctx->header_len;
-	mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
-	num_children = GINT_FROM_LE (mhii->num_children);
-	while ((num_children > 0) && (mhod_ctx != NULL)) {
-		parse_mhod (mhod_ctx, song, NULL);
-		num_children--;
-		cur_offset += mhod_ctx->total_len;
-		g_free (mhod_ctx);
+		cur_offset = ctx->header_len;
 		mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
+		num_children = get_gint32 (mhii->num_children, ctx->byte_order);
+		while ((num_children > 0) && (mhod_ctx != NULL)) {
+			parse_mhod (mhod_ctx, song, NULL);
+			num_children--;
+			cur_offset += mhod_ctx->total_len;
+			g_free (mhod_ctx);
+			mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
+		}
+		break;
+	default:
+	       g_return_val_if_reached (-1);
 	}
-
 	return 0;
 }
 
-
 static int
-parse_mhba (DBParseContext *ctx, Itdb_iTunesDB *db, GError *error)
+parse_mhba (DBParseContext *ctx, GError *error)
 {
 	MhbaHeader *mhba;
+	ArtworkDB_MhodHeader *mhod;
 	DBParseContext *mhod_ctx;
 	DBParseContext *mhia_ctx;
+	Itdb_PhotoAlbum *photo_album;
+	Itdb_PhotoDB *photodb;
 	int num_children;
 	off_t cur_offset;
 
@@ -277,36 +395,52 @@
 	if (mhba == NULL) {
 		return -1;
 	}
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhba->total_len));
+	db_parse_context_set_total_len (ctx, get_gint32 (mhba->total_len, ctx->byte_order));
 
 	dump_mhba (mhba);
 
+	photo_album = g_new0 (Itdb_PhotoAlbum, 1);
+	photo_album->num_images = get_gint32( mhba->num_mhias, ctx->byte_order);
+	photo_album->album_id = get_gint32( mhba->playlist_id, ctx->byte_order);
+	photo_album->master = get_gint32( mhba->master, ctx->byte_order);
+	photo_album->prev_album_id = get_gint32( mhba->prev_playlist_id, ctx->byte_order);
+
 	cur_offset = ctx->header_len;
 	mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
-	num_children = GINT_FROM_LE (mhba->num_mhods);
+	num_children = get_gint32 (mhba->num_mhods, ctx->byte_order);
 	while ((num_children > 0) && (mhod_ctx != NULL)) {
-		parse_mhod (mhod_ctx, NULL, NULL);
-		num_children--;
+		/* FIXME: First mhod is album name, whats the others for? */
+		mhod = db_parse_context_get_m_header (mhod_ctx, ArtworkDB_MhodHeader, "mhod");
+		if (mhod == NULL) {
+			return -1;
+		}
+		db_parse_context_set_total_len (mhod_ctx,  get_gint32(mhod->total_len, ctx->byte_order));
+		photo_album->name = g_strdup( (char *)((MhodHeaderArtworkType1*)mhod)->string );
 		cur_offset += mhod_ctx->total_len;
+		dump_mhod_type_1 ((MhodHeaderArtworkType1*)mhod);
 		g_free (mhod_ctx);
-		mhod_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
+		num_children--;
 	}
+
 	mhia_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
-	num_children = GINT_FROM_LE (mhba->num_mhias);
+	num_children = get_gint32 (mhba->num_mhias, ctx->byte_order);
 	while ((num_children > 0) && (mhia_ctx != NULL)) {
-		parse_mhia (mhia_ctx, db, NULL);
+		parse_mhia (mhia_ctx, photo_album, NULL);
 		num_children--;
 		cur_offset += mhia_ctx->total_len;
 		g_free (mhia_ctx);
 		mhia_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
 	}
-
+	photodb = db_get_photodb (ctx->db);
+	g_return_val_if_fail (photodb, -1);
+	photodb->photoalbums = g_list_append (photodb->photoalbums,
+					      photo_album);
 	return 0;
 }
 
 
 static int
-parse_mhl (DBParseContext *ctx, Itdb_iTunesDB *db, GError *error, 
+parse_mhl (DBParseContext *ctx, GError *error, 
 	   const char *id, ParseListItem parse_child)
 {
 	MhlHeader *mhl;
@@ -321,7 +455,7 @@
 
 	dump_mhl (mhl, id);
 
-	num_children = GINT_FROM_LE (mhl->num_children);
+	num_children = get_gint32 (mhl->num_children, ctx->byte_order);
 	if (num_children < 0) {
 		return -1;
 	}
@@ -330,7 +464,7 @@
 	mhi_ctx = db_parse_context_get_sub_context (ctx, cur_offset);
 	while ((num_children > 0) && (mhi_ctx != NULL)) {
 		if (parse_child != NULL) {
-			parse_child (mhi_ctx, db, NULL);
+			parse_child (mhi_ctx, NULL);
 		}
 		num_children--;
 		cur_offset += mhi_ctx->total_len;
@@ -344,42 +478,42 @@
 
 
 static int 
-parse_mhsd (DBParseContext *ctx, Itdb_iTunesDB *db, GError **error)
+parse_mhsd (DBParseContext *ctx, GError **error)
 {
-	MhsdHeader *mhsd;
+	ArtworkDB_MhsdHeader *mhsd;
 
-	mhsd = db_parse_context_get_m_header (ctx, MhsdHeader, "mhsd");
+	mhsd = db_parse_context_get_m_header (ctx, ArtworkDB_MhsdHeader, "mhsd");
 	if (mhsd == NULL) {
 		return -1;
 	}
 
-	db_parse_context_set_total_len (ctx, GINT_FROM_LE (mhsd->total_len));
+	db_parse_context_set_total_len (ctx, get_gint32 (mhsd->total_len, ctx->byte_order));
 	dump_mhsd (mhsd);
-	switch (GINT_FROM_LE (mhsd->index)) {
+	switch (get_gint16_db (ctx->db, mhsd->index)) {
 	case MHSD_IMAGE_LIST: {
 		DBParseContext *mhli_context;
 		mhli_context = db_parse_context_get_next_child (ctx);
-		parse_mhl (mhli_context, db, NULL, "mhli", parse_mhii);
+		parse_mhl (mhli_context, NULL, "mhli", parse_mhii);
 		g_free (mhli_context);
 		break;
 	}
 	case MHSD_ALBUM_LIST: {
 		DBParseContext *mhla_context;
 		mhla_context = db_parse_context_get_next_child (ctx);
-		parse_mhl (mhla_context, db, NULL, "mhla", parse_mhba);
+		parse_mhl (mhla_context, NULL, "mhla", parse_mhba);
 		g_free (mhla_context);
 		break;
 	}
 	case MHSD_FILE_LIST: {
 		DBParseContext *mhlf_context;
 		mhlf_context = db_parse_context_get_next_child (ctx);
-		parse_mhl (mhlf_context, db, NULL, "mhlf", parse_mhif);
+		parse_mhl (mhlf_context, NULL, "mhlf", parse_mhif);
 		g_free (mhlf_context);
 		break;
 	}
 	default:
 		g_warning (_("Unexpected mhsd index: %d\n"), 
-			   GINT_FROM_LE (mhsd->index));
+			   get_gint16_db (ctx->db, mhsd->index));
 		return -1;
 		break;
 	}
@@ -389,11 +523,12 @@
 
 /* Database Object */
 static int
-parse_mhfd (DBParseContext *ctx, Itdb_iTunesDB *db, GError **error)
+parse_mhfd (DBParseContext *ctx, GError **error)
 {
 	MhfdHeader *mhfd;
 	DBParseContext *mhsd_context;
 	unsigned int cur_pos;
+	gint total_len;
 
 	mhfd = db_parse_context_get_m_header (ctx, MhfdHeader, "mhfd");
 	if (mhfd == NULL) {
@@ -401,7 +536,8 @@
 	}
 
 	/* Sanity check */
-	g_return_val_if_fail (GINT_FROM_LE (mhfd->total_len) == ctx->total_len, -1);
+	total_len = get_gint32_db (ctx->db, mhfd->total_len);
+	g_return_val_if_fail (total_len == ctx->total_len, -1);
 	dump_mhfd (mhfd);
 	cur_pos = ctx->header_len;
 
@@ -413,7 +549,7 @@
 	if (mhsd_context == NULL) {
 		return -1;
 	}
-	parse_mhsd (mhsd_context, db, NULL);
+	parse_mhsd (mhsd_context, NULL);
 	cur_pos += mhsd_context->total_len;
 	g_free (mhsd_context);
 
@@ -421,7 +557,7 @@
 	if (mhsd_context == NULL) {
 		return -1;
 	}
-	parse_mhsd (mhsd_context, db, NULL);
+	parse_mhsd (mhsd_context, NULL);
 	cur_pos += mhsd_context->total_len;
 	g_free (mhsd_context);
 
@@ -429,7 +565,7 @@
 	if (mhsd_context == NULL) {
 		return -1;
 	}
-	parse_mhsd (mhsd_context, db, NULL);
+	parse_mhsd (mhsd_context, NULL);
 	cur_pos += mhsd_context->total_len;
 	g_free (mhsd_context);
 	
@@ -440,74 +576,127 @@
 G_GNUC_INTERNAL char *
 ipod_db_get_artwork_db_path (const char *mount_point)
 {
-        gchar *filename;
-	const char *paths[] = {"iPod_Control", "Artwork", "ArtworkDB", NULL};
-	filename = itdb_resolve_path (mount_point, paths);
+        gchar *filename=NULL;
 
+	/* fail silently if no mount point given */
+	if (!mount_point)  return NULL;
+
+	filename = itdb_get_artworkdb_path (mount_point);
+
 	/* itdb_resolve_path() only returns existing paths */
 	if (!filename)
 	{
-	    gchar *path;
-	    paths[2] = NULL;
-	    path = itdb_resolve_path (mount_point, (const char **)paths);
-	    if (path)
+	    gchar *artwork_dir;
+
+	    artwork_dir = itdb_get_artwork_dir (mount_point);
+	    if (!artwork_dir)
 	    {
-		filename = g_build_filename (path, "ArtworkDB", NULL);
+		/* attempt to create Artwork dir */
+		gchar *control_dir = itdb_get_control_dir (mount_point);
+		if (control_dir)
+		{
+		    gchar *dir = g_build_filename (control_dir, "Artwork", NULL);
+		    mkdir (dir, 0777);
+		    g_free (control_dir);
+		    g_free (dir);
+		    artwork_dir = itdb_get_artwork_dir (mount_point);
+		}
 	    }
-	    g_free (path);
+	    if (artwork_dir)
+	    {
+		filename = g_build_filename (artwork_dir,
+					     "ArtworkDB", NULL);
+		g_free (artwork_dir);
+	    }
 	}
 
 	return filename;
 }
 
+G_GNUC_INTERNAL gboolean
+ipod_supports_cover_art (Itdb_Device *device)
+{
+	const Itdb_ArtworkFormat *formats;
 
-static char *
-ipod_db_get_photo_db_path (const char *mount_point)
-{
-	const char *paths[] = {"Photos", "Photo Database", NULL};
-	g_return_val_if_fail (mount_point != NULL, NULL);
-	return itdb_resolve_path (mount_point, paths);
-				  
+	if (device == NULL) {
+		return FALSE;
+	}
+
+	formats = itdb_device_get_artwork_formats (device);
+	if (formats == NULL) {
+		return FALSE;
+	}
+	
+	while (formats->type != -1)
+	{
+	    switch (formats->type)
+	    {
+	    case ITDB_THUMB_COVER_SMALL:
+	    case ITDB_THUMB_COVER_LARGE:
+		return TRUE;
+	    case ITDB_THUMB_PHOTO_SMALL:
+	    case ITDB_THUMB_PHOTO_LARGE:
+	    case ITDB_THUMB_PHOTO_FULL_SCREEN:
+	    case ITDB_THUMB_PHOTO_TV_SCREEN:
+		break;
+	    }
+	    formats++;
+	}
+
+	return FALSE;
 }
 
-static gboolean
-ipod_supports_cover_art (IpodDevice *ipod)
+G_GNUC_INTERNAL gboolean
+ipod_supports_photos (Itdb_Device *device)
 {
-	const IpodArtworkFormat *formats;
+	const Itdb_ArtworkFormat *formats;
 
-	if (ipod == NULL) {
+	if (device == NULL) {
 		return FALSE;
 	}
 
-	g_object_get (G_OBJECT (ipod), "artwork-formats", &formats, NULL);
+	formats = itdb_device_get_artwork_formats (device);
 	if (formats == NULL) {
 		return FALSE;
 	}
 	
-	while (formats->type != -1) {
-		if ((formats->type == IPOD_COVER_SMALL) 
-		    || (formats->type == IPOD_COVER_LARGE)) {
-			return TRUE;
-		}
-		formats++;
+	while (formats->type != -1)
+	{
+	    switch (formats->type)
+	    {
+	    case ITDB_THUMB_COVER_SMALL:
+	    case ITDB_THUMB_COVER_LARGE:
+		break;
+	    case ITDB_THUMB_PHOTO_SMALL:
+	    case ITDB_THUMB_PHOTO_LARGE:
+	    case ITDB_THUMB_PHOTO_FULL_SCREEN:
+	    case ITDB_THUMB_PHOTO_TV_SCREEN:
+		return TRUE;
+	    }
+	    formats++;
 	}
 
 	return FALSE;
 }
 
+
 int
-ipod_parse_artwork_db (Itdb_iTunesDB *db)
+ipod_parse_artwork_db (Itdb_iTunesDB *itdb)
 {
 	DBParseContext *ctx;
 	char *filename;
+	Itdb_DB db;
 
-	g_return_val_if_fail (db, -1);
+	db.db.itdb = itdb;
+	db.db_type = DB_TYPE_ITUNES;
 
-	if (!ipod_supports_cover_art (db->device)) {
+	g_return_val_if_fail (itdb, -1);
+
+	if (!ipod_supports_cover_art (itdb->device)) {
 		return -1;
 	}
 	ctx = NULL;
-	filename = ipod_db_get_artwork_db_path (db->mountpoint);
+	filename = ipod_db_get_artwork_db_path (itdb_get_mountpoint (itdb));
 	if (filename == NULL) {
 		goto error;
 	}
@@ -515,13 +704,14 @@
 	{
 		goto error;
 	}
-	ctx = db_parse_context_new_from_file (filename);	
+
+	ctx = db_parse_context_new_from_file (filename, &db);
 	g_free (filename);
 	if (ctx == NULL) {
 		goto error;
 	}	
 
-	parse_mhfd (ctx, db, NULL);
+	parse_mhfd (ctx, NULL);
 	db_parse_context_destroy (ctx, TRUE);
 	return 0;
 
@@ -532,24 +722,68 @@
 	return -1;
 }
 
+
+G_GNUC_INTERNAL char *
+ipod_db_get_photos_db_path (const char *mount_point)
+{
+        gchar *filename=NULL;
+
+	/* fail silently if no mount point given */
+	if (!mount_point)  return NULL;
+
+	filename = itdb_get_photodb_path (mount_point);
+
+	/* itdb_resolve_path() only returns existing paths */
+	if (!filename)
+	{
+	    gchar *photos_dir;
+
+	    photos_dir = itdb_get_photos_dir (mount_point);
+	    if (!photos_dir)
+	    {
+		/* attempt to create Photos dir */
+		gchar *dir = g_build_filename (mount_point, "Photos", NULL);
+		mkdir (dir, 0777);
+		g_free (dir);
+		photos_dir = itdb_get_photos_dir (mount_point);
+	    }
+	    if (photos_dir)
+	    {
+		filename = g_build_filename (photos_dir,
+					     "Photo Database", NULL);
+		g_free (photos_dir);
+	    }
+	}
+
+	return filename;
+}
+
+
 int
-ipod_parse_photo_db (const char *mount_point)
+ipod_parse_photo_db (Itdb_PhotoDB *photodb)
 {
 	DBParseContext *ctx;
 	char *filename;
+	Itdb_DB db;
 
-	filename = ipod_db_get_photo_db_path (mount_point);
+	db.db.photodb = photodb;
+	db.db_type = DB_TYPE_PHOTO;
+
+
+	filename = itdb_get_photodb_path (
+	    itdb_photodb_get_mountpoint (photodb));
 	if (filename == NULL) {
 		return -1;
 	}       
-	ctx = db_parse_context_new_from_file (filename);
+
+	ctx = db_parse_context_new_from_file (filename, &db );
 	g_free (filename);
 	if (ctx == NULL) {
 		return  -1;
 	}
-
-	parse_mhfd (ctx, NULL, NULL);
+	parse_mhfd (ctx, NULL);
 	db_parse_context_destroy (ctx, TRUE);
 
 	return 0;
 }
+

Modified: libgpod/branches/upstream/current/src/db-artwork-parser.h
===================================================================
--- libgpod/branches/upstream/current/src/db-artwork-parser.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-artwork-parser.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -20,6 +20,7 @@
  * 
  *  This product is not supported/written/published by Apple!
  *
+ *  $Id: db-artwork-parser.h,v 1.8 2006/06/04 16:24:44 jcsjcs Exp $
  */
 
 
@@ -30,9 +31,12 @@
 
 #define iPodSong Itdb_Track
 
-G_GNUC_INTERNAL int ipod_parse_photo_db (const char *filename);
 G_GNUC_INTERNAL int ipod_parse_artwork_db (Itdb_iTunesDB *db);
-G_GNUC_INTERNAL int ipod_write_artwork_db (Itdb_iTunesDB *db);
-
+G_GNUC_INTERNAL int ipod_write_artwork_db (Itdb_iTunesDB *itdb);
 G_GNUC_INTERNAL char *ipod_db_get_artwork_db_path (const char *mount_point);
+G_GNUC_INTERNAL char *ipod_db_get_photos_db_path (const char *mount_point);
+G_GNUC_INTERNAL int ipod_parse_photo_db (Itdb_PhotoDB *photodb); 
+G_GNUC_INTERNAL int ipod_write_photo_db (Itdb_PhotoDB *db);
+G_GNUC_INTERNAL gboolean ipod_supports_cover_art (Itdb_Device *device);
+G_GNUC_INTERNAL gboolean ipod_supports_photos (Itdb_Device *device);
 #endif

Modified: libgpod/branches/upstream/current/src/db-artwork-writer.c
===================================================================
--- libgpod/branches/upstream/current/src/db-artwork-writer.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-artwork-writer.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -24,6 +24,7 @@
 
 #include <config.h>
 #include "itdb.h"
+#include "itdb_private.h"
 #include "db-artwork-parser.h"
 
 #if HAVE_GDKPIXBUF
@@ -31,6 +32,7 @@
 #include "db-artwork-debug.h"
 #include "db-itunes-parser.h"
 #include "db-image-parser.h"
+#include "itdb_endianness.h"
 
 #include <errno.h>
 #include <fcntl.h>
@@ -57,6 +59,8 @@
 struct _iPodBuffer {
 	struct iPodMmapBuffer *mmap;
 	off_t offset;
+	guint byte_order;
+	DbType db_type;
 };
 
 typedef struct _iPodBuffer iPodBuffer;
@@ -94,14 +98,14 @@
 	result = lseek (mmap_buf->fd, new_size, SEEK_SET);
 	if (result == (off_t)-1) {
 		g_print ("Failed to grow file to %lu: %s\n", 
-			 new_size, strerror (errno));
+                        (unsigned long)new_size, strerror (errno));
 		return -1;
 	}
 	result = 0;
 	result = write (mmap_buf->fd, &result, 1);
 	if (result != 1) {
 		g_print ("Failed to write a byte at %lu: %s\n", 
-			 new_size, strerror (errno));
+                        (unsigned long)new_size, strerror (errno));
 		return -1;
 	}
 
@@ -172,6 +176,8 @@
 	}
 	sub_buffer->mmap = buffer->mmap;
 	sub_buffer->offset = buffer->offset + offset;
+	sub_buffer->byte_order = buffer->byte_order;
+	sub_buffer->db_type = buffer->db_type;
 
 	buffer->mmap->ref_count++;
 
@@ -179,7 +185,7 @@
 }
 
 static iPodBuffer *
-ipod_buffer_new (const char *filename)
+ipod_buffer_new (const char *filename, guint byte_order, DbType db_type)
 {
 	int fd;
 	struct iPodMmapBuffer *mmap_buf;
@@ -224,6 +230,8 @@
 		return NULL;
 	}
 	buffer->mmap = mmap_buf;
+	buffer->byte_order = byte_order;
+	buffer->db_type = db_type;
 
 	return buffer;
 }
@@ -235,14 +243,13 @@
 };
 
 enum iPodThumbnailType {
-	IPOD_THUMBNAIL_FULL_SIZE,
-	IPOD_THUMBNAIL_NOW_PLAYING
+	IPOD_THUMBNAIL_FULL_SIZE = 0,
+	IPOD_THUMBNAIL_NOW_PLAYING = 1,
+	IPOD_PHOTO_LITTLE = 3,
+	IPOD_PHOTO_FULL_SIZE = 4
 };
 
-#define IPOD_THUMBNAIL_FULL_SIZE_SIZE (140*140*2)
-#define IPOD_THUMBNAIL_NOW_PLAYING_SIZE (56*56*2)
 
-
 #define RETURN_SIZE_FOR(id, size) if (strncmp (id, header_id, 4) == 0) return (size)
 
 
@@ -261,17 +268,19 @@
 	RETURN_SIZE_FOR ("mhla", 0x5c);
 	RETURN_SIZE_FOR ("mhlf", 0x5c);
 	RETURN_SIZE_FOR ("mhif", 0x7c);
+	RETURN_SIZE_FOR ("mhba", 0x94);
 
 	return 0;
 }
 
 static void *
-init_header (iPodBuffer *buffer, gchar header_id[4], guint header_len)
+init_header (iPodBuffer *buffer, gchar _header_id[4], guint header_len)
 {
 	MHeader *mh;
 	int padded_size;
+	gchar *header_id;
 
-	padded_size = get_padded_header_size (header_id);
+	padded_size = get_padded_header_size (_header_id);
 	if (padded_size != 0) {
 		header_len = padded_size;
 	}
@@ -281,58 +290,135 @@
 	}
 	mh = (MHeader*)ipod_buffer_get_pointer (buffer);
 	memset (mh, 0, header_len);
+
+	header_id = g_strndup (_header_id, 4);
+	if (buffer->byte_order == G_BIG_ENDIAN) {
+		g_strreverse (header_id);
+	}
 	strncpy ((char *)mh->header_id, header_id, 4);
-	mh->header_len = GINT_TO_LE (header_len);
-	
+	mh->header_len = get_gint32 (header_len, buffer->byte_order);
+
+	g_free (header_id);
 	return mh;
 }
 
 
 static int 
-write_mhod_type_3 (Itdb_Thumb *thumb, iPodBuffer *buffer)
+write_mhod_type_1 (gchar *string, iPodBuffer *buffer)
 {
-	MhodHeaderArtworkType3 *mhod;
+	MhodHeaderArtworkType1 *mhod;
 	unsigned int total_bytes;
 	int len;
-	gunichar2 *utf16;
-	int i;
+	int padding;
 
-	g_assert (thumb->filename != NULL);
+	g_assert (string != NULL);
 
-	mhod = (MhodHeaderArtworkType3 *)init_header (buffer, "mhod", 
-						      sizeof (MhodHeaderArtworkType3));
+	mhod = (MhodHeaderArtworkType1 *)init_header (buffer, "mhod", 
+						      sizeof (MhodHeaderArtworkType1));
 	if (mhod == NULL) {
 		return -1;
 	}
-	total_bytes = sizeof (MhodHeaderArtworkType3);
-	mhod->total_len = GINT_TO_LE (total_bytes);
+	total_bytes = sizeof (MhodHeaderArtworkType1);
+	mhod->total_len = get_gint32 (total_bytes, buffer->byte_order);
 	/* Modify header length, since iTunes only puts the length of 
 	 * MhodHeader in header_len
 	 */
-	mhod->header_len = GINT_TO_LE (sizeof (MhodHeader));
-	mhod->type = GINT_TO_LE (3);
-	mhod->mhod_version = GINT_TO_LE (2);
+	mhod->header_len = get_gint32 (sizeof (ArtworkDB_MhodHeader), buffer->byte_order);
+	mhod->unknown3 = get_gint32 (0x01, buffer->byte_order);
+	len = strlen (string);
+	mhod->string_len = get_gint32 (len, buffer->byte_order);
 
-	len = strlen (thumb->filename);
+	padding = 4 - ( (total_bytes + len) % 4 );
+	mhod->padding = padding;
+	mhod->type = get_gint32 (0x0001, buffer->byte_order);
 
-	/* number of bytes of the string encoded in UTF-16 */
-	mhod->string_len = GINT_TO_LE (2*len);
-
 	/* Make sure we have enough free space to write the string */
-	if (ipod_buffer_maybe_grow (buffer, total_bytes + 2*len) != 0) {
+	if (ipod_buffer_maybe_grow (buffer, total_bytes + len + padding ) != 0) {
 		return  -1;
 	}
-	utf16 = g_utf8_to_utf16 (thumb->filename, -1, NULL, NULL, NULL);
-	if (utf16 == NULL) {		
+	memcpy (mhod->string, string, len);
+	total_bytes += len + padding;
+	mhod->total_len = get_gint32 (total_bytes, buffer->byte_order);	
+
+	dump_mhod_type_1 (mhod);
+
+	return total_bytes;
+}
+
+static int 
+write_mhod_type_3 (gchar *string, iPodBuffer *buffer)
+{
+	ArtworkDB_MhodHeaderArtworkType3 *mhod;
+	unsigned int total_bytes;
+	int len;
+	gunichar2 *utf16, *strp;
+	int i, padding;
+
+	g_assert (string != NULL);
+
+	mhod = (ArtworkDB_MhodHeaderArtworkType3 *)
+	    init_header (buffer, "mhod", 
+			 sizeof (ArtworkDB_MhodHeaderArtworkType3));
+	if (mhod == NULL) {
 		return -1;
 	}
-	memcpy (mhod->string, utf16, 2*len);
-	g_free (utf16);
-	for (i = 0; i < len; i++) {
-		mhod->string[i] = GINT_TO_LE (mhod->string[i]);
+	total_bytes = sizeof (ArtworkDB_MhodHeaderArtworkType3);
+	mhod->total_len = get_gint32 (total_bytes, buffer->byte_order);
+	/* Modify header length, since iTunes only puts the length of 
+	 * MhodHeader in header_len
+	 */
+	mhod->header_len = get_gint32 (sizeof (ArtworkDB_MhodHeader), 
+				       buffer->byte_order);
+	mhod->type = get_gint16 (3, buffer->byte_order);
+
+	len = strlen (string);
+
+	/* FIXME: Tidy this up, combine cases more */
+	/* Some magic: endianess-reversed (BE) mobile phones use UTF8
+	 * (version 1) with padding, standard iPods (LE) use UTF16
+	 * (version 2).*/
+	switch (buffer->byte_order)
+	{
+	case G_LITTLE_ENDIAN:
+	    mhod->mhod_version = 2;
+	    /* number of bytes of the string encoded in UTF-16 */
+	    mhod->string_len = get_gint32 (2*len, buffer->byte_order);
+	    padding = 4 - ( (total_bytes + 2*len) % 4 );
+	    mhod->padding = padding; /* high byte is padding length (0-3) */
+
+	    /* Make sure we have enough free space to write the string */
+	    if (ipod_buffer_maybe_grow (buffer, total_bytes + 2*len+padding) != 0) {
+		return  -1;
+	    }
+
+	    utf16 = g_utf8_to_utf16 (string, -1, NULL, NULL, NULL);
+	    if (utf16 == NULL) {		
+		return -1;
+	    }
+	    strp = (gunichar2 *)mhod->string;
+	    memcpy (strp, utf16, 2*len);
+	    g_free (utf16);
+	    for (i = 0; i < len; i++) {
+		strp[i] = get_gint16 (strp[i], buffer->byte_order);
+	    }
+	    total_bytes += 2*len+padding;
+	    break;
+	case G_BIG_ENDIAN:
+	    mhod->mhod_version = 1;
+	    mhod->string_len = get_gint32 (len, buffer->byte_order);
+	    /* pad string if necessary */
+	    /* e.g. len = 7 bytes, len%4 = 3, 4-3=1 -> requires 1 byte
+	       padding */
+	    padding = 4 - ( (total_bytes + len) % 4 );
+	    mhod->padding = padding; /* high byte is padding length (0-3) */
+	    /* Make sure we have enough free space to write the string */
+	    if (ipod_buffer_maybe_grow (buffer, total_bytes + 2*len+padding) != 0) {
+		return  -1;
+	    }
+	    memcpy (mhod->string, string, len);
+	    total_bytes += (len+padding);
 	}
-	total_bytes += 2*len;
-	mhod->total_len = GINT_TO_LE (total_bytes);	
+	mhod->total_len = get_gint32 (total_bytes, buffer->byte_order);
 
 	dump_mhod_type_3 (mhod);
 
@@ -340,7 +426,7 @@
 }
 
 static int 
-write_mhni (Itdb_Thumb *thumb, int correlation_id, iPodBuffer *buffer)
+write_mhni (Itdb_DB *db, Itdb_Thumb *thumb, int correlation_id, iPodBuffer *buffer)
 {
 	MhniHeader *mhni;
 	unsigned int total_bytes;
@@ -356,30 +442,41 @@
 	if (mhni == NULL) {
 		return -1;
 	}
-	total_bytes = GINT_FROM_LE (mhni->header_len);
-	mhni->total_len = GINT_TO_LE (total_bytes);
+	total_bytes =          get_gint32 (mhni->header_len,
+					   buffer->byte_order);
+	mhni->total_len =      get_gint32 (total_bytes,
+					   buffer->byte_order);
+	mhni->correlation_id = get_gint32 (correlation_id,
+					   buffer->byte_order);
+	mhni->image_width =    get_gint16 (thumb->width,
+					   buffer->byte_order);
+	mhni->image_height =   get_gint16 (thumb->height,
+					   buffer->byte_order);
+	mhni->image_size =     get_gint32 (thumb->size,
+					   buffer->byte_order);
+	mhni->ithmb_offset =   get_gint32 (thumb->offset,
+					   buffer->byte_order);
 
-	mhni->correlation_id = GINT_TO_LE (correlation_id);
-	mhni->image_width  = GINT16_TO_LE (thumb->width);
-	mhni->image_height = GINT16_TO_LE (thumb->height);
-	mhni->image_size   = GINT32_TO_LE (thumb->size);
-	mhni->ithmb_offset = GINT32_TO_LE (thumb->offset);
+	mhni->vertical_padding =
+	    get_gint16 (thumb->vertical_padding, buffer->byte_order);
+	mhni->horizontal_padding = 
+	    get_gint16 (thumb->horizontal_padding, buffer->byte_order);
 
 	sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
 	if (sub_buffer == NULL) {
 		return  -1;
 	}
-	bytes_written = write_mhod_type_3 (thumb, sub_buffer);
+	bytes_written = write_mhod_type_3 (thumb->filename, sub_buffer);
 	ipod_buffer_destroy (sub_buffer);
 	if (bytes_written == -1) {
 		return -1;
 	}
 	total_bytes += bytes_written;
-	mhni->total_len = GINT_TO_LE (total_bytes);
+	mhni->total_len = get_gint32 (total_bytes, buffer->byte_order);
 	/* Only update number of children when all went well to try to get
 	 * something somewhat consistent when there are errors 
 	 */
-	mhni->num_children = GINT_TO_LE (1);
+	mhni->num_children = get_gint32 (1, buffer->byte_order);
 	
 	dump_mhni (mhni);
 
@@ -387,9 +484,9 @@
 }
 
 static int
-write_mhod (Itdb_Thumb *thumb, int correlation_id, iPodBuffer *buffer)
+write_mhod (Itdb_DB *db, Itdb_Thumb *thumb, int correlation_id, iPodBuffer *buffer)
 {
-	MhodHeader *mhod;
+	ArtworkDB_MhodHeader *mhod;
 	unsigned int total_bytes;
 	int bytes_written;
 	iPodBuffer *sub_buffer;
@@ -398,25 +495,26 @@
 		return -1;
 	}
 
-	mhod = (MhodHeader *)init_header (buffer, "mhod", 
-					  sizeof (MhodHeader));
+	mhod = (ArtworkDB_MhodHeader *)
+	    init_header (buffer, "mhod", 
+			 sizeof (ArtworkDB_MhodHeader));
 	if (mhod == NULL) {
 		return -1;
 	}
-	total_bytes = sizeof (MhodHeader);
-	mhod->total_len = GINT_TO_LE (total_bytes);
-	mhod->type = GINT_TO_LE (MHOD_TYPE_LOCATION);
+	total_bytes = sizeof (ArtworkDB_MhodHeader);
+	mhod->total_len = get_gint32 (total_bytes, buffer->byte_order);
+	mhod->type = get_gint16 (MHOD_TYPE_LOCATION, buffer->byte_order);
 	sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
 	if (sub_buffer == NULL) {
 		return -1;
 	}
-	bytes_written = write_mhni (thumb, correlation_id, sub_buffer);
+	bytes_written = write_mhni (db, thumb, correlation_id, sub_buffer);
 	ipod_buffer_destroy (sub_buffer);
 	if (bytes_written == -1) {
 		return -1;
 	}
 	total_bytes += bytes_written;
-	mhod->total_len = GINT_TO_LE (total_bytes);
+	mhod->total_len = get_gint32 (total_bytes, buffer->byte_order);
 
 	dump_mhod (mhod);
 
@@ -424,44 +522,62 @@
 }
 
 static int
-write_mhii (Itdb_Track *song, iPodBuffer *buffer)
+write_mhii (Itdb_DB *db, void *data, iPodBuffer *buffer)
 {
 	MhiiHeader *mhii;
 	unsigned int total_bytes;
 	int bytes_written;
 	int num_children;
-	GList *it;
+	GList *it = NULL;
+	Itdb_Track *song;
+	Itdb_Artwork *artwork;
 
 	mhii = (MhiiHeader *)init_header (buffer, "mhii", sizeof (MhiiHeader));
 	if (mhii == NULL) {
 		return -1;
 	}
-	total_bytes = GINT_FROM_LE (mhii->header_len);
-	mhii->song_id = GINT64_TO_LE (song->dbid);
-	mhii->image_id = GUINT_TO_LE (song->artwork->id);
-	mhii->orig_img_size = GINT_TO_LE (song->artwork->artwork_size);
+	total_bytes = get_gint32 (mhii->header_len, buffer->byte_order);
+
+	switch( buffer->db_type) {
+	case DB_TYPE_ITUNES:
+		song = (Itdb_Track *)data;
+		mhii->song_id = get_gint64 (song->dbid, buffer->byte_order);
+		mhii->image_id = get_guint32 (song->artwork->id, buffer->byte_order);
+		mhii->orig_img_size = get_gint32 (song->artwork->artwork_size, 
+				buffer->byte_order);
+		it = song->artwork->thumbnails;
+		break;
+	case DB_TYPE_PHOTO:
+		artwork = (Itdb_Artwork *)data;
+		mhii->song_id = get_gint64 (artwork->id + 2, buffer->byte_order);
+		mhii->image_id = get_guint32 (artwork->id, buffer->byte_order);
+		mhii->orig_date = get_guint32 (itdb_time_host_to_mac( artwork->creation_date )
+				, buffer->byte_order);
+		mhii->digitised_date = get_guint32 (itdb_time_host_to_mac( artwork->creation_date )
+				, buffer->byte_order);
+		it = artwork->thumbnails;
+		break;
+	}
 	num_children = 0;
-	for (it = song->artwork->thumbnails; it != NULL; it = it->next) {
+	while (it != NULL) {
 		iPodBuffer *sub_buffer;
 		Itdb_Thumb *thumb;
-		const IpodArtworkFormat *img_info;
+		const Itdb_ArtworkFormat *img_info;
 
-		mhii->num_children = GINT_TO_LE (num_children);
-		mhii->total_len = GINT_TO_LE (total_bytes);
+		mhii->num_children = get_gint32 (num_children, 
+						 buffer->byte_order);
+		mhii->total_len = get_gint32 (total_bytes, buffer->byte_order);
 		sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
 		if (sub_buffer == NULL) {
 			return -1;
 		}
 		thumb = (Itdb_Thumb *)it->data;
-		img_info = ipod_get_artwork_info_from_type (
-		    song->itdb->device, thumb->type);
+		img_info = itdb_get_artwork_info_from_type (
+		    db_get_device(db), thumb->type);
 		if (img_info == NULL) {
 			return -1;
 		}
-/* printf("correlation id: %d, type: %d\n", */
-/*        img_info->correlation_id, thumb->type); */
-/* printf("title: %s\n", song->title); */
-		bytes_written = write_mhod (thumb, img_info->correlation_id, 
+		bytes_written = write_mhod (db, thumb, img_info->correlation_id, 
 					    sub_buffer);
 		ipod_buffer_destroy (sub_buffer);
 		if (bytes_written == -1) {
@@ -469,10 +585,11 @@
 		}
 		total_bytes += bytes_written;
 		num_children++;
+		it = it->next;
 	}
 
-	mhii->num_children = GINT_TO_LE (num_children);
-	mhii->total_len = GINT_TO_LE (total_bytes);
+	mhii->num_children = get_gint32 (num_children, buffer->byte_order);
+	mhii->total_len = get_gint32 (total_bytes, buffer->byte_order);
 
 	dump_mhii (mhii);
 
@@ -480,9 +597,9 @@
 }
 
 static int
-write_mhli (Itdb_iTunesDB *db, iPodBuffer *buffer)
+write_mhli (Itdb_DB *db, iPodBuffer *buffer )
 {
-	GList *it;
+	GList *it = NULL;
 	MhliHeader *mhli;
 	unsigned int total_bytes;
 	int num_thumbs;
@@ -493,57 +610,161 @@
 	}
 
 	num_thumbs = 0;
-	total_bytes = GINT_FROM_LE (mhli->header_len);
-	for (it = db->tracks; it != NULL; it = it->next) {
+	total_bytes = get_gint32 (mhli->header_len, buffer->byte_order);
+	switch (buffer->db_type) {
+	case DB_TYPE_PHOTO:
+		it = db_get_photodb(db)->photos;
+		break;
+	case DB_TYPE_ITUNES:
+		it = db_get_itunesdb(db)->tracks;
+		break;
+	default:
+	        g_return_val_if_reached (-1);
+	}
+	while (it != NULL) {
 		Itdb_Track *song;
 		int bytes_written;
 		iPodBuffer *sub_buffer;
 
-		song = (Itdb_Track*)it->data;
-		if (song->artwork->id == 0) {
-			continue;
+		if (buffer->db_type == DB_TYPE_ITUNES) {
+			song = (Itdb_Track*)it->data;
+			if (song->artwork->id == 0) {
+				it = it->next;
+				continue;
+			}
 		}
 		sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
 		if (sub_buffer == NULL) {
-			continue;
+			break;
 		}
-		bytes_written = write_mhii (song, sub_buffer);
+		bytes_written = write_mhii (db, it->data, sub_buffer);
 		ipod_buffer_destroy (sub_buffer);
 		if (bytes_written != -1) {
 			num_thumbs++;
 			total_bytes += bytes_written;
-		}
+		} 
+		it = it->next;
 	}
+	mhli->num_children = get_gint32 (num_thumbs, buffer->byte_order);
+	dump_mhl ((MhlHeader *)mhli, "mhli");
 
-	mhli->num_children = GINT_TO_LE (num_thumbs);
+	return total_bytes;
+}
 
-	dump_mhl ((MhlHeader *)mhli, "mhli");
+static int
+write_mhia (gint image_id, iPodBuffer *buffer)
+{
+	MhiaHeader *mhia;
+	unsigned int total_bytes;
 
+
+	mhia = (MhiaHeader *)init_header (buffer, "mhia", 40);
+	if (mhia == NULL) {
+		return -1;
+	}
+
+	mhia->total_len = mhia->header_len;
+	mhia->image_id = get_gint32 (image_id, buffer->byte_order);
+	total_bytes = get_gint32 (mhia->header_len, buffer->byte_order);
+	dump_mhia( mhia );
 	return total_bytes;
 }
 
 static int
-write_mhla (Itdb_iTunesDB *db, iPodBuffer *buffer)
+write_mhba (Itdb_PhotoAlbum *photo_album, iPodBuffer *buffer)
 {
+	GList *it;
+	MhbaHeader *mhba;
+	iPodBuffer *sub_buffer;
+	unsigned int total_bytes;
+	unsigned int bytes_written;
+
+	mhba = (MhbaHeader *)init_header (buffer, "mhba", sizeof (MhbaHeader));
+	if (mhba == NULL) {
+		return -1;
+	}
+	mhba->num_mhods = get_gint32(1, buffer->byte_order);
+	mhba->playlist_id = get_gint32(photo_album->album_id, buffer->byte_order);
+	mhba->master = get_gint32(photo_album->master, buffer->byte_order);
+	mhba->prev_playlist_id = get_gint32(photo_album->prev_album_id, buffer->byte_order);
+	mhba->num_mhias = get_gint32(photo_album->num_images, buffer->byte_order);
+	total_bytes = get_gint32 (mhba->header_len, buffer->byte_order);
+
+	/* FIXME: Write other mhods */
+	/* Write album title */
+	sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
+	if (sub_buffer == NULL) {
+	    return -1;
+	}
+	bytes_written = write_mhod_type_1 (photo_album->name, sub_buffer);
+	ipod_buffer_destroy (sub_buffer);
+	if (bytes_written == -1) {
+	    return -1;
+	} 
+	total_bytes += bytes_written;
+
+	for (it = photo_album->members; it != NULL; it = it->next) {
+		gint image_id = GPOINTER_TO_INT(it->data);
+
+		sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
+		if (sub_buffer == NULL) {
+		    return -1;
+		}
+		bytes_written = write_mhia (image_id, sub_buffer);
+		ipod_buffer_destroy (sub_buffer);
+		if (bytes_written == -1) {
+		    return -1;
+		} 
+		total_bytes += bytes_written;
+	}
+	mhba->total_len = get_gint32( total_bytes, buffer->byte_order );
+	dump_mhba ( mhba );
+	return total_bytes;
+}
+
+static int
+write_mhla (Itdb_DB *db, iPodBuffer *buffer)
+{
+	GList *it;
 	MhlaHeader *mhla;
+	iPodBuffer *sub_buffer;
+	unsigned int total_bytes;
 
 	mhla = (MhlaHeader *)init_header (buffer, "mhla", sizeof (MhlaHeader));
 	if (mhla == NULL) {
 		return -1;
 	}
-	
+	total_bytes = get_gint32 (mhla->header_len, buffer->byte_order);
+	if (buffer->db_type == DB_TYPE_PHOTO) {
+	    unsigned int bytes_written;
+
+	    for (it = db_get_photodb(db)->photoalbums; it != NULL; it = it->next) {
+		Itdb_PhotoAlbum *photo_album = (Itdb_PhotoAlbum *)it->data;
+
+		sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
+		if (sub_buffer == NULL) {
+		    return -1;
+		}
+		bytes_written = write_mhba (photo_album, sub_buffer);
+		ipod_buffer_destroy (sub_buffer);
+		if (bytes_written == -1) {
+		    return -1;
+		} 
+		total_bytes += bytes_written;
+		mhla->num_children++;
+	    }
+	}
+
 	dump_mhl ((MhlHeader *)mhla, "mhla");
 
-	return GINT_FROM_LE (mhla->header_len);
+	return total_bytes;
 }
 
-
-
 static int
-write_mhif (Itdb_iTunesDB *db, iPodBuffer *buffer, enum iPodThumbnailType type)
+write_mhif (Itdb_DB *db, iPodBuffer *buffer, enum iPodThumbnailType type)
 {
 	MhifHeader *mhif;
-	const IpodArtworkFormat *img_info;
+	const Itdb_ArtworkFormat *img_info;
 	
 	mhif = (MhifHeader *)init_header (buffer, "mhif", sizeof (MhifHeader));
 	if (mhif == NULL) {
@@ -551,40 +772,52 @@
 	}
 	mhif->total_len = mhif->header_len;
 	
-	img_info = ipod_get_artwork_info_from_type (db->device, type);
+	img_info = itdb_get_artwork_info_from_type (db_get_device(db), type);
 	if (img_info == NULL) {
 		return -1;
 	}
+	mhif->correlation_id = get_gint32 (img_info->correlation_id, 
+					   buffer->byte_order);
+	mhif->image_size = get_gint32 (img_info->height * img_info->width * 2,
+				       buffer->byte_order);
 
-	mhif->correlation_id = GINT_TO_LE (img_info->correlation_id);
-	mhif->image_size = GINT_TO_LE (img_info->height * img_info->width * 2);
-
 	dump_mhif (mhif);
 	
-	return GINT_FROM_LE (mhif->header_len);
+	return get_gint32 (mhif->header_len, buffer->byte_order);
 }
 
-
 static int
-write_mhlf (Itdb_iTunesDB *db, iPodBuffer *buffer)
+write_mhlf (Itdb_DB *db, iPodBuffer *buffer)
 {
 	MhlfHeader *mhlf;
 	unsigned int total_bytes;
 	int bytes_written;
 	iPodBuffer *sub_buffer;
+	enum iPodThumbnailType thumb_type = IPOD_THUMBNAIL_FULL_SIZE;
 
 	mhlf = (MhlfHeader *)init_header (buffer, "mhlf", sizeof (MhlfHeader));
 	if (mhlf == NULL) {
 		return -1;
 	}
 
-	total_bytes = GINT_FROM_LE (mhlf->header_len);
+	total_bytes = get_gint32 (mhlf->header_len, buffer->byte_order);
 
 	sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
 	if (sub_buffer == NULL) {
 		return -1;
 	}
-	bytes_written = write_mhif (db, sub_buffer, IPOD_THUMBNAIL_FULL_SIZE);
+
+	switch (buffer->db_type) {
+	case DB_TYPE_ITUNES:
+		thumb_type = IPOD_THUMBNAIL_FULL_SIZE;
+		break;
+	case DB_TYPE_PHOTO:
+		thumb_type = IPOD_PHOTO_FULL_SIZE;
+		break;
+	}
+	bytes_written = write_mhif (db
+				  , sub_buffer
+				  , thumb_type);
 	ipod_buffer_destroy (sub_buffer);
 	if (bytes_written == -1) {
 		return -1;
@@ -598,13 +831,24 @@
 	 * thumbnails: F1016_1.ithmb for the bigger thumbnails (39200 bytes)
 	 * and F1017_1.ithmb for the 'now playing' thumbnails (6272)
 	 */
-	mhlf->num_files = GINT_TO_LE (1);
+	mhlf->num_files = get_gint32 (1, buffer->byte_order);
 
 	sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
 	if (sub_buffer == NULL) {
 		return -1;
 	}
-	bytes_written = write_mhif (db, sub_buffer, IPOD_THUMBNAIL_NOW_PLAYING);
+
+	switch (buffer->db_type) {
+	case DB_TYPE_ITUNES:
+		thumb_type = IPOD_THUMBNAIL_NOW_PLAYING;
+		break;
+	case DB_TYPE_PHOTO:
+		thumb_type = IPOD_PHOTO_LITTLE;
+		break;
+	}
+	bytes_written = write_mhif (db
+				  , sub_buffer
+				  , thumb_type);
 	ipod_buffer_destroy (sub_buffer);
 	if (bytes_written == -1) {
 		return -1;
@@ -618,7 +862,7 @@
 	 * thumbnails: F1016_1.ithmb for the bigger thumbnails (39200 bytes)
 	 * and F1017_1.ithmb for the 'now playing' thumbnails (6272)
 	 */
-	mhlf->num_files = GINT_TO_LE (2);
+	mhlf->num_files = get_gint32 (2, buffer->byte_order);
 
 	dump_mhl ((MhlHeader *)mhlf, "mhlf");
 
@@ -627,22 +871,22 @@
 
 
 static int 
-write_mhsd (Itdb_iTunesDB *db, iPodBuffer *buffer, enum MhsdType type)
+write_mhsd (Itdb_DB *db, iPodBuffer *buffer, enum MhsdType type)
 {
-	MhsdHeader *mhsd;
+	ArtworkDB_MhsdHeader *mhsd;
 	unsigned int total_bytes;
 	int bytes_written;
 	iPodBuffer *sub_buffer;
 
 	g_assert (type >= MHSD_TYPE_MHLI);
 	g_assert (type <= MHSD_TYPE_MHLF);
-	mhsd = (MhsdHeader *)init_header (buffer, "mhsd", sizeof (MhsdHeader));
+	mhsd = (ArtworkDB_MhsdHeader *)init_header (buffer, "mhsd", sizeof (ArtworkDB_MhsdHeader));
 	if (mhsd == NULL) {
 		return -1;
 	}
-	total_bytes = GINT_FROM_LE (mhsd->header_len);
-	mhsd->total_len = GINT_TO_LE (total_bytes);
-	mhsd->index = GINT_TO_LE (type);
+	total_bytes = get_gint32 (mhsd->header_len, buffer->byte_order);
+	mhsd->total_len = get_gint32 (total_bytes, buffer->byte_order);
+	mhsd->index = get_gint16 (type, buffer->byte_order);
 	bytes_written = -1;
 
 	sub_buffer = ipod_buffer_get_sub_buffer (buffer, total_bytes);
@@ -665,7 +909,7 @@
 		return -1;
 	} else {
 		total_bytes += bytes_written;
-		mhsd->total_len = GINT_TO_LE (total_bytes);
+		mhsd->total_len = get_gint32 (total_bytes, buffer->byte_order);
 	}
 
 	dump_mhsd (mhsd);
@@ -674,7 +918,7 @@
 }
 
 static int
-write_mhfd (Itdb_iTunesDB *db, iPodBuffer *buffer, int id_max)
+write_mhfd (Itdb_DB *db, iPodBuffer *buffer, int id_max)
 {
 	MhfdHeader *mhfd;
 	unsigned int total_bytes;
@@ -685,11 +929,18 @@
 	if (mhfd == NULL) {
 		return -1;
 	}
-	total_bytes = GINT_FROM_LE (mhfd->header_len);
-	mhfd->total_len = GINT_TO_LE (total_bytes);
-	mhfd->unknown2 = GINT_TO_LE (1);
-	mhfd->unknown4 = GINT_TO_LE (id_max);
-	mhfd->unknown7 = GINT_TO_LE (2);
+	total_bytes = get_gint32 (mhfd->header_len, buffer->byte_order);
+	mhfd->total_len = get_gint32 (total_bytes, buffer->byte_order);
+	switch (buffer->db_type) {
+	case DB_TYPE_PHOTO:
+		mhfd->unknown2 = get_gint32 (2, buffer->byte_order);
+		break;
+	case DB_TYPE_ITUNES:
+		mhfd->unknown2 = get_gint32 (1, buffer->byte_order);
+		break;
+	}
+	mhfd->next_id = get_gint32 (id_max, buffer->byte_order);
+	mhfd->unknown_flag1 = 2;
 	for (i = 1 ; i <= 3; i++) {
 		iPodBuffer *sub_buffer;
 
@@ -703,8 +954,8 @@
 			return -1;
 		}
 		total_bytes += bytes_written;
-		mhfd->total_len = GINT_TO_LE (total_bytes);
-		mhfd->num_children = GINT_TO_LE (i);
+		mhfd->total_len = get_gint32 (total_bytes, buffer->byte_order);
+		mhfd->num_children = get_gint32 (i, buffer->byte_order);
 	}
 
 	dump_mhfd (mhfd);
@@ -733,22 +984,26 @@
 }
 
 int
-ipod_write_artwork_db (Itdb_iTunesDB *db)
+ipod_write_artwork_db (Itdb_iTunesDB *itdb)
 {
 	iPodBuffer *buf;
 	int bytes_written;
 	int result;
 	char *filename;
 	int id_max;
+	Itdb_DB db;
 
+	db.db_type = DB_TYPE_ITUNES;
+	db.db.itdb = itdb;
+
 	/* First, let's write the .ithmb files, this will create the
 	 * various thumbnails as well */
 
-	itdb_write_ithumb_files (db);
+	itdb_write_ithumb_files (&db);
 	/* Now we can update the ArtworkDB file */
-	id_max = ipod_artwork_db_set_ids (db);
+	id_max = ipod_artwork_db_set_ids (itdb);
 
-	filename = ipod_db_get_artwork_db_path (db->mountpoint);
+	filename = ipod_db_get_artwork_db_path (itdb_get_mountpoint (itdb));
 	if (filename == NULL) {
 		/* FIXME: the iTunesDB will be inconsistent wrt artwork_count
 		 * it might be better to 0 out this field in all tracks
@@ -756,13 +1011,13 @@
 		 */
 		return -1;
 	}
-	buf = ipod_buffer_new (filename);
+	buf = ipod_buffer_new (filename, itdb->device->byte_order, DB_TYPE_ITUNES);
 	if (buf == NULL) {
 		g_print ("Couldn't create %s\n", filename);
 		g_free (filename);
 		return -1;
 	}
-	bytes_written = write_mhfd (db, buf, id_max);
+	bytes_written = write_mhfd (&db, buf, id_max);
 
 	/* Refcount of the mmap buffer should drop to 0 and this should
 	 * sync buffered data to disk
@@ -788,10 +1043,70 @@
 	g_free (filename);
 	return 0;
 }
+
+int
+ipod_write_photo_db (Itdb_PhotoDB *photodb)
+{
+	iPodBuffer *buf;
+	int bytes_written;
+	int result;
+	char *filename;
+	int id_max;
+	Itdb_DB db;
+
+	db.db_type = DB_TYPE_PHOTO;
+	db.db.photodb = photodb;
+
+	filename = ipod_db_get_photos_db_path (db_get_mountpoint (&db));
+
+	itdb_write_ithumb_files (&db);
+
+	if (filename == NULL) {
+		return -1;
+	}
+	buf = ipod_buffer_new (filename, photodb->device->byte_order, DB_TYPE_PHOTO);
+	if (buf == NULL) {
+		g_print ("Couldn't create %s\n", filename);
+		g_free (filename);
+		return -1;
+	}
+	id_max = itdb_get_free_photo_id( photodb );
+	bytes_written = write_mhfd (&db, buf, id_max);
+
+	/* Refcount of the mmap buffer should drop to 0 and this should
+	 * sync buffered data to disk
+	 * FIXME: it's probably less error-prone to add a ipod_buffer_mmap_sync
+	 * call...
+	 */
+	ipod_buffer_destroy (buf);
+
+	if (bytes_written == -1) {
+		g_print ("Failed to save %s\n", filename);
+		g_free (filename);
+		/* FIXME: maybe should unlink the file we may have created */
+		return -1;
+	}
+
+	result = truncate (filename, bytes_written);
+	if (result != 0) {
+		g_print ("Failed to truncate %s: %s\n", 
+			 filename, strerror (errno));
+		g_free (filename);	
+		return -1;
+	}
+	g_free (filename);
+	return 0;
+}
 #else
 int
-ipod_write_artwork_db (Itdb_iTunesDB *db)
+ipod_write_artwork_db (Itdb_iTunesDB *itdb)
 {
     return -1;
 }
+
+int
+ipod_write_photo_db (Itdb_PhotoDB *photodb)
+{
+    return -1;
+}
 #endif

Modified: libgpod/branches/upstream/current/src/db-image-parser.c
===================================================================
--- libgpod/branches/upstream/current/src/db-image-parser.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-image-parser.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -29,20 +29,23 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include "itdb_device.h"
+#include "itdb_endianness.h"
 #include "db-artwork-parser.h"
 #include "db-image-parser.h"
 #include <glib/gi18n-lib.h>
 
 static int
-image_type_from_corr_id (IpodDevice *ipod, int corr_id)
+image_type_from_corr_id (Itdb_Device *device, gint16 corr_id)
 {
-	const IpodArtworkFormat *formats;
+	const Itdb_ArtworkFormat *formats;
 
-	if (ipod == NULL) {
+	if (device == NULL) {
 		return -1;
 	}
 
-	g_object_get (G_OBJECT (ipod), "artwork-formats", &formats, NULL);
+	formats = itdb_device_get_artwork_formats (device);
+
 	if (formats == NULL) {
 		return -1;
 	}
@@ -58,16 +61,17 @@
 }
 
 
-G_GNUC_INTERNAL const IpodArtworkFormat *
-ipod_get_artwork_info_from_type (IpodDevice *ipod, int image_type)
+G_GNUC_INTERNAL const Itdb_ArtworkFormat *
+itdb_get_artwork_info_from_type (Itdb_Device *device,
+				 ItdbThumbType image_type)
 {
-	const IpodArtworkFormat *formats;
+	const Itdb_ArtworkFormat *formats;
 	
-	if (ipod == NULL) {
+	if (device == NULL) {
 		return NULL;
 	}
 
-	g_object_get (G_OBJECT (ipod), "artwork-formats", &formats, NULL);
+	formats = itdb_device_get_artwork_formats (device);
 	if (formats == NULL) {
 		return NULL;
 	}
@@ -84,25 +88,38 @@
 }
 
 G_GNUC_INTERNAL Itdb_Thumb *
-ipod_image_new_from_mhni (MhniHeader *mhni, Itdb_iTunesDB *db)
+ipod_image_new_from_mhni (MhniHeader *mhni, Itdb_DB *db)
 {
+	Itdb_Thumb *img;
+	gint16 corr_id;
+	Itdb_Device *device = NULL;
 
-	Itdb_Thumb *img;
 	img = g_new0 (Itdb_Thumb, 1);
 	if (img == NULL) {
 		return NULL;
 	}
-	img->size   = GUINT32_FROM_LE (mhni->image_size);
-	img->offset = GUINT32_FROM_LE (mhni->ithmb_offset);
-	img->width  = GINT16_FROM_LE (mhni->image_width);
-	img->height = GINT16_FROM_LE (mhni->image_height);
+	img->size   = get_guint32_db (db, mhni->image_size);
+	img->offset = get_guint32_db (db, mhni->ithmb_offset);
+	img->width  = get_gint16_db (db, mhni->image_width);
+	img->height = get_gint16_db (db, mhni->image_height);
+	img->horizontal_padding  =
+	    get_gint16_db (db, mhni->horizontal_padding);
+	img->vertical_padding =
+	    get_gint16_db (db, mhni->vertical_padding);
 
-	img->type = image_type_from_corr_id (db->device, mhni->correlation_id);
-	if ((img->type != IPOD_COVER_SMALL) && (img->type != IPOD_COVER_LARGE)) {
-		g_warning ("Unexpected cover type in mhni: type %d, size: %ux%u (%d), offset: %d\n", 
-			   img->type, img->width, img->height, mhni->correlation_id, img->offset);
-		g_free (img);
-		return NULL;
+	device = db_get_device (db);
+	g_return_val_if_fail (device, NULL);
+
+	corr_id = get_gint32_db (db, mhni->correlation_id);
+	img->type = image_type_from_corr_id (device, corr_id);
+
+	if (img->type == -1)
+	{
+	    g_warning (_("Unexpected image type in mhni: size: %ux%u (%d), offset: %d\n"), 
+		       img->width, img->height, 
+		       corr_id, img->offset);
+	    g_free (img);
+	    return NULL;
 	}
 
 	return img;

Modified: libgpod/branches/upstream/current/src/db-image-parser.h
===================================================================
--- libgpod/branches/upstream/current/src/db-image-parser.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-image-parser.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -20,12 +20,15 @@
  * 
  *  This product is not supported/written/published by Apple!
  *
+ *  $Id: db-image-parser.h,v 1.9 2006/06/04 16:24:44 jcsjcs Exp $
  */
 
 #ifndef IMAGE_PARSER_H
 #define IMAGE_PARSER_H
 
 #include "db-itunes-parser.h"
+#include "itdb_device.h"
+#include "itdb_private.h"
 #include "itdb.h"
 
 #define RED_BITS   5
@@ -41,11 +44,12 @@
 #define BLUE_MASK (((1 << BLUE_BITS)-1) << BLUE_SHIFT)
 
 G_GNUC_INTERNAL Itdb_Thumb *ipod_image_new_from_mhni (MhniHeader *mhni, 
-						      Itdb_iTunesDB *db);
+						      Itdb_DB *db);
 
-G_GNUC_INTERNAL int itdb_write_ithumb_files (Itdb_iTunesDB *db);
+G_GNUC_INTERNAL int itdb_write_ithumb_files (Itdb_DB *db);
 
-G_GNUC_INTERNAL const IpodArtworkFormat *ipod_get_artwork_info_from_type (
-    IpodDevice *ipod, int image_type);
+G_GNUC_INTERNAL
+const Itdb_ArtworkFormat *itdb_get_artwork_info_from_type (
+    Itdb_Device *ipod, ItdbThumbType image_type);
 
 #endif

Modified: libgpod/branches/upstream/current/src/db-itunes-parser.h
===================================================================
--- libgpod/branches/upstream/current/src/db-itunes-parser.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-itunes-parser.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -49,13 +49,15 @@
 
 
 typedef struct _MhbdHeader MhbdHeader;
-typedef struct _MhsdHeader MhsdHeader;
+typedef struct _ArtworkDB_MhsdHeader ArtworkDB_MhsdHeader;
+/*typedef struct _MhsdHeader MhsdHeader;*/
 typedef struct _MhltHeader MhltHeader;
 typedef struct _MhlpHeader MhlpHeader;
 typedef struct _MhypHeader MhypHeader;
 typedef struct _MhipHeader MhipHeader;
 typedef struct _MhitHeader MhitHeader;
-typedef struct _MhodHeader MhodHeader;
+typedef struct _ArtworkDB_MhodHeader ArtworkDB_MhodHeader;
+/*typedef struct _MhodHeader MhodHeader;*/
 typedef struct _MhfdHeader MhfdHeader;
 typedef struct _MhliHeader MhliHeader;
 typedef struct _MhiiHeader MhiiHeader;
@@ -68,9 +70,10 @@
 
 typedef struct _MhitHeader471 MhitHeader471;
 /* MHOD typedef mess */
+typedef struct _ArtworkDB_MhodHeaderArtworkType3 ArtworkDB_MhodHeaderArtworkType3;
 typedef struct _MhodHeaderString MhodHeaderString;
 typedef struct _MhodHeaderArtworkType1 MhodHeaderArtworkType1;
-typedef struct _MhodHeaderArtworkType3 MhodHeaderArtworkType3;
+/* typedef struct _MhodHeaderArtworkType3 MhodHeaderArtworkType3; */
 typedef struct _MhodHeaderSmartPlaylistData MhodHeaderSmartPlaylistData;
 typedef struct _MhodHeaderSmartPlaylistRuleString MhodHeaderSmartPlaylistRuleString; 
 typedef struct _MhodHeaderSmartPlaylistRuleNonString MhodHeaderSmartPlaylistRuleNonString;
@@ -99,14 +102,27 @@
 	MHSD_FILE_LIST = 3
 };
 
-struct _MhsdHeader {
+struct _ArtworkDB_MhsdHeader {
 	unsigned char header_id[4];
 	gint32 header_len;
 	gint32 total_len;
+        /* Strangely, the following field is only 16 bits long in the
+	 * ArtworkDB (it's definitely 32 bits in the iTunesDB). This
+	 * could well be an error with the first generation of mobile
+	 * phones with iPod support).
+	 */
+	gint16 index;
+        gint16 unknown014;
+	unsigned char padding[];
+};
+
+struct _iTunesDB_MhsdHeader {
+	unsigned char header_id[4];
+	gint32 header_len;
+	gint32 total_len;
 	gint32 index;
 	unsigned char padding[];
 };
-
 struct _MhltHeader {
 	unsigned char header_id[4];
 	gint32 header_len;
@@ -305,6 +321,21 @@
 	gint32 unknown2;
 };
 
+struct _ArtworkDB_MhodHeader {
+	unsigned char header_id[4];
+	gint32 header_len;
+	gint32 total_len;
+    /* Strangely, the following field is only 16 bits long in the
+	 * ArtworkDB (it's definitely 32 bits in the iTunesDB). This
+	 * could well be an error with the first generation of mobile
+	 * phones with iPod support).
+	 */
+	gint16 type;
+    gint16 unknown014;
+	gint32 unknown1;
+	gint32 unknown2;
+};
+
 struct _MhodHeaderString {
 	unsigned char header_id[4];
 	gint32 header_len;
@@ -334,7 +365,9 @@
 	unsigned char header_id[4];
 	gint32 header_len;
 	gint32 total_len;
-	gint32 type; /* low 3 bytes are type (always 1); high byte is padding length (0-3) */
+	gint16 type; 
+	gint8 unknown;
+	gint8 padding;
 	gint32 unknown1;
 	gint32 unknown2;
 	gint32 string_len;
@@ -347,7 +380,8 @@
 	unsigned char header_id[4];
 	gint32 header_len;
 	gint32 total_len;
-	gint32 type; /* 3 */
+	gint16 type; /* 3 */
+	gint16 padding; /* high byte is padding length (0-3) */
 	gint32 unknown1;
 	gint32 unknown2;
 	gint32 string_len;
@@ -356,6 +390,25 @@
 	gunichar2 string[];
 };
 
+struct _ArtworkDB_MhodHeaderArtworkType3 {
+	unsigned char header_id[4];
+	gint32 header_len;
+	gint32 total_len;
+        gint16 type; /* 3 */
+        gint8  unknown13;
+	gint8  padding;
+	gint32 unknown1;
+	gint32 unknown2;
+	gint32 string_len;
+	gint8 mhod_version; /* 0,1: string is UTF8, 2: string is
+			       UTF16-LE */
+        gint8 unknown5;
+        gint16 unknown6;
+	gint32 unknown4;
+        gchar  string[];
+};
+
+
 enum MhodLimitType {
 	MHOD_LIMIT_MINUTES = 1,
 	MHOD_LIMIT_MEGABYTES = 2,
@@ -491,10 +544,13 @@
 	gint32 unknown2;
 	gint32 num_children;
 	gint32 unknown3;
-	gint32 unknown4;
+	gint32 next_id;
 	gint64 unknown5;
 	gint64 unknown6;
-	gint32 unknown7;
+	gint8  unknown_flag1;
+	gint8  unknown_flag2;
+	gint8  unknown_flag3;
+	gint8  unknown_flag4;
 	gint32 unknown8;
 	gint32 unknown9;
 	gint32 unknown10;
@@ -519,8 +575,8 @@
 	gint32 unknown4;
 	gint32 unknown5;
 	gint32 unknown6;
-	gint32 unknown7;
-	gint32 unknown8;
+	gint32 orig_date;
+	gint32 digitised_date;
 	gint32 orig_img_size;
 	unsigned char padding[];
 } __attribute__((__packed__));
@@ -538,7 +594,8 @@
 	gint32 correlation_id;
 	gint32 ithmb_offset;
 	gint32 image_size;
-	gint32 unknown3;
+	gint16 vertical_padding;
+	gint16 horizontal_padding;
 	gint16 image_height;
 	gint16 image_width;
 	unsigned char padding[];
@@ -559,9 +616,19 @@
 	gint32 num_mhias; /* number of pictures in the album */
 	gint32 playlist_id; /* starts out at $64 and increments by 1 */
 	gint32 unknown2; /* unknown, seems to be always 0 */
-	gint32 unknown3; /* unknown, but is 0x10000 for the Photo Library and 0x60000 for normal albums
-			  * (maybe not a 4 byte field?) */
-	gint32 unknown[7]; /* more zeroes */
+	gint16 unknown3; /* unknown, seems to be always 0 */
+	gchar master;
+	/* FIXME: not sure if I have these right; iPod doesn't seem to listen to them */
+	guint8 playmusic;
+	guint8 repeat;
+	guint8 random;
+	guint8 show_titles;
+	guint8 transition_direction;
+	gint32 slide_duration;
+	gint32 transition_duration;
+	gint32 unknown4;
+	gint32 unknown5;
+	gint64 song_id;
 	gint32 prev_playlist_id; /* the id of the previous playlist */
 	unsigned char padding[];
 };

Modified: libgpod/branches/upstream/current/src/db-parse-context.c
===================================================================
--- libgpod/branches/upstream/current/src/db-parse-context.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-parse-context.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -35,9 +35,10 @@
 #include "glib-compat.h"
 #include "db-parse-context.h"
 #include "db-itunes-parser.h"
+#include "itdb_endianness.h"
 
 DBParseContext *
-db_parse_context_new (const unsigned char *buffer, off_t len)
+db_parse_context_new (const unsigned char *buffer, off_t len, guint byte_order)
 {
 	DBParseContext *result;
 
@@ -49,6 +50,7 @@
 	result->buffer = buffer;
 	result->cur_pos = buffer;
 	result->total_len = len;
+	result->byte_order = byte_order;
 
 	return result;
 }
@@ -102,11 +104,16 @@
 DBParseContext *
 db_parse_context_get_sub_context (DBParseContext *ctx, off_t offset)
 {
+	DBParseContext *sub_ctx;
+
 	if (offset >= ctx->total_len) {
 		return NULL;
 	}
-	return db_parse_context_new (&ctx->buffer[offset], 
-				     ctx->total_len - offset);
+	sub_ctx = db_parse_context_new (&ctx->buffer[offset], 
+				     ctx->total_len - offset, 
+				     ctx->byte_order);
+	sub_ctx->db = ctx->db;
+	return sub_ctx;
 }
 
 
@@ -127,15 +134,21 @@
 db_parse_context_get_m_header_internal (DBParseContext *ctx, const char *id, off_t size) 
 {
 	MHeader *h;
+	char *header_id;
 
 	if (db_parse_context_get_remaining_length (ctx) < 8) {
 		return NULL;
 	}
 
 	h = (MHeader *)ctx->cur_pos;
-	if (strncmp (id, (char *)h->header_id, 4) != 0) {
+	header_id = g_strndup ((char *)h->header_id, 4);
+	if (ctx->byte_order == G_BIG_ENDIAN) {
+		g_strreverse (header_id);
+	}
+	if (strncmp (id, header_id, 4) != 0) {
 		return NULL;
 	}
+	g_free (header_id);
 
 	/* FIXME: this test sucks for compat: if a field is smaller than 
 	 * expected, we probably should create a buffer of the appropriate 
@@ -143,27 +156,32 @@
 	 * that buffer in the rest of the code (maybe it's harmful to have
 	 * some fields at 0 in some headers though...)
 	 */
-	if (GINT_FROM_LE (h->header_len) < size) {
+	if (get_gint32 (h->header_len, ctx->byte_order) < size) {
 		return NULL;
 	}
 
-	db_parse_context_set_header_len (ctx, GINT_FROM_LE (h->header_len));
+	db_parse_context_set_header_len (ctx, get_gint32 (h->header_len, 
+							  ctx->byte_order));
 
 	return h;
 }
 
 DBParseContext *
-db_parse_context_new_from_file (const char *filename)
+db_parse_context_new_from_file (const char *filename, Itdb_DB *db)
 {
 	int fd;
 	struct stat stat_buf;
 	int result;
 	unsigned char *buffer;
 	DBParseContext *ctx;
+	Itdb_Device *device;
 
 	buffer = NULL;
 	ctx = NULL;
 
+	device = db_get_device (db);
+	g_return_val_if_fail (device, NULL);
+
 	fd = open (filename, O_RDONLY);
 	if (fd == -1) {
 		g_print ("Failed to open %s: %s\n", 
@@ -196,10 +214,17 @@
 		goto error;
 	}
 
-	ctx = db_parse_context_new (buffer, stat_buf.st_size);
+	if (device->byte_order == 0)
+	    itdb_device_autodetect_endianess (device);
+
+	ctx = db_parse_context_new (buffer,
+				    stat_buf.st_size, device->byte_order);
+
 	if (ctx == NULL) {
 		munmap (buffer, stat_buf.st_size);
 	}
+	ctx->db = db;
+
  error:
 	close (fd);
 	return ctx;

Modified: libgpod/branches/upstream/current/src/db-parse-context.h
===================================================================
--- libgpod/branches/upstream/current/src/db-parse-context.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/db-parse-context.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -14,25 +14,56 @@
  *  
  *  You should have received a copy of the GNU Lesser General Public
  *  License along with this code; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA
  * 
  *  iTunes and iPod are trademarks of Apple
  * 
  *  This product is not supported/written/published by Apple!
  *
+ *  $Id: db-parse-context.h,v 1.6 2006/06/04 16:24:44 jcsjcs Exp $
  */
+/*
+ *  Copyright (C) 2005 Christophe Fergeau
+ *
+ * 
+ *  The code contained in this file is free software; you can redistribute
+ *  it and/or modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either version
+ *  2.1 of the License, or (at your option) any later version.
+ *  
+ *  This file is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this code; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA
+ * 
+ *  iTunes and iPod are trademarks of Apple
+ * 
+ *  This product is not supported/written/published by Apple!
+ *
+ *  $Id: db-parse-context.h,v 1.6 2006/06/04 16:24:44 jcsjcs Exp $
+ */
 
 
 #ifndef DB_PARSE_CONTEXT
 #define DB_PARSE_CONTEXT
 
 #include <sys/types.h>
+#include "itdb.h"
+#include "itdb_private.h"
 
 struct _DBParseContext {
 	const unsigned char *buffer;
 	const unsigned char *cur_pos;
 	off_t header_len;
 	off_t total_len;
+	guint byte_order;
+	Itdb_DB *db;
 };
 
 typedef struct _DBParseContext DBParseContext;
@@ -40,15 +71,33 @@
 
 #define db_parse_context_get_m_header(ctx, type, id) (type *)db_parse_context_get_m_header_internal (ctx, id, sizeof (type))
 
-G_GNUC_INTERNAL DBParseContext *db_parse_context_new (const unsigned char *buffer, off_t len) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL void db_parse_context_set_total_len (DBParseContext *ctx, off_t len) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL off_t db_parse_context_get_remaining_length (DBParseContext *ctx) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL DBParseContext *db_parse_context_get_sub_context (DBParseContext *ctx, 
-						  off_t offset) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL DBParseContext *db_parse_context_get_next_child (DBParseContext *ctx) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL void *db_parse_context_get_m_header_internal (DBParseContext *ctx, const char *id, off_t size) G_GNUC_INTERNAL;
+G_GNUC_INTERNAL DBParseContext *
+db_parse_context_new (const unsigned char *buffer, 
+		      off_t len, guint byte_order);
 
-G_GNUC_INTERNAL DBParseContext *db_parse_context_new_from_file (const char *filename) G_GNUC_INTERNAL;
-G_GNUC_INTERNAL void db_parse_context_destroy (DBParseContext *ctx, gboolean unmap);
+G_GNUC_INTERNAL void 
+db_parse_context_set_total_len (DBParseContext *ctx, off_t len);
 
+G_GNUC_INTERNAL off_t 
+db_parse_context_get_remaining_length (DBParseContext *ctx) G_GNUC_INTERNAL;
+
+G_GNUC_INTERNAL DBParseContext *
+db_parse_context_get_sub_context (DBParseContext *ctx, off_t offset);
+
+
+G_GNUC_INTERNAL DBParseContext *
+db_parse_context_get_next_child (DBParseContext *ctx);
+
+
+G_GNUC_INTERNAL void *
+db_parse_context_get_m_header_internal (DBParseContext *ctx, 
+					const char *id, off_t size);
+
+G_GNUC_INTERNAL DBParseContext *
+db_parse_context_new_from_file (const char *filename, Itdb_DB *db);
+
+
+G_GNUC_INTERNAL void 
+db_parse_context_destroy (DBParseContext *ctx, gboolean unmap);
+
 #endif

Modified: libgpod/branches/upstream/current/src/glib-compat.h
===================================================================
--- libgpod/branches/upstream/current/src/glib-compat.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/glib-compat.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,3 +1,29 @@
+/*
+ *  Copyright (C) 2005 Christophe Fergeau
+ *
+ * 
+ *  The code contained in this file is free software; you can redistribute
+ *  it and/or modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either version
+ *  2.1 of the License, or (at your option) any later version.
+ *  
+ *  This file is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this code; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA
+ * 
+ *  iTunes and iPod are trademarks of Apple
+ * 
+ *  This product is not supported/written/published by Apple!
+ *
+ *  $Id: glib-compat.h,v 1.3 2006/06/04 16:24:44 jcsjcs Exp $
+ */
+
 #ifndef GLIB_COMPAT_H
 #define GLIB_COMPAT_H
 

Deleted: libgpod/branches/upstream/current/src/hal-common.c
===================================================================
--- libgpod/branches/upstream/current/src/hal-common.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/hal-common.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,95 +0,0 @@
-/* Time-stamp: <2005-12-10 00:22:44 jcs>
-|
-|  Copyright (C) 2005 Jorg Schuler <jcsjcs at users sourceforge net>
-|  Part of the gtkpod project.
-| 
-|  URL: http://www.gtkpod.org/
-|  URL: http://gtkpod.sourceforge.net/
-|
-|
-|  The source is taken from libipoddevice, CVS version October 8 2005
-|  (http://64.14.94.162/index.php/Libipoddevice).
-|
-|  I decided not to make libgpod dependent on libipoddevice because
-|  the latter depends on libraries not widely available yet (libhal >=
-|  0.5.2, glib >= 2.8). It is planned to replace these files with a
-|  libipoddevice dependence at some later time.
-|
-|  The following changes were done:
-|
-|  - libhal becomes optional (see #ifdef HAVE_LIBHAL sections)
-|  - provide some dummy libhal functions to make libhal-independence
-|    of ipod-device.c easier.
-|
-|  Because of these changes only a limited amount of functionality is
-|  available. See ipod-device.h for summary.
-|
-|
-|
-|
-|  $Id: hal-common.c,v 1.6 2005/12/09 15:24:40 jcsjcs Exp $
-*/
-/* ex: set ts=4: */
-/***************************************************************************
-*  hal-common.c
-*  Copyright (C) 2005 Novell 
-*  Written by Aaron Bockover <aaron at aaronbock.net>
-****************************************************************************/
-
-/*  
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of version 2.1 of the GNU Lesser General Public
- *  License as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Lesser Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- *  USA
- */
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include "itdb_private.h"
-#include "hal-common.h"
-
-#ifndef HAVE_LIBHAL
-gchar **libhal_manager_find_device_string_match (LibHalContext *hal_ctx,
-						 const gchar *type,
-						 const gchar *str,
-						 gint *vol_count,
-						 void *error)
-{
-/*    gchar **volumes = g_new0 (gchar *, 2);
-      volumes[0] = g_strdup (type);*/
-    gchar **volumes = NULL;
-    *vol_count = 0;
-    return volumes;
-}
-void libhal_free_string_array (gchar **volumes)
-{
-/*    g_strfreev (volumes);*/
-}
-gboolean libhal_device_property_exists (LibHalContext *hal_ctx,
-					const gchar *vol,
-					const gchar *prop,
-					void *error)
-{
-    return FALSE;
-}
-gboolean libhal_device_get_property_bool (LibHalContext *hal_ctx,
-					  const gchar *vol,
-					  const gchar *prop,
-					  void *error)
-{
-    return FALSE;
-}
-void libhal_ctx_shutdown (LibHalContext *hal_ctx, void *error) {}
-void libhal_ctx_free (LibHalContext *hal_ctx) {}
-#endif

Deleted: libgpod/branches/upstream/current/src/hal-common.h
===================================================================
--- libgpod/branches/upstream/current/src/hal-common.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/hal-common.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,95 +0,0 @@
-/* Time-stamp: <2005-10-10 01:23:30 jcs>
-|
-|  Copyright (C) 2005 Jorg Schuler <jcsjcs at users sourceforge net>
-|  Part of the gtkpod project.
-| 
-|  URL: http://www.gtkpod.org/
-|  URL: http://gtkpod.sourceforge.net/
-|
-|
-|  The source is taken from libipoddevice, CVS version October 8 2005
-|  (http://64.14.94.162/index.php/Libipoddevice).
-|
-|  I decided not to make libgpod dependent on libipoddevice because
-|  the latter depends on libraries not widely available yet (libhal >=
-|  0.5.2, glib >= 2.8). It is planned to replace these files with a
-|  libipoddevice dependence at some later time.
-|
-|  The following changes were done:
-|
-|  - libhal becomes optional (see #if HAVE_LIBHAL sections)
-|  - provide some dummy libhal functions to make libhal-independence
-|    of ipod-device.c easier.
-|
-|  Because of these changes only a limited amount of functionality is
-|  available. See ipod-device.h for summary.
-|
-|
-|
-|
-|  $Id: hal-common.h,v 1.4 2005/11/21 19:50:27 teuf Exp $
-*/
-/* ex: set ts=4: */
-/***************************************************************************
-*  hal-common.h
-*  Copyright (C) 2005 Novell 
-*  Written by Aaron Bockover <aaron at aaronbock.net>
-****************************************************************************/
-
-/*  
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of version 2.1 of the GNU Lesser General Public
- *  License as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Lesser Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- *  USA
- */
-
-#ifndef HAL_COMMON_H
-#define HAL_COMMON_H
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <glib.h>
-#include <glib-object.h>
-
-#ifdef HAVE_LIBHAL
-
-#include <libhal.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
-
-dbus_bool_t hal_mainloop_integration(LibHalContext *ctx, DBusError *error);
-void ipod_device_set_global_main_context(GMainContext *ctx);
-
-#else
-typedef void LibHalContext;
-G_GNUC_INTERNAL gchar **libhal_manager_find_device_string_match (LibHalContext *hal_ctx,
-								 const gchar *dev,
-								 const gchar *str,
-								 gint *vol_count,
-								 void *error);
-G_GNUC_INTERNAL void libhal_free_string_array (gchar **volumes);
-G_GNUC_INTERNAL gboolean libhal_device_property_exists (LibHalContext *hal_ctx,
-							const gchar *vol,
-							const gchar *prop,
-							void *error);
-G_GNUC_INTERNAL gboolean libhal_device_get_property_bool (LibHalContext *hal_ctx,
-							  const gchar *vol,
-							  const gchar *prop,
-							  void *error);
-G_GNUC_INTERNAL void libhal_ctx_shutdown (LibHalContext *hal_ctx, void *error);
-G_GNUC_INTERNAL void libhal_ctx_free (LibHalContext *hal_ctx);
-#endif
-
-
-#endif /* HAL_COMMON_H */

Modified: libgpod/branches/upstream/current/src/itdb.h
===================================================================
--- libgpod/branches/upstream/current/src/itdb.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-11-29 00:56:25 jcs>
+/* Time-stamp: <2006-09-23 21:25:40 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -30,7 +30,7 @@
 |
 |  This product is not supported/written/published by Apple!
 |
-|  $Id: itdb.h,v 1.24 2005/11/28 16:20:40 jcsjcs Exp $
+|  $Id: itdb.h,v 1.43 2006/09/23 12:28:23 jcsjcs Exp $
 */
 
 #ifndef __ITUNESDB_H__
@@ -40,8 +40,6 @@
 #  include <config.h>
 #endif
 
-#include "ipod-device.h"
-
 #include <sys/types.h>
 #include <time.h>
 #include <glib.h>
@@ -56,14 +54,18 @@
 typedef void (* ItdbUserDataDestroyFunc) (gpointer userdata);
 typedef gpointer (* ItdbUserDataDuplicateFunc) (gpointer userdata);
 
+typedef struct _Itdb_Device Itdb_Device;
 typedef struct _Itdb_Artwork Itdb_Artwork;
 typedef struct _Itdb_Thumb Itdb_Thumb;
 typedef struct _SPLPref SPLPref;
 typedef struct _SPLRule SPLRule;
 typedef struct _SPLRules SPLRules;
 typedef struct _Itdb_iTunesDB Itdb_iTunesDB;
+typedef struct _Itdb_PhotoDB Itdb_PhotoDB;
 typedef struct _Itdb_Playlist Itdb_Playlist;
+typedef struct _Itdb_PhotoAlbum Itdb_PhotoAlbum;
 typedef struct _Itdb_Track Itdb_Track;
+typedef struct _Itdb_IpodInfo Itdb_IpodInfo;
 
 
 /* ------------------------------------------------------------ *\
@@ -86,7 +88,7 @@
 /* The Itdb_Thumb structure can represent two slightly different
    thumbnails:
 
-   - a thumbnail before it's transferred to the iPod.
+  a) a thumbnail before it's transferred to the iPod.
 
      offset and size are 0
 
@@ -96,31 +98,106 @@
 
      type is set according to the type this thumbnail represents
 
-     filename point to a 'real' image file.
+     filename point to a 'real' image file OR image_data and
+     image_data_len are set.
  
-   - a thumbnail (big or small) stored on a database in the iPod.  In
+  b) a thumbnail (big or small) stored on a database in the iPod.  In
      these cases, id corresponds to the ID originally used in the
      database, filename points to a .ithmb file on the iPod
  */
 struct _Itdb_Thumb {
     ItdbThumbType type;
     gchar *filename;
+    guchar *image_data;      /* holds the thumbnail data of
+				non-transfered thumbnails when
+				filename == NULL */
+    gsize  image_data_len;   /* length of data */
     guint32 offset;
     guint32 size;
     gint16 width;
     gint16 height;
+    gint16 horizontal_padding;
+    gint16 vertical_padding;
 };
 
 struct _Itdb_Artwork {
     GList *thumbnails;    /* list of Itdb_Thumbs */
     guint32 artwork_size; /* Size in bytes of the original source image */
-    guint id;             /* some kind of ID, starting with
+    guint32 id;           /* Artwork id used by photoalbums, starts at
 			   * 0x40... libgpod will set this on sync. */
+    gint32 creation_date; /* Date the image was created */
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
 };
 
 
 /* ------------------------------------------------------------ *\
  *
+ * iPod model-relevant definitions
+ *
+\* ------------------------------------------------------------ */
+
+typedef enum {
+    ITDB_IPOD_GENERATION_UNKNOWN,
+    ITDB_IPOD_GENERATION_FIRST,
+    ITDB_IPOD_GENERATION_SECOND,
+    ITDB_IPOD_GENERATION_THIRD,
+    ITDB_IPOD_GENERATION_FOURTH,
+    ITDB_IPOD_GENERATION_FIFTH,
+    ITDB_IPOD_GENERATION_SIXTH,
+    ITDB_IPOD_GENERATION_MOBILE
+} Itdb_IpodGeneration;
+
+typedef enum {
+    ITDB_IPOD_MODEL_INVALID,
+    ITDB_IPOD_MODEL_UNKNOWN,
+    ITDB_IPOD_MODEL_COLOR,
+    ITDB_IPOD_MODEL_COLOR_U2,
+    ITDB_IPOD_MODEL_REGULAR,
+    ITDB_IPOD_MODEL_REGULAR_U2,
+    ITDB_IPOD_MODEL_MINI,
+    ITDB_IPOD_MODEL_MINI_BLUE,
+    ITDB_IPOD_MODEL_MINI_PINK,
+    ITDB_IPOD_MODEL_MINI_GREEN,
+    ITDB_IPOD_MODEL_MINI_GOLD,
+    ITDB_IPOD_MODEL_SHUFFLE,
+    ITDB_IPOD_MODEL_NANO_WHITE,
+    ITDB_IPOD_MODEL_NANO_BLACK,
+    ITDB_IPOD_MODEL_VIDEO_WHITE,
+    ITDB_IPOD_MODEL_VIDEO_BLACK,
+    ITDB_IPOD_MODEL_MOBILE_1,
+    ITDB_IPOD_MODEL_VIDEO_U2,
+    ITDB_IPOD_MODEL_NANO_SILVER,
+    ITDB_IPOD_MODEL_NANO_BLUE,
+    ITDB_IPOD_MODEL_NANO_GREEN,
+    ITDB_IPOD_MODEL_NANO_PINK
+} Itdb_IpodModel;
+
+struct _Itdb_IpodInfo {
+       /* model_number is abbreviated: if the first character is not
+	  numeric, it is ommited. e.g. "MA350 -> A350", "M9829 -> 9829" */
+	const gchar *model_number;
+        const double capacity;  /* in GB */
+	const Itdb_IpodModel ipod_model;
+	const Itdb_IpodGeneration ipod_generation;
+        /* Number of music (Fnn) dirs created by iTunes. The exact
+	   number seems to be version dependent. Therefore, the
+	   numbers here represent a mixture of reported values and
+	   common sense. Note: this number does not necessarily
+	   represent the number of dirs present on a particular
+	   iPod. It is used when setting up a new iPod from
+	   scratch. */
+        const guint musicdirs;
+};
+
+
+/* ------------------------------------------------------------ *\
+ *
  * Smart Playlists (Rules)
  *
 \* ------------------------------------------------------------ */
@@ -389,14 +466,26 @@
 /* one star is how much (track->rating) */
 #define ITDB_RATING_STEP 20
 
+struct _Itdb_PhotoDB
+{
+    GList *photos;
+    GList *photoalbums;
+    Itdb_Device *device;/* iPod device info     */
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+};
+
 struct _Itdb_iTunesDB
 {
     GList *tracks;
     GList *playlists;
     gchar *filename;    /* filename of iTunesDB */
-    gchar *mountpoint;  /* mountpoint of iPod (if available) */
-    IpodDevice *device;
-    gint   musicdirs;   /* number of /iPod_Control/Music/F.. dirs */
+    Itdb_Device *device;/* iPod device info     */
     guint32 version;
     guint64 id;
     /* below is for use by application */
@@ -408,12 +497,31 @@
     ItdbUserDataDestroyFunc userdata_destroy;
 };
 
+struct _Itdb_PhotoAlbum
+{
+    gchar *name;          /* name of photoalbum in UTF8            */
+    GList *members;       /* photos in album (Track *)             */
+    gint  num_images;     /* number of photos in album             */
+    gint  master;         /* 0x01 for master, 0x00 otherwise       */
+    gint  album_id;
+    gint  prev_album_id;
+    /* below is for use by application */
+    guint64 usertype;
+    gpointer userdata;
+    /* function called to duplicate userdata */
+    ItdbUserDataDuplicateFunc userdata_duplicate;
+    /* function called to free userdata */
+    ItdbUserDataDestroyFunc userdata_destroy;
+};
 
 struct _Itdb_Playlist
 {
     Itdb_iTunesDB *itdb;  /* pointer to iTunesDB (for convenience) */
     gchar *name;          /* name of playlist in UTF8              */
-    guint32 type;         /* ITDB_PL_TYPE_NORM/_MPL                */
+    guint8 type;          /* ITDB_PL_TYPE_NORM/_MPL                */
+    guint8 flag1;         /* unknown, usually set to 0             */
+    guint8 flag2;         /* unknown, always set to 0              */
+    guint8 flag3;         /* unknown, always set to 0              */
     gint  num;            /* number of tracks in playlist          */
     GList *members;       /* tracks in playlist (Track *)          */
     gboolean is_spl;      /* smart playlist?                       */
@@ -547,6 +655,9 @@
   gint32  tracks;            /* number of tracks       */
   gint32  bitrate;           /* bitrate                */
   guint16 samplerate;        /* samplerate (CD: 44100) */
+  guint16 samplerate_low;    /* in the iTunesDB the samplerate is
+                                multiplied by 0x10000 -- these are the
+				lower 16 bit, which are usually 0 */
   gint32  year;              /* year                   */
   gint32  volume;            /* volume adjustment              */
   guint32 soundcheck;        /* volume adjustment "soundcheck" */
@@ -563,33 +674,35 @@
 				playcount. */
   guint32 recent_playcount;  /* times track was played since last sync */
   gboolean transferred;      /* has file been transferred to iPod?  */
-  gint16 BPM;                /* supposed to vary the playback speed */
+  gint16  BPM;               /* supposed to vary the playback speed */
   guint8  app_rating;        /* star rating set by appl. (not
 			      * iPod). If the rating set on the iPod
 			        and the rating field above differ, the
 				original rating is copied here and the
 				new rating is stored above. */
-  guint16 type;              /* CBR MP3s are type 0x100, VBR MP3s are
-			        type 0x101, AAC are type 0x0 */
+  guint8  type1;             /* CBR MP3s and AAC are 0x00, VBR MP3s are
+			        0x01 */
+  guint8  type2;             /* MP3s are 0x01, AAC are 0x00 */
   guint8  compilation;
   guint32 starttime;
   guint32 stoptime;
-  guint8  checked;
+  guint8  checked;           /* 0x0: checkmark on track is set 0x1: not set */
   guint64 dbid;              /* unique database ID */
   guint32 drm_userid;        /* Apple Store/Audible User ID (for DRM'ed
 				files only, set to 0 otherwise). */
   guint32 visible;           /*  If this value is 1, the song is visible
 				 on the iPod. All other values cause
 				 the file to be hidden. */
-  gchar filetype_marker[4];  /* This appears to always be 0 on hard
+  guint32 filetype_marker;   /* This appears to always be 0 on hard
                                 drive based iPods, but for the
                                 iTunesDB that is written to an iPod
                                 Shuffle, iTunes 4.7.1 writes out the
                                 file's type as an ANSI string(!). For
                                 example, a MP3 file has a filetype of
                                 0x4d503320 -> 0x4d = 'M', 0x50 = 'P',
-                                0x33 = '3', 0x20 = <space>. (always
-                                left set to 0 by itdb)*/
+                                0x33 = '3', 0x20 = <space>. (set to
+				the filename extension by itdb when
+				copying track to iPod)*/
   guint16 artwork_count;     /* The number of album artwork items
 				associated with this song. libgpod
 				updates this value when syncing */
@@ -605,7 +718,6 @@
 				here.  itdb will set this when adding
 				a track */
 
-  guint16 unk060;     /* unknown */
   guint16 unk126;     /* unknown, but always seems to be 0xffff for
 			 MP3/AAC songs, 0x0 for uncompressed songs
 			 (like WAVE format), 0x1 for Audible. itdb
@@ -616,25 +728,28 @@
 			 0700 GMT. For podcasts: release date as
 			 displayed next to the title in the Podcast
 			 playlist  */
-  guint32 unk144;     /* unknown, but MP3 songs appear to be always
-			 0x0000000c or 0x0100000c (if played one or
-			 more times in iTunes), AAC songs are always
-			 0x01000033, Audible files are 0x01000029, WAV
-			 files are 0x0. itdb will attempt to set this
-			 value when adding a track. */  
+  guint16 unk144;     /* unknown, but MP3 songs appear to be always
+			 0x000c, AAC songs are always 0x0033, Audible
+			 files are 0x0029, WAV files are 0x0. itdb
+			 will attempt to set this value when adding a
+			 track. */  
+  guint16 unk146;     /* unknown, but appears to be 1 if played at
+			 least once in iTunes and 0 otherwise. */
   guint32 unk148;     /* unknown - used for Apple Store DRM songs
 			 (always 0x01010100?), zero otherwise */
   guint32 unk152;     /* unknown */
   guint32 unk156, unk160;
-  guint8 flag1;       /* basically unknown. set to 0x02 for
-		       * podcasts, 0x00 otherwise. */
-  guint8 flag2;       /* "Skip when shuffling" when set to 0x01, set
-			 to 0x00 otherwise. .m4b and .aa files always
-			 seem to be skipped when shuffling, however */
-  guint8 flag3;       /* "Remember playback position" when set to
+  guint8 has_artwork; /* 0x01: artwork is present. 0x02: no artwork is
+			 present for this track (used by the iPod to
+			 decide whether to display Artwork or not) */
+  guint8 skip_when_shuffling;/* "Skip when shuffling" when set to
 			 0x01, set to 0x00 otherwise. .m4b and .aa
-			 files always seem to remember the playback
-			 position, however. */
+			 files always seem to be skipped when
+			 shuffling, however */
+  guint8 remember_playback_position;/* "Remember playback position"
+			 when set to 0x01, set to 0x00 otherwise. .m4b
+			 and .aa files always seem to remember the
+			 playback position, however. */
   guint8 flag4;       /* Used for podcasts, 0x00 otherwise.  If set to
 			 0x01 the "Now Playing" page will show
 			 Title/Album, when set to 0x00 it will also
@@ -643,10 +758,14 @@
 			 about the track will be shown. */
   guint64 dbid2;      /* not clear. if not set, itdb will set this to
 			 the same value as dbid when adding a track */
-  guint32 unk176;     /* unknown - added in dbversion 0x0c, first
-			 values observed in 0x0d. Observed to be
-			 0x00010000 for non-podcasts and 0x00020000
-			 for a podcast. */
+  guint8 lyrics_flag; /* set to 0x01 if lyrics are present in MP3 tag
+			 ("ULST"), 0x00 otherwise */
+  guint8 movie_flag;  /* set to 0x01 if it's a movie file, 0x00
+		         otherwise */
+  guint8 mark_unplayed; /* A value of 0x02 marks a podcast as unplayed
+			   on the iPod (bullet) once played it is set to
+			   0x01. Non-podcasts have this set to 0x01. */
+  guint8 unk179;      /* unknown (always 0x00 so far) */
   guint32 unk180, unk184;
   guint32 samplecount;/* Number of samples in the song. First observed
 			 in dbversion 0x0d, and only for AAC and WAV
@@ -710,7 +829,7 @@
 /* functions for reading/writing database, general itdb functions */
 Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error);
 Itdb_iTunesDB *itdb_parse_file (const gchar *filename, GError **error);
-gboolean itdb_write (Itdb_iTunesDB *itdb, GError **error);
+gboolean itdb_write (Itdb_iTunesDB *db, GError **error);
 gboolean itdb_write_file (Itdb_iTunesDB *itdb, const gchar *filename,
 			  GError **error);
 gboolean itdb_shuffle_write (Itdb_iTunesDB *itdb, GError **error);
@@ -725,8 +844,8 @@
 
 /* general file functions */
 gint itdb_musicdirs_number (Itdb_iTunesDB *itdb);
-gchar * itdb_resolve_path (const gchar *root,
-			   const gchar * const * components);
+gchar *itdb_resolve_path (const gchar *root,
+			  const gchar * const * components);
 gboolean itdb_rename_files (const gchar *mp, GError **error);
 gboolean itdb_cp_track_to_ipod (Itdb_Track *track,
 				gchar *filename, GError **error);
@@ -736,7 +855,34 @@
 void itdb_filename_ipod2fs (gchar *ipod_file);
 gchar *itdb_filename_on_ipod (Itdb_Track *track);
 void itdb_set_mountpoint (Itdb_iTunesDB *itdb, const gchar *mp);
+const gchar *itdb_get_mountpoint (Itdb_iTunesDB *itdb);
+gchar *itdb_get_control_dir (const gchar *mountpoint);
+gchar *itdb_get_itunes_dir (const gchar *mountpoint);
+gchar *itdb_get_music_dir (const gchar *mountpoint);
+gchar *itdb_get_artwork_dir (const gchar *mountpoint);
+gchar *itdb_get_photos_dir (const gchar *mountpoint);
+gchar *itdb_get_photos_thumb_dir (const gchar *mountpoint);
+gchar *itdb_get_device_dir (const gchar *mountpoint);
+gchar *itdb_get_itunesdb_path (const gchar *mountpoint);
+gchar *itdb_get_itunessd_path (const gchar *mountpoint);
+gchar *itdb_get_artworkdb_path (const gchar *mountpoint);
+gchar *itdb_get_photodb_path (const gchar *mountpoint);
+gchar *itdb_get_path (const gchar *dir, const gchar *file);
 
+/* itdb_device functions */
+Itdb_Device *itdb_device_new (void);
+void itdb_device_free (Itdb_Device *device);
+void itdb_device_set_mountpoint (Itdb_Device *device, const gchar *mp);
+gboolean itdb_device_read_sysinfo (Itdb_Device *device);
+gboolean itdb_device_write_sysinfo (Itdb_Device *device, GError **error);
+gchar *itdb_device_get_sysinfo (Itdb_Device *device, const gchar *field);
+void itdb_device_set_sysinfo (Itdb_Device *device,
+			      const gchar *field, const gchar *value);
+const Itdb_IpodInfo *itdb_device_get_ipod_info (Itdb_Device *device);
+const Itdb_IpodInfo *itdb_info_get_ipod_info_table (void);
+const gchar *itdb_info_get_ipod_model_name_string (Itdb_IpodModel model);
+const gchar *itdb_info_get_ipod_generation_string (Itdb_IpodGeneration generation);
+
 /* track functions */
 Itdb_Track *itdb_track_new (void);
 void itdb_track_free (Itdb_Track *track);
@@ -797,7 +943,29 @@
 /* itdb_track_... */
 gboolean itdb_track_set_thumbnails (Itdb_Track *track,
 				    const gchar *filename);
+gboolean itdb_track_set_thumbnails_from_data (Itdb_Track *track,
+					      const guchar *image_data,
+					      gsize image_data_len);
 void itdb_track_remove_thumbnails (Itdb_Track *track);
+
+/* photoalbum functions */
+Itdb_PhotoDB *itdb_photodb_parse (const gchar *mp, GError **error);
+gboolean itdb_photodb_add_photo (Itdb_PhotoDB *db,
+				 const gchar *albumname,
+				 const gchar *filename);
+gboolean itdb_photodb_add_photo_from_data (Itdb_PhotoDB *db,
+					   const gchar *albumname,
+					   const guchar *image_data,
+					   gsize image_data_len);
+Itdb_PhotoAlbum *itdb_photodb_photoalbum_new (Itdb_PhotoDB *db,
+					      const gchar *album_name);
+Itdb_PhotoDB *itdb_photodb_new (void);
+void itdb_photodb_free (Itdb_PhotoDB *photodb);
+gboolean itdb_photodb_write (Itdb_PhotoDB *db, GError **error);
+void itdb_photodb_photoalbum_free (Itdb_PhotoAlbum *pa);
+gboolean itdb_photodb_remove_photo (Itdb_PhotoDB *db,
+        const gint photo_id );
+
 /* itdb_artwork_... */
 Itdb_Artwork *itdb_artwork_new (void);
 Itdb_Artwork *itdb_artwork_duplicate (Itdb_Artwork *artwork);
@@ -807,25 +975,34 @@
 gboolean itdb_artwork_add_thumbnail (Itdb_Artwork *artwork,
 				     ItdbThumbType type,
 				     const gchar *filename);
+gboolean itdb_artwork_add_thumbnail_from_data (Itdb_Artwork *artwork,
+					       ItdbThumbType type,
+					       const guchar *image_data,
+					       gsize image_data_len);
 void itdb_artwork_remove_thumbnail (Itdb_Artwork *artwork,
 				    Itdb_Thumb *thumb);
 void itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork);
 /* itdb_thumb_... */
 /* the following funciton returns a pointer to a GdkPixbuf if
    gdk-pixbuf is installed -- a NULL pointer otherwise. */
-gpointer itdb_thumb_get_gdk_pixbuf (IpodDevice *device,
+gpointer itdb_thumb_get_gdk_pixbuf (Itdb_Device *device,
 				    Itdb_Thumb *thumb);
 Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb);
 void itdb_thumb_free (Itdb_Thumb *thumb);
 Itdb_Thumb *itdb_thumb_new (void);
-gchar *itdb_thumb_get_filename (IpodDevice *device, Itdb_Thumb *thumb);
+gchar *itdb_thumb_get_filename (Itdb_Device *device, Itdb_Thumb *thumb);
 
-
 /* time functions */
 guint64 itdb_time_get_mac_time (void);
 time_t itdb_time_mac_to_host (guint64 mactime);
 guint64 itdb_time_host_to_mac (time_t time);
 
+/* Initialise a blank ipod */
+gboolean itdb_init_ipod (const gchar *mountpoint,
+			 const gchar *model_number,
+			 const gchar *ipod_name,
+			 GError **error);
+
 G_END_DECLS
 
 #endif

Modified: libgpod/branches/upstream/current/src/itdb_artwork.c
===================================================================
--- libgpod/branches/upstream/current/src/itdb_artwork.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_artwork.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-12-11 16:27:33 jcs>
+/* Time-stamp: <2006-09-18 02:23:53 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -24,13 +24,14 @@
 |
 |  This product is not supported/written/published by Apple!
 |
-|  $Id: itdb_artwork.c,v 1.6 2005/12/11 07:41:42 jcsjcs Exp $
+|  $Id: itdb_artwork.c,v 1.15 2006/09/17 17:27:21 jcsjcs Exp $
 */
 
 #include <config.h>
 
 #include "itdb_private.h"
 #include "db-image-parser.h"
+#include "itdb_endianness.h"
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
@@ -38,19 +39,34 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #endif
 #include <glib/gi18n-lib.h>
+#include <stdlib.h>
 
-
+/**
+ * itdb_artwork_new:
+ * 
+ * Creates a new #Itdb_Artwork 
+ *
+ * Return value: a new #Itdb_Artwork to be freed with itdb_artwork_free() when
+ * no longer needed
+ **/
 Itdb_Artwork *itdb_artwork_new (void)
 {
     Itdb_Artwork *artwork = g_new0 (Itdb_Artwork, 1);
     return artwork;
 }
 
-
+/**
+ * itdb_artwork_free:
+ * @artwork: an #Itdb_Artwork
+ *
+ * Frees memory used by @artwork
+ **/
 void itdb_artwork_free (Itdb_Artwork *artwork)
 {
     g_return_if_fail (artwork);
     itdb_artwork_remove_thumbnails (artwork);
+    if (artwork->userdata && artwork->userdata_destroy)
+	(*artwork->userdata_destroy) (artwork->userdata);
     g_free (artwork);
 }
 
@@ -77,12 +93,20 @@
     return g_list_reverse (result);
 }
 
+/**
+ * itdb_artwork_duplicate:
+ * @artwork: an #Itdb_Artwork
+ *
+ * Duplicates @artwork
+ *
+ * Return value: a new copy of @artwork
+ **/
 Itdb_Artwork *itdb_artwork_duplicate (Itdb_Artwork *artwork)
 {
     Itdb_Artwork *dup;
     g_return_val_if_fail (artwork, NULL);
 
-    dup = itdb_artwork_new ();
+    dup = g_new0 (Itdb_Artwork, 1);
 
     memcpy (dup, artwork, sizeof (Itdb_Artwork));
 
@@ -92,7 +116,13 @@
 }
 
 
-/* Remove @thumb in @artwork */
+/**
+ * itdb_artwork_remove_thumbnail:
+ * @artwork: an #Itdb_Artwork
+ * @thumb: an #Itdb_Thumb
+ *
+ * Removes @thumb from @artwork. The memory used by @thumb isn't freed.
+ **/
 void
 itdb_artwork_remove_thumbnail (Itdb_Artwork *artwork, Itdb_Thumb *thumb)
 {
@@ -103,7 +133,12 @@
 }
 
 
-/* Remove all thumbnails in @artwork */
+/**
+ * itdb_artwork_remove_thumbnails:
+ * @artwork: an #Itdb_Artwork
+ *
+ * Removes all thumbnails from @artwork 
+ **/
 void
 itdb_artwork_remove_thumbnails (Itdb_Artwork *artwork)
 {
@@ -122,11 +157,23 @@
 
 
 
-/* Append thumbnail of type @type to existing thumbnails in @artwork */
+/**
+ * itdb_artwork_add_thumbnail
+ * @artwork: an #Itdb_Thumbnail
+ * @type: thumbnail size
+ * @filename: image file to use to create the thumbnail
+ *
+ * Appends a thumbnail of type @type to existing thumbnails in @artwork. No 
+ * data is read from @filename yet, the file will be when @artwork is saved to
+ * disk. @filename must still exist when that happens.
+ *
+ * Return value: TRUE if the thumbnail could be successfully added, FALSE
+ * otherwise
+ **/
 gboolean
 itdb_artwork_add_thumbnail (Itdb_Artwork *artwork,
 			    ItdbThumbType type,
-			    const char *filename)
+			    const gchar *filename)
 {
 #ifdef HAVE_GDKPIXBUF
 /* This operation doesn't make sense when we can't save thumbnail files */
@@ -140,7 +187,8 @@
 	return FALSE;
     }
 
-    artwork->artwork_size = statbuf.st_size;
+    artwork->artwork_size  = statbuf.st_size;
+    artwork->creation_date = statbuf.st_mtime;
 
     thumb = itdb_thumb_new ();
     thumb->filename = g_strdup (filename);
@@ -154,8 +202,65 @@
 }
 
 
-/* Return a pointer to the Itdb_Thumb of type @type or NULL when it
- * does not exist */
+/**
+ * itdb_artwork_add_thumbnail_from_data
+ * @artwork: an #Itdb_Thumbnail
+ * @type: thumbnail size
+ * @image_data: data used to create the thumbnail (the raw contents of
+ *              an image file)
+ * @image_data_len: length of above data block
+ *
+ * Appends a thumbnail of type @type to existing thumbnails in
+ * @artwork. No data is processed yet. This will be done when @artwork
+ * is saved to disk.
+ *
+ * Return value: TRUE if the thumbnail could be successfully added, FALSE
+ * otherwise
+ **/
+gboolean
+itdb_artwork_add_thumbnail_from_data (Itdb_Artwork *artwork,
+				      ItdbThumbType type,
+				      const guchar *image_data,
+				      gsize image_data_len)
+{
+#ifdef HAVE_GDKPIXBUF
+/* This operation doesn't make sense when we can't save thumbnail files */
+    Itdb_Thumb *thumb;
+    GTimeVal time;
+
+    g_return_val_if_fail (artwork, FALSE);
+    g_return_val_if_fail (image_data, FALSE);
+
+    g_get_current_time (&time);
+
+    artwork->artwork_size  = image_data_len;
+    artwork->creation_date = time.tv_sec;
+
+    thumb = itdb_thumb_new ();
+    thumb->image_data = g_malloc (image_data_len);
+    thumb->image_data_len = image_data_len;
+    memcpy (thumb->image_data,  image_data, image_data_len);
+
+    thumb->type = type;
+    artwork->thumbnails = g_list_append (artwork->thumbnails, thumb);
+
+    return TRUE;
+#else
+    return FALSE;
+#endif
+}
+
+
+/**
+ * itdb_artwork_get_thumb_by_type:
+ * @artwork: an #Itdb_Artwork
+ * @type: type of the #Itdb_Thumb to retrieve
+ *
+ * Searches @artwork for an #Itdb_Thumb of type @type.
+ * 
+ * Returns: an #Itdb_Thumb of type @type, or NULL if such a thumbnail couldn't
+ * be found
+ **/
 Itdb_Thumb *itdb_artwork_get_thumb_by_type (Itdb_Artwork *artwork,
 					    ItdbThumbType type)
 {
@@ -173,15 +278,21 @@
 }
 
 
-/* Get filename of thumbnail. If it's a thumbnail on the iPod, return
-   the full path to the ithmb file. Otherwise return the full path to
-   the original file.
-   g_free() when not needed any more.
-*/
-gchar *itdb_thumb_get_filename (IpodDevice *device, Itdb_Thumb *thumb)
+/**
+ * itdb_thumb_get_filename:
+ * @device: an #Itdb_Device
+ * @thumb: an #Itdb_Thumb
+ *
+ * Get filename of thumbnail. If it's a thumbnail on the iPod, return
+ * the full path to the ithmb file. Otherwise return the full path to
+ * the original file.
+ *
+ * Return value: newly allocated string containing the absolute path to the 
+ * thumbnail file. 
+ **/
+gchar *itdb_thumb_get_filename (Itdb_Device *device, Itdb_Thumb *thumb)
 {
-    gchar *paths[] = {"iPod_Control", "Artwork", NULL, NULL};
-    gchar *filename, *mountpoint;
+    gchar *artwork_dir, *filename=NULL;
 
     g_return_val_if_fail (device, NULL);
     g_return_val_if_fail (thumb, NULL);
@@ -196,26 +307,35 @@
 	return NULL;
     }
 
-    g_object_get (G_OBJECT (device),
-		  "mount-point", &mountpoint,
-		  NULL);
-
-    if (!mountpoint)
+    if (!device->mountpoint)
     {
 	g_print (_("Mountpoint not set.\n"));
 	return NULL;
     }
+    artwork_dir = itdb_get_artwork_dir (device->mountpoint);
+    if (artwork_dir)
+    {
+	filename = itdb_get_path (artwork_dir, thumb->filename+1);
+	g_free (artwork_dir);
+    }
+    /* FIXME: Hack */
+    if( !filename ) {
+	artwork_dir = itdb_get_photos_thumb_dir (device->mountpoint);
 
-    paths[2] = thumb->filename+1;
-    filename = itdb_resolve_path (mountpoint, (const char **)paths);
+	if (artwork_dir)
+	{
+	    filename = itdb_get_path (artwork_dir, strchr( thumb->filename+1, ':') + 1);
+	    g_free (artwork_dir);
+	}
 
+    }
     return filename;
 }
 
 
 #if HAVE_GDKPIXBUF
 static guchar *
-unpack_RGB_565 (guint16 *pixels, guint bytes_len)
+unpack_RGB_565 (guint16 *pixels, guint bytes_len, guint byte_order)
 {
 	guchar *result;
 	guint i;
@@ -227,8 +347,8 @@
 	}
 	for (i = 0; i < bytes_len/2; i++) {
 		guint16 cur_pixel;
-
-		cur_pixel = GINT16_FROM_LE (pixels[i]);
+		/* FIXME: endianness */
+		cur_pixel = get_gint16 (pixels[i], byte_order);
 		/* Unpack pixels */
 		result[3*i] = (cur_pixel & RED_MASK) >> RED_SHIFT;
 		result[3*i+1] = (cur_pixel & GREEN_MASK) >> GREEN_SHIFT;
@@ -245,7 +365,7 @@
 
 
 static guchar *
-get_pixel_data (IpodDevice *device, Itdb_Thumb *thumb)
+get_pixel_data (Itdb_Device *device, Itdb_Thumb *thumb)
 {
 	gchar *filename = NULL;
 	guchar *result = NULL;
@@ -305,24 +425,35 @@
 }
 
 static guchar *
-itdb_thumb_get_rgb_data (IpodDevice *device, Itdb_Thumb *thumb)
+itdb_thumb_get_rgb_data (Itdb_Device *device, Itdb_Thumb *thumb)
 {
 	void *pixels565;
 	guchar *pixels;
+	guint byte_order;
+	const Itdb_ArtworkFormat *img_info;
 
 	g_return_val_if_fail (device, NULL);
 	g_return_val_if_fail (thumb, NULL);
-
-	/* no rgb pixel data available (FIXME: calculate from real
-	 * image file) */
-	if (thumb->size == 0)  return NULL;
-
+	g_return_val_if_fail (thumb->size != 0, NULL);
+	img_info = itdb_get_artwork_info_from_type (device, thumb->type);
+	g_return_val_if_fail (img_info, NULL);
+	
 	pixels565 = get_pixel_data (device, thumb);
 	if (pixels565 == NULL) {
 		return NULL;
 	}
-	
-	pixels = unpack_RGB_565 (pixels565, thumb->size);
+
+	byte_order = device->byte_order; 
+	/* Swap the byte order on full screen nano photos */
+	if (img_info->correlation_id == 1023)
+	{
+	    if (byte_order == G_LITTLE_ENDIAN)
+		byte_order = G_BIG_ENDIAN;
+	    else
+		byte_order = G_LITTLE_ENDIAN; 
+	}
+
+	pixels = unpack_RGB_565 (pixels565, thumb->size, byte_order);
 	g_free (pixels565);
 
 	return pixels;
@@ -332,20 +463,27 @@
 
 
 
-/* Convert the pixeldata in @thumb to a GdkPixbuf.
-   Since we want to have gdk-pixbuf dependency optional, a generic
-   gpointer is returned which you have to cast to (GdkPixbuf *)
-   yourself. If gdk-pixbuf is not installed the NULL pointer is
-   returned.
-   The returned GdkPixbuf must be freed with gdk_pixbuf_unref() after
-   use. */
+/**
+ * itdb_thumb_get_gdk_pixbuf:
+ * @device: an #Itdb_Device
+ * @thumb: an #Itdb_Thumb
+ * 
+ * Converts @thumb to a #GdkPixbuf.
+ * Since we want to have gdk-pixbuf dependency optional, a generic
+ * gpointer is returned which you have to cast to a #GdkPixbuf using 
+ * GDK_PIXBUF() yourself. 
+ *
+ * Return value: a #GdkPixbuf that must be unreffed with gdk_pixbuf_unref()
+ * after use, or NULL if the creation of the gdk-pixbuf failed or if 
+ * libgpod was compiled without gdk-pixbuf support.
+ **/
 gpointer
-itdb_thumb_get_gdk_pixbuf (IpodDevice *device, Itdb_Thumb *thumb)
+itdb_thumb_get_gdk_pixbuf (Itdb_Device *device, Itdb_Thumb *thumb)
 {
 #if HAVE_GDKPIXBUF
     GdkPixbuf *pixbuf=NULL;
     guchar *pixels;
-    const IpodArtworkFormat *img_info=NULL;
+    const Itdb_ArtworkFormat *img_info=NULL;
 
     g_return_val_if_fail (thumb, NULL);
 
@@ -358,7 +496,7 @@
     */
     if (device != NULL)
     {
-	img_info = ipod_get_artwork_info_from_type (device, thumb->type);
+	img_info = itdb_get_artwork_info_from_type (device, thumb->type);
     }
 
     if (thumb->size == 0)
@@ -395,9 +533,28 @@
 	    }
 	}
 
-	pixbuf = gdk_pixbuf_new_from_file_at_size (thumb->filename, 
-						   width, height,
-						   NULL);
+	if (thumb->filename)
+	{   /* read data from filename */
+	    pixbuf = gdk_pixbuf_new_from_file_at_size (thumb->filename, 
+						       width, height,
+						       NULL);
+	}
+	else if (thumb->image_data)
+	{   /* use data stored in image_data */
+	    	GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
+		g_return_val_if_fail (loader, FALSE);
+		gdk_pixbuf_loader_set_size (loader,
+					    width, height);
+		gdk_pixbuf_loader_write (loader,
+					 thumb->image_data,
+					 thumb->image_data_len,
+					 NULL);
+		gdk_pixbuf_loader_close (loader, NULL);
+		pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+		g_object_ref (pixbuf);
+		g_object_unref (loader);
+	}
+
 	if (!pixbuf)
 	    return NULL;
 
@@ -415,7 +572,16 @@
     else
     {
 	/* pixbuf is already on the iPod -> read from there */
+	GdkPixbuf *pixbuf_full;
+	GdkPixbuf *pixbuf_sub;
+	gint pad_x = thumb->horizontal_padding;
+	gint pad_y = thumb->vertical_padding;
+	gint width = thumb->width;
+	gint height = thumb->height;
 
+/*	printf ("hp%d vp%d w%d h%d\n",
+	       pad_x, pad_y, width, height);*/
+
 	if (img_info == NULL)
 	{
 	    g_print (_("Unable to retreive thumbnail (appears to be on iPod, but no image info available): type: %d, filename: '%s'\n"),
@@ -429,17 +595,46 @@
 	    return NULL;
 	}
 
-	pixbuf = gdk_pixbuf_new_from_data (pixels,
-					   GDK_COLORSPACE_RGB,
-					   FALSE,
-					   8, thumb->width,
-					   thumb->height,
-					   img_info->width*3,
-					   (GdkPixbufDestroyNotify)g_free,
-					   NULL);
-
+	pixbuf_full =
+	    gdk_pixbuf_new_from_data (pixels,
+				      GDK_COLORSPACE_RGB,
+				      FALSE, 8,
+				      img_info->width, img_info->height,
+				      img_info->width*3,
+				      (GdkPixbufDestroyNotify)g_free,
+				      NULL);
 	/* !! do not g_free(pixels) here: it will be freed when doing a
 	 * gdk_pixbuf_unref() on the GdkPixbuf !! */
+
+	/* Remove padding from the pixmap and/or cut the pixmap to the
+	   right size. */
+
+	/* Negative offsets indicate that part of the image was cut
+	   off at the left/top. thumb->width/height include that part
+	   of the image. Positive offsets indicate that part of the
+	   thumbnail are padded in black. thumb->width/height also
+	   include that part of the image -> reduce width and height
+	   by the absolute value of the padding */
+	width = width - abs (pad_x);
+	height = height - abs (pad_y);
+	/* And throw out "negative" padding */
+	if (pad_x < 0)		pad_x = 0;
+	if (pad_y < 0)		pad_y = 0;
+	/* Width/height might still be larger than
+	   img_info->width/height, indicating that part of the image
+	   was cut off at the right/bottom (similar to negative
+	   padding above). Adjust width/height accordingly. */
+	if (pad_x + width > img_info->width)
+	    width = img_info->width - pad_x;
+	if (pad_y + height > img_info->height)
+	    height = img_info->height - pad_y;
+
+	pixbuf_sub = gdk_pixbuf_new_subpixbuf (pixbuf_full,
+					       pad_x, pad_y,
+					       width, height);
+	pixbuf = gdk_pixbuf_copy (pixbuf_sub);
+	gdk_pixbuf_unref (pixbuf_full);
+	gdk_pixbuf_unref (pixbuf_sub);
     }
 
     return pixbuf;
@@ -448,22 +643,45 @@
 #endif
 }
 
-
+/**
+ * itdb_thumb_new:
+ * 
+ * Creates a new #Itdb_Thumb
+ *
+ * Return Value: newly allocated #Itdb_Thumb to be freed with itdb_thumb_free()
+ * after use
+ **/
 Itdb_Thumb *itdb_thumb_new (void)
 {
     Itdb_Thumb *thumb = g_new0 (Itdb_Thumb, 1);
     return thumb;
 }
 
-
+/** 
+ * itdb_thumb_free:
+ * @thumb: an #Itdb_Thumb
+ *
+ * Frees the memory used by @thumb
+ **/
 void itdb_thumb_free (Itdb_Thumb *thumb)
 {
     g_return_if_fail (thumb);
 
+    g_free (thumb->image_data);
     g_free (thumb->filename);
     g_free (thumb);
 }
 
+
+/** 
+ * itdb_thumb_duplicate:
+ * @thumb: an #Itdb_Thumb
+ *
+ * Duplicates the data contained in @thumb
+ *
+ * Return value: a newly allocated copy of @thumb to be freed with 
+ * itdb_thumb_free() after use
+ **/
 Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb)
 {
     Itdb_Thumb *new_thumb;
@@ -474,5 +692,12 @@
     memcpy (new_thumb, thumb, sizeof (Itdb_Thumb));
     new_thumb->filename = g_strdup (thumb->filename);
  
+    if (thumb->image_data)
+    {
+	/* image_data_len already copied with the memcpy above */
+	new_thumb->image_data = g_malloc (thumb->image_data_len);
+	memcpy (new_thumb->image_data, thumb->image_data,
+		new_thumb->image_data_len);
+    }
     return new_thumb;
 }

Modified: libgpod/branches/upstream/current/src/itdb_device.c
===================================================================
--- libgpod/branches/upstream/current/src/itdb_device.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_device.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,1830 +1,780 @@
-/* Time-stamp: <2006-02-28 20:04:37 jcs>
+/* Time-stamp: <2006-09-21 20:37:09 jcs>
 |
-|  Copyright (C) 2005 Jorg Schuler <jcsjcs at users sourceforge net>
+|  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
 | 
 |  URL: http://www.gtkpod.org/
 |  URL: http://gtkpod.sourceforge.net/
 |
+|  Part of this code is based on ipod-device.c from the libipoddevice
+|  project (http://64.14.94.162/index.php/Libipoddevice).
 |
-|  The source is taken from libipoddevice, CVS version October 8 2005
-|  (http://64.14.94.162/index.php/Libipoddevice).
+|  The code contained in this file is free software; you can redistribute
+|  it and/or modify it under the terms of the GNU Lesser General Public
+|  License as published by the Free Software Foundation; either version
+|  2.1 of the License, or (at your option) any later version.
 |
-|  I decided not to make libgpod dependent on libipoddevice because
-|  the latter depends on libraries not widely available yet (libhal >=
-|  0.5.2, glib >= 2.8). It is planned to replace these files with a
-|  libipoddevice dependence at some later time.
+|  This file is distributed in the hope that it will be useful,
+|  but WITHOUT ANY WARRANTY; without even the implied warranty of
+|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+|  Lesser General Public License for more details.
 |
-|  The following changes were done:
+|  You should have received a copy of the GNU Lesser General Public
+|  License along with this code; if not, write to the Free Software
+|  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+|  USA
 |
-|  - libhal becomes optional (see #ifdef HAVE_LIBHAL sections)
-|  - g_mkdir_with_parents() is provided if not available (glib < 2.8)
-|  - publicly available functions were renamed from ipod_device_...()
-|    to itdb_device_...()
+|  iTunes and iPod are trademarks of Apple
 |
-|  Because of these changes only a limited amount of functionality is
-|  available. See ipod-device.h for summary.
+|  This product is not supported/written/published by Apple!
 |
-|
-|
-|
-|  $Id: ipod-device.c,v 1.17 2006/02/28 11:06:09 jcsjcs Exp $
+|  $Id: itdb_device.c,v 1.13 2006/09/21 11:39:05 jcsjcs Exp $
 */
-/* ex: set ts=4: */
-/***************************************************************************
-*  ipod-device.c
-*  Copyright (C) 2005 Novell 
-*  Written by Aaron Bockover <aaron at aaronbock.net>
-****************************************************************************/
 
-/*  
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of version 2.1 of the GNU Lesser General Public
- *  License as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Lesser Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- *  USA
- */
+#include "itdb_device.h"
+#include <ctype.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <glib/gi18n-lib.h>
 
+static const Itdb_IpodInfo ipod_info_table [] = {
+    /* Handle idiots who hose their iPod file system, or lucky people
+       with iPods we don't yet know about*/
+    {"Invalid", 0,  ITDB_IPOD_MODEL_INVALID,     ITDB_IPOD_GENERATION_UNKNOWN, 0},
+    {"Unknown", 0,  ITDB_IPOD_MODEL_UNKNOWN,     ITDB_IPOD_GENERATION_UNKNOWN, 0},
 
-/* JCS: Change from ipod_device... to itdb_device for public functions */
-#define ipod_device_get_type itdb_device_get_type
-#define ipod_device_new itdb_device_new
-#define ipod_device_rescan_disk itdb_device_rescan_disk
-#define ipod_device_eject itdb_device_eject
-#define ipod_device_reboot itdb_device_reboot
-#define ipod_device_debug itdb_device_debug
-#define ipod_device_save itdb_device_save
-#define ipod_device_list_devices itdb_device_list_devices
-#define ipod_device_list_device_udis itdb_device_list_device_udis
+    /* First Generation */
+    /* Mechanical buttons arranged around rotating "scroll wheel".
+       8513, 8541 and 8709 are Mac types, 8697 is PC */
+    {"8513",  5, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FIRST,  20},
+    {"8541",  5, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FIRST,  20},
+    {"8697",  5, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FIRST,  20},
+    {"8709", 10, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FIRST,  20},
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-#include "glib-compat.h"
+    /* Second Generation */
+    /* Same buttons as First Generation but around touch-sensitive
+       "touch wheel". 8737 and 8738 are Mac types, 8740 and 8741 * are
+       PC */
+    {"8737", 10, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_SECOND, 20},
+    {"8740", 10, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_SECOND, 20},
+    {"8738", 20, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_SECOND, 50},
+    {"8741", 20, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_SECOND, 50},
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
+    /* Third Generation */
+    /* Touch sensitive buttons and arranged in a line above "touch
+       wheel". Docking connector was introduced here, same models for
+       Mac and PC from now on. */
+    {"8976", 10, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_THIRD,  20},
+    {"8946", 15, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_THIRD,  50},
+    {"9460", 15, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_THIRD,  50},
+    {"9244", 20, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_THIRD,  50},
+    {"8948", 30, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_THIRD,  50},
+    {"9245", 40, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_THIRD,  50},
 
-#include "hal-common.h"
-#include "ipod-device.h"
+    /* Fourth Generation */
+    /* Buttons are now integrated into the "touch wheel". */
+    {"9282", 20, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"9787", 25, ITDB_IPOD_MODEL_REGULAR_U2,  ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"9268", 40, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"A079", 20, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"A127", 20, ITDB_IPOD_MODEL_COLOR_U2,    ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"9830", 60, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
 
-#define GB 1024
+    /* First Generation Mini */
+    {"9160",  4, ITDB_IPOD_MODEL_MINI,        ITDB_IPOD_GENERATION_FIRST,   6},
+    {"9436",  4, ITDB_IPOD_MODEL_MINI_BLUE,   ITDB_IPOD_GENERATION_FIRST,   6},
+    {"9435",  4, ITDB_IPOD_MODEL_MINI_PINK,   ITDB_IPOD_GENERATION_FIRST,   6},
+    {"9434",  4, ITDB_IPOD_MODEL_MINI_GREEN,  ITDB_IPOD_GENERATION_FIRST,   6},
+    {"9437",  4, ITDB_IPOD_MODEL_MINI_GOLD,   ITDB_IPOD_GENERATION_FIRST,   6},	
 
-typedef struct _IpodModel {
-	const gchar *model_number;
-	const guint64 capacity;
-	guint model_type;
-	guint generation;
-} IpodModel;
+    /* Second Generation Mini */
+    {"9800",  4, ITDB_IPOD_MODEL_MINI,        ITDB_IPOD_GENERATION_SECOND,  6},
+    {"9802",  4, ITDB_IPOD_MODEL_MINI_BLUE,   ITDB_IPOD_GENERATION_SECOND,  6},
+    {"9804",  4, ITDB_IPOD_MODEL_MINI_PINK,   ITDB_IPOD_GENERATION_SECOND,  6},
+    {"9806",  4, ITDB_IPOD_MODEL_MINI_GREEN,  ITDB_IPOD_GENERATION_SECOND,  6},
+    {"9801",  6, ITDB_IPOD_MODEL_MINI,        ITDB_IPOD_GENERATION_SECOND, 20},
+    {"9803",  6, ITDB_IPOD_MODEL_MINI_BLUE,   ITDB_IPOD_GENERATION_SECOND, 20},
+    {"9805",  6, ITDB_IPOD_MODEL_MINI_PINK,   ITDB_IPOD_GENERATION_SECOND, 20},
+    {"9807",  6, ITDB_IPOD_MODEL_MINI_GREEN,  ITDB_IPOD_GENERATION_SECOND, 20},	
 
+    /* Photo / Fourth Generation */
+    /* Buttons are integrated into the "touch wheel". */
+    {"9829", 30, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"9585", 40, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"9586", 60, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"9830", 60, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
 
-static const IpodModel ipod_model_table [] = {
-	/* Handle idiots who hose their iPod file system, or 
-	   lucky people with iPods we don't yet know about*/
-	{"Invalid", 0,    MODEL_TYPE_INVALID,    UNKNOWN_GENERATION},
-	{"Unknown", 0,    MODEL_TYPE_UNKNOWN,    UNKNOWN_GENERATION},
-	
-	/* First Generation */
-	{"8513", 5  * GB, MODEL_TYPE_REGULAR,    FIRST_GENERATION},
-	{"8541", 5  * GB, MODEL_TYPE_REGULAR,    FIRST_GENERATION},
-	{"8697", 5  * GB, MODEL_TYPE_REGULAR,    FIRST_GENERATION},
-	{"8709", 10 * GB, MODEL_TYPE_REGULAR,    FIRST_GENERATION},
-	
-	/* Second Generation */
-	{"8737", 10 * GB, MODEL_TYPE_REGULAR,    SECOND_GENERATION},
-	{"8740", 10 * GB, MODEL_TYPE_REGULAR,    SECOND_GENERATION},
-	{"8738", 20 * GB, MODEL_TYPE_REGULAR,    SECOND_GENERATION},
-	{"8741", 20 * GB, MODEL_TYPE_REGULAR,    SECOND_GENERATION},
-	
-	/* Third Generation */
-	{"8976", 10 * GB, MODEL_TYPE_REGULAR,    THIRD_GENERATION},
-	{"8946", 15 * GB, MODEL_TYPE_REGULAR,    THIRD_GENERATION},
-	{"9460", 15 * GB, MODEL_TYPE_REGULAR,    THIRD_GENERATION},
-	{"9244", 20 * GB, MODEL_TYPE_REGULAR,    THIRD_GENERATION},
-	{"8948", 30 * GB, MODEL_TYPE_REGULAR,    THIRD_GENERATION},
-	{"9245", 40 * GB, MODEL_TYPE_REGULAR,    THIRD_GENERATION},
-	
-	
-	/* Fourth Generation */
-	{"9282", 20 * GB, MODEL_TYPE_REGULAR,    FOURTH_GENERATION},
-	{"9787", 25 * GB, MODEL_TYPE_REGULAR_U2, FOURTH_GENERATION},
-	{"9268", 40 * GB, MODEL_TYPE_REGULAR,    FOURTH_GENERATION},
-	{"A079", 20 * GB, MODEL_TYPE_COLOR,      FOURTH_GENERATION},
-	{"A127", 20 * GB, MODEL_TYPE_COLOR_U2,   FOURTH_GENERATION},
-	{"9830", 60 * GB, MODEL_TYPE_COLOR,      FOURTH_GENERATION},
-	
-	/* First Generation Mini */
-	{"9160", 4 * GB, MODEL_TYPE_MINI,        FIRST_GENERATION},
-	{"9436", 4 * GB, MODEL_TYPE_MINI_BLUE,   FIRST_GENERATION},
-	{"9435", 4 * GB, MODEL_TYPE_MINI_PINK,   FIRST_GENERATION},
-	{"9434", 4 * GB, MODEL_TYPE_MINI_GREEN,  FIRST_GENERATION},
-	{"9437", 4 * GB, MODEL_TYPE_MINI_GOLD,   FIRST_GENERATION},	
+    /* Shuffle / Fourth Generation */
+    {"9724", 0.5,ITDB_IPOD_MODEL_SHUFFLE,     ITDB_IPOD_GENERATION_FOURTH,  3},
+    {"9725", 1,  ITDB_IPOD_MODEL_SHUFFLE,     ITDB_IPOD_GENERATION_FOURTH,  3},
+    /* Shuffle / Sixth Generation */
+    /* Square, connected to computer via cable */
+    {"A564", 1,  ITDB_IPOD_MODEL_SHUFFLE,     ITDB_IPOD_GENERATION_SIXTH,  3},
 
-	/* Second Generation Mini */
-	{"9800", 4 * GB, MODEL_TYPE_MINI,        SECOND_GENERATION},
-	{"9802", 4 * GB, MODEL_TYPE_MINI_BLUE,   SECOND_GENERATION},
-	{"9804", 4 * GB, MODEL_TYPE_MINI_PINK,   SECOND_GENERATION},
-	{"9806", 4 * GB, MODEL_TYPE_MINI_GREEN,  SECOND_GENERATION},
-	{"9801", 6 * GB, MODEL_TYPE_MINI,        SECOND_GENERATION},
-	{"9803", 6 * GB, MODEL_TYPE_MINI_BLUE,   SECOND_GENERATION},
-	{"9805", 6 * GB, MODEL_TYPE_MINI_PINK,   SECOND_GENERATION},
-	{"9807", 6 * GB, MODEL_TYPE_MINI_GREEN,  SECOND_GENERATION},	
+    /* Nano / Fifth Generation */
+    /* Buttons are integrated into the "touch wheel". */
+    {"A350",  1, ITDB_IPOD_MODEL_NANO_WHITE,  ITDB_IPOD_GENERATION_FIFTH,   3},
+    {"A352",  1, ITDB_IPOD_MODEL_NANO_BLACK,  ITDB_IPOD_GENERATION_FIFTH,   3},
+    {"A004",  2, ITDB_IPOD_MODEL_NANO_WHITE,  ITDB_IPOD_GENERATION_FIFTH,   3},
+    {"A099",  2, ITDB_IPOD_MODEL_NANO_BLACK,  ITDB_IPOD_GENERATION_FIFTH,   3},
+    {"A005",  4, ITDB_IPOD_MODEL_NANO_WHITE,  ITDB_IPOD_GENERATION_FIFTH,   6},
+    {"A107",  4, ITDB_IPOD_MODEL_NANO_BLACK,  ITDB_IPOD_GENERATION_FIFTH,   6},
 
-	/* Photo / Fourth Generation */
-	{"9829", 30 * GB, MODEL_TYPE_COLOR,      FOURTH_GENERATION},
-	{"9585", 40 * GB, MODEL_TYPE_COLOR,      FOURTH_GENERATION},
-	{"9586", 60 * GB, MODEL_TYPE_COLOR,      FOURTH_GENERATION},
-	{"9830", 60 * GB, MODEL_TYPE_COLOR,      FOURTH_GENERATION},
-	
-	/* Shuffle / Fourth Generation */
-	{"9724", GB / 2, MODEL_TYPE_SHUFFLE,     FOURTH_GENERATION},
-	{"9725", GB,     MODEL_TYPE_SHUFFLE,     FOURTH_GENERATION},
-	
-	/* Nano / Fifth Generation */
-	{"A004", GB * 2, MODEL_TYPE_NANO_WHITE,  FIFTH_GENERATION},
-	{"A099", GB * 2, MODEL_TYPE_NANO_BLACK,  FIFTH_GENERATION},
-	{"A005", GB * 4, MODEL_TYPE_NANO_WHITE,  FIFTH_GENERATION},
-	{"A107", GB * 4, MODEL_TYPE_NANO_BLACK,  FIFTH_GENERATION},
+    /* Video / Fifth Generation */
+    /* Buttons are integrated into the "touch wheel". */
+    {"A002", 30, ITDB_IPOD_MODEL_VIDEO_WHITE, ITDB_IPOD_GENERATION_FIFTH,  50},
+    {"A146", 30, ITDB_IPOD_MODEL_VIDEO_BLACK, ITDB_IPOD_GENERATION_FIFTH,  50},
+    {"A003", 60, ITDB_IPOD_MODEL_VIDEO_WHITE, ITDB_IPOD_GENERATION_FIFTH,  50},
+    {"A147", 60, ITDB_IPOD_MODEL_VIDEO_BLACK, ITDB_IPOD_GENERATION_FIFTH,  50},
 
-	/* Video / Fifth Generation */
-	{"A002", GB * 30, MODEL_TYPE_VIDEO_WHITE, FIFTH_GENERATION},
-	{"A146", GB * 30, MODEL_TYPE_VIDEO_BLACK, FIFTH_GENERATION},
-	{"A003", GB * 60, MODEL_TYPE_VIDEO_WHITE, FIFTH_GENERATION},
-	{"A147", GB * 60, MODEL_TYPE_VIDEO_BLACK, FIFTH_GENERATION},
-	
-	/* HP iPods, need contributions for this table */
-	{"E436", 40 * GB, MODEL_TYPE_REGULAR, FOURTH_GENERATION},
-	{"S492", 30 * GB, MODEL_TYPE_COLOR, FOURTH_GENERATION},
-	
-	{NULL, 0, 0, 0}
+    /* Video / Sixth Generation */
+    /* Pretty much identical to fifth generation with better display,
+     * extended battery operation time and gap-free playback */
+    {"A444", 30, ITDB_IPOD_MODEL_VIDEO_WHITE, ITDB_IPOD_GENERATION_SIXTH,  50},
+    {"A446", 30, ITDB_IPOD_MODEL_VIDEO_BLACK, ITDB_IPOD_GENERATION_SIXTH,  50},
+    {"A664", 30, ITDB_IPOD_MODEL_VIDEO_U2,    ITDB_IPOD_GENERATION_SIXTH,  50},
+    {"A448", 80, ITDB_IPOD_MODEL_VIDEO_WHITE, ITDB_IPOD_GENERATION_SIXTH,  50},
+    {"A450", 80, ITDB_IPOD_MODEL_VIDEO_BLACK, ITDB_IPOD_GENERATION_SIXTH,  50},
+
+    /* Nano / Sixth Generation */
+    /* Pretty much identical to fifth generation with better display,
+     * extended battery operation time and gap-free playback */
+    {"A477",  2, ITDB_IPOD_MODEL_NANO_SILVER, ITDB_IPOD_GENERATION_SIXTH,   3},
+    {"A426",  4, ITDB_IPOD_MODEL_NANO_SILVER, ITDB_IPOD_GENERATION_SIXTH,   6},
+    {"A428",  4, ITDB_IPOD_MODEL_NANO_BLUE,   ITDB_IPOD_GENERATION_SIXTH,   6},
+    {"A487",  4, ITDB_IPOD_MODEL_NANO_GREEN,  ITDB_IPOD_GENERATION_SIXTH,   6},
+    {"A489",  4, ITDB_IPOD_MODEL_NANO_PINK,   ITDB_IPOD_GENERATION_SIXTH,   6},
+    {"A497",  8, ITDB_IPOD_MODEL_NANO_BLACK,  ITDB_IPOD_GENERATION_SIXTH,  14},
+
+    /* HP iPods, need contributions for this table */
+    /* Buttons are integrated into the "touch wheel". */
+    {"E436", 40, ITDB_IPOD_MODEL_REGULAR,     ITDB_IPOD_GENERATION_FOURTH, 50},
+    {"S492", 30, ITDB_IPOD_MODEL_COLOR,       ITDB_IPOD_GENERATION_FOURTH, 50},
+
+    /* No known model number -- create a Device/SysInfo file with
+     * one entry, e.g.:
+       ModelNumStr: Mmobile1
+    */
+    {"mobile1", -1, ITDB_IPOD_MODEL_MOBILE_1, ITDB_IPOD_GENERATION_MOBILE},
+
+    {NULL, 0, 0, 0, 0}
 };
 
+
+/* One entry for each of Itdb_IpodModel (itdb.h) */
 static const gchar *ipod_model_name_table [] = {
-	"Invalid",
-	"Unknown",
-	"Color",
-	"Color U2",
-	"Grayscale",
-	"Grayscale U2",
-	"Mini (Silver)",
-	"Mini (Blue)",
-	"Mini (Pink)",
-	"Mini (Green)",
-	"Mini (Gold)",
-	"Shuffle",
-	"Nano (White)",
-	"Nano (Black)",
-	"Video (White)",
-	"Video (Black)",
+	N_("Invalid"),
+	N_("Unknown"),
+	N_("Color"),
+	N_("Color U2"),
+	N_("Grayscale"),
+	N_("Grayscale U2"),
+	N_("Mini (Silver)"),
+	N_("Mini (Blue)"),
+	N_("Mini (Pink)"),
+	N_("Mini (Green)"),
+	N_("Mini (Gold)"),
+	N_("Shuffle"),
+	N_("Nano (White)"),
+	N_("Nano (Black)"),
+	N_("Video (White)"),
+	N_("Video (Black)"),
+	N_("Mobile (1)"),
+	N_("Video U2"),
+	N_("Nano (Silver)"),
+	N_("Nano (Blue)"),
+	N_("Nano (Green)"),
+	N_("Nano (Pink)"),
 	NULL
 };
 
-static const IpodArtworkFormat ipod_color_artwork_info[] = {
-	{IPOD_COVER_SMALL,        56,  56, 1017},
-	{IPOD_COVER_LARGE,       140, 140, 1016},
-	{IPOD_PHOTO_SMALL,        42,  30, 1009},
-	{IPOD_PHOTO_LARGE,       130,  88, 1015},
-	{IPOD_PHOTO_FULL_SCREEN, 220, 176, 1013},
-	{IPOD_PHOTO_TV_SCREEN,   720, 480, 1019},
-	{-1,                      -1,  -1,   -1}
+/* One entry for each of Itdb_IpodGeneration (itdb.h) */
+static const gchar *ipod_generation_name_table [] = {
+	N_("Unknown"),
+	N_("First Generation"),
+	N_("Second Generation"),
+	N_("Third Generation"),
+	N_("Fourth Generation"),
+	N_("Fifth Generation"),
+	N_("Sixth Generation"),
+	N_("Mobile Phone"),
+	NULL
 };
 
-static const IpodArtworkFormat ipod_nano_artwork_info[] = {
-	{IPOD_COVER_SMALL,        42,  42, 1031},
-	{IPOD_COVER_LARGE,       100, 100, 1027},
-	{IPOD_PHOTO_LARGE,        42,  37, 1032},
-	{IPOD_PHOTO_FULL_SCREEN, 176, 132, 1023},
-	{-1,                      -1,  -1,   -1}
+static const Itdb_ArtworkFormat ipod_color_artwork_info[] = {
+	{ITDB_THUMB_COVER_SMALL,        56,  56, 1017},
+	{ITDB_THUMB_COVER_LARGE,       140, 140, 1016},
+	{ITDB_THUMB_PHOTO_SMALL,        42,  30, 1009},
+	{ITDB_THUMB_PHOTO_LARGE,       130,  88, 1015},
+	{ITDB_THUMB_PHOTO_FULL_SCREEN, 220, 176, 1013},
+	{ITDB_THUMB_PHOTO_TV_SCREEN,   720, 480, 1019},
+	{-1,                            -1,  -1,   -1}
 };
 
-static const IpodArtworkFormat ipod_video_artwork_info[] = {
-	{IPOD_COVER_SMALL,       100, 100, 1028},
-	{IPOD_COVER_LARGE,       200, 200, 1029},
-	{IPOD_PHOTO_SMALL,        50,  41, 1036},
-	{IPOD_PHOTO_LARGE,       130,  88, 1015},
-	{IPOD_PHOTO_FULL_SCREEN, 320, 240, 1024},
-	{IPOD_PHOTO_TV_SCREEN,   720, 480, 1019},
-	{-1,                      -1,  -1,   -1}
+static const Itdb_ArtworkFormat ipod_nano_artwork_info[] = {
+	{ITDB_THUMB_COVER_SMALL,        42,  42, 1031},
+	{ITDB_THUMB_COVER_LARGE,       100, 100, 1027},
+	{ITDB_THUMB_PHOTO_LARGE,        42,  37, 1032},
+	{ITDB_THUMB_PHOTO_FULL_SCREEN, 176, 132, 1023},
+	{-1,                            -1,  -1,   -1}
 };
 
-/* This will be indexed using a value from the MODEL_TYPE enum */
-static const IpodArtworkFormat *ipod_artwork_info_table[] = {
-        NULL,                    /* Invalid       */
-	NULL,                    /* Unknown       */
-	ipod_color_artwork_info, /* Color         */
-	ipod_color_artwork_info, /* Color U2      */
-	NULL,                    /* Grayscale     */ 
-	NULL,                    /* Grayscale U2  */
-	NULL,                    /* Mini (Silver) */
-	NULL,                    /* Mini (Blue)   */
-	NULL,                    /* Mini (Pink)   */
-	NULL,                    /* Mini (Green)  */
-	NULL,                    /* Mini (Gold)   */
-	NULL,                    /* Shuffle       */
-	ipod_nano_artwork_info,  /* Nano (White)  */
-	ipod_nano_artwork_info,  /* Nano (Black)  */
-	ipod_video_artwork_info, /* Video (White) */
-	ipod_video_artwork_info  /* Video (Black) */
+static const Itdb_ArtworkFormat ipod_video_artwork_info[] = {
+	{ITDB_THUMB_COVER_SMALL,       100, 100, 1028},
+	{ITDB_THUMB_COVER_LARGE,       200, 200, 1029},
+	{ITDB_THUMB_PHOTO_SMALL,        50,  41, 1036},
+	{ITDB_THUMB_PHOTO_LARGE,       130,  88, 1015},
+	{ITDB_THUMB_PHOTO_FULL_SCREEN, 320, 240, 1024},
+	{ITDB_THUMB_PHOTO_TV_SCREEN,   720, 480, 1019},
+	{-1,                            -1,  -1,   -1}
 };
 
+static const Itdb_ArtworkFormat ipod_mobile_1_artwork_info[] = {
+	{ITDB_THUMB_COVER_SMALL,        50,  50, 2002},
+	{ITDB_THUMB_COVER_LARGE,       150, 150, 2003},
+	{-1,                            -1,  -1,   -1}
+};
 
-#define g_free_if_not_null(o) \
-    if(o != NULL) {           \
-        g_free(o);            \
-        o = NULL;             \
-    }
-	
-static const gchar *sysinfo_field_names [] = {
-	"pszSerialNumber",
-	"ModelNumStr",
-	"visibleBuildID",
+
+/* This will be indexed using a value from the ITDB_IPOD_MODEL enum */
+static const Itdb_ArtworkFormat *ipod_artwork_info_table[] = {
+        NULL,                      /* Invalid       */
+	NULL,                      /* Unknown       */
+	ipod_color_artwork_info,   /* Color         */
+	ipod_color_artwork_info,   /* Color U2      */
+	NULL,                      /* Grayscale     */ 
+	NULL,                      /* Grayscale U2  */
+	NULL,                      /* Mini (Silver) */
+	NULL,                      /* Mini (Blue)   */
+	NULL,                      /* Mini (Pink)   */
+	NULL,                      /* Mini (Green)  */
+	NULL,                      /* Mini (Gold)   */
+	NULL,                      /* Shuffle       */
+	ipod_nano_artwork_info,    /* Nano (White)  */
+	ipod_nano_artwork_info,    /* Nano (Black)  */
+	ipod_video_artwork_info,   /* Video (White) */
+	ipod_video_artwork_info,   /* Video (Black) */
+	ipod_mobile_1_artwork_info,/* Mobile (1)    */
+	ipod_video_artwork_info,   /* Video U2      */
+	ipod_nano_artwork_info,    /* Nano (Silver) */
+	ipod_nano_artwork_info,    /* Nano (Blue)   */
+	ipod_nano_artwork_info,    /* Nano (Green)  */
+	ipod_nano_artwork_info,    /* Nano (Pink)   */
 	NULL
 };
-	
-static gchar *sysinfo_arr_get_dup(gchar *arr[], const gchar *key)
-{
-	gint i = 0;
-	
-	for(i = 0; sysinfo_field_names[i] != NULL; i++) {
-		if(g_strcasecmp(sysinfo_field_names[i], key) == 0)
-			return g_strdup(arr[i]);
-	}
 
-	return NULL;	
+
+/* Reset or create the SysInfo hash table */
+static void itdb_device_reset_sysinfo (Itdb_Device *device)
+{
+    if (device->sysinfo)
+	g_hash_table_destroy (device->sysinfo);
+    device->sysinfo = g_hash_table_new_full (g_str_hash, g_str_equal,
+					     g_free, g_free);
+    device->sysinfo_changed = FALSE;
 }
 
 
-#if ((GLIB_MAJOR_VERSION <= 2) && (GLIB_MINOR_VERSION < 8))
 /**
- * g_mkdir_with_parents:
- * @pathname: a pathname in the GLib file name encoding
- * @mode: permissions to use for newly created directories
+ * itdb_device_new:
+ * 
+ * Creates a new #Itdb_Device structure
  *
- * Create a directory if it doesn't already exist. Create intermediate
- * parent directories as needed, too.
- *
- * Returns: 0 if the directory already exists, or was successfully
- * created. Returns -1 if an error occurred, with errno set.
- *
- * Since: 2.8  (copied from GLIB version 2.8 - JCS)
- */
-static int
-g_mkdir_with_parents (const gchar *pathname,
-		      int          mode)
+ * Return value: a newly allocated #Itdb_Device which must be freed with
+ * itdb_device_free() when no longer needed
+ **/
+Itdb_Device *itdb_device_new ()
 {
-  gchar *fn, *p;
+    Itdb_Device *dev;
 
-  if (pathname == NULL || *pathname == '\0')
-    {
-      errno = EINVAL;
-      return -1;
-    }
+    dev = g_new0 (Itdb_Device, 1);
+    itdb_device_reset_sysinfo (dev);
+    return dev;
+}
 
-  fn = g_strdup (pathname);
-
-  if (g_path_is_absolute (fn))
-    p = (gchar *) g_path_skip_root (fn);
-  else
-    p = fn;
-
-  do
+/**
+ * itdb_device_free:
+ * @device: an #Itdb_Device
+ *
+ * Frees memory used by @device
+ **/
+void itdb_device_free (Itdb_Device *device)
+{
+    if (device)
     {
-      while (*p && !G_IS_DIR_SEPARATOR (*p))
-	p++;
-      
-      if (!*p)
-	p = NULL;
-      else
-	*p = '\0';
-      
-      if (!g_file_test (fn, G_FILE_TEST_EXISTS))
-	{
-	  if (g_mkdir (fn, mode) == -1)
-	    {
-	      int errno_save = errno;
-	      g_free (fn);
-	      errno = errno_save;
-	      return -1;
-	    }
-	}
-      else if (!g_file_test (fn, G_FILE_TEST_IS_DIR))
-	{
-	  g_free (fn);
-	  errno = ENOTDIR;
-	  return -1;
-	}
-      if (p)
-	{
-	  *p++ = G_DIR_SEPARATOR;
-	  while (*p && G_IS_DIR_SEPARATOR (*p))
-	    p++;
-	}
+	g_free (device->mountpoint);
+	if (device->sysinfo)
+	    g_hash_table_destroy (device->sysinfo);
+	g_free (device);
     }
-  while (p);
-
-  g_free (fn);
-
-  return 0;
 }
-#endif
 
 
-static void ipod_device_class_init(IpodDeviceClass *klass);
-static void ipod_device_init(IpodDevice *sp);
-static void ipod_device_finalize(GObject *object);
+/**
+ * itdb_device_set_mountpoint:
+ * @device: an #Itdb_Device
+ * @mp: the new mount point
+ *
+ * Sets the mountpoint of @device to @mp and update the cached device 
+ * information (in particular, re-read the SysInfo file)
+ **/
+void itdb_device_set_mountpoint (Itdb_Device *device, const gchar *mp)
+{
+    g_return_if_fail (device);
 
-static gchar *ipod_device_read_device_info_string(FILE *fd);
-static void ipod_device_write_device_info_string(gchar *str, FILE *fd);
-	
-static gboolean ipod_device_reload(IpodDevice *device);
-static void ipod_device_construct_paths(IpodDevice *device);
-static gboolean ipod_device_info_load(IpodDevice *device);
-static guint ipod_device_detect_model(IpodDevice *device);
-static gboolean ipod_device_detect_volume_info(IpodDevice *device);
-static LibHalContext *ipod_device_hal_initialize(void);
-static void ipod_device_detect_volume_used(IpodDevice *device);
-static guint64 ipod_device_dir_size(const gchar *path);
-static gboolean ipod_device_read_sysinfo(IpodDevice *device);
-static gboolean ipod_device_detect_writeable(IpodDevice *device);
-static void ipod_device_restore_reboot_preferences(IpodDevice *device);
-	
-struct IpodDevicePrivate {
-	LibHalContext *hal_context;
-	
-	/* Paths */
-	gchar *device_path;
-	gchar *mount_point;
-	gchar *control_path;
-	gchar *hal_volume_id;
-	
-	gchar *adv_capacity;
-	guint model_index;
+    g_free (device->mountpoint);
+    device->mountpoint = g_strdup (mp);
+    if (mp)
+	itdb_device_read_sysinfo (device);
+}
 
-	/* DeviceInfo Fields (All Devices) */ 
-	gchar *device_name;
-	gchar *user_name;
-	gchar *host_name;
-	
-	/* Volume Size/Usage */
-	guint64 volume_size;
-	guint64 volume_available;
-	guint64 volume_used;
-	
-	/* System Info */
-	gchar *serial_number;
-	gchar *model_number;
-	gchar *firmware_version;
-	
-	gchar *volume_uuid;
-	gchar *volume_label;
-	
-	/* Fresh from the factory/restore? */
-	gboolean is_new;
-	
-	/* Safety */
-	gboolean is_ipod;
-	gboolean can_write;
-};
 
-static GObjectClass *parent_class = NULL;
-
-/* GObject Class Specific Methods */
-
-GType
-ipod_device_get_type()
+/** 
+ * itdb_device_read_sysinfo:
+ * @device: an #Itdb_Device
+ *
+ * Reads the SysInfo file and stores information in device->sysinfo for
+ * later use.
+ *
+ * Return value: TRUE if file could be read, FALSE otherwise 
+ **/
+gboolean itdb_device_read_sysinfo (Itdb_Device *device)
 {
-	static GType type = 0;
+    const gchar *p_sysinfo[] = {"SysInfo", NULL};
+    gchar *dev_path, *sysinfo_path;
+    FILE *fd;
+    gboolean result = FALSE;
+    gchar buf[1024];
 
-	if(type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (IpodDeviceClass),
-			NULL,
-			NULL,
-			(GClassInitFunc)ipod_device_class_init,
-			NULL,
-			NULL,
-			sizeof (IpodDevice),
-			0,
-			(GInstanceInitFunc)ipod_device_init,
-		};
+    g_return_val_if_fail (device, FALSE);
+    g_return_val_if_fail (device->mountpoint, FALSE);
 
-		type = g_type_register_static(G_TYPE_OBJECT, 
-			"IpodDevice", &our_info, 0);
-	}
+    itdb_device_reset_sysinfo (device);
 
-	return type;
-}
+    g_return_val_if_fail (device->sysinfo, FALSE);
 
-static void 
-ipod_device_get_property(GObject *object, guint prop_id, 
-	GValue *value, GParamSpec *pspec)
-{
-	IpodDevice *device = IPOD_DEVICE(object);
-	
-	switch(prop_id) {
-		case PROP_HAL_CONTEXT:
-			g_value_set_pointer(value, device->priv->hal_context);
-			break;
-		case PROP_HAL_VOLUME_ID:
-			g_value_set_string(value, device->priv->hal_volume_id);
-			break;
-		case PROP_MOUNT_POINT:
-			g_value_set_string(value, device->priv->mount_point);
-			break;
-		case PROP_DEVICE_PATH:
-			g_value_set_string(value, device->priv->device_path);
-			break;
-		case PROP_CONTROL_PATH:
-			g_value_set_string(value, device->priv->control_path);
-			break;
-		case PROP_DEVICE_MODEL:
-			g_value_set_uint(value, 
-				ipod_model_table[device->priv->model_index].model_type);
-			break;
-		case PROP_DEVICE_MODEL_STRING:
-			g_value_set_string(value,
-				ipod_model_name_table[ipod_model_table[
-					device->priv->model_index].model_type]);
-			break;
-		case PROP_DEVICE_GENERATION:
-			g_value_set_uint(value, 
-				ipod_model_table[device->priv->model_index].generation);
-			break;
-		case PROP_ADVERTISED_CAPACITY:
-			g_value_set_string(value, device->priv->adv_capacity);
-			break;
-		case PROP_DEVICE_NAME:
-			g_value_set_string(value, device->priv->device_name);
-			break;
-		case PROP_USER_NAME:
-			g_value_set_string(value, device->priv->user_name);
-			break;
-		case PROP_HOST_NAME:
-			g_value_set_string(value, device->priv->host_name);
-			break;
-		case PROP_VOLUME_SIZE:
-			g_value_set_uint64(value, device->priv->volume_size);
-			break;
-		case PROP_VOLUME_AVAILABLE:
-			g_value_set_uint64(value, device->priv->volume_available);
-			break;
-		case PROP_VOLUME_USED:
-			g_value_set_uint64(value, device->priv->volume_used);
-			break;
-		case PROP_IS_IPOD:
-			g_value_set_boolean(value, device->priv->is_ipod);
-			break;
-		case PROP_IS_NEW:
-			g_value_set_boolean(value, device->priv->is_new);
-			break;
-		case PROP_SERIAL_NUMBER:
-			g_value_set_string(value, device->priv->serial_number);
-			break;
-		case PROP_MODEL_NUMBER:
-			g_value_set_string(value, device->priv->model_number);
-			break;
-		case PROP_FIRMWARE_VERSION:
-			g_value_set_string(value, device->priv->firmware_version);
-			break;
-		case PROP_VOLUME_UUID:
-			g_value_set_string(value, device->priv->volume_uuid);
-			break;
-		case PROP_VOLUME_LABEL:
-			g_value_set_string(value, device->priv->volume_label);
-			break;
-		case PROP_CAN_WRITE:
-			g_value_set_boolean(value, device->priv->can_write);
-			break;
-     	        case PROP_ARTWORK_FORMAT:
-			g_value_set_pointer(value, 
-				(gpointer)ipod_artwork_info_table[ipod_model_table[
-					device->priv->model_index].model_type]);
-			break;
-		default:
-			G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-			break;
-	}
-}
+    dev_path = itdb_get_device_dir (device->mountpoint);
 
-static void
-ipod_device_set_property(GObject *object, guint prop_id,
-	const GValue *value, GParamSpec *pspec)
-{
-	IpodDevice *device = IPOD_DEVICE(object);
-	const gchar *str;
-	gchar **volumes;
-	gint volume_count;
+    if (!dev_path) return FALSE;
 
-	g_return_if_fail (device);
+    sysinfo_path = itdb_resolve_path (dev_path, p_sysinfo);
 
-	switch(prop_id) {
-		case PROP_MOUNT_POINT:
-		case PROP_DEVICE_PATH:
-		case PROP_HAL_VOLUME_ID:
-		        str = g_value_get_string(value);
-			volumes = NULL;
-			if (device->priv->hal_context)
-			{
-			    volumes = libhal_manager_find_device_string_match(
-				device->priv->hal_context, "block.device", str,
-				&volume_count, NULL);
-			    if(volume_count == 0)
-			    {
-				libhal_free_string_array(volumes);
-				volumes = libhal_manager_find_device_string_match(
-				    device->priv->hal_context, "volume.mount_point",
-				    str, &volume_count, NULL);
-			    }
-			    if(volume_count >= 1)
-			    {
-				str = volumes[0];
-			    }
-			}
-#ifdef HAVE_LIBHAL
-			g_free_if_not_null(device->priv->hal_volume_id);
-			device->priv->hal_volume_id = g_strdup (str);
-#else
-/* JCS for libgpod */
-			g_free (device->priv->mount_point);
-			device->priv->mount_point = g_strdup (str);
-/* end JCS for libgpod */
-#endif
-			if (volumes)
-			    libhal_free_string_array(volumes);
-			device->priv->is_ipod = ipod_device_reload(device);
-			break;
-		case PROP_DEVICE_NAME:
-			str = g_value_get_string(value);
-			g_free_if_not_null(device->priv->device_name);
-			device->priv->device_name = g_strdup(str);
-			break;
-		case PROP_USER_NAME:
-			str = g_value_get_string(value);
-			g_free_if_not_null(device->priv->user_name);
-			device->priv->user_name = g_strdup(str);
-			break;
-		case PROP_HOST_NAME:
-			str = g_value_get_string(value);
-			g_free_if_not_null(device->priv->host_name);
-			device->priv->host_name = g_strdup(str);
-			break;
-		default:
-			G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-			break;
+    if (sysinfo_path)
+    {
+	fd = fopen (sysinfo_path, "r");
+	if (fd)
+	{
+	    result = TRUE;
+	    while(fgets(buf, sizeof(buf), fd))
+	    {
+		gchar *ptr;
+		gint len = strlen (buf);
+		/* suppress newline at end of line */
+		if ((len>0) && (buf[len-1]==0x0a))
+		{
+		    buf[len-1] = 0;
+		    --len;
+		}
+		ptr = strchr (buf, ':');
+		if (ptr && (ptr!=buf))
+		{
+		    *ptr = 0;
+		    ++ptr;
+		    itdb_device_set_sysinfo (device,
+					     buf, g_strstrip(ptr));
+		}
+	    }
+	    fclose (fd);
 	}
+	g_free (sysinfo_path);
+    }
+    g_free (dev_path);
+    /* indicate that sysinfo is identical to what is on the iPod */
+    device->sysinfo_changed = FALSE;
+    return result;
 }
 
-static void
-ipod_device_class_init(IpodDeviceClass *klass)
-{
-	GParamSpec *hal_context_param;
-	GParamSpec *hal_volume_id_param;
-	GParamSpec *mount_point_param;
-	GParamSpec *device_path_param;
-	GParamSpec *control_path_param;
-	GParamSpec *device_model_param;
-	GParamSpec *device_model_string_param;
-	GParamSpec *device_name_param;
-	GParamSpec *user_name_param;
-	GParamSpec *host_name_param;
-	GParamSpec *volume_size_param;
-	GParamSpec *volume_available_param;
-	GParamSpec *volume_used_param;
-	GParamSpec *is_ipod_param;
-	GParamSpec *is_new_param;
-	GParamSpec *serial_number_param;
-	GParamSpec *model_number_param;
-	GParamSpec *firmware_version_param;
-	GParamSpec *volume_uuid_param;
-	GParamSpec *volume_label_param;
-	GParamSpec *can_write_param;
-	GParamSpec *device_generation_param;
-	GParamSpec *advertised_capacity_param;
-	GParamSpec *artwork_format_param;
 
-	GObjectClass *class = G_OBJECT_CLASS(klass);
 
-	parent_class = g_type_class_peek_parent(klass);
-	class->finalize = ipod_device_finalize;
-	
-	hal_context_param = g_param_spec_pointer("hal-context", "HAL Context",
-		"LibHalContext handle", G_PARAM_READABLE);
-	
-	hal_volume_id_param = g_param_spec_string("hal-volume-id", "HAL Volume ID", 
-		"Volume ID of a device in HAL",
-		NULL, G_PARAM_READWRITE);
-	
-	mount_point_param = g_param_spec_string("mount-point", "Mount Point", 
-		"Where iPod is mounted (parent of an iPod_Control directory)",
-		NULL, G_PARAM_READWRITE);
-	
-	device_path_param = g_param_spec_string("device-path", "Device Path",
-		"Path to raw iPod Device (/dev/sda2, for example)",
-		NULL, G_PARAM_READWRITE);
-		
-	control_path_param = g_param_spec_string("control-path", 
-		"iPod_Control Path","Full path to iPod_Control", 
-		NULL, G_PARAM_READABLE);
-		 
-	device_model_param = g_param_spec_uint("device-model", "Device Model",
-		"Type of iPod (Regular, Photo, Shuffle)", 0, 2, 0, G_PARAM_READABLE);
-	
-	device_model_string_param = g_param_spec_string("device-model-string",
-		"Device Model String", "String type of iPod (Regular, Shuffle)",
-		NULL, G_PARAM_READABLE);
-	
-	device_name_param = g_param_spec_string("device-name", "Device Name",
-		"The user-assigned name of their iPod", NULL, G_PARAM_READWRITE);
-		 
-	user_name_param = g_param_spec_string("user-name", "User Name",
-		"On Windows, Maybe Mac, the user account owning the iPod",
-		NULL, G_PARAM_READWRITE);
-		
-	host_name_param = g_param_spec_string("host-name", "Host Name",
-		"On Windows, Maybe Mac, the host/computer name owning the iPod",
-		NULL, G_PARAM_READWRITE);
-		
-	volume_size_param = g_param_spec_uint64("volume-size", "Volume Size",
-		"Total size of the iPod's hard drive", 0, G_MAXLONG, 0, 
-		G_PARAM_READABLE);
-		
-	volume_available_param = g_param_spec_uint64("volume-available", 
-		"Volume Available", "Available space on the iPod",
-		0, G_MAXLONG, 0, G_PARAM_READABLE);
-		
-	volume_used_param = g_param_spec_uint64("volume-used", "Volume Used",
-		"How much space has been used", 0, G_MAXLONG, 0, G_PARAM_READABLE);
-	
-	is_ipod_param = g_param_spec_boolean("is-ipod", "Is iPod",
-		"If all device checks are okay, then this is true",
-		FALSE, G_PARAM_READABLE);
-		
-	is_new_param = g_param_spec_boolean("is-new", "Is iPod",
-		"If device is fresh from factory/restore, this is true",
-		FALSE, G_PARAM_READABLE);
-	
-	serial_number_param = g_param_spec_string("serial-number", "Serial Number",
-		"Serial Number of the iPod",
-		NULL, G_PARAM_READABLE);
-		
-	model_number_param = g_param_spec_string("model-number", "Model Number",
-		"Model Number of the iPod",
-		NULL, G_PARAM_READABLE);
-		
-	firmware_version_param = g_param_spec_string("firmware-version",
-		"Firmware Version", "iPod Firmware Version",
-		NULL, G_PARAM_READABLE);
-			
-	volume_uuid_param = g_param_spec_string("volume-uuid", "Volume UUID",
-		"Volume UUID of the iPod",
-		NULL, G_PARAM_READABLE);
-		
-	volume_label_param = g_param_spec_string("volume-label", "Volume Label",
-		"Volume Label of the iPod",
-		NULL, G_PARAM_READABLE);
-		
-	can_write_param = g_param_spec_boolean("can-write", "Can Write",
-		"True if device can be written to (mounted read/write)",
-		FALSE, G_PARAM_READABLE);
-
-	advertised_capacity_param = g_param_spec_string("advertised-capacity", 
-		"Advertised Capacity", "Apple Marketed/Advertised Capacity String",
-		NULL, G_PARAM_READABLE);
-
-	device_generation_param = g_param_spec_uint("device-generation", 
-		"Generation", "Generation of the iPod",
-		0, G_MAXUINT, 0, G_PARAM_READABLE);
-
-	artwork_format_param = g_param_spec_pointer("artwork-formats",
-		"Artwork Format", "Support Artwork Formats", G_PARAM_READABLE);
-
-	class->set_property = ipod_device_set_property;
-	class->get_property = ipod_device_get_property;	
-	g_object_class_install_property(class, PROP_HAL_CONTEXT,
-		hal_context_param);
-	
-	g_object_class_install_property(class, PROP_HAL_VOLUME_ID,
-		hal_volume_id_param);
-	
-	g_object_class_install_property(class, PROP_MOUNT_POINT, 
-		mount_point_param);
-	
-	g_object_class_install_property(class, PROP_DEVICE_PATH, 
-		device_path_param);
-	
-	g_object_class_install_property(class, PROP_CONTROL_PATH, 
-		control_path_param);
-	
-	g_object_class_install_property(class, PROP_DEVICE_MODEL, 
-		device_model_param);
-		
-	g_object_class_install_property(class, PROP_DEVICE_MODEL_STRING,
-		device_model_string_param);
-		
-	g_object_class_install_property(class, PROP_DEVICE_NAME, 
-		device_name_param);
-		
-	g_object_class_install_property(class, PROP_USER_NAME, 
-		user_name_param);
-		
-	g_object_class_install_property(class, PROP_HOST_NAME, 
-		host_name_param);
-		
-	g_object_class_install_property(class, PROP_VOLUME_SIZE, 
-		volume_size_param);
-		
-	g_object_class_install_property(class, PROP_VOLUME_AVAILABLE, 
-		volume_available_param);
-		
-	g_object_class_install_property(class, PROP_VOLUME_USED, 
-		volume_used_param);
-		
-	g_object_class_install_property(class, PROP_IS_IPOD, is_ipod_param);
-	
-	g_object_class_install_property(class, PROP_IS_NEW, is_new_param);
-	
-	g_object_class_install_property(class, PROP_SERIAL_NUMBER, 
-		serial_number_param);
-	
-	g_object_class_install_property(class, PROP_MODEL_NUMBER, 
-		model_number_param);
-	
-	g_object_class_install_property(class, PROP_FIRMWARE_VERSION, 
-		firmware_version_param);
-	
-	g_object_class_install_property(class, PROP_VOLUME_UUID, 
-		volume_uuid_param);
-	
-	g_object_class_install_property(class, PROP_VOLUME_LABEL, 
-		volume_label_param);
-
-	g_object_class_install_property(class, PROP_CAN_WRITE,
-		can_write_param);
-		
-	g_object_class_install_property(class, PROP_DEVICE_GENERATION, 
-		device_generation_param);
-
-	g_object_class_install_property(class, PROP_ADVERTISED_CAPACITY,
-		advertised_capacity_param);
-	
-	g_object_class_install_property(class, PROP_ARTWORK_FORMAT,
-		artwork_format_param);
-		
-}
-
-static void
-ipod_device_init(IpodDevice *device)
+/* used by itdb_device_write_sysinfo() */
+static void write_sysinfo_entry (const gchar *key,
+				 const gchar *value,
+				 FILE *file)
 {
-	device->priv = g_new0(IpodDevicePrivate, 1);
-	
-	device->priv->hal_context = ipod_device_hal_initialize();
-	
-	device->priv->hal_volume_id = NULL;
-	device->priv->mount_point = NULL;
-	device->priv->device_path = NULL;
-	device->priv->control_path = NULL;
-	device->priv->device_name = NULL;
-	device->priv->user_name = NULL;
-	device->priv->host_name = NULL;
-	device->priv->adv_capacity = NULL;
-	device->priv->serial_number = NULL;
-	device->priv->model_number = NULL;
-	device->priv->firmware_version = NULL;
-	device->priv->volume_uuid = NULL;
-	device->priv->volume_label = NULL;
-	
-	device->priv->volume_size = 0;
-	device->priv->volume_available = 0;
-	device->priv->volume_used = 0;
-	
-	device->priv->is_new = FALSE;
-	device->priv->can_write = FALSE;
+    fprintf (file, "%s: %s\n", key, value);
 }
 
-static void
-ipod_device_finalize(GObject *object)
-{
-	IpodDevice *device = IPOD_DEVICE(object);
-	
-	/* Free private members, etc. */
-	g_free_if_not_null(device->priv->hal_volume_id);
-	g_free_if_not_null(device->priv->device_path);
-	g_free_if_not_null(device->priv->mount_point);
-	g_free_if_not_null(device->priv->control_path);
-	g_free_if_not_null(device->priv->device_name);
-	g_free_if_not_null(device->priv->user_name);
-	g_free_if_not_null(device->priv->host_name);
-	g_free_if_not_null(device->priv->adv_capacity);
-	g_free_if_not_null(device->priv->serial_number);
-	g_free_if_not_null(device->priv->model_number);
-	g_free_if_not_null(device->priv->firmware_version);
-	g_free_if_not_null(device->priv->volume_uuid);
-	g_free_if_not_null(device->priv->volume_label);
 
-	if(device->priv->hal_context != NULL) {
-		libhal_ctx_shutdown(device->priv->hal_context, NULL);
-		libhal_ctx_free(device->priv->hal_context);
-	}
-	g_free(device->priv);
-	G_OBJECT_CLASS(parent_class)->finalize(object);
-}
 
-/* PRIVATE METHODS */
-
-LibHalContext *
-ipod_device_hal_initialize()
+/** 
+ * itdb_device_write_sysinfo:
+ * @device: an #Itdb_Device
+ *
+ * Fills the SysInfo file with information in device->sysinfo. Note:
+ * no directories are created if not already existent.
+ *
+ * Return value: TRUE if file could be read, FALSE otherwise 
+ **/
+gboolean itdb_device_write_sysinfo (Itdb_Device *device, GError **error)
 {
-#ifdef HAVE_LIBHAL
-	LibHalContext *hal_context;
-	DBusError error;
-	DBusConnection *dbus_connection;
-	char **devices;
-	gint device_count;
+    gchar *devicedir;
+    gboolean success = FALSE;
 
-	hal_context = libhal_ctx_new();
-	if(hal_context == NULL) 
-		return NULL;
-	
-	dbus_error_init(&error);
-	dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
-	if(dbus_error_is_set(&error)) {
-		dbus_error_free(&error);
-		libhal_ctx_free(hal_context);
-		return NULL;
+    g_return_val_if_fail (device, FALSE);
+    g_return_val_if_fail (device->mountpoint, FALSE);
+
+    devicedir = itdb_get_device_dir (device->mountpoint);
+    if (devicedir)
+    {
+	gchar *sysfile = g_build_filename (devicedir, "SysInfo", NULL);
+	FILE *sysinfo = fopen (sysfile, "w");
+	if (sysinfo)
+	{
+	    if (device->sysinfo)
+	    {
+		g_hash_table_foreach (device->sysinfo,
+				      (GHFunc)write_sysinfo_entry,
+				      sysinfo);
+	    }
+	    fclose (sysinfo);
+	    success = TRUE;
 	}
-	
-	libhal_ctx_set_dbus_connection(hal_context, dbus_connection);
-	
-	if(!libhal_ctx_init(hal_context, &error)) {
-		dbus_error_free(&error);
-		libhal_ctx_free(hal_context);
-		return NULL;
+	else
+	{
+	    g_set_error (error, 0, -1,
+			 _("Could not open '%s' for writing."),
+			 sysfile);
 	}
+	g_free (sysfile);
+	g_free (devicedir);
+    }
+    else
+    {
+	g_set_error (error, 0, -1,
+		     _("Device directory does not exist."));
+    }
 
-	devices = libhal_get_all_devices(hal_context, &device_count, NULL);
-	if(devices == NULL) {
-		libhal_ctx_shutdown(hal_context, NULL);
-		libhal_ctx_free(hal_context);
-		hal_context = NULL;
-		return NULL;
-	}
-	
-	libhal_free_string_array(devices);
-	
-	return hal_context;
-#else
-	return NULL;
-#endif
+    if (success)
+	device->sysinfo_changed = FALSE;
+
+    return success;
 }
 
-gboolean
-ipod_device_reload(IpodDevice *device)
+
+/**
+ * itdb_device_get_sysinfo:
+ * @device: an #Itdb_Device
+ * @field: field to retrive information from
+ *
+ * Retrieve specified field from the SysInfo file.
+ *
+ * Return value: the information associated with @field, or NULL if @field
+ * couldn't be found. g_free() after use
+ **/
+gchar *itdb_device_get_sysinfo (Itdb_Device *device, const gchar *field)
 {
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	
-	device->priv->model_index = 0;
+    g_return_val_if_fail (device, NULL);
+    g_return_val_if_fail (device->sysinfo, NULL);
+    g_return_val_if_fail (field, NULL);
 
-	if(!ipod_device_detect_volume_info(device))
-		return FALSE;
-	
-	ipod_device_construct_paths(device);
-	
-	device->priv->is_new = !ipod_device_info_load(device);
-	
-	ipod_device_detect_volume_used(device);
-	ipod_device_detect_writeable(device);
-	ipod_device_read_sysinfo(device);
-	ipod_device_detect_model(device);
-	ipod_device_restore_reboot_preferences(device);
-	
-	return device->priv->model_index != 0;
+    return g_strdup (g_hash_table_lookup (device->sysinfo, field));
 }
 
-void 
-ipod_device_construct_paths(IpodDevice *device)
+/**
+ * itdb_device_set_sysinfo:
+ * @device: an #Itdb_Device
+ * @field: field to set
+ * @value: value to set (or NULL to remove the field).
+ *
+ * Set specified field. It can later be written to the iPod using
+ * itdb_device_read_sysinfo
+ *
+ **/
+void itdb_device_set_sysinfo (Itdb_Device *device,
+			      const gchar *field, const gchar *value)
 {
-	int len;
-	
-	g_return_if_fail(IS_IPOD_DEVICE(device));
-	g_return_if_fail(device->priv->mount_point != NULL);
-	
-	len = strlen(device->priv->mount_point);
-	if(device->priv->mount_point[len - 1] == '/')
-		device->priv->mount_point[len - 1] = '\0';
+    g_return_if_fail (device);
+    g_return_if_fail (device->sysinfo);
+    g_return_if_fail (field);
 
-	if(strlen(device->priv->mount_point) == 0)
-		return;
-	
-	device->priv->control_path = g_strdup_printf("%s/%s",
-		device->priv->mount_point, "iPod_Control/");
+    if (field)
+    {
+	g_hash_table_insert (device->sysinfo,
+			     g_strdup (field), g_strdup (value));
+    }
+    else
+    {
+	g_hash_table_remove (device->sysinfo, field);
+    }
+    device->sysinfo_changed = TRUE;
 }
 
-gchar *
-ipod_device_read_device_info_string(FILE *fd)
-{
-	gshort length;
-	gunichar2 *utf16;
-	gchar *utf8;
-	
-	if (fread(&length, sizeof(gshort), 1, fd) != 1)
-	        return NULL;
-	
-	if(length <= 0)
-		return NULL;
-	
-	utf16 = (gunichar2 *)g_malloc(length * sizeof(gunichar2));
-	if (fread(utf16, sizeof(gunichar2), length, fd) != length)
-		return NULL;
-	
-	if(utf16 == NULL)
-		return NULL;
-	
-	utf8 = g_utf16_to_utf8(utf16, length, NULL, NULL, NULL);
-	
-	g_free(utf16);
-	utf16 = NULL;
-	
-	return utf8;
-}
 
-void
-ipod_device_write_device_info_string(gchar *str, FILE *fd)
+/**
+ * itdb_device_get_ipod_info:
+ * @device: an #Itdb_Device
+ *
+ * Retrieve the #Itdb_IpodInfo entry for this iPod
+ *
+ * Return value: the #Itdb_IpodInfo entry for this iPod
+ **/
+const Itdb_IpodInfo *
+itdb_device_get_ipod_info (Itdb_Device *device)
 {
-	gunichar2 *unistr;
-	gshort length;
-	size_t res;
+    gint i;
+    gchar *model_num, *p;
 
-	if(str == NULL)
-		return;
-	
-	length = strlen(str);
-	unistr = g_utf8_to_utf16(str, length, NULL, NULL, NULL);
-	
-	length = length > 0x198 ? 0x198 : length;
+    model_num = itdb_device_get_sysinfo (device, "ModelNumStr");
 
-	/* FIXME: we do not check if the write was successful */
-	res = fwrite(&length, 2, 1, fd);
-	res = fwrite(unistr, 2, length, fd);
-	
-	g_free(unistr);
-}
+    if (!model_num)
+	return &ipod_info_table[0];
 
-gboolean
-ipod_device_read_sysinfo(IpodDevice *device)
-{
-	gchar *field_values[sizeof(sysinfo_field_names) + 1];
-	gchar *tmp, *path, buf[512];
-	gint i, name_len;
-	FILE *fd;
+    p = model_num;
+
+    if(isalpha(model_num[0])) 
+	p++;
 	
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	
-	path = g_strdup_printf("%sDevice/SysInfo", 
-		device->priv->control_path);
-	
-	fd = fopen(path, "r");
-	if(fd == NULL) {
-		g_free(path);
-		return FALSE;
+    for(i=2; ipod_info_table[i].model_number != NULL; i++)
+    {
+	if(g_strncasecmp(p, ipod_info_table[i].model_number, 
+			 strlen (ipod_info_table[i].model_number)) == 0)
+	{
+	    g_free(model_num);
+	    return &ipod_info_table[i];
 	}
-	
-	while(fgets(buf, sizeof(buf), fd)) {
-		buf[strlen(buf) - 1] = '\0';
-		
-		for(i = 0; sysinfo_field_names[i] != NULL; i++) {
-			name_len = strlen(sysinfo_field_names[i]);
-			if(strncasecmp(buf, sysinfo_field_names[i], name_len) == 0) {
-				field_values[i] = strdup(buf + name_len + 2);
-				if(strncasecmp(field_values[i], "0x", 2) == 0) {
-					if((tmp = strstr(field_values[i], "(")) != NULL) {
-						field_values[i] = tmp + 1;
-						field_values[i][strlen(field_values[i]) - 1] = '\0';
-					}
-				}
-				
-				field_values[i] = g_strdup(field_values[i]);
-			}
-		}
-	}
-	
-	fclose(fd);
-	
-	device->priv->serial_number = sysinfo_arr_get_dup(field_values, 
-		"pszSerialNumber");
-	device->priv->model_number = sysinfo_arr_get_dup(field_values, 
-		"ModelNumStr");
-	device->priv->firmware_version = sysinfo_arr_get_dup(field_values, 
-		"visibleBuildID");
-		
-	g_free(path);
-	
-	return TRUE;
+    }	
+    g_free(model_num);
+    return &ipod_info_table[1];
 }
 
-gboolean
-ipod_device_info_load(IpodDevice *device)
-{
-	gchar *path;
-	FILE *fd;
-	gint intres;
-	
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	
-	path = g_strdup_printf("%siTunes/DeviceInfo", 
-		device->priv->control_path);
-	
-	fd = fopen(path, "r");
-	if(fd == NULL) {
-		g_free(path);
-		return FALSE;
-	}
-	
-	device->priv->device_name = ipod_device_read_device_info_string(fd);
-	if(device->priv->device_name == NULL)
-		device->priv->device_name = g_strdup("iPod");
-	
-	intres=fseek(fd, 0x200, SEEK_SET);
-	device->priv->user_name = ipod_device_read_device_info_string(fd);
-	
-	intres=fseek(fd, 0x400, SEEK_SET);
-	device->priv->host_name = ipod_device_read_device_info_string(fd);
-	
-	fclose(fd);
-	g_free(path);
 
-	return TRUE;
-}
 
-gboolean
-ipod_device_detect_writeable(IpodDevice *device)
+/* Return supported artwork formats supported by this iPod */
+G_GNUC_INTERNAL const Itdb_ArtworkFormat *
+itdb_device_get_artwork_formats (Itdb_Device *device)
 {
-	FILE *fp;
-	gchar *itunes_dir, *music_dir, *itunesdb_path;
-	struct stat finfo;
-		
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	
-	device->priv->can_write = FALSE;
+    const Itdb_IpodInfo *info;
 
-	itunes_dir = g_strdup_printf("%siTunes", device->priv->control_path);
-	
-	if(!g_file_test(itunes_dir, G_FILE_TEST_IS_DIR)) {
-		if(g_mkdir_with_parents(itunes_dir, 0755) != 0) {
-			g_free(itunes_dir);
-			return FALSE;
-		}
-	}
-	
-	itunesdb_path = g_strdup_printf("%s/iTunesDB", itunes_dir);
-	
-	if((fp = fopen(itunesdb_path, "a+")) != NULL) {
-		device->priv->can_write = TRUE;
-		fclose(fp);
-		
-		memset(&finfo, 0, sizeof(finfo));
-		if(stat(itunesdb_path, &finfo) == 0) {
-			if(finfo.st_size == 0) {
-				unlink(itunesdb_path);
-			}
-		}
-	} else {
-		g_free(itunes_dir);
-		g_free(itunesdb_path);
-		return FALSE;
-	}
+    g_return_val_if_fail (device, NULL);
 
-	music_dir = g_strdup_printf("%sMusic", device->priv->control_path);
-	
-	if(!g_file_test(music_dir, G_FILE_TEST_IS_DIR)) {
-		device->priv->can_write = g_mkdir_with_parents(music_dir, 0755) == 0;
-	}
-	
-	g_free(itunes_dir);
-	g_free(itunesdb_path);
-	g_free(music_dir);
-	
-	return device->priv->can_write;
-}
+    info = itdb_device_get_ipod_info (device);
 
-static gint
-ipod_device_get_model_index_from_table(const gchar *_model_num)
-{
-	gint i;
-	gchar *model_num = g_strdup(_model_num);
-	gchar *p = model_num;
-	
-	if(isalpha(model_num[0])) 
-		p++;
-	
-	for(i = 2; ipod_model_table[i].model_number != NULL; i++) {
-		if(g_strncasecmp(p, ipod_model_table[i].model_number, 4) == 0) {
-			g_free(model_num);
-			return i;
-		}
-	}	
-	
-	g_free(model_num);
-	return 1;
+    g_return_val_if_fail (info, NULL);
+
+    return ipod_artwork_info_table[info->ipod_model];
 }
 
-guint
-ipod_device_detect_model(IpodDevice *device)
+
+/* Determine the number of F.. directories in iPod_Control/Music.
+
+   If device->musicdirs is already set, simply return the previously
+   determined number. Otherwise count the directories first and set
+   itdb->musicdirs. */
+G_GNUC_INTERNAL gint
+itdb_device_musicdirs_number (Itdb_Device *device)
 {
-	gint i;
-	guint64 adv, act;
-	gint cap;
-	
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), 0);
+    gchar *dir_filename = NULL;
+    gint dir_num;
 
-	device->priv->model_index = 0;
+    g_return_val_if_fail (device, 0);
 
-	/* Shuffle! */
-	if(device->priv->model_number == NULL) {
-		for(i = 2; ipod_model_table[i].model_number != NULL; i++) {
-			if(ipod_model_table[i].model_type != MODEL_TYPE_SHUFFLE)
-				continue;
-			
-			cap = ipod_model_table[i].capacity;	
-			adv = cap * 1048576;
-			act = device->priv->volume_size;
+    if (device->musicdirs <= 0)
+    {
+	gchar *music_dir = itdb_get_music_dir (device->mountpoint);
+	if (!music_dir) return 0;
+	/* count number of dirs */
+	for (dir_num=0; ;++dir_num)
+	{
+	    gchar dir_num_str[5];
 
-			if((adv - act) / 1048576 < 50) {
-				device->priv->model_index = i;
-				device->priv->model_number = g_strdup_printf("M%s",
-					ipod_model_table[i].model_number);
-					
-				device->priv->adv_capacity = g_strdup_printf("%d %s", 
-					cap < 1024 ? cap : cap / 1024,
-					cap < 1024 ? "MB" : "GB");
-				break;
-			}
-		}	
-	} else {
-		/* Anything Else */
-		device->priv->model_index = 
-			ipod_device_get_model_index_from_table(device->priv->model_number);
-		
-		cap = ipod_model_table[device->priv->model_index].capacity;
-	
-		device->priv->adv_capacity = g_strdup_printf("%d %s", 
-			cap < 1024 ? cap : cap / 1024,
-			cap < 1024 ? "MB" : "GB");
-	}
-		
-	return device->priv->model_index;
-}
+	    g_snprintf (dir_num_str, 5, "F%02d", dir_num);
+  
+	    dir_filename = itdb_get_path (music_dir, dir_num_str);
 
-void
-ipod_device_restore_reboot_preferences(IpodDevice *device)
-{
-	gchar *backup_prefs, *prefs;
-	
-	backup_prefs = g_strdup_printf("%s/.Reboot_Preferences", 
-		device->priv->control_path);
-	prefs = g_strdup_printf("%s/Device/Preferences",
-		device->priv->control_path);
-		
-	g_return_if_fail(IS_IPOD_DEVICE(device));
-	
-	if(g_file_test(backup_prefs, G_FILE_TEST_EXISTS)) {
-		unlink(prefs);
-		g_rename(backup_prefs, prefs);
+	    if (!dir_filename)  break;
+	    g_free (dir_filename);
 	}
+	device->musicdirs = dir_num;
+	g_free (music_dir);
+    }
+    return device->musicdirs;
 }
 
-gboolean
-ipod_device_detect_volume_info(IpodDevice *device)
+/**
+ * endianess_check_path:
+ *
+ * Check if endianess can be determined by looking at header of @path.
+ *
+ * @path:   the file to look at.
+ * @hdr: the header string (4 bytes) in case of LITTLE_ENDIAN
+ *
+ * Return value:
+ * G_LITTLE_ENDIAN, G_BIG_ENDIAN or 0 if endianess could not be
+ * determined.
+ */
+static guint endianess_check_path (const gchar *path, const gchar *hdr)
 {
-#ifdef HAVE_LIBHAL
-	LibHalContext *hal_context;
-	gchar **volumes;
-	gchar *hd_mount_point, *hd_device_path;
-	gchar *hd_hal_id = NULL, *maybe_hd_hal_id = NULL;
-	gint volume_count, i;
-	
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	hal_context = device->priv->hal_context;
-	
-	g_free_if_not_null(device->priv->device_path);
-	g_free_if_not_null(device->priv->mount_point);
-	device->priv->volume_size = 0;
-	
-	if(!libhal_device_exists(hal_context, device->priv->hal_volume_id, NULL)) {
-		/* For testing/debugging... we don't have a real device, but
-		   the location may be a directory containing an iPod image */
-		if(g_strncasecmp(device->priv->hal_volume_id, "/dev/", 5) == 0 || 
-			device->priv->hal_volume_id[0] != '/')
-			return FALSE;
+    guint byte_order = 0;
 
-		g_free_if_not_null(device->priv->mount_point);
-		device->priv->mount_point = g_strdup(device->priv->hal_volume_id);
-		
-		g_free_if_not_null(device->priv->hal_volume_id);
-		g_free_if_not_null(device->priv->device_path);
-		
-		/* Let's find out about the disk drive containing our image */
-	
-		volumes = libhal_manager_find_device_string_match(hal_context, 
-			"info.category", "volume", &volume_count, NULL);
-		
-		for(i = 0; i < volume_count; i++) {
-			if(!libhal_device_property_exists(hal_context, 
-				volumes[i], "volume.is_mounted", NULL) || 
-				!libhal_device_get_property_bool(hal_context, 
-				volumes[i], "volume.is_mounted", NULL)) {
-				continue;
-			}
-			
-			hd_mount_point = libhal_device_get_property_string(hal_context,
-				volumes[i], "volume.mount_point", NULL);
-			
-			if(g_strncasecmp(hd_mount_point, device->priv->mount_point, 
-				strlen(hd_mount_point)) != 0)
-				continue;
-			
-			if(g_strcasecmp(hd_mount_point, "/") == 0)
-				maybe_hd_hal_id = volumes[i];
-			else 
-				hd_hal_id = volumes[i];
+    if (path)
+    {
+	int fd = open (path, O_RDONLY);
+	if (fd != -1)
+	{
+	    gchar buf[4];
+	    if (read (fd, buf, 4) == 4)
+	    {
+		if (strncmp (buf, hdr, 4) == 0)
+		{
+		    byte_order = G_LITTLE_ENDIAN;
 		}
-		
-		if(hd_hal_id == NULL && maybe_hd_hal_id != NULL)
-			hd_hal_id = maybe_hd_hal_id;
-		
-		if(hd_hal_id == NULL) {
-			libhal_free_string_array(volumes);
-			return FALSE;
+		else
+		{
+		    if ((buf[0] == hdr[3]) &&
+			(buf[1] == hdr[2]) &&
+			(buf[2] == hdr[1]) &&
+			(buf[3] == hdr[0]))
+		    {
+			byte_order = G_BIG_ENDIAN;
+		    }
 		}
-		
-		if(!libhal_device_exists(hal_context, hd_hal_id, NULL)) {
-			libhal_free_string_array(volumes);
-			return FALSE;
-		}
-		
-		hd_device_path = libhal_device_get_property_string(hal_context,
-			hd_hal_id, "block.device", NULL);
-		
-		device->priv->hal_volume_id = g_strdup(hd_hal_id);
-		device->priv->device_path = g_strdup(hd_device_path);
-		device->priv->volume_size = libhal_device_get_property_uint64(
-			hal_context, hd_hal_id, "volume.size", NULL);
-		
-		libhal_free_string_array(volumes);
-		
-		return TRUE;
+	    }
+	    close (fd);
 	}
-	
-	if(!libhal_device_property_exists(hal_context, 
-		device->priv->hal_volume_id, "volume.is_mounted", NULL) 
-		|| !libhal_device_get_property_bool(hal_context, 
-		device->priv->hal_volume_id, "volume.is_mounted", NULL)) {
-		return FALSE;
-	}
-			
-	if(libhal_device_property_exists(hal_context, device->priv->hal_volume_id, 
-		"block.device", NULL))
-		device->priv->device_path = libhal_device_get_property_string(
-			hal_context, device->priv->hal_volume_id, "block.device", NULL);
-	
-	if(libhal_device_property_exists(hal_context, device->priv->hal_volume_id,
-		"volume.mount_point", NULL))
-		device->priv->mount_point = libhal_device_get_property_string(
-			hal_context, device->priv->hal_volume_id, 
-			"volume.mount_point", NULL);
-	
-	if(libhal_device_property_exists(hal_context, device->priv->hal_volume_id,
-		"volume.size", NULL))
-		device->priv->volume_size = libhal_device_get_property_uint64(
-			hal_context, device->priv->hal_volume_id, "volume.size", NULL);
-	
-	if(libhal_device_property_exists(hal_context, device->priv->hal_volume_id,
-		"volume.uuid", NULL)) {
-		device->priv->volume_uuid = libhal_device_get_property_string(
-			hal_context, device->priv->hal_volume_id,
-			"volume.uuid", NULL);
-		
-		if(strlen(device->priv->volume_uuid) == 0) {
-			g_free(device->priv->volume_uuid);
-			device->priv->volume_uuid = NULL;
-		}
-	}
-
-	if(libhal_device_property_exists(hal_context, device->priv->hal_volume_id,
-		"volume.label", NULL))
-		device->priv->volume_label = libhal_device_get_property_string(
-			hal_context, device->priv->hal_volume_id,
-			"volume.label", NULL);
-#endif	
-	return TRUE;
+    }
+    return byte_order;
 }
 
-void 
-ipod_device_detect_volume_used(IpodDevice *device)
-{
-	device->priv->volume_used = 
-		ipod_device_dir_size(device->priv->mount_point);
-	device->priv->volume_available = device->priv->volume_size - 
-		device->priv->volume_used;
-}
+/* Attempt to guess the endianess used by this iPod.
+ *
+ * It will overwrite the previous setting.
+ *
+ */
 
-static void 
-_ipod_device_dir_size(const gchar *path, guint64 *total_size)
+G_GNUC_INTERNAL void
+itdb_device_autodetect_endianess (Itdb_Device *device)
 {
-	GDir *dir;
-	const gchar *next_path;
-	gchar *fullpath;
-	struct stat finfo;
-	
-	if((dir = g_dir_open(path, 0, NULL)) == NULL)
-		return;
+    guint byte_order = 0;
 
-	while((next_path = g_dir_read_name(dir)) != NULL) {
-		fullpath = g_strdup_printf("%s/%s", path, next_path);
+    g_return_if_fail (device);
 
-		if(g_file_test(fullpath, G_FILE_TEST_IS_DIR))
-			_ipod_device_dir_size(fullpath, total_size);
-		else 
-			*total_size += stat(fullpath, &finfo) == 0 ? finfo.st_size : 0;
-		
-		g_free(fullpath);
-		fullpath = NULL;
+    if (device->mountpoint)
+    {
+	gchar *path;
+	if (byte_order == 0)
+	{
+	    /* First try reading the iTunesDB */
+	    path = itdb_get_itunesdb_path (device->mountpoint);
+	    byte_order = endianess_check_path (path, "mhbd");
+	    g_free (path);
 	}
-	
-	g_dir_close(dir);
-}
-
-guint64
-ipod_device_dir_size(const gchar *path)
-{
-	guint64 retsize, *size = g_new(guint64, 1);
-	*size = 0;
-	_ipod_device_dir_size(path, size);
-	retsize = *size;
-	g_free(size);
-	return retsize;
-}
-
-#ifdef HAVE_LIBHAL
-static gboolean 
-ipod_device_has_open_fd(IpodDevice *device)
-{
-	GDir *dir, *fddir;
-	gchar *fdpath, *fdidpath, *realpath;
-	const gchar *procpath, *fdid;
-
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	
-	if((dir = g_dir_open("/proc", 0, NULL)) == NULL)
-		return FALSE;
-
-	while((procpath = g_dir_read_name(dir)) != NULL) {
-		if(atoi(procpath) <= 0)
-			continue;
-		
-		fdpath = g_strdup_printf("/proc/%s/fd", procpath);
-		
-		if(!g_file_test(fdpath, G_FILE_TEST_IS_DIR)) {
-			g_free(fdpath);
-			continue;
-		}
-		
-		if((fddir = g_dir_open(fdpath, 0, NULL)) == NULL) {
-			g_free(fdpath);
-			continue;
-		}
-		
-		while((fdid = g_dir_read_name(fddir)) != NULL) {
-			fdidpath = g_strdup_printf("%s/%s", fdpath, fdid);
-			realpath = g_file_read_link(fdidpath, NULL);
-			
-			if(realpath == NULL) {
-				g_free(fdidpath);
-				continue;
-			}
-			
-			if(g_strncasecmp(realpath, device->priv->mount_point, 
-				strlen(device->priv->mount_point)) == 0) {
-				g_dir_close(fddir);
-				g_dir_close(dir);
-				g_free(realpath);
-				g_free(fdidpath);
-				return TRUE;
-			}
-			
-			g_free(realpath);
-			g_free(fdidpath);
-		}
-		
-		g_dir_close(fddir);
+	if (byte_order == 0)
+	{
+	    /* Try reading the ArtworkDB */
+	    path = itdb_get_artworkdb_path (device->mountpoint);
+	    byte_order = endianess_check_path (path, "mhfd");
+	    g_free (path);
 	}
-	
-	g_dir_close(dir);
-	
-	return FALSE;
-}
-
-/* modded from g-v-m */
-static int
-ipod_device_run_command(IpodDevice *device, const char *command, 
-	GError **error_out)
-{
-	char *path;
-	const char *inptr, *start;
-	GError *error = NULL;
-	GString *exec;
-	char *argv[4];
-	int status = 0;
-	
-	exec = g_string_new(NULL);
-	
-	/* perform s/%d/device/, s/%m/mount_point/ and s/%h/udi/ */
-	start = inptr = command;
-	while((inptr = strchr (inptr, '%')) != NULL) {
-		g_string_append_len(exec, start, inptr - start);
-		inptr++;
-		switch (*inptr) {
-		case 'd':
-			g_string_append(exec, device->priv->device_path ? 
-				device->priv->device_path : "");
-			break;
-		case 'm':
-			if(device->priv->mount_point) {
-				path = g_shell_quote(device->priv->mount_point);
-				g_string_append(exec, path);
-				g_free(path);
-			} else {
-				g_string_append(exec, "\"\"");
-			}
-			break;
-		case 'h':
-			g_string_append(exec, device->priv->hal_volume_id);
-			break;
-		case '%':
-			g_string_append_c(exec, '%');
-			break;
-		default:
-			g_string_append_c(exec, '%');
-			if(*inptr)
-				g_string_append_c(exec, *inptr);
-			break;
+	if (byte_order == 0)
+	{
+	    /* Try reading the Photos Database */
+	    path = itdb_get_photodb_path (device->mountpoint);
+	    byte_order = endianess_check_path (path, "mhfd");
+	    g_free (path);
+	}
+	if (byte_order == 0)
+	{
+	    gchar *control_dir = itdb_get_control_dir (device->mountpoint);
+	    if (control_dir)
+	    {
+		gchar *cd_l = g_ascii_strdown (control_dir, -1);
+		/* check if cd_l ends on "itunes/itunes_control" */
+		if (strstr (cd_l, "itunes/itunes_control") ==
+		    (cd_l + strlen (cd_l) - strlen ("itunes/itunes_control")))
+		{
+		    byte_order = G_BIG_ENDIAN;
 		}
-		
-		if(*inptr)
-			inptr++;
-		start = inptr;
+		g_free (cd_l);
+		g_free (control_dir);
+	    }
 	}
-	
-	g_string_append(exec, start);
-	
-	argv[0] = "/bin/sh";
-	argv[1] = "-c";
-	argv[2] = exec->str;
-	argv[3] = NULL;
+    }
 
-	g_spawn_sync(g_get_home_dir(), argv, NULL, 0, NULL, 
-		NULL, NULL, NULL, &status, &error);
-	
-	if(error != NULL)
-		g_propagate_error(error_out, error);
-	
-	g_string_free(exec, TRUE);
-	
-	return status;
+    /* default: non-reversed */
+    if (byte_order == 0)
+	byte_order = G_LITTLE_ENDIAN;
+
+    device->byte_order = byte_order;
 }
-#endif
 
-/* PUBLIC METHODS */
+/*------------------------------------------------------------------*\
+ *                                                                  *
+ * Functions for applications to obtain general infos about various *
+ * iPods.                                                           *
+ *                                                                  *
+\*------------------------------------------------------------------*/
 
-IpodDevice *
-ipod_device_new(const gchar *hal_volume_id)
+/**
+ * itdb_info_get_ipod_info_table:
+ *
+ * Return a pointer to the start of valid iPod model descriptions,
+ * which is an array of #Itdb_IpodInfo entries.
+ *
+ * Return value: a pointer to the array of #Itdb_IpodInfo entries.
+ **/
+const Itdb_IpodInfo *itdb_info_get_ipod_info_table (void)
 {
-	IpodDevice *device = g_object_new(TYPE_IPOD_DEVICE, 
-		"hal-volume-id", hal_volume_id, NULL);
-
-	if (device == NULL) {
-		/* This can happen if one forgot to call g_type_init before
-		 * calling ipod_device_new
-		 */
-		return NULL;
-	}
-	
-	if(!device->priv->is_ipod) {
-		g_object_unref(device);
-		return NULL;
-	}
-	
-	return device;
+    return &ipod_info_table[2];
 }
 
-gboolean 
-ipod_device_rescan_disk(IpodDevice *device)
-{
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	ipod_device_detect_volume_used(device);
-	return TRUE;
-}
 
-guint
-ipod_device_eject(IpodDevice *device, GError **error_out)
+/**
+ * itdb_info_get_ipod_model_string:
+ *
+ * Return the iPod's generic model name, like "Color", "Nano"...
+ *
+ * Return value: a pointer to the model name. This is a static string
+ * and must not be g_free()d.
+ **/
+const gchar *itdb_info_get_ipod_model_name_string (Itdb_IpodModel model)
 {
-#ifdef HAVE_LIBHAL	
-	gint exit_status;
-	GError *error = NULL;
+    gint i=0;
 
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), EJECT_ERROR);
-	g_return_val_if_fail(device->priv->is_ipod, EJECT_ERROR);
-
-	if(ipod_device_has_open_fd(device))
-		return EJECT_BUSY;
-
-#ifdef ASSUME_SUBMOUNT
-	sync();
-	
-	exit_status = ipod_device_run_command(device, EJECT_COMMAND, &error);
-	if(error) {
-		g_propagate_error(error_out, error);
-		return EJECT_ERROR;
-	}
-		
-	return exit_status == 0 ? EJECT_OK : EJECT_ERROR;
-#endif
-	
-	exit_status = ipod_device_run_command(device, UNMOUNT_COMMAND, &error);
-	
-	if(!error && exit_status == 0) {
-		exit_status = ipod_device_run_command(device, EJECT_COMMAND, &error);
-		if(error) {
-			g_propagate_error(error_out, error);
-			return EJECT_ERROR;
-		}
-		
-		return exit_status == 0 ? EJECT_OK : EJECT_ERROR;
-	} 
-	
-	if(error)
-		g_propagate_error(error_out, error);
-	
-	return EJECT_ERROR;
+    /* Instead of returning ipod_model_name_table[model] directly,
+       verify if @model is valid */
+    while (ipod_model_name_table[i])
+    {
+	if (i==model)  return gettext (ipod_model_name_table[i]);
+	++i;
+    }
+    return NULL;
 }
 
-guint
-ipod_device_reboot(IpodDevice *device, GError **error_out)
-{
-	gchar *sysinfo, *prefs, *backup_prefs, *devpath;
-	gboolean can_eject = TRUE;
 
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), EJECT_ERROR);
-	g_return_val_if_fail(device->priv->is_ipod, EJECT_ERROR);
-	
-	devpath = g_strdup_printf("%s/Device/", device->priv->control_path);
-	sysinfo = g_strdup_printf("%sSysInfo", devpath);
-	prefs = g_strdup_printf("%sPreferences", devpath);
-	backup_prefs = g_strdup_printf("%s/.Reboot_Preferences", 
-		device->priv->control_path);
-		
-	if(g_file_test(sysinfo, G_FILE_TEST_EXISTS))
-		can_eject = unlink(sysinfo) == 0;
-		
-	if(g_file_test(prefs, G_FILE_TEST_EXISTS) && can_eject) {
-		if(g_file_test(backup_prefs, G_FILE_TEST_EXISTS))
-			unlink(backup_prefs);
-			
-		g_rename(prefs, backup_prefs);
-		unlink(prefs);
-		
-		can_eject = TRUE;
-	}
-		
-	if(can_eject) 
-		can_eject = rmdir(devpath) == 0;
-		
-	g_free(devpath);
-	g_free(sysinfo);
-	g_free(prefs);
-	g_free(backup_prefs);
-		
-	if(can_eject)
-		return ipod_device_eject(device, error_out);
-	
-	g_propagate_error(error_out, g_error_new(g_quark_from_string("UNLINK"),
-		errno, "Could not remove file to initiate iPod reboot"));
-#endif		
-	return EJECT_ERROR;
-}
-
-static GList *
-_ipod_device_list_devices(gboolean create_device)
+/**
+ * itdb_info_get_ipod_generation_string:
+ *
+ * Return the iPod's generic generation name, like "First Generation",
+ * "Mobile Phone"...
+ *
+ * Return value: a pointer to the generation name. This is a static
+ * string and must not be g_free()d.
+ **/
+const gchar *itdb_info_get_ipod_generation_string (Itdb_IpodGeneration generation)
 {
-	LibHalContext *hal_context;
-	GList *finalDevices = NULL;
-	gchar **ipods, **volumes;
-	gint ipod_count, volume_count, i, j;
-	IpodDevice *ipod;
-	gboolean validIpod = FALSE;
-	
-	hal_context = ipod_device_hal_initialize();
-	if(hal_context == NULL)
-		return NULL;
-	
-	ipods = libhal_manager_find_device_string_match(hal_context, 
-		"info.product", "iPod", &ipod_count, NULL);
-	
-	for(i = 0; i < ipod_count; i++) {
-		volumes = libhal_manager_find_device_string_match(hal_context,
-			"info.parent", ipods[i], &volume_count, NULL);
-		
-		for(j = 0; j < volume_count; j++) {
-			if(!libhal_device_property_exists(hal_context, 
-				volumes[j], "volume.is_mounted", NULL) 
-				|| !libhal_device_get_property_bool(hal_context, 
-				volumes[j], "volume.is_mounted", NULL))
-				continue;
-					
-			if(!create_device) {
-				finalDevices = g_list_append(finalDevices, 
-					g_strdup(volumes[j]));
-				continue;
-			}
-				
-			if((ipod = ipod_device_new(volumes[j])) == NULL)
-				continue;
-			
-			g_object_get(ipod, "is-ipod", &validIpod, NULL);
-			if(validIpod)
-				finalDevices = g_list_append(finalDevices, ipod);
-		}
-	}
-	
-	libhal_ctx_shutdown(hal_context, NULL);
-	libhal_ctx_free(hal_context);
-	
-	return finalDevices;
-}
+    gint i=0;
 
-GList *
-ipod_device_list_devices()
-{
-	return _ipod_device_list_devices(TRUE);
+    /* Instead of returning ipod_generation_name_table[generation]
+       directly, verify if @generation is valid */
+    while (ipod_generation_name_table[i])
+    {
+	if (i==generation)
+	    return gettext (ipod_generation_name_table[i]);
+	++i;
+    }
+    return NULL;
 }
-
-GList *
-ipod_device_list_device_udis()
-{
-	return _ipod_device_list_devices(FALSE);
-}
-	
-gboolean
-ipod_device_save(IpodDevice *device, GError **error_out)
-{
-	FILE *fd;
-	gchar *path, *itunes_dir;
-	gchar bs = 0;
-	GError *error = NULL;
-	size_t res;
-	gint intres;
-	
-	g_return_val_if_fail(IS_IPOD_DEVICE(device), FALSE);
-	
-	itunes_dir = g_strdup_printf("%siTunes", device->priv->control_path);
-	path = g_strdup_printf("%s/DeviceInfo", itunes_dir);
-	
-	if(!g_file_test(itunes_dir, G_FILE_TEST_IS_DIR)) {
-		if(g_mkdir_with_parents(itunes_dir, 0744) != 0) {
-			if(error_out != NULL) {
-				error = g_error_new(g_quark_from_static_string("IPOD_DEVICE"),
-					ERROR_SAVE, "Could not create iTunes Directory: %s", 
-					itunes_dir);
-				g_propagate_error(error_out, error);
-			}
-			
-			g_free(path);
-			g_free(itunes_dir);
-			
-			return FALSE;
-		}
-	}
-	
-	fd = fopen(path, "w+");
-	if(fd == NULL) {
-		if(error_out != NULL) {
-			error = g_error_new(g_quark_from_static_string("IPOD_DEVICE"),
-				ERROR_SAVE, "Could not save DeviceInfo file: %s", path);
-			g_propagate_error(error_out, error);
-		}
-		
-		g_free(path);
-		g_free(itunes_dir);
-		
-		return FALSE;
-	}
-	
-	ipod_device_write_device_info_string(device->priv->device_name, fd);
-	
-	fseek(fd, 0x200, SEEK_SET);
-	ipod_device_write_device_info_string(device->priv->user_name, fd);
-	
-	intres = fseek(fd, 0x400, SEEK_SET);
-	ipod_device_write_device_info_string(device->priv->host_name, fd);
-	
-	intres = fseek(fd, 0X5FF, SEEK_SET);
-	/* FIXME: we do not check if the write was successful */
-	res = fwrite(&bs, 1, 1, fd);
-	
-	fclose(fd);
-	
-	g_free(path);
-	g_free(itunes_dir);
-	
-	return TRUE;
-}
-
-void
-ipod_device_debug(IpodDevice *device)
-{	
-	static const gchar *generation_names [] = {
-		"Unknown",
-		"First",
-		"Second",
-		"Third",
-		"Fourth"	
-	};
-	
-	gchar *device_path, *mount_point, *control_path, *hal_id;
-	gchar *model_number, *adv_capacity, *model_string;
-	guint model, generation;
-	gboolean is_new, can_write;
-	gchar *serial_number, *firmware_version;
-	guint64 volume_size, volume_used, volume_available;
-	gchar *volume_uuid, *volume_label;
-	gchar *device_name, *user_name, *host_name;
-	
-	g_return_if_fail(IS_IPOD_DEVICE(device));
-	
-	g_object_get(device, 
-		"device-path", &device_path,
-		"mount-point", &mount_point,
-		"control-path", &control_path,
-		"hal-volume-id", &hal_id,
-		"model-number", &model_number,
-		"device-model", &model,
-		"device-model-string", &model_string,
-		"device-generation", &generation,
-		"advertised-capacity", &adv_capacity,
-		"is-new", &is_new,
-		"can-write", &can_write,
-		"serial-number", &serial_number,
-		"firmware-version", &firmware_version,
-		"volume-size", &volume_size,
-		"volume-used", &volume_used,
-		"volume-available", &volume_available,
-		"volume_uuid", &volume_uuid,
-		"volume-label", &volume_label,
-		"device-name", &device_name,
-		"user-name", &user_name,
-		"host-name", &host_name,
-		NULL);
-		
-	g_printf("Path Info\n");
-	g_printf("   Device Path:      %s\n", device_path);
-	g_printf("   Mount Point:      %s\n", mount_point);
-	g_printf("   Control Path:     %s\n", control_path);
-	g_printf("   HAL ID:           %s\n", hal_id);
-	
-	g_printf("Device Info\n");
-	g_printf("   Model Number:     %s\n", model_number);
-	g_printf("   Device Model:     %s\n", model_string);
-	g_printf("   iPod Generation:  %s\n", generation_names[generation]);
-	g_printf("   Adv. Capacity:    %s\n", adv_capacity);
-	g_printf("   Is New:           %s\n", is_new ? "YES" : "NO");
-	g_printf("   Writeable:        %s\n", can_write ? "YES" : "NO");
-	g_printf("   Serial Number:    %s\n", serial_number);
-	g_printf("   Firmware Version: %s\n", firmware_version);
-	g_printf("Volume Info\n");
-	g_printf("   Volume Size:      %lld\n", (long long int)volume_size);
-	g_printf("   Volume Used:      %lld\n", (long long int)volume_used);
-	g_printf("   Available         %lld\n", (long long int)volume_available);
-	g_printf("   UUID:             %s\n", volume_uuid);
-	g_printf("   Label             %s\n", volume_label);
-	g_printf("User-Provided Info\n");
-	g_printf("   Device Name:      %s\n", device_name);
-	g_printf("   User Name:        %s\n", user_name);
-	g_printf("   Host Name:        %s\n", host_name);
-	
-	g_printf("\n");
-	fflush(stdout);
-}

Modified: libgpod/branches/upstream/current/src/itdb_device.h
===================================================================
--- libgpod/branches/upstream/current/src/itdb_device.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_device.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,196 +1,78 @@
-/* Time-stamp: <2005-10-10 01:23:28 jcs>
+/* Time-stamp: <2006-06-07 23:48:37 jcs>
 |
-|  Copyright (C) 2005 Jorg Schuler <jcsjcs at users sourceforge net>
+|  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
 | 
 |  URL: http://www.gtkpod.org/
 |  URL: http://gtkpod.sourceforge.net/
 |
+|  Most of the code in this file has been ported from the perl
+|  script "mktunes.pl" (part of the gnupod-tools collection) written
+|  by Adrian Ulrich <pab at blinkenlights.ch>.
 |
-|  The source is taken from libipoddevice, CVS version October 8 2005
-|  (http://64.14.94.162/index.php/Libipoddevice).
+|  gnupod-tools: http://www.blinkenlights.ch/cgi-bin/fm.pl?get=ipod
 |
-|  I decided not to make libgpod dependent on libipoddevice because
-|  the latter depends on libraries not widely available yet (libhal >=
-|  0.5.2, glib >= 2.8). It is planned to replace these files with a
-|  libipoddevice dependence at some later time.
+|  The code contained in this file is free software; you can redistribute
+|  it and/or modify it under the terms of the GNU Lesser General Public
+|  License as published by the Free Software Foundation; either version
+|  2.1 of the License, or (at your option) any later version.
 |
-|  The following changes were done:
+|  This file is distributed in the hope that it will be useful,
+|  but WITHOUT ANY WARRANTY; without even the implied warranty of
+|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+|  Lesser General Public License for more details.
 |
-|  - libhal becomes optional (see #ifdef HAVE_LIBHAL sections)
-|  - publicly available functions were renamed from ipod_device_...()
-|    to itdb_device_...()
+|  You should have received a copy of the GNU Lesser General Public
+|  License along with this code; if not, write to the Free Software
+|  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 |
-|  Because of these changes only a limited amount of functionality is
-|  available if libhal is not present. In particular the following
-|  functions are non-functional:
+|  iTunes and iPod are trademarks of Apple
 |
-|    GList *ipod_device_list_devices(void);
-|    GList *ipod_device_list_device_udis(void);
-|    guint ipod_device_eject(IpodDevice *device, GError **error);
-|    guint ipod_device_reboot(IpodDevice *device, GError **error_out);
+|  This product is not supported/written/published by Apple!
 |
-|  Only the following properties are available:
-|
-|
-|    device-model
-|    device-model-string
-|    device-generation
-|    advertised-capacity
-|    is-new
-|    can-write
-|    serial-number
-|    firmware-version
-|    device-name
-|    user-name
-|    host-name
-|
-|
-|  $Id: ipod-device.h,v 1.6 2005/11/21 19:50:27 teuf Exp $
+|  $Id: itdb_device.h,v 1.6 2006/06/07 15:41:50 jcsjcs Exp $
 */
-/* ex: set ts=4: */
-/***************************************************************************
-*  ipod-device.h
-*  Copyright (C) 2005 Novell 
-*  Written by Aaron Bockover <aaron at aaronbock.net>
-****************************************************************************/
 
-/*  
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of version 2.1 of the GNU Lesser General Public
- *  License as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Lesser Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- *  USA
- */
+#ifndef __ITDB_DEVICE_H__
+#define __ITDB_DEVICE_H__
 
-#ifndef IPOD_DEVICE_H
-#define IPOD_DEVICE_H
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
+#include "itdb.h"
+
 #include <glib.h>
-#include <glib-object.h>
 
 G_BEGIN_DECLS
 
-#define TYPE_IPOD_DEVICE         (ipod_device_get_type ())
-#define IPOD_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_IPOD_DEVICE, IpodDevice))
-#define IPOD_DEVICE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), TYPE_IPOD_DEVICE, IpodDeviceClass))
-#define IS_IPOD_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_IPOD_DEVICE))
-#define IS_IPOD_DEVICE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_IPOD_DEVICE))
-#define IPOD_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_IPOD_DEVICE, IpodDeviceClass))
+typedef struct _Itdb_ArtworkFormat Itdb_ArtworkFormat;
 
-typedef struct IpodDevicePrivate IpodDevicePrivate;
-
-typedef struct {
-	GObject parent;
-	IpodDevicePrivate *priv;
-} IpodDevice;
-
-typedef struct {
-	GObjectClass parent_class;
-} IpodDeviceClass;
-
-enum {
-	UNKNOWN_GENERATION,
-	FIRST_GENERATION,
-	SECOND_GENERATION,
-	THIRD_GENERATION,
-	FOURTH_GENERATION,
-	FIFTH_GENERATION
+struct _Itdb_Device
+{
+    gchar *mountpoint;    /* mountpoint of the iPod */
+    gint   musicdirs;     /* number of /iPod_Control/Music/F.. dirs */
+    guint  byte_order;    /* G_LITTLE_ENDIAN "regular" endianness 
+			   * G_BIG_ENDIAN "reversed" endianness (e.g. mobile
+			   * phone iTunesDBs)
+			   */
+    GHashTable *sysinfo;  /* hash with value/key pairs of all entries
+			   * in Device/SysInfo */
+    gboolean sysinfo_changed; /* Has the sysinfo hash been changed by
+				 the user (itdb_set_sysinfo) */
 };
 
-enum {
-	MODEL_TYPE_INVALID,
-	MODEL_TYPE_UNKNOWN,
-	MODEL_TYPE_COLOR,
-	MODEL_TYPE_COLOR_U2,
-	MODEL_TYPE_REGULAR,
-	MODEL_TYPE_REGULAR_U2,
-	MODEL_TYPE_MINI,
-	MODEL_TYPE_MINI_BLUE,
-	MODEL_TYPE_MINI_PINK,
-	MODEL_TYPE_MINI_GREEN,
-	MODEL_TYPE_MINI_GOLD,
-	MODEL_TYPE_SHUFFLE,
-	MODEL_TYPE_NANO_WHITE,
-	MODEL_TYPE_NANO_BLACK,
-	MODEL_TYPE_VIDEO_WHITE,
-	MODEL_TYPE_VIDEO_BLACK
-};
-
-enum {
-	EJECT_OK,
-	EJECT_ERROR,
-	EJECT_BUSY
-};
-
-enum {
-	PROP_IPOD_0,
-	PROP_HAL_VOLUME_ID,
-	PROP_HAL_CONTEXT,
-	PROP_MOUNT_POINT,
-	PROP_DEVICE_PATH,
-	PROP_CONTROL_PATH,
-	PROP_DEVICE_MODEL,
-	PROP_DEVICE_MODEL_STRING,
-	PROP_DEVICE_GENERATION,
-	PROP_ADVERTISED_CAPACITY,
-	PROP_DEVICE_NAME,
-	PROP_USER_NAME,
-	PROP_HOST_NAME,
-	PROP_VOLUME_SIZE,
-	PROP_VOLUME_AVAILABLE,
-	PROP_VOLUME_USED,
-	PROP_IS_IPOD,
-	PROP_IS_NEW,
-	PROP_SERIAL_NUMBER,
-	PROP_MODEL_NUMBER,
-	PROP_FIRMWARE_VERSION,
-	PROP_VOLUME_UUID,
-	PROP_VOLUME_LABEL,
-	PROP_CAN_WRITE,
-	PROP_ARTWORK_FORMAT
-};
-
-enum {
-	ERROR_SAVE
-};
-
-enum { 
-	IPOD_COVER_SMALL,
-	IPOD_COVER_LARGE,
-	IPOD_PHOTO_SMALL,
-	IPOD_PHOTO_LARGE,
-	IPOD_PHOTO_FULL_SCREEN,
-	IPOD_PHOTO_TV_SCREEN
-};
-
-
-typedef struct {
-	gint  type;
+struct _Itdb_ArtworkFormat
+{
+	ItdbThumbType type;
 	gint16 width;
 	gint16 height;
 	gint16 correlation_id;
-} IpodArtworkFormat;
+};
 
-
-GType itdb_device_get_type(void);
-IpodDevice *itdb_device_new(const gchar *mount_point);
-gboolean itdb_device_rescan_disk(IpodDevice *device);
-guint itdb_device_eject(IpodDevice *device, GError **error);
-guint itdb_device_reboot(IpodDevice *device, GError **error_out);
-void itdb_device_debug(IpodDevice *device);
-gboolean itdb_device_save(IpodDevice *device, GError **error);
-GList *itdb_device_list_devices(void);
-GList *itdb_device_list_device_udis(void);
-
+G_GNUC_INTERNAL const Itdb_ArtworkFormat *itdb_device_get_artwork_formats (Itdb_Device *device);
+G_GNUC_INTERNAL gint itdb_device_musicdirs_number (Itdb_Device *device);
+G_GNUC_INTERNAL void itdb_device_autodetect_endianess (Itdb_Device *device);
 G_END_DECLS
 
-#endif /* IPOD_DEVICE_H */
+#endif

Added: libgpod/branches/upstream/current/src/itdb_endianness.h
===================================================================
--- libgpod/branches/upstream/current/src/itdb_endianness.h	                        (rev 0)
+++ libgpod/branches/upstream/current/src/itdb_endianness.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,92 @@
+/*
+ *  Copyright (C) 2005 Christophe Fergeau
+ *
+ * 
+ *  The code contained in this file is free software; you can redistribute
+ *  it and/or modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either version
+ *  2.1 of the License, or (at your option) any later version.
+ *  
+ *  This file is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this code; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *  02111-1307 USA
+ * 
+ *  iTunes and iPod are trademarks of Apple
+ * 
+ *  This product is not supported/written/published by Apple!
+ *
+ *  $Id: itdb_endianness.h,v 1.4 2006/06/04 16:24:45 jcsjcs Exp $
+ */
+
+#ifndef __ITDB_ENDIANNESS_H__
+#define __ITDB_ENDIANNESS_H__
+
+#include <glib.h>
+#include "itdb.h"
+#include "itdb_device.h"
+#include "itdb_private.h"
+
+#define DB_TO_CPU_GET(lower_case_type, upper_case_type) \
+    static inline lower_case_type \
+    get_##lower_case_type (lower_case_type val, guint byte_order) \
+    { \
+        if (byte_order == G_BIG_ENDIAN) { \
+            return upper_case_type##_FROM_BE (val); \
+        } else if (byte_order == G_LITTLE_ENDIAN) { \
+            return upper_case_type##_FROM_LE (val); \
+	} else { \
+  	    g_assert_not_reached ();  \
+	} \
+        return 0;  /* never reached */ \
+    }
+/*
+#define DB_TO_CPU_GET_DB(lower_case_type, upper_case_type) \
+    DB_TO_CPU_GET(lower_case_type, upper_case_type) \
+    static inline lower_case_type \
+    get_##lower_case_type##_db (Itdb_iTunesDB *db, lower_case_type val) \
+    { \
+        g_assert (db->device != NULL); \
+        return get_##lower_case_type (val, db->device->byte_order); \
+}
+*/
+
+#define DB_TO_CPU_GET_DB(lower_case_type, upper_case_type) \
+    DB_TO_CPU_GET(lower_case_type, upper_case_type) \
+    static inline lower_case_type \
+    get_##lower_case_type##_db (Itdb_DB *db, lower_case_type val) \
+    { \
+	g_assert (db_get_device(db) != NULL); \
+	return get_##lower_case_type (val, db_get_device(db)->byte_order); \
+    }
+
+DB_TO_CPU_GET_DB(guint32, GUINT32)
+DB_TO_CPU_GET_DB(gint32, GINT32)
+DB_TO_CPU_GET_DB(gint16, GINT16)
+DB_TO_CPU_GET_DB(gint64, GINT64)
+
+/* OK, for 'normal' people an effective summary of what this file is
+ * doing:
+ *
+ * The following inline functions are defined:
+ *
+ * guint32 get_guint32 (guint32 val, guint byte_order);
+ * guint32 get_gint32 (gint32 val, guint byte_order);
+ * guint32 get_gint16 (gint16 val, guint byte_order);
+ * guint32 get_gint64 (gint64 val, guint byte_order);
+ * guint32 get_guint32_db (guint32 val, guint byte_order);
+ * guint32 get_gint32_db (gint32 val, guint byte_order);
+ * guint32 get_gint16_db (gint16 val, guint byte_order);
+ * guint32 get_gint64_db (gint64 val, guint byte_order);
+ *
+
+ * They are used to retrieve integer data from or store integer data
+ * to the iPod's databases which may use a different byte order
+ * (@byte_order) than the host system on which this library runs on.
+ */
+#endif

Modified: libgpod/branches/upstream/current/src/itdb_itunesdb.c
===================================================================
--- libgpod/branches/upstream/current/src/itdb_itunesdb.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_itunesdb.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-02-14 22:10:45 jcs>
+/* Time-stamp: <2006-09-21 20:12:24 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -24,13 +24,14 @@
 |
 |  You should have received a copy of the GNU Lesser General Public
 |  License along with this code; if not, write to the Free Software
-|  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+|  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+|  USA
 |
 |  iTunes and iPod are trademarks of Apple
 |
 |  This product is not supported/written/published by Apple!
 |
-|  $Id: itdb_itunesdb.c,v 1.42 2006/02/14 13:28:06 jcsjcs Exp $
+|  $Id: itdb_itunesdb.c,v 1.68 2006/09/21 11:39:05 jcsjcs Exp $
 */
 
 /* Some notes on how to use the functions in this file:
@@ -111,17 +112,20 @@
 #  include <config.h>
 #endif
 
-#include <time.h>
+#include "db-artwork-parser.h"
+#include "itdb_device.h"
+#include "itdb_private.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <glib-object.h>
+#include <glib/gi18n-lib.h>
+#include <stdio.h>
 #include <string.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
 #include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+#include <time.h>
 #include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
-#include "itdb_private.h"
-#include "db-artwork-parser.h"
-#include <glib/gi18n-lib.h>
 
 #define ITUNESDB_DEBUG 0
 #define ITUNESDB_MHIT_DEBUG 0
@@ -189,7 +193,10 @@
 
 typedef struct _MHODData MHODData;
 
+/* Declarations */
+static gboolean itdb_create_directories (Itdb_Device *device, GError **error);
 
+
 /* ID for error domain */
 GQuark itdb_file_error_quark (void)
 {
@@ -219,6 +226,7 @@
     g_return_val_if_fail (fname, NULL);
 
     cts = g_new0 (FContents, 1);
+    cts->reversed = FALSE;
 
     if (g_file_get_contents (fname, &cts->contents, &cts->length, error))
     {
@@ -258,12 +266,17 @@
    component of the filename.  If we can find such a match, we return
    it.  Otherwise, we return NULL.*/
      
-/* We start by assuming that the ipod mount point exists.  Then, for
- * each component c of track->ipod_path, we try to find an entry d in
+/**
+ * itdb_resolve_path:
+ * @root: in local encoding
+ * @components: in utf8
+ *
+ * We start by assuming that the ipod mount point exists.  Then, for
+ * each component c of track-&gt;ipod_path, we try to find an entry d in
  * good_path that is case-insensitively equal to c.  If we find d, we
  * append d to good_path and make the result the new good_path.
- * Otherwise, we quit and return NULL.  @root: in local encoding,
- * @components: in utf8 */
+ * Otherwise, we quit and return NULL.
+ **/
 gchar * itdb_resolve_path (const gchar *root,
 			   const gchar * const * components)
 {
@@ -394,6 +407,40 @@
 }
 
 
+/* Compare 4 bytes of @header with 4 bytes at @seek taking into
+ * consideration the status of cts->reversed */
+static gboolean check_header_seek (FContents *cts, const gchar *data,
+				   glong seek)
+{
+    gchar rdata[4];
+    gint i, offset, sign;
+
+    g_return_val_if_fail (cts, FALSE);
+    g_return_val_if_fail (data, FALSE);
+    /* reverse data for compare if necessary */
+    if (cts->reversed)
+    {
+	offset = 3;
+	sign = -1;
+    }
+    else
+    {
+	offset = 0;
+	sign = 1;
+    }
+    for (i=0; i<4; ++i)
+    {
+	    rdata[i] = data[offset + sign*i];
+    }
+
+    return cmp_n_bytes_seek (cts, rdata, seek, 4);
+}
+
+
+/* ------------------------------------------------------------
+   Not Endian Dependent
+   ------------------------------------------------------------ */
+
 /* Returns the 1-byte number stored at position @seek. On error the
  * GError in @cts is set. */
 static guint8 get8int (FContents *cts, glong seek)
@@ -407,9 +454,14 @@
     return n;
 }
 
+
+/* ------------------------------------------------------------
+   Little Endian
+   ------------------------------------------------------------ */
+
 /* Get the 2-byte-number stored at position "seek" in little endian
    encoding. On error the GError in @cts is set. */
-static guint16 get16lint (FContents *cts, glong seek)
+static guint16 raw_get16lint (FContents *cts, glong seek)
 {
     guint16 n=0;
 
@@ -424,7 +476,7 @@
 
 /* Get the 3-byte-number stored at position "seek" in little endian
    encoding. On error the GError in @cts is set. */
-static guint32 get24lint (FContents *cts, glong seek)
+static guint32 raw_get24lint (FContents *cts, glong seek)
 {
     guint32 n=0;
 
@@ -440,7 +492,7 @@
 
 /* Get the 4-byte-number stored at position "seek" in little endian
    encoding. On error the GError in @cts is set. */
-static guint32 get32lint (FContents *cts, glong seek)
+static guint32 raw_get32lint (FContents *cts, glong seek)
 {
     guint32 n=0;
 
@@ -454,7 +506,7 @@
 }
 
 /* Get 4 byte floating number */
-static float get32lfloat (FContents *cts, glong seek)
+static float raw_get32lfloat (FContents *cts, glong seek)
 {
     union
     {
@@ -464,46 +516,97 @@
 
     g_return_val_if_fail (sizeof (float) == 4, 0);
 
-    flt.i = get32lint (cts, seek);
+    flt.i = raw_get32lint (cts, seek);
 
     return flt.f;
 }
 
 
-/* Get the 4-byte-number stored at position "seek" in big endian
+/* Get the 8-byte-number stored at position "seek" in little endian
    encoding. On error the GError in @cts is set. */
-static guint32 get32bint (FContents *cts, glong seek)
+static guint64 raw_get64lint (FContents *cts, glong seek)
 {
+    guint64 n=0;
+
+    if (check_seek (cts, seek, 8))
+    {
+	g_return_val_if_fail (cts->contents, 0);
+	memcpy (&n, &cts->contents[seek], 8);
+	n = GUINT64_FROM_LE (n);
+    }
+    return n;
+}
+
+
+/* ------------------------------------------------------------
+   Big Endian
+   ------------------------------------------------------------ */
+
+/* Get the 2-byte-number stored at position "seek" in little endian
+   encoding. On error the GError in @cts is set. */
+static guint16 raw_get16bint (FContents *cts, glong seek)
+{
+    guint16 n=0;
+
+    if (check_seek (cts, seek, 2))
+    {
+	g_return_val_if_fail (cts->contents, 0);
+	memcpy (&n, &cts->contents[seek], 2);
+	n = GUINT16_FROM_BE (n);
+    }
+    return n;
+}
+
+/* Get the 3-byte-number stored at position "seek" in big endian
+   encoding. On error the GError in @cts is set. */
+static guint32 raw_get24bint (FContents *cts, glong seek)
+{
     guint32 n=0;
 
-    if (check_seek (cts, seek, 4))
+    if (check_seek (cts, seek, 3))
     {
 	g_return_val_if_fail (cts->contents, 0);
-	memcpy (&n, &cts->contents[seek], 4);
-	n = GUINT32_FROM_BE (n);
+	n = ((guint32)get8int (cts, seek+2)) +
+	    (((guint32)get8int (cts, seek+1)) >> 8) +
+	    (((guint32)get8int (cts, seek+0)) >> 16);
     }
     return n;
 }
 
-/* Get the 8-byte-number stored at position "seek" in little endian
+/* Get the 4-byte-number stored at position "seek" in big endian
    encoding. On error the GError in @cts is set. */
-static guint64 get64lint (FContents *cts, glong seek)
+static guint32 raw_get32bint (FContents *cts, glong seek)
 {
-    guint64 n=0;
+    guint32 n=0;
 
-    if (check_seek (cts, seek, 8))
+    if (check_seek (cts, seek, 4))
     {
 	g_return_val_if_fail (cts->contents, 0);
-	memcpy (&n, &cts->contents[seek], 8);
-	n = GUINT64_FROM_LE (n);
+	memcpy (&n, &cts->contents[seek], 4);
+	n = GUINT32_FROM_BE (n);
     }
     return n;
 }
 
+/* Get 4 byte floating number */
+static float raw_get32bfloat (FContents *cts, glong seek)
+{
+    union
+    {
+	guint32 i;
+	float   f;
+    } flt;
 
+    g_return_val_if_fail (sizeof (float) == 4, 0);
+
+    flt.i = raw_get32bint (cts, seek);
+
+    return flt.f;
+}
+
 /* Get the 8-byte-number stored at position "seek" in big endian
    encoding. On error the GError in @cts is set. */
-static guint64 get64bint (FContents *cts, glong seek)
+static guint64 raw_get64bint (FContents *cts, glong seek)
 {
     guint64 n=0;
 
@@ -516,6 +619,115 @@
     return n;
 }
 
+
+/* ------------------------------------------------------------
+   Reversed Endian Sensitive (little endian)
+   ------------------------------------------------------------ */
+
+/* The following functions take into consideration the state of
+ * cts->reversed and call either raw_getnnlint or raw_getnnbint */
+static guint16 get16lint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get16lint (cts, seek);
+    else
+	return raw_get16bint (cts, seek);
+}
+
+static guint32 get24lint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get24lint (cts, seek);
+    else
+	return raw_get24bint (cts, seek);
+}
+#if 0
+static guint32 get24bint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get24bint (cts, seek);
+    else
+	return raw_get24lint (cts, seek);
+}
+#endif
+static guint32 get32lint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get32lint (cts, seek);
+    else
+	return raw_get32bint (cts, seek);
+}
+
+static float get32lfloat (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get32lfloat (cts, seek);
+    else
+	return raw_get32bfloat (cts, seek);
+}
+
+static guint64 get64lint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get64lint (cts, seek);
+    else
+	return raw_get64bint (cts, seek);
+}
+
+
+
+/* ------------------------------------------------------------
+   Reversed Endian Sensitive (big endian)
+   ------------------------------------------------------------ */
+
+#if 0
+static guint16 get16bint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get16bint (cts, seek);
+    else
+	return raw_get16lint (cts, seek);
+}
+#endif
+static guint32 get32bint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get32bint (cts, seek);
+    else
+	return raw_get32lint (cts, seek);
+}
+
+#if 0
+static float get32bfloat (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get32bfloat (cts, seek);
+    else
+	return raw_get32lfloat (cts, seek);
+}
+#endif
+
+static guint64 get64bint (FContents *cts, glong seek)
+{
+    g_return_val_if_fail (cts, 0);
+    if (!cts->reversed)
+	return raw_get64bint (cts, seek);
+    else
+	return raw_get64lint (cts, seek);
+}
+
+
+
+
 /* Fix little endian UTF16 String to correct byteorder if necessary
  * (all strings in the Itdb_iTunesDB are little endian except for the ones
  * in smart playlists). */
@@ -589,22 +801,32 @@
     g_return_val_if_fail (fimp, FALSE);
     g_return_val_if_fail (cts, FALSE);
 
-    if (!cmp_n_bytes_seek (cts, "mhdp", 0, 4))
+    if (!check_header_seek (cts, "mhdp", 0))
     {
 	if (cts->error)
 	{
 	    g_propagate_error (&fimp->error, cts->error);
+	    return FALSE;
 	}
-	else
-	{   /* set error */
-	    g_return_val_if_fail (cts->filename, FALSE);
-	    g_set_error (&fimp->error,
-			 ITDB_FILE_ERROR,
-			 ITDB_FILE_ERROR_CORRUPT,
-			 _("Not a Play Counts file: '%s' (missing mhdp header)."),
-			 cts->filename);
+	cts->reversed = TRUE;
+	if (!check_header_seek (cts, "mhdp", 0))
+	{
+	    if (cts->error)
+	    {
+		g_propagate_error (&fimp->error, cts->error);
+		return FALSE;
+	    }
+	    else
+	    {   /* set error */
+		g_return_val_if_fail (cts->filename, FALSE);
+		g_set_error (&fimp->error,
+			     ITDB_FILE_ERROR,
+			     ITDB_FILE_ERROR_CORRUPT,
+			     _("Not a Play Counts file: '%s' (missing mhdp header)."),
+			     cts->filename);
+		return FALSE;
+	    }
 	}
-	return FALSE;
     }
     header_length = get32lint (cts, 4);
     CHECK_ERROR (fimp, FALSE);
@@ -825,14 +1047,19 @@
 {
     if (fimp)
     {
-	if (fimp->itunesdb)  fcontents_free (fimp->itunesdb);
+	if (fimp->fcontents)  fcontents_free (fimp->fcontents);
 	g_list_free (fimp->pos_glist);
 	playcounts_free (fimp);
 	g_free (fimp);
     }
 }
 
-/* Free the memory taken by @itdb. */
+/** 
+ * itdb_free:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Free the memory taken by @itdb. 
+ **/
 void itdb_free (Itdb_iTunesDB *itdb)
 {
     if (itdb)
@@ -844,18 +1071,22 @@
 			(GFunc)(itdb_track_free), NULL);
 	g_list_free (itdb->tracks);
 	g_free (itdb->filename);
-	g_free (itdb->mountpoint);
-	if (itdb->device != NULL) {
-	    g_object_unref (G_OBJECT (itdb->device));
-	}
+	itdb_device_free (itdb->device);
 	if (itdb->userdata && itdb->userdata_destroy)
 	    (*itdb->userdata_destroy) (itdb->userdata);
 	g_free (itdb);
     }
 }
 
-/* Duplicate @itdb */
-/* FIXME: not implemented yet */
+/**
+ * itdb_duplicate:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Duplicate @itdb 
+ * FIXME: not implemented yet 
+ *
+ * Return value: always return NULL since it's unimplemented
+ **/
 Itdb_iTunesDB *itdb_duplicate (Itdb_iTunesDB *itdb)
 {
     g_return_val_if_fail (itdb, NULL);
@@ -863,7 +1094,15 @@
     g_return_val_if_reached (NULL);
 }
 
-/* return number of playlists */
+/**
+ * itdb_playlists_number:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Counts the number of playlists stored in @itdb
+ *
+ * Return value: the number of playlists in @itdb (including the master 
+ * playlist)
+ **/
 guint32 itdb_playlists_number (Itdb_iTunesDB *itdb)
 {
     g_return_val_if_fail (itdb, 0);
@@ -872,7 +1111,14 @@
 }
 
 
-/* return total number of tracks */
+/**
+ * itdb_tracks_number:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Counts the number of tracks stored in @itdb
+ *
+ * Return value: the number of tracks in @itdb
+ **/
 guint32 itdb_tracks_number (Itdb_iTunesDB *itdb)
 {
     g_return_val_if_fail (itdb, 0);
@@ -880,7 +1126,16 @@
     return g_list_length (itdb->tracks);
 }
 
-
+/**
+ * itdb_tracks_number_nontransferred:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Counts the number of non-transferred tracks in @itdb
+ *
+ * Return value: the number of tracks in @itdb that haven't been transferred
+ * to the iPod yet (ie the number of #Itdb_Track in which the transferred field
+ * is false)
+ **/
 guint32 itdb_tracks_number_nontransferred (Itdb_iTunesDB *itdb)
 {
     guint n = 0;
@@ -898,8 +1153,15 @@
 
 
 
-/* Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable
-   values */
+/**
+ * itdb_new:
+ *
+ * Creates a new Itdb_iTunesDB with the unknowns filled in to reasonable
+ * values.
+ *
+ * Return value: a newly created Itdb_iTunesDB to be freed with itdb_free()
+ * when it's no longer needed
+ **/
 Itdb_iTunesDB *itdb_new (void)
 {
     static GOnce g_type_init_once = G_ONCE_INIT;
@@ -907,6 +1169,7 @@
 
     g_once (&g_type_init_once, (GThreadFunc)g_type_init, NULL);
     itdb = g_new0 (Itdb_iTunesDB, 1);
+    itdb->device = itdb_device_new ();
     itdb->version = 0x09;
     itdb->id = ((guint64)g_random_int () << 32) |
 	((guint64)g_random_int ());
@@ -927,7 +1190,7 @@
 
     if (ml) *ml = -1;
 
-    if (cmp_n_bytes_seek (cts, "mhod", seek, 4))
+    if (check_header_seek (cts, "mhod", seek))
     {
 	guint32 len = get32lint (cts, seek+8);    /* total length */
 	if (cts->error) return -1;
@@ -960,6 +1223,7 @@
   gint32 xl;
   guint32 mhod_len;
   gint32 header_length;
+  guint32 string_type;
   gulong seek;
 
   result.valid = FALSE;
@@ -988,8 +1252,12 @@
       }
       return result;
   }
+
+  if (!check_seek (cts, mhod_seek, mhod_len))
+      return result;
+
+
   header_length = get32lint (cts, mhod_seek+4); /* header length  */
-  if (cts->error) return result;
 
   seek = mhod_seek + header_length;
 
@@ -1004,7 +1272,6 @@
   case MHOD_ID_PLAYLIST:
       /* return the position indicator */
       result.data.track_pos = get32lint (cts, mhod_seek+24);
-      if (cts->error) return result;  /* *ml==-1, result.valid==FALSE */
       break;
   case MHOD_ID_TITLE:
   case MHOD_ID_PATH:
@@ -1018,28 +1285,40 @@
   case MHOD_ID_GROUPING:
   case MHOD_ID_DESCRIPTION:
   case MHOD_ID_SUBTITLE:
+      /* type of string: 0x02: UTF8, 0x01 or 0x00: UTF16 LE */
+      string_type = get32lint (cts, seek);
       xl = get32lint (cts, seek+4);   /* length of string */
-      if (cts->error) return result;  /* *ml==-1, result.valid==FALSE */
       g_return_val_if_fail (xl < G_MAXUINT - 2, result);
-      entry_utf16 = g_new0 (gunichar2, (xl+2)/2);
-      if (seek_get_n_bytes (cts, (gchar *)entry_utf16, seek+16, xl))
+      if (string_type != 0x02)
       {
-	  fixup_little_utf16 (entry_utf16);
-	  result.data.string = g_utf16_to_utf8 (entry_utf16, -1,
-					   NULL, NULL, NULL);
-	  g_free (entry_utf16);
+	  entry_utf16 = g_new0 (gunichar2, (xl+2)/2);
+	  if (seek_get_n_bytes (cts, (gchar *)entry_utf16, seek+16, xl))
+	  {
+	      fixup_little_utf16 (entry_utf16);
+	      result.data.string = g_utf16_to_utf8 (entry_utf16, -1,
+						    NULL, NULL, NULL);
+	      g_free (entry_utf16);
+	  }
+	  else
+	  {   /* error */
+	      g_free (entry_utf16);
+	      return result;  /* *ml==-1, result.valid==FALSE */
+	  }
       }
       else
-      {   /* error */
-	  g_free (entry_utf16);
-	  return result;  /* *ml==-1, result.valid==FALSE */
+      {
+	  result.data.string = g_new0 (gchar, xl+1);
+	  if (!seek_get_n_bytes (cts, result.data.string, seek+16, xl))
+	  {   /* error */
+	      g_free (entry_utf16);
+	      return result;  /* *ml==-1, result.valid==FALSE */
+	  }
       }
       break;
   case MHOD_ID_PODCASTURL:
   case MHOD_ID_PODCASTRSS:
       /* length of string */
       xl = mhod_len - header_length;
-      if (cts->error) return result;  /* *ml==-1, result.valid==FALSE */
       g_return_val_if_fail (xl < G_MAXUINT - 1, result);
       result.data.string = g_new0 (gchar, xl+1);
       if (!seek_get_n_bytes (cts, result.data.string, seek, xl))
@@ -1075,7 +1354,7 @@
 	  result.data.splpref->limitsort |= 0x80000000;
       break;
   case MHOD_ID_SPLRULES:  /* Rules for smart playlist */
-      if (cmp_n_bytes_seek (cts, "SLst", seek, 4))
+      if (check_header_seek (cts, "SLst", seek))
       {
 	  /* !!! for some reason the SLst part is the only part of the
 	     iTunesDB with big-endian encoding, including UTF16
@@ -1098,7 +1377,7 @@
 		  result.data.splrules->rules, splr);
 	      if (!check_seek (cts, seek, 56))
 		  goto splrules_error;
-	      splr->field = get32bint (cts, seek);
+      splr->field = get32bint (cts, seek);
 	      splr->action = get32bint (cts, seek+4);
 	      seek += 52;
 	      length = get32bint (cts, seek);
@@ -1307,7 +1586,7 @@
 /* 	printf ("offset: %lx, b_len: %lx, bseek+offset: %lx\n",  */
 /* 		offset, b_len, b_seek+offset); */
     } while ((offset < b_len-4) && 
-	     !cmp_n_bytes_seek (cts, a, b_seek+offset, 4));
+	     !check_header_seek (cts, a, b_seek+offset));
     if (cts->error) return -1;
 
     if (offset >= b_len)	return -1;
@@ -1333,17 +1612,22 @@
     guint32 i, len, mhsd_num;
     glong seek;
 
-    if (!cmp_n_bytes_seek (cts, "mhbd", 0, 4))
+    if (!check_header_seek (cts, "mhbd", 0))
     {
-	if (!cts->error)
-	{   /* set error */
-	    g_set_error (&cts->error,
-			 ITDB_FILE_ERROR,
-			 ITDB_FILE_ERROR_CORRUPT,
-			 _("Not a iTunesDB: '%s' (missing mhdb header)."),
-			 cts->filename);
+	cts->reversed = TRUE;
+	if (cts->error) return 0;
+	if (!check_header_seek (cts, "mhbd", 0))
+	{
+	    if (!cts->error)
+	    {   /* set error */
+		g_set_error (&cts->error,
+			     ITDB_FILE_ERROR,
+			     ITDB_FILE_ERROR_CORRUPT,
+			     _("Not a iTunesDB: '%s' (missing mhdb header)."),
+			     cts->filename);
+	    }
+	    return 0;
 	}
-	return 0;
     }
     len = get32lint (cts, 4);
     if (cts->error) return 0;
@@ -1370,7 +1654,7 @@
 	guint32 mhsd_type;
 
 	seek += len;
-	if (!cmp_n_bytes_seek (cts, "mhsd", seek, 4))
+	if (!check_header_seek (cts, "mhsd", seek))
 	{
 	    if (!cts->error)
 	    {   /* set error */
@@ -1420,9 +1704,9 @@
     g_return_val_if_fail (fimp, -1);
     g_return_val_if_fail (plitem, -1);
 
-    cts = fimp->itunesdb;
+    cts = fimp->fcontents;
 
-    if (!cmp_n_bytes_seek (cts, "mhip", mhip_seek, 4))
+    if (!check_header_seek (cts, "mhip", mhip_seek))
     {
 	CHECK_ERROR (fimp, -1);
 	return -1;
@@ -1549,9 +1833,9 @@
   g_return_val_if_fail (fimp->pos_glist == NULL, -1);
   g_return_val_if_fail (fimp->pos_len == 0, -1);
 
-  cts = fimp->itunesdb;
+  cts = fimp->fcontents;
 
-  if (!cmp_n_bytes_seek (cts, "mhyp", mhyp_seek, 4))
+  if (!check_header_seek (cts, "mhyp", mhyp_seek))
   {
       if (cts->error)
 	  g_propagate_error (&fimp->error, cts->error);
@@ -1583,7 +1867,10 @@
 
   /* Some Playlists have added 256 to their type -- I don't know what
      it's for, so we just ignore it for now -> & 0xff */
-  plitem->type = get32lint (cts, mhyp_seek+20) & 0xff;
+  plitem->type = get8int (cts, mhyp_seek+20);
+  plitem->flag1 = get8int (cts, mhyp_seek+21);
+  plitem->flag2 = get8int (cts, mhyp_seek+22);
+  plitem->flag3 = get8int (cts, mhyp_seek+23);
   plitem->timestamp = get32lint (cts, mhyp_seek+24);
   plitem->id = get64lint (cts, mhyp_seek+28);
   plitem->mhodcount = get32lint (cts, mhyp_seek+36);
@@ -1739,9 +2026,9 @@
 
   g_return_val_if_fail (fimp, -1);
 
-  cts = fimp->itunesdb;
+  cts = fimp->fcontents;
 
-  if (!cmp_n_bytes_seek (cts, "mhit", seek, 4))
+  if (!check_header_seek (cts, "mhit", seek))
   {
       if (cts->error)
 	  g_propagate_error (&fimp->error, cts->error);
@@ -1776,21 +2063,24 @@
 
   if (header_len >= 0x9c)
   {
+      guint32 val32;
       track->id = get32lint(cts, seek+16);         /* iPod ID          */
       track->visible = get32lint (cts, seek+20);
-      seek_get_n_bytes (cts, track->filetype_marker, seek+24, 4);
-      track->type = get16lint (cts, seek+28);
+      track->filetype_marker = get32lint (cts, seek+24);
+      track->type1 = get8int (cts, seek+28);
+      track->type2 = get8int (cts, seek+29);
       track->compilation = get8int (cts, seek+30);
       track->rating = get8int (cts, seek+31);
-      track->time_added = get32lint(cts, seek+32); /* time added       */
+      track->time_modified = get32lint(cts, seek+32); /* time added       */
       track->size = get32lint(cts, seek+36);       /* file size        */
       track->tracklen = get32lint(cts, seek+40);   /* time             */
       track->track_nr = get32lint(cts, seek+44);   /* track number     */
       track->tracks = get32lint(cts, seek+48);     /* nr of tracks     */
       track->year = get32lint(cts, seek+52);       /* year             */
       track->bitrate = get32lint(cts, seek+56);    /* bitrate          */
-      track->unk060 = get32lint(cts, seek+60);     /* unknown          */
-      track->samplerate = get16lint(cts,seek+62);  /* sample rate      */
+      val32 = get32lint (cts, seek+60);
+      track->samplerate = val32 >> 16;             /* sample rate      */
+      track->samplerate_low = val32 & 0xffff;      /* remaining bits   */
       track->volume = get32lint(cts, seek+64);     /* volume adjust    */
       track->starttime = get32lint (cts, seek+68);
       track->stoptime = get32lint (cts, seek+72);
@@ -1803,7 +2093,7 @@
       /* Apple Store/Audible User ID (for DRM'ed files only, set to 0
 	 otherwise). */
       track->drm_userid = get32lint (cts, seek+100);
-      track->time_modified = get32lint(cts, seek+104);/* last mod. time */
+      track->time_added = get32lint(cts, seek+104);/* last mod. time */
       track->bookmark_time = get32lint (cts, seek+108);/*time bookmarked*/
       track->dbid = get64lint (cts, seek+112);
       track->checked = get8int (cts, seek+120); /*Checked/Unchecked: 0/1*/
@@ -1817,7 +2107,8 @@
       track->unk132 = get32lint (cts, seek+132);
       track->samplerate2 = get32lfloat (cts, seek+136);
       track->time_released = get32lint (cts, seek+140);
-      track->unk144 = get32lint (cts, seek+144);
+      track->unk144 = get16lint (cts, seek+144);
+      track->unk146 = get16lint (cts, seek+146);
       track->unk148 = get32lint (cts, seek+148);
       track->unk152 = get32lint (cts, seek+152);
   }
@@ -1825,12 +2116,15 @@
   {
       track->unk156 = get32lint (cts, seek+156);
       track->unk160 = get32lint (cts, seek+160);
-      track->flag1 = get8int (cts, seek+164);
-      track->flag2 = get8int (cts, seek+165);
-      track->flag3 = get8int (cts, seek+166);
+      track->has_artwork = get8int (cts, seek+164);
+      track->skip_when_shuffling = get8int (cts, seek+165);
+      track->remember_playback_position = get8int (cts, seek+166);
       track->flag4 = get8int (cts, seek+167);
       track->dbid2 = get64lint (cts, seek+168);
-      track->unk176 = get32lint (cts, seek+176);
+      track->lyrics_flag = get8int (cts, seek+176);
+      track->movie_flag = get8int (cts, seek+177);
+      track->mark_unplayed = get8int (cts, seek+178);
+      track->unk179 = get8int (cts, seek+179);
       track->unk180 = get32lint (cts, seek+180);
       track->unk184 = get32lint (cts, seek+184);
       track->samplecount = get32lint (cts, seek+188);
@@ -1957,6 +2251,10 @@
 	  track->bookmark_time = playcount->bookmark_time;
 
       track->playcount += playcount->playcount;
+      if (playcount->playcount != 0)
+      {   /* unmark the 'unplayed' flag */
+	  track->mark_unplayed = 0x01;
+      }
       track->recent_playcount = playcount->playcount;
       g_free (playcount);
   }
@@ -1980,22 +2278,26 @@
 
     if (!plname) plname = _("OTG Playlist");
 
-    if (!cmp_n_bytes_seek (cts, "mhpo", 0, 4))
+    if (!check_header_seek (cts, "mhpo", 0))
     {
 	if (cts->error)
 	{
 	    g_propagate_error (&fimp->error, cts->error);
+	    return FALSE;
 	}
-	else
-	{   /* set error */
+	cts->reversed = TRUE;
+	if (!check_header_seek (cts, "mhpo", 0))
+	{
+	    /* cts->error can't be set as already checked above */
+	    /* set error */
 	    g_return_val_if_fail (cts->filename, FALSE);
 	    g_set_error (&fimp->error,
 			 ITDB_FILE_ERROR,
 			 ITDB_FILE_ERROR_CORRUPT,
 			 _("Not a OTG playlist file: '%s' (missing mhpo header)."),
 			 cts->filename);
+	    return FALSE;
 	}
-	return FALSE;
     }
     header_length = get32lint (cts, 4);
     CHECK_ERROR (fimp, FALSE);
@@ -2128,13 +2430,13 @@
 
     g_return_val_if_fail (fimp, FALSE);
     g_return_val_if_fail (fimp->itdb, FALSE);
-    g_return_val_if_fail (fimp->itunesdb, FALSE);
-    g_return_val_if_fail (fimp->itunesdb->filename, FALSE);
+    g_return_val_if_fail (fimp->fcontents, FALSE);
+    g_return_val_if_fail (fimp->fcontents->filename, FALSE);
     g_return_val_if_fail (mhsd_seek >= 0, FALSE);
 
-    cts = fimp->itunesdb;
+    cts = fimp->fcontents;
 
-    g_return_val_if_fail (cmp_n_bytes_seek (cts, "mhsd", mhsd_seek, 4),
+    g_return_val_if_fail (check_header_seek (cts, "mhsd", mhsd_seek),
 			  FALSE);
 
    /* The mhlt header should be the next after the mhsd header. In
@@ -2188,13 +2490,13 @@
 
     g_return_val_if_fail (fimp, FALSE);
     g_return_val_if_fail (fimp->itdb, FALSE);
-    g_return_val_if_fail (fimp->itunesdb, FALSE);
-    g_return_val_if_fail (fimp->itunesdb->filename, FALSE);
+    g_return_val_if_fail (fimp->fcontents, FALSE);
+    g_return_val_if_fail (fimp->fcontents->filename, FALSE);
     g_return_val_if_fail (mhsd_seek >= 0, FALSE);
 
-    cts = fimp->itunesdb;
+    cts = fimp->fcontents;
 
-    g_return_val_if_fail (cmp_n_bytes_seek (cts, "mhsd", mhsd_seek, 4),
+    g_return_val_if_fail (check_header_seek (cts, "mhsd", mhsd_seek),
 			  FALSE);
 
     /* The mhlp header should be the next after the mhsd header. In
@@ -2248,10 +2550,10 @@
 
     g_return_val_if_fail (fimp, FALSE);
     g_return_val_if_fail (fimp->itdb, FALSE);
-    g_return_val_if_fail (fimp->itunesdb, FALSE);
-    g_return_val_if_fail (fimp->itunesdb->filename, FALSE);
+    g_return_val_if_fail (fimp->fcontents, FALSE);
+    g_return_val_if_fail (fimp->fcontents->filename, FALSE);
 
-    cts = fimp->itunesdb;
+    cts = fimp->fcontents;
 
     /* get the positions of the various mhsd */
     /* type 1: track list */
@@ -2281,6 +2583,17 @@
 	return FALSE;
     }
 
+    /* copy the 'reversed endian flag' */
+    if (cts->reversed) {
+      fimp->itdb->device->byte_order = G_BIG_ENDIAN;
+    } else {
+      fimp->itdb->device->byte_order = G_LITTLE_ENDIAN;
+    }
+#if 0
+    fimp->itdb->device->endianess_set = TRUE;
+    fimp->itdb->device->endianess_reversed = cts->reversed;
+#endif
+
     parse_tracks (fimp, mhsd_1);
     if (fimp->error) return FALSE;
 
@@ -2303,18 +2616,88 @@
 }
 
 
-/* Parse the Itdb_iTunesDB.
-   Returns a pointer to the Itdb_iTunesDB struct holding the tracks and the
-   playlists.
-   "mp" should point to the mount point of the iPod,
-   e.g. "/mnt/ipod" and be in local encoding */
+
+/* Set @error with standard error message */
+static void error_no_itunes_dir (const gchar *mp, GError **error)
+{
+    gchar *str;
+
+    g_return_if_fail (mp);
+    g_return_if_fail (error);
+
+    str = g_build_filename (mp, "iPod_Control", "iTunes", NULL);
+    g_set_error (error,
+		 ITDB_FILE_ERROR,
+		 ITDB_FILE_ERROR_NOTFOUND,
+		 _("iTunes directory not found: '%s' (or similar)."),
+		 str);
+    g_free (str);
+}
+
+/* Set @error with standard error message */
+static void error_no_music_dir (const gchar *mp, GError **error)
+{
+    gchar *str;
+
+    g_return_if_fail (mp);
+    g_return_if_fail (error);
+
+    str = g_build_filename (mp, "iPod_Control", "Music", NULL);
+    g_set_error (error,
+		 ITDB_FILE_ERROR,
+		 ITDB_FILE_ERROR_NOTFOUND,
+		 _("Music directory not found: '%s' (or similar)."),
+		 str);
+    g_free (str);
+}
+
+#if 0
+/* Set @error with standard error message */
+static void error_no_control_dir (const gchar *mp, GError **error)
+{
+    gchar *str;
+
+    g_return_if_fail (mp);
+    g_return_if_fail (error);
+
+    str = g_build_filename (mp, "iPod_Control", NULL);
+    g_set_error (error,
+		 ITDB_FILE_ERROR,
+		 ITDB_FILE_ERROR_NOTFOUND,
+		 _("Control directory not found: '%s' (or similar)."),
+		 str);
+    g_free (str);
+}
+#endif
+
+/**
+ * itdb_parse:
+ * @mp: mount point of the iPod (eg "/mnt/ipod) in local encoding
+ * @error: return location for a #GError or NULL
+ *
+ * Parse the Itdb_iTunesDB of the iPod located at @mp
+ *
+ * Return value: a newly allocated #Itdb_iTunesDB struct holding the tracks and
+ * the playlists present on the iPod at @mp, NULL if @mp isn't an iPod mount
+ * point. If non-NULL, the #Itdb_iTunesDB is to be freed with itdb_free() when
+ * it's no longer needed
+ **/
 Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error)
 {
     gchar *filename;
+    gchar *itunes_dir;
     Itdb_iTunesDB *itdb = NULL;
-    const gchar *db[] = {"iPod_Control","iTunes","iTunesDB",NULL};
+    const gchar *db[] = {"iTunesDB", NULL};
 
-    filename = itdb_resolve_path (mp, db);
+    itunes_dir = itdb_get_itunes_dir (mp);
+
+    if (!itunes_dir)
+    {
+	error_no_itunes_dir (mp, error);
+	return NULL;
+    }
+
+    filename = itdb_resolve_path (itunes_dir, db);
     if (filename)
     {
 	itdb = itdb_parse_file (filename, error);
@@ -2344,6 +2727,7 @@
 	     * should be modified by the repository name.
 	     */
 	    ipod_parse_artwork_db (itdb);
+
 	}
 	g_free (filename);
     }
@@ -2357,11 +2741,22 @@
 		     str);
 	g_free (str);
     }
+    g_free (itunes_dir);
     return itdb;
 }
 
-
-/* Same as itunesdb_parse(), but filename is specified directly. */
+/**
+ * itdb_parse_file:
+ * @filename: path to a file in iTunesDB format
+ * @error: return location for a #GError or NULL
+ *
+ *  Same as itunesdb_parse(), but filename is specified directly.
+ *
+ * Return value: a newly allocated #Itdb_iTunesDB struct holding the tracks and
+ * the playlists present on the iPod at @mp, NULL if @mp isn't an iPod mount
+ * point. If non-NULL, the #Itdb_iTunesDB is to be freed with itdb_free() when
+ * it's no longer needed
+ **/
 Itdb_iTunesDB *itdb_parse_file (const gchar *filename, GError **error)
 {
     FImport *fimp;
@@ -2375,9 +2770,9 @@
     itdb->filename = g_strdup (filename);
     fimp->itdb = itdb;
 
-    fimp->itunesdb = fcontents_read (filename, error);
+    fimp->fcontents = fcontents_read (filename, error);
 
-    if (fimp->itunesdb)
+    if (fimp->fcontents)
     {
 	if (playcounts_init (fimp))
 	{
@@ -2429,10 +2824,10 @@
 			   gulong len, gulong seek)
 {
     g_return_if_fail (cts);
-    g_return_if_fail (data);
 
     if (len != 0)
     {
+	g_return_if_fail (data);
 	wcontents_maybe_expand (cts, len, seek);
 
 	memcpy (&cts->contents[seek], data, len);
@@ -2464,31 +2859,71 @@
     put_data (cts, string, strlen(string));
 }
 
+/* Write 4-byte long @header identifcation taking into account
+ * possible reversed endianess */
+static void put_header (WContents *cts, gchar *header)
+{
+    gchar rdata[4];
+    gint i, offset, sign;
 
-/* Write 1-byte integer @n to @cts */
-static void put8int (WContents *cts, guint8 n)
-{
-    put_data (cts, (gchar *)&n, 1);
+
+    g_return_if_fail (cts);
+    g_return_if_fail (header);
+    g_return_if_fail (strlen (header) == 4);
+
+    /* reverse data for write if necessary */
+    if (cts->reversed)
+    {
+	offset = 3;
+	sign = -1;
+    }
+    else
+    {
+	offset = 0;
+	sign = 1;
+    }
+    for (i=0; i<4; ++i)
+    {
+	    rdata[i] = header[offset + sign*i];
+    }
+
+    put_data (cts, rdata, 4);
 }
 
 
+
+/* ------------------------------------------------------------
+   Little Endian
+   ------------------------------------------------------------ */
+
 /* Write 2-byte integer @n to @cts in little endian order. */
-static void put16lint (WContents *cts, guint16 n)
+static void raw_put16lint (WContents *cts, guint16 n)
 {
     n = GUINT16_TO_LE (n);
     put_data (cts, (gchar *)&n, 2);
 }
 
 
+/* Write 3-byte integer @n to @cts in big endian order. */
+static void raw_put24lint (WContents *cts, guint32 n)
+{
+    gchar buf[3] ;
+    buf[2] = (n >> 16) & 0xff ;
+    buf[1] = (n >> 8)  & 0xff ;
+    buf[0] = (n >> 0)  & 0xff ;
+    put_data (cts, buf, 3);
+}
+
+
 /* Write 4-byte integer @n to @cts in little endian order. */
-static void put32lint (WContents *cts, guint32 n)
+static void raw_put32lint (WContents *cts, guint32 n)
 {
     n = GUINT32_TO_LE (n);
     put_data (cts, (gchar *)&n, 4);
 }
 
 /* Write 4 byte floating number */
-static void put32lfloat (WContents *cts, float f)
+static void raw_put32lfloat (WContents *cts, float f)
 {
     union
     {
@@ -2498,30 +2933,46 @@
 
     if (sizeof (float) != 4)
     {
-	put32lint (cts, 0);
+	raw_put32lint (cts, 0);
 	g_return_if_reached ();
     }
 
     flt.f = f;
-    put32lint (cts, flt.i);
+    raw_put32lint (cts, flt.i);
 }
 
 
-/* Append @n times 2-byte-long zeros */
-static void put16_n0 (WContents *cts, gulong n)
+/* Write 4-byte integer @n to @cts at position @seek in little
+   endian order. */
+static void raw_put32lint_seek (WContents *cts, guint32 n, gulong seek)
 {
-    g_return_if_fail (cts);
+    n = GUINT32_TO_LE (n);
+    put_data_seek (cts, (gchar *)&n, 4, seek);
+}
 
-    if (n>0)
-    {
-	wcontents_maybe_expand (cts, 2*n, cts->pos);
-	memset (&cts->contents[cts->pos], 0, 2*n);
-	cts->pos += 2*n;
-    }
+
+/* Write 8-byte integer @n to @cts in big little order. */
+static void raw_put64lint (WContents *cts, guint64 n)
+{
+    n = GUINT64_TO_LE (n);
+    put_data (cts, (gchar *)&n, 8);
 }
 
+
+/* ------------------------------------------------------------
+   Big Endian
+   ------------------------------------------------------------ */
+
+/* Write 2-byte integer @n to @cts in big endian order. */
+static void raw_put16bint (WContents *cts, guint16 n)
+{
+    n = GUINT16_TO_BE (n);
+    put_data (cts, (gchar *)&n, 2);
+}
+
+
 /* Write 3-byte integer @n to @cts in big endian order. */
-static void put24bint (WContents *cts, guint32 n)
+static void raw_put24bint (WContents *cts, guint32 n)
 {
     gchar buf[3] ;
     buf[0] = (n >> 16) & 0xff ;
@@ -2530,59 +2981,75 @@
     put_data (cts, buf, 3);
 }
 
+/* Write 4-byte integer @n to @cts in big endian order. */
+static void raw_put32bint (WContents *cts, guint32 n)
+{
+    n = GUINT32_TO_BE (n);
+    put_data (cts, (gchar *)&n, 4);
+}
 
-/* Write 4-byte integer @n to @cts at position @seek in little
+
+/* Write 4-byte integer @n to @cts at position @seek in big
    endian order. */
-static void put32lint_seek (WContents *cts, guint32 n, gulong seek)
+static void raw_put32bint_seek (WContents *cts, guint32 n, gulong seek)
 {
-    n = GUINT32_TO_LE (n);
+    n = GUINT32_TO_BE (n);
     put_data_seek (cts, (gchar *)&n, 4, seek);
 }
 
 
-/* Write 8-byte integer @n to @cts in big little order. */
-static void put64lint (WContents *cts, guint64 n)
+/* Write 4 byte floating number */
+static void raw_put32bfloat (WContents *cts, float f)
 {
-    n = GUINT64_TO_LE (n);
-    put_data (cts, (gchar *)&n, 8);
-}
+    union
+    {
+	guint32 i;
+	float   f;
+    } flt;
 
+    if (sizeof (float) != 4)
+    {
+	raw_put32bint (cts, 0);
+	g_return_if_reached ();
+    }
 
-/* Write 4-byte integer @n to @cts in big endian order. */
-static void put32bint (WContents *cts, guint32 n)
-{
-    n = GUINT32_TO_BE (n);
-    put_data (cts, (gchar *)&n, 4);
+    flt.f = f;
+    raw_put32bint (cts, flt.i);
 }
 
 
 /* Write 8-byte integer @n to cts in big endian order. */
-static void put64bint (WContents *cts, guint64 n)
+static void raw_put64bint (WContents *cts, guint64 n)
 {
     n = GUINT64_TO_BE (n);
     put_data (cts, (gchar *)&n, 8);
 }
 
 
-#if 0
-/* Write 4-byte integer @n to @cts at position @seek in big endian
-   order. */
-static void put32bint_seek (WContents *cts, guint32 n, gulong seek)
+/* ------------------------------------------------------------
+   Not Endian Dependent
+   ------------------------------------------------------------ */
+
+/* Write 1-byte integer @n to @cts */
+static void put8int (WContents *cts, guint8 n)
 {
-    n = GUINT32_TO_BE (n);
-    put_data_seek (cts, (gchar *)&n, 4, seek);
+    put_data (cts, (gchar *)&n, 1);
 }
 
-/* Write 8-byte integer @n to @cts at position @seek in big endian
-   order. */
-static void put64bint_seek (WContents *cts, guint64 n, gulong seek)
+
+/* Append @n times 2-byte-long zeros */
+static void put16_n0 (WContents *cts, gulong n)
 {
-    n = GUINT64_TO_BE (n);
-    put_data_seek (cts, (gchar *)&n, 8, seek);
+    g_return_if_fail (cts);
+
+    if (n>0)
+    {
+	wcontents_maybe_expand (cts, 2*n, cts->pos);
+	memset (&cts->contents[cts->pos], 0, 2*n);
+	cts->pos += 2*n;
+    }
 }
-#endif
 
-
 /* Append @n times 4-byte-long zeros */
 static void put32_n0 (WContents *cts, gulong n)
 {
@@ -2597,7 +3064,113 @@
 }
 
 
+/* ------------------------------------------------------------
+   Reversed Endian Sensitive (little endian)
+   ------------------------------------------------------------ */
 
+static void put16lint (WContents *cts, guint16 n)
+{
+    if (!cts->reversed)
+	raw_put16lint (cts, n);
+    else
+	raw_put16bint (cts, n);
+}
+#if 0
+static void put24lint (WContents *cts, guint32 n)
+{
+    if (!cts->reversed)
+	raw_put24lint (cts, n);
+    else
+	raw_put24bint (cts, n);
+}
+#endif
+static void put32lint (WContents *cts, guint32 n)
+{
+    if (!cts->reversed)
+	raw_put32lint (cts, n);
+    else
+	raw_put32bint (cts, n);
+}
+
+static void put32lfloat (WContents *cts, float f)
+{
+    if (!cts->reversed)
+	raw_put32lfloat (cts, f);
+    else
+	raw_put32bfloat (cts, f);
+}
+
+static void put32lint_seek (WContents *cts, guint32 n, gulong seek)
+{
+    if (!cts->reversed)
+	raw_put32lint_seek (cts, n, seek);
+    else
+	raw_put32bint_seek (cts, n, seek);
+}
+
+
+static void put64lint (WContents *cts, guint64 n)
+{
+    if (!cts->reversed)
+	raw_put64lint (cts, n);
+    else
+	raw_put64bint (cts, n);
+}
+
+/* ------------------------------------------------------------
+   Reversed Endian Sensitive (big endian)
+   ------------------------------------------------------------ */
+#if 0
+static void put16bint (WContents *cts, guint16 n)
+{
+    if (cts->reversed)
+	raw_put16lint (cts, n);
+    else
+	raw_put16bint (cts, n);
+}
+#endif
+static void put24bint (WContents *cts, guint32 n)
+{
+    if (cts->reversed)
+	raw_put24lint (cts, n);
+    else
+	raw_put24bint (cts, n);
+}
+
+static void put32bint (WContents *cts, guint32 n)
+{
+    if (cts->reversed)
+	raw_put32lint (cts, n);
+    else
+	raw_put32bint (cts, n);
+}
+#if 0
+static void put32bfloat (WContents *cts, float f)
+{
+    if (cts->reversed)
+	raw_put32lfloat (cts, f);
+    else
+	raw_put32bfloat (cts, f);
+}
+
+static void put32bint_seek (WContents *cts, guint32 n, gulong seek)
+{
+    if (cts->reversed)
+	raw_put32lint_seek (cts, n, seek);
+    else
+	raw_put32bint_seek (cts, n, seek);
+}
+#endif
+static void put64bint (WContents *cts, guint64 n)
+{
+    if (cts->reversed)
+	raw_put64lint (cts, n);
+    else
+	raw_put64bint (cts, n);
+}
+
+
+
 /* Write out the mhbd header. Size will be written later */
 static void mk_mhbd (FExport *fexp, guint32 children)
 {
@@ -2605,11 +3178,11 @@
 
   g_return_if_fail (fexp);
   g_return_if_fail (fexp->itdb);
-  g_return_if_fail (fexp->itunesdb);
+  g_return_if_fail (fexp->wcontents);
 
-  cts = fexp->itunesdb;
+  cts = fexp->wcontents;
 
-  put_string (cts, "mhbd");
+  put_header (cts, "mhbd");
   put32lint (cts, 104); /* header size */
   put32lint (cts, -1);  /* size of whole mhdb -- fill in later */
   put32lint (cts, 1);   /* ? */
@@ -2642,11 +3215,11 @@
 
   g_return_if_fail (fexp);
   g_return_if_fail (fexp->itdb);
-  g_return_if_fail (fexp->itunesdb);
+  g_return_if_fail (fexp->wcontents);
 
-  cts = fexp->itunesdb;
+  cts = fexp->wcontents;
 
-  put_string (cts, "mhsd");
+  put_header (cts, "mhsd");
   put32lint (cts, 96);   /* Headersize */
   put32lint (cts, -1);   /* size of whole mhsd -- fill in later */
   put32lint (cts, type); /* type: 1 = track, 2 = playlist */
@@ -2661,11 +3234,11 @@
 
   g_return_if_fail (fexp);
   g_return_if_fail (fexp->itdb);
-  g_return_if_fail (fexp->itunesdb);
+  g_return_if_fail (fexp->wcontents);
 
-  cts = fexp->itunesdb;
+  cts = fexp->wcontents;
 
-  put_string (cts, "mhlt");
+  put_header (cts, "mhlt");
   put32lint (cts, 92);       /* Headersize */
   put32lint (cts, num);      /* tracks in this itunesdb */
   put32_n0 (cts, 20);        /* dummy space */
@@ -2678,26 +3251,27 @@
   g_return_if_fail (cts);
   g_return_if_fail (track);
 
-  put_string (cts, "mhit");
+  put_header (cts, "mhit");
   put32lint (cts, 0xf4);  /* header size */
   put32lint (cts, -1);   /* size of whole mhit -- fill in later */
   put32lint (cts, -1);   /* nr of mhods in this mhit -- later   */
   put32lint (cts, track->id); /* track index number */
 
   put32lint (cts, track->visible);
-  put_data  (cts, track->filetype_marker, 4);
-  put16lint (cts, track->type);
+  put32lint (cts, track->filetype_marker);
+  put8int (cts, track->type1);
+  put8int (cts, track->type2);
   put8int   (cts, track->compilation);
   put8int   (cts, track->rating);
-  put32lint (cts, track->time_added); /* timestamp               */
+  put32lint (cts, track->time_modified); /* timestamp               */
   put32lint (cts, track->size);    /* filesize                   */
   put32lint (cts, track->tracklen);/* length of track in ms      */
   put32lint (cts, track->track_nr);/* track number               */
   put32lint (cts, track->tracks);  /* number of tracks           */
   put32lint (cts, track->year);    /* the year                   */
   put32lint (cts, track->bitrate); /* bitrate                    */
-  put16lint (cts, track->unk060);  /* unknown                    */
-  put16lint (cts, track->samplerate);
+  put32lint (cts, (((guint32)track->samplerate)<<16) |
+	     ((guint32)track->samplerate_low));
   put32lint (cts, track->volume);  /* volume adjust              */
   put32lint (cts, track->starttime);
   put32lint (cts, track->stoptime);
@@ -2709,7 +3283,7 @@
   put32lint (cts, track->cd_nr);   /* CD number                  */
   put32lint (cts, track->cds);     /* number of CDs              */
   put32lint (cts, track->drm_userid);
-  put32lint (cts, track->time_modified); /* timestamp            */
+  put32lint (cts, track->time_added); /* timestamp            */
   put32lint (cts, track->bookmark_time);
   put64lint (cts, track->dbid);
   if (track->checked)   put8int (cts, 1);
@@ -2722,18 +3296,22 @@
   put32lint (cts, track->unk132);
   put32lfloat (cts, track->samplerate2);
   put32lint (cts, track->time_released);
-  put32lint (cts, track->unk144);
+  put16lint (cts, track->unk144);
+  put16lint (cts, track->unk146);
   put32lint (cts, track->unk148);
   put32lint (cts, track->unk152);
   /* since iTunesDB version 0x0c */
   put32lint (cts, track->unk156);
   put32lint (cts, track->unk160);
-  put8int (cts, track->flag1);
-  put8int (cts, track->flag2);
-  put8int (cts, track->flag3);
+  put8int (cts, track->has_artwork);
+  put8int (cts, track->skip_when_shuffling);
+  put8int (cts, track->remember_playback_position);
   put8int (cts, track->flag4);
   put64lint (cts, track->dbid2);
-  put32lint (cts, track->unk176);
+  put8int (cts, track->lyrics_flag);
+  put8int (cts, track->movie_flag);
+  put8int (cts, track->mark_unplayed);
+  put8int (cts, track->unk179);
   put32lint (cts, track->unk180);
   put32lint (cts, track->unk184);
   put32lint (cts, track->samplecount);
@@ -2792,40 +3370,61 @@
   case MHOD_ID_DESCRIPTION:
   case MHOD_ID_SUBTITLE:
       g_return_if_fail (mhod->data.string);
+      /* normal iTunesDBs seem to take utf16 strings), endian-inversed
+	 iTunesDBs seem to take utf8 strings */
+      if (!cts->reversed)
       {
 	  /* convert to utf16  */
 	  gunichar2 *entry_utf16 = g_utf8_to_utf16 (mhod->data.string, -1,
 						    NULL, NULL, NULL);
 	  guint32 len = utf16_strlen (entry_utf16);
 	  fixup_little_utf16 (entry_utf16);
-	  put_string (cts, "mhod");   /* header                     */
+	  put_header (cts, "mhod");   /* header                     */
 	  put32lint (cts, 24);        /* size of header             */
 	  put32lint (cts, 2*len+40);  /* size of header + body      */
-	  put32lint (cts, mhod->type); /* type of the mhod           */
+	  put32lint (cts, mhod->type);/* type of the mhod           */
 	  put32_n0 (cts, 2);          /* unknown                    */
 	  /* end of header, start of data */
-	  put32lint (cts, 1);         /* always 1 for these MHOD_IDs*/
+	  put32lint (cts, 1);         /* string type UTF16          */
 	  put32lint (cts, 2*len);     /* size of string             */
 	  put32_n0 (cts, 2);          /* unknown                    */
 	  put_data (cts, (gchar *)entry_utf16, 2*len);/* the string */
 	  g_free (entry_utf16);
       }
+      else
+      {
+	  guint32 len = strlen (mhod->data.string);
+	  put_header (cts, "mhod");   /* header                     */
+	  put32lint (cts, 24);        /* size of header             */
+	  put32lint (cts, len+40);    /* size of header + body      */
+	  put32lint (cts, mhod->type);/* type of the mhod           */
+	  put32_n0 (cts, 2);          /* unknown                    */
+	  /* end of header, start of data */
+	  put32lint (cts, 2);         /* string type UTF 8          */
+	  put32lint (cts, len);       /* size of string             */
+	  put8int (cts, 1);           /* unknown                    */
+	  put8int (cts, 0);           /* unknown                    */
+	  put8int (cts, 0);           /* unknown                    */
+	  put8int (cts, 0);           /* unknown                    */
+	  put32lint (cts, 0);         /* unknown                    */
+	  put_string (cts, mhod->data.string);/* the string         */
+      }
       break;
   case MHOD_ID_PODCASTURL:
   case MHOD_ID_PODCASTRSS:
       g_return_if_fail (mhod->data.string);
       {
 	  guint32 len = strlen (mhod->data.string);
-	  put_string (cts, "mhod");   /* header                     */
+	  put_header (cts, "mhod");   /* header                     */
 	  put32lint (cts, 24);        /* size of header             */
 	  put32lint (cts, 24+len);    /* size of header + data      */
-	  put32lint (cts, mhod->type); /* type of the mhod           */
+	  put32lint (cts, mhod->type);/* type of the mhod           */
 	  put32_n0 (cts, 2);          /* unknown                    */
-	  put_string (cts, mhod->data.string); /* the string         */
+	  put_string (cts, mhod->data.string);/* the string         */
       }
       break;
   case MHOD_ID_PLAYLIST:
-      put_string (cts, "mhod");   /* header                     */
+      put_header (cts, "mhod");   /* header                     */
       put32lint (cts, 24);        /* size of header             */
       put32lint (cts, 44);        /* size of header + body      */
       put32lint (cts, mhod->type); /* type of the entry          */
@@ -2838,7 +3437,7 @@
       g_return_if_fail (mhod->data.chapterdata_track);
       {
 	  Itdb_Track *track = mhod->data.chapterdata_track;
-	  put_string (cts, "mhod");   /* header                     */
+	  put_header (cts, "mhod");   /* header                     */
 	  put32lint (cts, 24);        /* size of header             */
 	  put32lint (cts, 24+track->chapterdata_raw_length); /*size */
 	  put32lint (cts, mhod->type); /* type of the entry          */
@@ -2849,7 +3448,7 @@
       break;
   case MHOD_ID_SPLPREF:
       g_return_if_fail (mhod->data.splpref);
-      put_string (cts, "mhod");  /* header                 */
+      put_header (cts, "mhod");  /* header                 */
       put32lint (cts, 24);       /* size of header         */
       put32lint (cts, 96);       /* size of header + body  */
       put32lint (cts, mhod->type);/* type of the entry      */
@@ -2879,7 +3478,7 @@
 	  GList *gl;
 	  gint numrules = g_list_length (mhod->data.splrules->rules);
 
-	  put_string (cts, "mhod");  /* header                   */
+	  put_header (cts, "mhod");  /* header                   */
 	  put32lint (cts, 24);       /* size of header           */
 	  put32lint (cts, -1);       /* total length, fix later  */
 	  put32lint (cts, mhod->type);/* type of the entry        */
@@ -2887,7 +3486,7 @@
 	  /* end of header, start of data */
 	  /* For some reason this is the only part of the iTunesDB
 	     that uses big endian */
-	  put_string (cts, "SLst");  /* header                   */
+	  put_header (cts, "SLst");  /* header                   */
 	  put32bint (cts, mhod->data.splrules->unk004); /* unknown*/
 	  put32bint (cts, numrules);
 	  put32bint (cts, mhod->data.splrules->match_operator);
@@ -2906,9 +3505,13 @@
 	      put32_n0 (cts, 11);          /* unknown              */
 	      if (ft == splft_string)
 	      {   /* write string-type rule */
-		  gunichar2 *entry_utf16 =
-		      g_utf8_to_utf16 (splr->string, -1,NULL,NULL,NULL);
-		  gint len = utf16_strlen (entry_utf16);
+		  gunichar2 *entry_utf16 = NULL;
+		  gint len;
+		  /* splr->string may be NULL */
+		  if (splr->string)
+		      entry_utf16 = g_utf8_to_utf16 (splr->string,
+						     -1,NULL,NULL,NULL);
+		  len = utf16_strlen (entry_utf16);
 		  fixup_big_utf16 (entry_utf16);
 		  put32bint (cts, 2*len); /* length of string     */
 		  put_data (cts, (gchar *)entry_utf16, 2*len);
@@ -2948,11 +3551,11 @@
   WContents *cts;
 
   g_return_if_fail (fexp);
-  g_return_if_fail (fexp->itunesdb);
+  g_return_if_fail (fexp->wcontents);
 
-  cts = fexp->itunesdb;
+  cts = fexp->wcontents;
 
-  put_string (cts, "mhlp");        /* header                   */
+  put_header (cts, "mhlp");        /* header                   */
   put32lint (cts, 92);             /* size of header           */
   /* playlists on iPod (including main!) */
   put32lint (cts, g_list_length (fexp->itdb->playlists));
@@ -2973,12 +3576,12 @@
   WContents *cts;
 
   g_return_if_fail (fexp);
-  g_return_if_fail (fexp->itunesdb);
+  g_return_if_fail (fexp->wcontents);
   g_return_if_fail (pl);
 
-  cts = fexp->itunesdb;
+  cts = fexp->wcontents;
 
-  put_string (cts, "mhod");          /* header                   */
+  put_header (cts, "mhod");          /* header                   */
   put32lint (cts, 0x18);             /* size of header  ?        */
   put32lint (cts, 0x0288);           /* size of header + body    */
   put32lint (cts, MHOD_ID_PLAYLIST); /* type of the entry        */
@@ -3025,11 +3628,11 @@
   WContents *cts;
 
   g_return_if_fail (fexp);
-  g_return_if_fail (fexp->itunesdb);
+  g_return_if_fail (fexp->wcontents);
 
-  cts = fexp->itunesdb;
+  cts = fexp->wcontents;
 
-  put_string (cts, "mhip");
+  put_header (cts, "mhip");
   put32lint (cts, 76);                              /*  4 */
   put32lint (cts, -1);  /* fill in later */         /*  8 */
   put32lint (cts, childcount);                      /* 12 */
@@ -3052,9 +3655,9 @@
 
     g_return_val_if_fail (fexp, FALSE);
     g_return_val_if_fail (fexp->itdb, FALSE);
-    g_return_val_if_fail (fexp->itunesdb, FALSE);
+    g_return_val_if_fail (fexp->wcontents, FALSE);
 
-    cts = fexp->itunesdb;
+    cts = fexp->wcontents;
     
     mhsd_seek = cts->pos;      /* get position of mhsd header  */
     mk_mhsd (fexp, 1);         /* write header: type 1: tracks */
@@ -3198,10 +3801,10 @@
 
     g_return_val_if_fail (fexp, FALSE);
     g_return_val_if_fail (fexp->itdb, FALSE);
-    g_return_val_if_fail (fexp->itunesdb, FALSE);
+    g_return_val_if_fail (fexp->wcontents, FALSE);
     g_return_val_if_fail (pl, FALSE);
 
-    cts = fexp->itunesdb;
+    cts = fexp->wcontents;
 
     for (gl=pl->members; gl; gl=gl->next)
     {
@@ -3259,9 +3862,9 @@
     g_return_if_fail (memberlist);
     g_return_if_fail (fexp);
     g_return_if_fail (fexp->itdb);
-    g_return_if_fail (fexp->itunesdb);
+    g_return_if_fail (fexp->wcontents);
 
-    cts = fexp->itunesdb;
+    cts = fexp->wcontents;
     itdb = fexp->itdb;
     mhip_seek = cts->pos;
 
@@ -3308,10 +3911,10 @@
 
     g_return_val_if_fail (fexp, FALSE);
     g_return_val_if_fail (fexp->itdb, FALSE);
-    g_return_val_if_fail (fexp->itunesdb, FALSE);
+    g_return_val_if_fail (fexp->wcontents, FALSE);
     g_return_val_if_fail (pl, FALSE);
 
-    cts = fexp->itunesdb;
+    cts = fexp->wcontents;
 
     /* Create a list wit all available album names because we have to
        group the podcasts according to albums */
@@ -3321,14 +3924,21 @@
     for (gl=pl->members; gl; gl=gl->next)
     {
 	GList **memberlist;
+	gchar *album;
 	Itdb_Track *track = gl->data;
 	g_return_val_if_fail (track, FALSE);
 
-	memberlist = g_hash_table_lookup (album_hash, track->album);
+	if (track->album)
+	    album = track->album;
+	else
+	    album = "";
+
+	memberlist = g_hash_table_lookup (album_hash, album);
+
 	if (!memberlist)
 	{
 	    memberlist = g_new0 (GList *, 1);
-	    g_hash_table_insert (album_hash, track->album, memberlist);
+	    g_hash_table_insert (album_hash, album, memberlist);
 	}
 	*memberlist = g_list_append (*memberlist, track);
     }
@@ -3360,17 +3970,17 @@
 
     g_return_val_if_fail (fexp, FALSE);
     g_return_val_if_fail (fexp->itdb, FALSE);
-    g_return_val_if_fail (fexp->itunesdb, FALSE);
+    g_return_val_if_fail (fexp->wcontents, FALSE);
     g_return_val_if_fail (pl, FALSE);
 
-    cts = fexp->itunesdb;
+    cts = fexp->wcontents;
     mhyp_seek = cts->pos;
 
 #if ITUNESDB_DEBUG
   fprintf(stderr, "Playlist: %s (%d tracks)\n", pl->name, g_list_length (pl->members));
 #endif
 
-    put_string (cts, "mhyp");      /* header                    */
+    put_header (cts, "mhyp");      /* header                    */
     put32lint (cts, 108);          /* length		        */
     put32lint (cts, -1);           /* size -> later             */
     if (pl->is_spl)
@@ -3379,7 +3989,10 @@
 	put32lint (cts, 2);        /* nr of mhods               */
     /* number of tracks in plist */
     put32lint (cts, -1);           /* number of mhips -> later  */
-    put32lint (cts, pl->type);     /* 1 = main, 0 = visible     */
+    put8int (cts, pl->type);       /* 1 = main, 0 = visible     */
+    put8int (cts, pl->flag1);      /* unknown                   */
+    put8int (cts, pl->flag2);      /* unknown                   */
+    put8int (cts, pl->flag3);      /* unknown                   */
     put32lint (cts, pl->timestamp);/* some timestamp            */
     put64lint (cts, pl->id);       /* 64 bit ID                 */
     pl->mhodcount = 1;             /* we only write one mhod type < 50 */
@@ -3432,10 +4045,10 @@
 
     g_return_val_if_fail (fexp, FALSE);
     g_return_val_if_fail (fexp->itdb, FALSE);
-    g_return_val_if_fail (fexp->itunesdb, FALSE);
+    g_return_val_if_fail (fexp->wcontents, FALSE);
     g_return_val_if_fail ((mhsd_type == 2) || (mhsd_type == 3), FALSE);
 
-    cts = fexp->itunesdb;
+    cts = fexp->wcontents;
     mhsd_seek = cts->pos;      /* get position of mhsd header */
     mk_mhsd (fexp, mhsd_type); /* write header */
     /* write header with nr. of playlists */
@@ -3482,8 +4095,8 @@
     {
 	cts->error = g_error_new (G_FILE_ERROR,
 				  g_file_error_from_errno (errno),
-				  _("Opening of '%s' for writing failed."),
-				  cts->filename);
+				  _("Opening of '%s' for writing failed (%s)."),
+				  cts->filename, g_strerror (errno));
 	return FALSE;
     }
     if (cts->contents && cts->pos)
@@ -3493,8 +4106,8 @@
 	{
 	    cts->error = g_error_new (G_FILE_ERROR,
 				      g_file_error_from_errno (errno),
-				      _("Writing to '%s' failed."),
-				      cts->filename);
+				      _("Writing to '%s' failed (%s)."),
+				      cts->filename, g_strerror (errno));
 	    close (fd);
 	    return FALSE;
 	}
@@ -3569,9 +4182,17 @@
 }
 
 
-
-/* Do the actual writing to the iTunesDB */
-/* If @filename==NULL, itdb->filename is tried */
+/**
+ * itdb_write_file:
+ * @itdb: the #Itdb_iTunesDB to save
+ * @filename: filename to save @itdb to
+ * @error: return location for a #GError or NULL
+ *
+ * Write the content of @itdb to @filename. If @filename is NULL, it attempts
+ * to write to itdb-&gt;filename.
+ *
+ * Return value: TRUE if all went well, FALSE otherwise
+ **/
 gboolean itdb_write_file (Itdb_iTunesDB *itdb, const gchar *filename,
 			  GError **error)
 {
@@ -3581,24 +4202,31 @@
     gboolean result = TRUE;;
 
     g_return_val_if_fail (itdb, FALSE);
+    g_return_val_if_fail (itdb->device, FALSE);
     g_return_val_if_fail (filename || itdb->filename, FALSE);
 
     if (!filename) filename = itdb->filename;
 
+    /* set endianess flag */
+    if (!itdb->device->byte_order)
+	itdb_device_autodetect_endianess (itdb->device);
+
 #if HAVE_GDKPIXBUF
     /* only write ArtworkDB if we deal with an iPod
-       FIXME: figure out a way to store the artwork data when storint
+       FIXME: figure out a way to store the artwork data when storing
        to local directories. At the moment it's the application's task
        to handle this. */
-    if (itdb->device)
-	ipod_write_artwork_db (itdb);
+    if (itdb->device && itdb_device_get_artwork_formats(itdb->device))
+		ipod_write_artwork_db (itdb);
 #endif
 
     fexp = g_new0 (FExport, 1);
     fexp->itdb = itdb;
-    fexp->itunesdb = wcontents_new (filename);
-    cts = fexp->itunesdb;
+    fexp->wcontents = wcontents_new (filename);
+    cts = fexp->wcontents;
 
+    cts->reversed = (itdb->device->byte_order == G_BIG_ENDIAN);
+
     reassign_ids (fexp);
 
     mk_mhbd (fexp, 3);   /* three mhsds */
@@ -3631,6 +4259,7 @@
 	g_free (itdb->filename);
 	itdb->filename = fn;
     }
+
     /* make sure all buffers are flushed as some people tend to
        disconnect as soon as gtkpod returns */
     sync ();
@@ -3638,27 +4267,27 @@
     return result;
 }
 
-/* Write out an iTunesDB.
-
-   First reassigns unique IDs to all tracks.
-
-   An existing "Play Counts" file is renamed to "Play Counts.bak" if
-   the export was successful.
-
-   An existing "OTGPlaylistInfo" file is removed if the export was
-   successful.
-
-   Returns TRUE on success, FALSE on error, in which case @error is
-   set accordingly.
-*/
+/**
+ * itdb_write:
+ * @itdb: the #Itdb_iTunesDB to write to disk
+ * @error: return location for a #GError or NULL
+ *
+ * Write out an iTunesDB. It reassigns unique IDs to all tracks. 
+ * An existing "Play Counts" file is renamed to "Play Counts.bak" if
+ * the export was successful.
+ * An existing "OTGPlaylistInfo" file is removed if the export was
+ * successful.
+ *
+ * Return value: TRUE on success, FALSE on error, in which case @error is
+ * set accordingly.
+ **/
 gboolean itdb_write (Itdb_iTunesDB *itdb, GError **error)
 {
     gchar *itunes_filename, *itunes_path;
-    const gchar *db[] = {"iPod_Control","iTunes",NULL};
     gboolean result = FALSE;
 
     g_return_val_if_fail (itdb, FALSE);
-    g_return_val_if_fail (itdb->mountpoint, FALSE);
+    g_return_val_if_fail (itdb_get_mountpoint (itdb), FALSE);
 
     /* First, let's try to write the .ithmb files containing the artwork data
      * since this operation modifies the 'artwork_count' and 'artwork_size' 
@@ -3667,18 +4296,12 @@
      * they shouldn't corrupt the main database.
      */
 
-    itunes_path = itdb_resolve_path (itdb->mountpoint, db);
-    
+
+    itunes_path = itdb_get_itunes_dir (itdb_get_mountpoint (itdb));
+
     if(!itunes_path)
     {
-	gchar *str = g_build_filename (itdb->mountpoint, 
-				       db[0], db[1], db[2], NULL);
-	g_set_error (error,
-		     ITDB_FILE_ERROR,
-		     ITDB_FILE_ERROR_NOTFOUND,
-		     _("Path not found: '%s'."),
-		     str);
-	g_free (str);
+	error_no_itunes_dir (itdb_get_mountpoint (itdb), error);
 	return FALSE;
     }
 
@@ -3686,11 +4309,18 @@
 
     result = itdb_write_file (itdb, itunes_filename, error);
 
-    g_free(itunes_filename);
-    g_free(itunes_path);
+    g_free (itunes_filename);
+    g_free (itunes_path);
 
     if (result == TRUE)
-	result = itdb_rename_files (itdb->mountpoint, error);
+    {
+	/* Write SysInfo file if it has changed */
+	if (itdb->device->sysinfo_changed)
+	{
+	    itdb_device_write_sysinfo (itdb->device, error);
+	}
+	result = itdb_rename_files (itdb_get_mountpoint (itdb), error);
+    }
 
     /* make sure all buffers are flushed as some people tend to
        disconnect as soon as gtkpod returns */
@@ -3803,42 +4433,41 @@
 */
 
 
-/* Write out an iTunesSD for the Shuffle.
-
-   First reassigns unique IDs to all tracks.
-
-   An existing "Play Counts" file is renamed to "Play Counts.bak" if
-   the export was successful.
-
-   An existing "OTGPlaylistInfo" file is removed if the export was
-   successful.
-
-   Returns TRUE on success, FALSE on error, in which case @error is
-   set accordingly.
-
-   itdb->mountpoint must point to the mount point of the iPod,
-   e.g. "/mnt/ipod" and be in local encoding. */
-
-
+/**
+ * itdb_shuffle_write:
+ * @itdb: the #Itdb_iTunesDB to write to disk
+ * @error: return location for a #GError or NULL
+ *
+ * Write out an iTunesSD for the Shuffle.
+ * First reassigns unique IDs to all tracks.
+ * An existing "Play Counts" file is renamed to "Play Counts.bak" if
+ * the export was successful.
+ * An existing "OTGPlaylistInfo" file is removed if the export was
+ * successful.
+ * @itdb->mountpoint must point to the mount point of the iPod,
+ * e.g. "/mnt/ipod" and be in local encoding.
+ *
+ * Return value: TRUE on success, FALSE on error, in which case @error is
+ * set accordingly.
+ **/
 gboolean itdb_shuffle_write (Itdb_iTunesDB *itdb, GError **error)
 {
     gchar *itunes_filename, *itunes_path;
-    const gchar *db[] = {"iPod_Control","iTunes",NULL};
     gboolean result = FALSE;
 
     g_return_val_if_fail (itdb, FALSE);
-    g_return_val_if_fail (itdb->mountpoint, FALSE);
+    g_return_val_if_fail (itdb_get_mountpoint (itdb), FALSE);
 
-    itunes_path = itdb_resolve_path (itdb->mountpoint, db);
+    itunes_path = itdb_get_itunes_dir (itdb_get_mountpoint (itdb));
     
     if(!itunes_path)
     {
-	gchar *str = g_build_filename (itdb->mountpoint,
-				       db[0], db[1], db[2], NULL);
+	gchar *str = g_build_filename (itdb_get_mountpoint (itdb),
+				       "iPod_Control", "iTunes", NULL);
 	g_set_error (error,
 		     ITDB_FILE_ERROR,
 		     ITDB_FILE_ERROR_NOTFOUND,
-		     _("Path not found: '%s'."),
+		     _("Path not found: '%s' (or similar)."),
 		     str);
 	g_free (str);
 	return FALSE;
@@ -3852,7 +4481,7 @@
     g_free(itunes_path);
 
     if (result == TRUE)
-	result = itdb_rename_files (itdb->mountpoint, error);
+	result = itdb_rename_files (itdb_get_mountpoint (itdb), error);
 
     /* make sure all buffers are flushed as some people tend to
        disconnect as soon as gtkpod returns */
@@ -3862,8 +4491,17 @@
 }
 
 
-/* Do the actual writing to the iTunesSD */
-/* If @filename cannot be NULL */
+/**
+ * itdb_shuffle_write_file:
+ * @itdb: the #Itdb_iTunesDB to write to disk
+ * @filename: file to write to, cannot be NULL
+ * @error: return location for a #GError or NULL
+ *
+ * Do the actual writing to the iTunesSD 
+ *
+ * Return value: TRUE on success, FALSE on error, in which case @error is
+ * set accordingly.
+ **/
 gboolean itdb_shuffle_write_file (Itdb_iTunesDB *itdb,
 				  const gchar *filename, GError **error)
 {
@@ -3889,8 +4527,8 @@
 
     fexp = g_new0 (FExport, 1);
     fexp->itdb = itdb;
-    fexp->itunesdb = wcontents_new (filename);
-    cts = fexp->itunesdb;
+    fexp->wcontents = wcontents_new (filename);
+    cts = fexp->wcontents;
 
     reassign_ids (fexp);
 
@@ -4000,14 +4638,20 @@
 \*------------------------------------------------------------------*/
 
 
-/* (Renames/removes some files on the iPod (Playcounts, OTG
-   semaphore). May have to be called if you write the iTunesDB not
-   directly to the iPod but to some other location and then manually
-   copy the file from there to the iPod. */
-/* Returns FALSE on error and sets @error accordingly */
+/**
+ * itdb_rename_files:
+ * @mp: mount point of the iPod
+ * @error: return location for a #GError or NULL
+ *
+ * Renames/removes some files on the iPod (Playcounts, OTG
+ * semaphore). May have to be called if you write the iTunesDB not
+ * directly to the iPod but to some other location and then manually
+ * copy the file from there to the iPod. 
+ *
+ * Return value: FALSE on error and sets @error accordingly
+ **/
 gboolean itdb_rename_files (const gchar *mp, GError **error)
 {
-    const gchar *db_itd[] =  {"iPod_Control", "iTunes", NULL};
     const gchar *db_plc_o[] = {"Play Counts", NULL};
     const gchar *db_otg[] = {"OTGPlaylistInfo", NULL};
     const gchar *db_shu[] = {"iTunesShuffle", NULL};
@@ -4018,21 +4662,16 @@
     gchar *shuname;
     gboolean result = TRUE;
 
-    itunesdir = itdb_resolve_path (mp, db_itd);
+    g_return_val_if_fail (mp, FALSE);
+
+    itunesdir = itdb_get_itunes_dir (mp);
+
     if(!itunesdir)
     {
-	gchar *str = g_build_filename (mp, db_itd[0],
-				       db_itd[1], db_itd[2], NULL);
-	g_set_error (error,
-		     ITDB_FILE_ERROR,
-		     ITDB_FILE_ERROR_NOTFOUND,
-		     _("Path not found: '%s'."),
-		     str);
-	g_free (str);
+	error_no_itunes_dir (mp, error);
 	return FALSE;
     }
 
-
     plcname_o = itdb_resolve_path (itunesdir, db_plc_o);
     plcname_n = g_build_filename (itunesdir, 
 					 "Play Counts.bak", NULL);
@@ -4098,17 +4737,27 @@
 }
 
 
-/* Convert string from casual PC file name to iPod iTunesDB format
- * using ':' instead of slashes
- */
+/**
+ * itdb_filename_fs2ipod:
+ * @filename: a filename 'PC-style' (eg /iPod_Control/Music/f00/test.mp3)
+ *
+ * Convert string from casual PC file name to iPod iTunesDB format using ':' 
+ * instead of G_DIR_SEPARATOR_S (ie slashes on Unix-like systems). @ipod_file
+ * is modified in place.
+ **/
 void itdb_filename_fs2ipod (gchar *ipod_file)
 {
     g_strdelimit (ipod_file, G_DIR_SEPARATOR_S, ':');
 }
 
-/* Convert string from iPod iTunesDB format to casual PC file name
- * using slashes instead of ':'
- */
+/**
+ * itdb_filename_ipod2fs:
+ * @ipod_file: a filename 'PC-style' (eg /iPod_Control/Music/f00/test.mp3)
+ *
+ * Convert string from from iPod iTunesDB format to casual PC file name
+ * using G_DIR_SEPARATOR (ie slashes on Unix-like systems) instead of ':'.
+ * @ipod_file is modified in place.
+ **/
 void itdb_filename_ipod2fs (gchar *ipod_file)
 {
     g_strdelimit (ipod_file, ":", G_DIR_SEPARATOR);
@@ -4116,86 +4765,102 @@
 
 
 
-/* Set the mountpoint.
+/**
+ * itdb_set_mountpoint:
+ * @itdb: an #Itdb_iTunesDB
+ * @mp: new mount point
  *
- * Always use this function to set the mountpoint as it will reset the
- * number of available /iPod_Control/Music/F.. dirs
-*/
+ * Sets the mountpoint of @db. Always use this function to set the mountpoint
+ * of an #Itdb_iTunesDB as it will reset the number of available 
+ * /iPod_Control/Music/F.. dirs. It doesn't attempt to parse an iPod database
+ * that may be present on the iPod at @mp
+ **/
 void itdb_set_mountpoint (Itdb_iTunesDB *itdb, const gchar *mp)
 {
     g_return_if_fail (itdb);
+    g_return_if_fail (itdb->device);
 
-    g_free (itdb->mountpoint);
-    itdb->mountpoint = g_strdup (mp);
-    if (itdb->device)
-    {
-	g_object_unref (G_OBJECT (itdb->device));
-	itdb->device = NULL;
-    }
-    if (mp)
-	itdb->device = itdb_device_new (mp);
-    itdb->musicdirs = 0;
+    itdb_device_set_mountpoint (itdb->device, mp);
+    itdb->device->musicdirs = 0;
 }
 
+/**
+ * itdb_get_mountpoint:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Retrieve a reference to the mountpoint of @itdb
+ *
+ * Return value: the @itdb mountpoint, this string shouldn't be freed nor 
+ * modified
+ **/
+const gchar *itdb_get_mountpoint (Itdb_iTunesDB *itdb)
+{
+    g_return_val_if_fail (itdb, NULL);
+    g_return_val_if_fail (itdb->device, NULL);
+    return itdb->device->mountpoint;
+}
 
-/* Determine the number of F.. directories in iPod_Control/Music.
+/* Retrieve a reference to the mountpoint */
+const gchar *itdb_photodb_get_mountpoint (Itdb_PhotoDB *photodb)
+{
+    g_return_val_if_fail (photodb, NULL);
+    g_return_val_if_fail (photodb->device, NULL);
+    return photodb->device->mountpoint;
+}
 
-   If itdb->musicdirs is already set, simply return the previously
-   determined number. Otherwise count the directories first and set
-   itdb->musicdirs. */
+/**
+ * itdb_musicdirs_number:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Determine the number of F.. directories in iPod_Control/Music.
+ *
+ * If itdb->musicdirs is already set, simply return the previously
+ * determined number. Otherwise count the directories first and set
+ * itdb->musicdirs. 
+ *
+ * Return value: max number of directories in iPod_Control/Music
+ **/
 gint itdb_musicdirs_number (Itdb_iTunesDB *itdb)
 {
-    gchar *dest_components[] = {"iPod_Control", "Music",
-				NULL, NULL, NULL};
-    gchar *dir_filename = NULL;
-    gint dir_num;
-
     g_return_val_if_fail (itdb, 0);
-    g_return_val_if_fail (itdb->mountpoint, 0);
+    g_return_val_if_fail (itdb->device, 0);
 
-    if (itdb->musicdirs <= 0)
-    {   /* count number of dirs */
-	for (dir_num=0; ;++dir_num)
-	{
-	    gchar dir_num_str[5];
-
-	    g_snprintf (dir_num_str, 5, "F%02d", dir_num);
-	    dest_components[2] = dir_num_str;
-  
-	    dir_filename =
-		itdb_resolve_path (itdb->mountpoint,
-				   (const gchar **)dest_components);
-
-	    if (!dir_filename)  break;
-	    g_free (dir_filename);
-	}
-	itdb->musicdirs = dir_num;
-    }
-    return itdb->musicdirs;
+    return itdb_device_musicdirs_number (itdb->device);
 }
 
 
 
-
-/* Copy one track to the iPod. The PC filename is @filename
-   and is taken literally.
-
-   The mountpoint of the iPod (in local encoding) is expected in
-   track->itdb->mountpoint.
-
-   If @track->transferred is set to TRUE, nothing is done. Upon
-   successful transfer @track->transferred is set to TRUE.
-
-   For storage, the directories "f00 ... f19" will be
-   cycled through.
-
-   The filename is constructed as "gtkpod"<random number> and copied
-   to @track->ipod_path. If this file already exists, <random number>
-   is adjusted until an unused filename is found.
-
-   If @track->ipod_path is already set, this one will be used
-   instead. If a file with this name already exists, it will be
-   overwritten. */
+/**
+ * itdb_cp_track_to_ipod:
+ * @track: the #Itdb_Track to copy (containing @filename metadata)
+ * @filename: the source file
+ * @error: return location for a #GError or NULL
+ * 
+ * Copy one track to the iPod. The PC filename is @filename
+ * and is taken literally.
+ *
+ * The mountpoint of the iPod (in local encoding) is expected in
+ * track-&gt;itdb-&gt;mountpoint.
+ *
+ * If @track-&gt;transferred is set to TRUE, nothing is done. Upon
+ * successful transfer @track-&gt;transferred is set to TRUE.
+ *
+ * For storage, the directories "f00 ... fnn" will be
+ * cycled through.
+ *
+ * The filename is constructed as "gtkpod"&lt;random number&gt; and copied
+ * to @track-&gt;ipod_path. If this file already exists, &lt;random number&gt;
+ * is adjusted until an unused filename is found.
+ *
+ * If @track-&gt;ipod_path is already set, this one will be used
+ * instead. If a file with this name already exists, it will be
+ * overwritten.
+ *
+ * @track-&gt;filetype_marker is set according to the filename extension
+ *
+ * Return value: TRUE on success, FALSE on error, in which case @error is
+ * set accordingly.
+ **/
 gboolean itdb_cp_track_to_ipod (Itdb_Track *track,
 				gchar *filename, GError **error)
 {
@@ -4203,17 +4868,18 @@
   gchar *track_db_path, *ipod_fullfile;
   gboolean success;
   gint mplen = 0;
-  const gchar *mp;
+  gint i;
+  const gchar *mountpoint;
   Itdb_iTunesDB *itdb;
 
   g_return_val_if_fail (track, FALSE);
   g_return_val_if_fail (track->itdb, FALSE);
-  g_return_val_if_fail (track->itdb->mountpoint, FALSE);
+  g_return_val_if_fail (itdb_get_mountpoint (track->itdb), FALSE);
   g_return_val_if_fail (filename, FALSE);
 
   if(track->transferred)  return TRUE; /* nothing to do */ 
 
-  mp = track->itdb->mountpoint;
+  mountpoint = itdb_get_mountpoint (track->itdb);
   itdb = track->itdb;
 
   /* If track->ipod_path exists, we use that one instead. */
@@ -4221,50 +4887,57 @@
 
   if (!ipod_fullfile)
   {
-      gchar *dest_components[] = {"iPod_Control", "Music",
-				  NULL, NULL, NULL};
-      gchar *parent_dir_filename;
+      gchar *dest_components[] = {NULL, NULL, NULL};
+      gchar *parent_dir_filename, *music_dir;
       gchar *original_suffix;
       gchar dir_num_str[5];
       gint32 oops = 0;
       gint32 rand = g_random_int_range (0, 899999); /* 0 to 900000 */
 
+      music_dir = itdb_get_music_dir (mountpoint);
+      if (!music_dir)
+      {
+	  error_no_music_dir (mountpoint, error);
+	  return FALSE;
+      }
+
       if (itdb_musicdirs_number (itdb) <= 0)
       {
-	  gchar *str = g_build_filename (mp, dest_components[0],
-					 dest_components[1], NULL);
-
 	  g_set_error (error,
 		       ITDB_FILE_ERROR,
 		       ITDB_FILE_ERROR_NOTFOUND,
 		       _("No 'F..' directories found in '%s'."),
-		       str);
-	  g_free (str);
+		       music_dir);
+	  g_free (music_dir);
 	  return FALSE;
       }
-		       
-      if (dir_num == -1) dir_num = g_random_int_range (0, itdb->musicdirs);
-      else dir_num = (dir_num + 1) % itdb_musicdirs_number (itdb);
 
+      if (dir_num == -1)
+      {
+	  dir_num = g_random_int_range (0, itdb_musicdirs_number (itdb));
+      }
+      else
+      {
+	  dir_num = (dir_num + 1) % itdb_musicdirs_number (itdb);
+      }
+
       g_snprintf (dir_num_str, 5, "F%02d", dir_num);
-      dest_components[2] = dir_num_str;
+      dest_components[0] = dir_num_str;
   
       parent_dir_filename =
-	  itdb_resolve_path (mp, (const gchar **)dest_components);
-
+	  itdb_resolve_path (music_dir, (const gchar **)dest_components);
       if(parent_dir_filename == NULL)
       {
 	  /* Can't find the F%02d directory */
-	  gchar *str = g_build_filename (mp, dest_components[0],
-					 dest_components[1],
-					 dest_components[2],
-					 dest_components[3], NULL);
+	  gchar *str = g_build_filename (music_dir,
+					 dest_components[0], NULL);
 	  g_set_error (error,
 		       ITDB_FILE_ERROR,
 		       ITDB_FILE_ERROR_NOTFOUND,
 		       _("Path not found: '%s'."),
 		       str);
 	  g_free (str);
+	  g_free (music_dir);
 	  return FALSE;
       }
 
@@ -4275,14 +4948,24 @@
 	 string. Note: the iPod will most certainly ignore this file... */
       if (!original_suffix) original_suffix = "";
 
+      /* set filetype from the suffix, e.g. '.mp3' -> 'MP3 ' */
+      track->filetype_marker = 0;
+      for (i=1; i<=4; ++i)   /* start with i=1 to skip the '.' */
+      {
+	  track->filetype_marker = track->filetype_marker << 8;
+	  if (strlen (original_suffix) > i)
+	      track->filetype_marker |= g_ascii_toupper (original_suffix[i]);
+	  else
+	      track->filetype_marker |= g_ascii_toupper (' ');
+      }
       do
       {   /* we need to loop until we find an unused filename */
-	  dest_components[3] = 
+	  dest_components[1] = 
 	      g_strdup_printf("gtkpod%06d%s",
 			      rand + oops, original_suffix);
 	  ipod_fullfile = itdb_resolve_path (
 	      parent_dir_filename,
-	      (const gchar **)&dest_components[3]);
+	      (const gchar **)&dest_components[1]);
 	  if(ipod_fullfile)
 	  {   /* already exists -- try next */
               g_free(ipod_fullfile);
@@ -4291,16 +4974,17 @@
 	  else
 	  {   /* found unused file -- build filename */
 	      ipod_fullfile = g_build_filename (parent_dir_filename,
-					        dest_components[3], NULL);
+					        dest_components[1], NULL);
 	  }
-	  g_free (dest_components[3]);
+	  g_free (dest_components[1]);
 	  ++oops;
       } while (!ipod_fullfile);
       g_free(parent_dir_filename);
+      g_free (music_dir);
   }
   /* now extract filepath for track->ipod_path from ipod_fullfile */
   /* ipod_path must begin with a '/' */
-  mplen = strlen (mp); /* length of mountpoint in bytes */
+  mplen = strlen (mountpoint); /* length of mountpoint in bytes */
   if (ipod_fullfile[mplen] == G_DIR_SEPARATOR)
   {
       track_db_path = g_strdup (&ipod_fullfile[mplen]);
@@ -4329,22 +5013,22 @@
 }
 
 
-/* Return the full iPod filename as stored in @track. Return value
-   must be g_free()d after use.
-
-   mount point of the iPod file system (in local encoding) is expected
-   in track->itdb->mountpoint
-
-   @track: track
-   Return value: full filename to @track on the iPod or NULL if no
-   filename is set in @track.
-
-   NOTE: NULL is returned when the file does not exist.
-
-   NOTE: this code works around a problem on some systems (see
-   itdb_resolve_path() ) and might return a filename with different
-   case than the original filename. Don't copy it back to @track
-   unless you must */
+/**
+ * itdb_filename_on_ipod:
+ * @track: an #Itdb_Track
+ *
+ * Return the full iPod filename as stored in @track.
+ *
+ * NOTE: NULL is returned when the file does not exist.
+ *
+ * NOTE: this code works around a problem on some systems (see
+ * itdb_resolve_path() ) and might return a filename with different
+ * case than the original filename. Don't copy it back to @track
+ * unless you must 
+ *
+ * Return value: full filename to @track on the iPod or NULL if no
+ * filename is set in @track. Must be freed with g_free() after use.
+ **/
 gchar *itdb_filename_on_ipod (Itdb_Track *track)
 {
     gchar *result = NULL;
@@ -4353,9 +5037,9 @@
     g_return_val_if_fail (track, NULL);
     g_return_val_if_fail (track->itdb, NULL);
 
-    if (!track->itdb->mountpoint) return NULL;
+    if (!itdb_get_mountpoint (track->itdb)) return NULL;
 
-    mp = track->itdb->mountpoint;
+    mp = itdb_get_mountpoint (track->itdb);
 
     if(track->ipod_path && *track->ipod_path)
     {
@@ -4375,8 +5059,17 @@
 }
 
 
-/* Copy file "from_file" to "to_file".
-   Returns TRUE on success, FALSE otherwise */
+/**
+ * itdb_cp:
+ * @from_file: source file
+ * @to_file: destination file
+ * @error: return location for a #GError or NULL
+ *
+ * Copy file "from_file" to "to_file".
+ *
+ * Return value: TRUE on success, FALSE on error, in which case @error is
+ * set accordingly.
+ **/
 gboolean itdb_cp (const gchar *from_file, const gchar *to_file,
 		  GError **error)
 {
@@ -4485,14 +5178,248 @@
 
 
 
+/**
+ * itdb_get_control_dir:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Get the i*_Control directory. Observed values are 'iPod_Control'
+ * for standard iPods and 'iTunes/iTunes_Control' for mobile
+ * applications.
+ *
+ * Return value: path to the control dir or NULL of non-existent. Must
+ * g_free() after use.
+ **/
+gchar *itdb_get_control_dir (const gchar *mountpoint)
+{
+    gchar *p_ipod[] = {"iPod_Control", NULL};
+    gchar *p_mobile[] = {"iTunes", "iTunes_Control", NULL};
+    /* Use an array with all possibilities, so further extension will
+       be easy */
+    gchar **paths[] = {p_ipod, p_mobile, NULL};
+    gchar ***ptr;
+    gchar *result = NULL;
 
+    g_return_val_if_fail (mountpoint, NULL);
 
+    for (ptr=paths; *ptr && !result; ++ptr)
+    {
+	result = itdb_resolve_path (mountpoint, (const gchar **)*ptr);
+    }
+    return result;
+}
+
+/**
+ * itdb_get_dir:
+ * @mountpoint: the iPod mountpoint
+ * @dir: a directory
+ *
+ * Retrieve the directory @dir by first calling itdb_get_control_dir()
+ * and then adding @dir
+ *
+ * Return value: path to @dir or NULL if non-existent. Must g_free()
+ * after use.
+ **/
+static gchar *itdb_get_dir (const gchar *mountpoint, const gchar *dir)
+{
+    gchar *control_dir;
+    gchar *result = NULL;
+
+    g_return_val_if_fail (mountpoint, NULL);
+    g_return_val_if_fail (dir, NULL);
+
+    control_dir = itdb_get_control_dir (mountpoint);
+    if (control_dir)
+    {
+	const gchar *p_dir[] = {NULL, NULL};
+	p_dir[0] = dir;
+	result = itdb_resolve_path (control_dir, p_dir);
+	g_free (control_dir);
+    }
+    return result;
+}
+
+/**
+ * itdb_get_path:
+ * @dir: a directory
+ * @file: a file
+ *
+ * Retrieve a path to the @file in @dir
+ *
+ * Return value: path to the @file or NULL if non-existent. Must be g_free()'d 
+ * after use.
+ **/
+gchar *itdb_get_path (const gchar *dir, const gchar *file)
+{
+    const gchar *p_file[] = {NULL, NULL};
+
+    g_return_val_if_fail (dir, NULL);
+
+    p_file[0] = file;
+
+    return itdb_resolve_path (dir, p_file);
+}
+
+/**
+ * itdb_get_itunes_dir:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve the iTunes directory (containing the iTunesDB) by first
+ * calling itdb_get_control_dir() and then adding 'iTunes'
+ *
+ * Return value: path to the iTunes directory or NULL of non-existent.
+ * Must g_free() after use.
+ **/
+gchar *itdb_get_itunes_dir (const gchar *mountpoint)
+{
+    g_return_val_if_fail (mountpoint, NULL);
+
+    return itdb_get_dir (mountpoint, "iTunes");
+}
+
+/**
+ * itdb_get_music_dir:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve the Music directory (containing the Fnn dirs) by first
+ * calling itdb_get_control_dir() and then adding 'Music'
+ *
+ * Return value: path to the Music directory or NULL of
+ * non-existent. Must g_free() after use.
+ **/
+gchar *itdb_get_music_dir (const gchar *mountpoint)
+{
+    g_return_val_if_fail (mountpoint, NULL);
+
+    return itdb_get_dir (mountpoint, "Music");
+}
+
+/**
+ * itdb_get_device_dir:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve the Device directory (containing the SysInfo file) by
+ * first calling itdb_get_control_dir() and then adding 'Device'
+ *
+ * Return value: path to the Device directory or NULL of
+ * non-existent. Must g_free() after use.
+ **/
+gchar *itdb_get_device_dir (const gchar *mountpoint)
+{
+    g_return_val_if_fail (mountpoint, NULL);
+
+    return itdb_get_dir (mountpoint, "Device");
+}
+
+/**
+ * itdb_get_artwork_dir:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve the Artwork directory (containing the ArtworDB) by
+ * first calling itdb_get_control_dir() and then adding 'Artwork'
+ *
+ * Return value: path to the Artwork directory or NULL of
+ * non-existent. Must g_free() after use.
+ **/
+gchar *itdb_get_artwork_dir (const gchar *mountpoint)
+{
+    g_return_val_if_fail (mountpoint, NULL);
+
+    return itdb_get_dir (mountpoint, "Artwork");
+}
+
+/**
+ * itdb_get_itunesdb_path:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve a path to the iTunesDB
+ *
+ * Return value: path to the iTunesDB or NULL if non-existent. Must g_free()
+ * after use.
+ **/
+gchar *itdb_get_itunesdb_path (const gchar *mountpoint)
+{
+    gchar *itunes_dir, *path=NULL;
+
+    g_return_val_if_fail (mountpoint, NULL);
+
+    itunes_dir = itdb_get_itunes_dir (mountpoint);
+
+    if (itunes_dir)
+    {
+	path = itdb_get_path (itunes_dir, "iTunesDB");
+	g_free (itunes_dir);
+    }
+
+    return path;
+}
+
+/**
+ * itdb_get_itunessd_path:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve a path to the iTunesSD
+ *
+ * Return value: path to the iTunesSD or NULL if non-existent. Must g_free()
+ * after use.
+ **/
+gchar *itdb_get_itunessd_path (const gchar *mountpoint)
+{
+    gchar *itunes_dir, *path=NULL;
+
+    g_return_val_if_fail (mountpoint, NULL);
+
+    itunes_dir = itdb_get_itunes_dir (mountpoint);
+
+    if (itunes_dir)
+    {
+	path = itdb_get_path (itunes_dir, "iTunesSD");
+	g_free (itunes_dir);
+    }
+
+    return path;
+}
+
+/**
+ * itdb_get_artworkdb_path:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve a path to the ArtworkDB
+ *
+ * Return value: path to the ArtworkDB or NULL if non-existent. Must g_free() 
+ * after use.
+ **/
+gchar *itdb_get_artworkdb_path (const gchar *mountpoint)
+{
+    gchar *itunes_dir, *path=NULL;
+
+    g_return_val_if_fail (mountpoint, NULL);
+
+    itunes_dir = itdb_get_artwork_dir (mountpoint);
+
+    if (itunes_dir)
+    {
+	path = itdb_get_path (itunes_dir, "ArtworkDB");
+	g_free (itunes_dir);
+    }
+
+    return path;
+}
+
+
 /*------------------------------------------------------------------*\
  *                                                                  *
  *                       Timestamp stuff                            *
  *                                                                  *
 \*------------------------------------------------------------------*/
 
+/**
+ * itdb_time_get_mac_time:
+ *
+ * Gets the current time expressed in 'Mac' unit (ie in number of seconds since
+ * 1/1/1904).
+ * 
+ * Return value: current time in 'Mac' unit.
+ **/
 guint64 itdb_time_get_mac_time (void)
 {
     GTimeVal time;
@@ -4502,10 +5429,17 @@
 }
 
 
-/* convert Macintosh timestamp to host system time stamp -- modify
+/**
+ * itdb_time_mac_to_host:
+ * @mactime: time expressed in 'Mac' unit
+ *
+ * Convert a Mac timestamp to host system time stamp -- modify
  * this function if necessary to port to host systems with different
- * start of Epoch */
-/* A "0" time will not be converted */
+ * start of Epoch.
+ * A "0" time will not be converted.
+ *
+ * Return value: timestamp for the host system
+ **/
 time_t itdb_time_mac_to_host (guint64 mactime)
 {
     if (mactime != 0)  return (time_t)(mactime - 2082844800);
@@ -4513,10 +5447,483 @@
 }
 
 
-/* convert host system timestamp to Macintosh time stamp -- modify
+/**
+ * itdb_time_host_to_mac:
+ * @time: time expressed in host unit
+ *
+ * Convert host system timestamp to Mac time stamp -- modify
  * this function if necessary to port to host systems with different
- * start of Epoch */
+ * start of Epoch 
+ *
+ * Return value: a Mac timestamp
+ **/
 guint64 itdb_time_host_to_mac (time_t time)
 {
     return (guint64)(((gint64)time) + 2082844800);
 }
+
+
+/**
+ * itdb_init_ipod:
+ * @mountpoint:   the iPod mountpoint
+ * @model_number: the iPod model number
+ * @model_type:   the type of iPod, eg. regular, shuffle
+ * @ipod_name:    the name to give to the iPod. Will be displayed in
+ *                gtkpod or itunes
+ *
+ * Initialise an iPod device from scratch. The function attempts to
+ * create a blank database, complete with master playlist and device
+ * information as well as the directory structure required for the
+ * type of iPod.
+ * 
+ * Return value: TRUE when successful, FALSE if a failure has occurred.
+ * 
+ **/
+gboolean itdb_init_ipod (const gchar *mountpoint,
+			 const gchar *model_number,
+			 const gchar *ipod_name,
+			 GError **error)
+{
+	gboolean writeok;
+	Itdb_iTunesDB *itdb = NULL;
+	Itdb_Playlist *mpl = NULL;
+	Itdb_IpodInfo const *info = NULL;
+	gchar *path;
+	
+	g_return_val_if_fail (mountpoint, FALSE);
+						
+	/* Create new blank itdb database for writing to iPod */
+	itdb = itdb_new();
+					
+	/* Assign iPod device reference to new database */
+	itdb_set_mountpoint(itdb, mountpoint);
+	
+	/* Insert model_number into sysinfo file if present
+	 * The model number can be extracted in a couple of ways:
+	 *		- use the read_sysinfo_file function
+	 * 		- use libipoddevice and hal to get the model
+	 *                (as far as I know, libipoddevice will also
+         *                read the sysinfo file, complemented by some
+	 *	          guessing).
+	 */
+	if (model_number)
+	{
+	    itdb_device_set_sysinfo (itdb->device,
+				     "ModelNumStr", model_number);
+	}
+	
+	/* Create the remaining directories resident on blank ipod */
+	writeok = itdb_create_directories(itdb->device, error);
+	if(! writeok)
+	{
+		return FALSE;
+	}
+
+	/* Create a new playlist with the desired name of the ipod
+	 * and set it as the mpl */
+	if (ipod_name == NULL)
+	{
+	    mpl = itdb_playlist_new(_("iPod"), FALSE);
+	}
+	else
+	{
+	    mpl = itdb_playlist_new(ipod_name, FALSE);
+	}
+	itdb_playlist_set_mpl(mpl);
+	itdb_playlist_add(itdb, mpl, -1);
+	
+	/* Write both the iTunesDB and iTunesSD files to the new ipod,
+	 * unless they already exist */
+	path = itdb_get_itunesdb_path (mountpoint);
+	if (!path)
+	{
+	    writeok = itdb_write(itdb, error);
+	    if(! writeok)
+	    {
+	        itdb_free (itdb);
+		return FALSE;
+	    }
+	}
+	g_free (path);
+
+	/* Retrieve the model from the device information */
+	info = itdb_device_get_ipod_info(itdb->device);
+    
+	/* If model is a shuffle or the model is undetermined,
+	 * ie. @model_number is NULL, then create the itunesSD database
+	 */
+	if(!model_number || info->ipod_model == ITDB_IPOD_MODEL_SHUFFLE)
+	{
+	    path = itdb_get_itunessd_path (mountpoint);
+	    if (!path)
+	    {
+	    	writeok = itdb_shuffle_write(itdb, error);
+	    	if(! writeok)
+	    	{
+	    	    itdb_free (itdb);
+		    return FALSE;
+	    	}
+	    }
+	    g_free (path);
+	}
+	itdb_free (itdb);
+	return TRUE;
+}
+
+
+
+/*------------------------------------------------------------------*\
+ *                                                                  *
+ *             Some functions to access Itdb_DB safely              *
+ *                                                                  *
+\*------------------------------------------------------------------*/
+G_GNUC_INTERNAL
+Itdb_iTunesDB *db_get_itunesdb (Itdb_DB *db)
+{
+    g_return_val_if_fail (db, NULL);
+    g_return_val_if_fail (db->db_type == DB_TYPE_ITUNES, NULL);
+
+    return db->db.itdb;
+}
+
+G_GNUC_INTERNAL
+Itdb_PhotoDB *db_get_photodb (Itdb_DB *db)
+{
+    g_return_val_if_fail (db, NULL);
+    g_return_val_if_fail (db->db_type == DB_TYPE_PHOTO, NULL);
+
+    return db->db.photodb;
+}
+
+G_GNUC_INTERNAL
+Itdb_Device *db_get_device(Itdb_DB *db)
+{
+    g_return_val_if_fail (db, NULL);
+
+    switch (db->db_type) {
+    case DB_TYPE_ITUNES:
+	g_return_val_if_fail (db_get_itunesdb(db), NULL);
+	return db_get_itunesdb(db)->device;
+    case DB_TYPE_PHOTO:
+	g_return_val_if_fail (db_get_photodb(db), NULL);
+	return db_get_photodb(db)->device;
+    }
+    g_return_val_if_reached (NULL);
+}
+
+G_GNUC_INTERNAL
+gchar *db_get_mountpoint(Itdb_DB *db)
+{
+    Itdb_Device *device;
+    g_return_val_if_fail (db, NULL);
+
+    device = db_get_device (db);
+    g_return_val_if_fail (device, NULL);
+
+    return device->mountpoint;
+}
+
+
+
+/*------------------------------------------------------------------*\
+ *                                                                  *
+ *             Create iPod directory hierarchy                      *
+ *                                                                  *
+\*------------------------------------------------------------------*/
+
+/* mkdir_with_parents is copied from GLIB2.8 (gfileutils.c, V1.78), as
+ * it is new to V2.8. May be replaced with g_mkdir_with_parents() in a
+ * couple of years. */
+
+/**
+ * mkdir_with_parents:
+ * @pathname: a pathname in the GLib file name encoding
+ * @mode: permissions to use for newly created directories
+ *
+ * Create a directory if it doesn't already exist. Create intermediate
+ * parent directories as needed, too.
+ *
+ * Returns: 0 if the directory already exists, or was successfully
+ * created. Returns -1 if an error occurred, with errno set.
+ *
+ */
+static int
+mkdir_with_parents (const gchar *pathname,
+		      int          mode)
+{
+  gchar *fn, *p;
+
+  if (pathname == NULL || *pathname == '\0')
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  fn = g_strdup (pathname);
+
+  if (g_path_is_absolute (fn))
+    p = (gchar *) g_path_skip_root (fn);
+  else
+    p = fn;
+
+  do
+    {
+      while (*p && !G_IS_DIR_SEPARATOR (*p))
+	p++;
+      
+      if (!*p)
+	p = NULL;
+      else
+	*p = '\0';
+      
+      if (!g_file_test (fn, G_FILE_TEST_EXISTS))
+	{
+	  if (g_mkdir (fn, mode) == -1)
+	    {
+	      int errno_save = errno;
+	      g_free (fn);
+	      errno = errno_save;
+	      return -1;
+	    }
+	}
+      else if (!g_file_test (fn, G_FILE_TEST_IS_DIR))
+	{
+	  g_free (fn);
+	  errno = ENOTDIR;
+	  return -1;
+	}
+      if (p)
+	{
+	  *p++ = G_DIR_SEPARATOR;
+	  while (*p && G_IS_DIR_SEPARATOR (*p))
+	    p++;
+	}
+    }
+  while (p);
+
+  g_free (fn);
+
+  return 0;
+}
+
+	
+static gboolean itdb_create_directories (Itdb_Device *device, GError **error)
+{
+    const gchar *mp;
+    gboolean result;
+    gchar *pbuf;
+    gint i, dirnum;
+    Itdb_IpodInfo const *info = NULL;
+    gboolean calconnotes, devicefile;
+    gchar *podpath;
+
+    g_return_val_if_fail (device, FALSE);
+
+    mp = device->mountpoint;
+    g_return_val_if_fail (mp, FALSE);
+
+    /* Retrieve the model from the device information */
+    info = itdb_device_get_ipod_info(device);
+
+    /* Set up special treatment for shuffle and mobile */
+    switch(info->ipod_model)
+    {
+    case ITDB_IPOD_MODEL_SHUFFLE:
+	podpath = g_strdup ("iPod_Control");
+	calconnotes = FALSE;
+	devicefile = TRUE;
+	break;
+    case ITDB_IPOD_MODEL_MOBILE_1:
+	podpath = g_build_filename ("iTunes", "iTunes_Control", NULL);
+	calconnotes = FALSE;
+	devicefile = TRUE;
+	break;
+    case ITDB_IPOD_MODEL_UNKNOWN:
+	podpath = g_strdup ("iPod_Control");
+	calconnotes = TRUE;
+	devicefile = TRUE;
+	break;
+    default:
+	podpath = g_strdup ("iPod_Control");
+	calconnotes = TRUE;
+	devicefile = TRUE;
+	break;
+    }
+
+    /* Construct the Control directory */
+    pbuf = g_build_filename (mp, podpath, NULL);
+    if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+    {
+	if (mkdir_with_parents(pbuf, 0777) != 0)
+	{
+	    goto error_dir;
+	}
+    }
+    g_free (pbuf);
+
+    /* Construct the Music directory inside the Control directory */
+    pbuf = g_build_filename (mp, podpath, "Music", NULL);
+    if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+    {
+	if((mkdir(pbuf, 0777) != 0))
+	{
+	    goto error_dir;
+	}
+    }
+    g_free (pbuf);
+
+    /* Construct the iTunes directory inside the Control directory */
+    pbuf = g_build_filename (mp, podpath, "iTunes", NULL);
+    if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+    {
+	if((mkdir(pbuf, 0777) != 0))
+	{
+	    goto error_dir;
+	}
+    }
+    g_free (pbuf);
+
+    /* Build Artwork directory only for devices requiring artwork
+     * (assume that 'unknown models' are new and will support
+     * artwork) */
+    if (ipod_supports_cover_art(device) ||
+	(info->ipod_model == ITDB_IPOD_MODEL_UNKNOWN))
+    {
+	pbuf = g_build_filename (mp, podpath, "Artwork", NULL);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if((mkdir(pbuf, 0777) != 0)) {
+		goto error_dir;
+	    }
+	}
+	g_free (pbuf);
+    }
+
+    /* Build Photo directory only for devices requiring it */
+    if (ipod_supports_photos(device) ||
+	(info->ipod_model == ITDB_IPOD_MODEL_UNKNOWN))
+    {
+	pbuf = g_build_filename (mp, "Photos", "Thumbs", NULL);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if (mkdir_with_parents(pbuf, 0777) != 0)
+	    {
+		goto error_dir;
+	    }
+	}
+	g_free (pbuf);
+    }
+    
+
+    /* Build the directories that hold the music files */
+    dirnum = info->musicdirs;
+    if (dirnum == 0)
+    {   /* do a guess */
+	struct statvfs stat;
+	if (statvfs (mp, &stat) != 0)
+	{   /* why should this fail !? */
+	    dirnum = 20;
+	}
+	else
+	{
+	    gdouble size = ((gdouble)stat.f_blocks * stat.f_frsize) / 1073741824;
+	    if (size < 20)  dirnum = 20;
+	    else            dirnum = 50;
+	}
+    }
+
+    for(i = 0; i < dirnum; i++)
+    {
+	gchar *num = g_strdup_printf ("F%02d", i);
+	pbuf = g_build_filename (mp, podpath, "Music", num, NULL);
+	g_free (num);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if((mkdir(pbuf, 0777) != 0))
+	    {
+		goto error_dir;
+	    }
+	}
+	g_free (pbuf);
+    }
+
+    /* Build Calendar directory for models requiring it */
+    if (calconnotes)
+    {
+	pbuf = g_build_filename (mp, "Calendars", NULL);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if((mkdir(pbuf, 0777) != 0))
+	    {
+		goto error_dir;
+	    }
+	}
+	g_free (pbuf);
+
+	/* Build Contacts directory for models requiring it */
+	pbuf = g_build_filename (mp, "Contacts", NULL);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if((mkdir(pbuf, 0777) != 0))
+	    {
+		goto error_dir;
+	    }
+	}
+	g_free (pbuf);
+
+	pbuf = g_build_filename (mp, "Notes", NULL);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if((mkdir(pbuf, 0777) != 0))
+	    {
+		goto error_dir;
+	    }
+	}
+	g_free (pbuf);
+    }
+
+    /* Construct a Device directory file for special models */
+    if (devicefile)
+    {
+	gchar *model_number;
+
+	pbuf = g_build_filename (mp, podpath, "Device", NULL);
+	if (!g_file_test (pbuf, G_FILE_TEST_EXISTS))
+	{
+	    if((mkdir(pbuf, 0777) != 0))
+	    {
+		goto error_dir;
+	    }
+   	}
+	g_free (pbuf);
+
+	model_number = itdb_device_get_sysinfo (device, "ModelNumStr");
+   	/* Construct a SysInfo file */
+	if (model_number && (strlen (model_number) != 0))
+	{
+	    pbuf = NULL;
+	    if (!itdb_device_write_sysinfo (device, error))
+	    {
+		g_free (model_number);
+		goto error_dir;
+	    }
+	}
+	g_free (model_number);
+    }
+    pbuf = NULL;
+
+  error_dir:
+    if (pbuf)
+    {
+	g_set_error (error, 0, -1,
+		     _("Problem creating iPod directory or file: '%s'."), 
+		     pbuf);
+	result = FALSE;
+    } else
+    {
+	result = TRUE;
+    }
+    g_free (pbuf);
+    g_free (podpath);
+    return result;
+}

Added: libgpod/branches/upstream/current/src/itdb_photoalbum.c
===================================================================
--- libgpod/branches/upstream/current/src/itdb_photoalbum.c	                        (rev 0)
+++ libgpod/branches/upstream/current/src/itdb_photoalbum.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,421 @@
+#include <config.h>
+
+#include "itdb_private.h"
+#include "itdb_device.h"
+#include "db-artwork-parser.h"
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <glib/gi18n-lib.h>
+
+
+/* Set @error with standard error message */
+static void error_no_photos_dir (const gchar *mp, GError **error)
+{
+    gchar *str;
+
+    g_return_if_fail (mp);
+
+    if (error)
+    {
+	str = g_build_filename (mp, "iPod_Control", "Photos", NULL);
+	g_set_error (error,
+		     ITDB_FILE_ERROR,
+		     ITDB_FILE_ERROR_NOTFOUND,
+		     _("Photos directory not found: '%s' (or similar)."),
+		     str);
+	g_free (str);
+    }
+}
+
+
+/**
+ * itdb_get_photos_dir:
+ * @mountpoint: mountpoint of iPod
+ *
+ * Retrieve the Photo directory by
+ * first calling itdb_get_control_dir() and then adding 'Photos'
+ *
+ * Return value: path to the Artwork directory or NULL of
+ * non-existent. Must g_free() after use.
+ */
+gchar *itdb_get_photos_dir (const gchar *mountpoint)
+{
+    gchar *p_ipod[] = {"Photos", NULL};
+    /* Use an array with all possibilities, so further extension will
+       be easy */
+    gchar **paths[] = {p_ipod, NULL};
+    gchar ***ptr;
+    gchar *result = NULL;
+
+    g_return_val_if_fail (mountpoint, NULL);
+
+    for (ptr=paths; *ptr && !result; ++ptr)
+    {
+	result = itdb_resolve_path (mountpoint, (const gchar **)*ptr);
+    }
+    return result;
+}
+
+/**
+ * itdb_get_photodb_path:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve a path to the Photo DB
+ *
+ * Return value: path to the PhotoDB or NULL if non-existent. Must
+ * g_free() after use.
+ **/
+gchar *itdb_get_photodb_path (const gchar *mountpoint)
+{
+    gchar *photo_dir, *path=NULL;
+
+    g_return_val_if_fail (mountpoint, NULL);
+
+    photo_dir = itdb_get_photos_dir (mountpoint);
+
+    if (photo_dir)
+    {
+	path = itdb_get_path (photo_dir, "Photo Database");
+	g_free (photo_dir);
+    }
+
+    return path;
+}
+
+/**
+ * itdb_get_photos_thumb_dir:
+ * @mountpoint: the iPod mountpoint
+ *
+ * Retrieve the Photo Thumbnail directory by
+ * first calling itdb_get_control_dir() and then adding 'Photos/Thumbs'
+ *
+ * Return value: path to the Artwork directory or NULL of
+ * non-existent. Must g_free() after use.
+ */
+gchar *itdb_get_photos_thumb_dir (const gchar *mountpoint)
+{
+    gchar *control_dir;
+    gchar *result = NULL;
+    gchar *dir = "Thumbs";
+
+    g_return_val_if_fail (mountpoint, NULL);
+    g_return_val_if_fail (dir, NULL);
+
+    control_dir = itdb_get_photos_dir (mountpoint);
+    if (control_dir)
+    {
+	const gchar *p_dir[] = {NULL, NULL};
+	p_dir[0] = dir;
+	result = itdb_resolve_path (control_dir, p_dir);
+	g_free (control_dir);
+    }
+    return result;
+}
+
+
+/**
+ * itdb_photodb_parse:
+ *
+ * Parses the photo database of an iPod mounted at @mp.
+ *
+ * @mp: mountpoint of the iPod
+ * @error: will contain the error description when an error occured.
+ *
+ * Return value: the imported PhotoDB or NULL in case of an error.
+ **/
+Itdb_PhotoDB *itdb_photodb_parse (const gchar *mp, GError **error)
+{
+    gchar *photos_dir;
+    Itdb_PhotoDB *photodb = NULL;
+
+    photos_dir = itdb_get_photos_dir (mp);
+
+    if (!photos_dir)
+    {
+	error_no_photos_dir (mp, error);
+	return NULL;
+    }
+    g_free (photos_dir);
+
+    photodb = itdb_photodb_new ();
+    itdb_device_set_mountpoint (photodb->device, mp);
+    ipod_parse_photo_db (photodb);
+    return photodb;
+}
+
+
+/**
+ * itdb_photodb_new:
+ *
+ * Creates a new Itdb_PhotoDB
+ *
+ * Return value: a newly created Itdb_PhotoDB to be freed with
+ * itdb_photodb_free() when it's no longer needed
+ **/
+Itdb_PhotoDB *itdb_photodb_new (void)
+{
+    Itdb_PhotoDB *photodb;
+
+    photodb = g_new0 (Itdb_PhotoDB, 1);
+    photodb->device = itdb_device_new ();
+
+    return photodb;
+}
+
+
+/** 
+ * itdb_photodb_free:
+ * @photodb: an #Itdb_PhotoDB
+ *
+ * Free the memory taken by @photodb. 
+ **/
+void itdb_photodb_free (Itdb_PhotoDB *photodb)
+{
+	if (photodb)
+	{
+		g_list_foreach (photodb->photoalbums,
+				(GFunc)(itdb_photodb_photoalbum_free), NULL);
+		g_list_free (photodb->photoalbums);
+		g_list_foreach (photodb->photos,
+				(GFunc)(itdb_artwork_free), NULL);
+		g_list_free (photodb->photos);
+		itdb_device_free (photodb->device);
+
+		if (photodb->userdata && photodb->userdata_destroy)
+		    (*photodb->userdata_destroy) (photodb->userdata);
+
+		g_free (photodb);
+	}
+}
+
+
+
+
+G_GNUC_INTERNAL gint itdb_get_free_photo_id ( Itdb_PhotoDB *db ) 
+{
+	gint photo_id = 0;
+	GList *it;
+
+	for (it = db->photos; it != NULL; it = it->next) {
+		Itdb_Artwork *artwork;
+
+		artwork = (Itdb_Artwork *)it->data;
+		if( artwork->id > photo_id )
+			photo_id = artwork->id;
+	}
+	return photo_id + 1;
+}
+
+static gint itdb_get_free_photoalbum_id ( Itdb_PhotoDB *db )
+{
+	gint album_id = 0;
+	GList *it;
+
+	for (it = db->photoalbums; it != NULL; it = it->next) {
+		Itdb_PhotoAlbum *album;
+
+		album = (Itdb_PhotoAlbum *)it->data;
+		if( album->album_id > album_id )
+			album_id = album->album_id;
+	}
+	return album_id + 1;
+}
+
+static Itdb_PhotoAlbum *itdb_get_photoalbum ( Itdb_PhotoDB *db, const gchar *albumname )
+{
+	GList *it;
+
+	if( strcmp( albumname, "master" ) == 0 )
+	    return g_list_nth_data (db->photoalbums, 0);
+
+	for (it = db->photoalbums; it != NULL; it = it->next) {
+		Itdb_PhotoAlbum *album;
+
+		album = (Itdb_PhotoAlbum *)it->data;
+		if( strcmp(album->name, albumname) == 0 )
+			return album;
+	}
+	return (Itdb_PhotoAlbum *)NULL;
+}
+
+
+void itdb_photodb_photoalbum_free (Itdb_PhotoAlbum *pa)
+{
+    if (pa)
+    {
+	g_free (pa->name);
+	g_list_free (pa->members);
+
+	if (pa->userdata && pa->userdata_destroy)
+	    (*pa->userdata_destroy) (pa->userdata);
+
+	g_free (pa);
+    }
+}
+
+static gboolean itdb_photodb_add_photo_internal (Itdb_PhotoDB *db,
+						 const gchar *albumname,
+						 const gchar *filename,
+						 const guchar *image_data,
+						 gsize image_data_len)
+{
+	gboolean result;
+	Itdb_Artwork *artwork;
+	Itdb_PhotoAlbum *photoalbum;
+	const Itdb_ArtworkFormat *format;
+	gint photo_id;
+
+	g_return_val_if_fail (db, FALSE);
+
+	artwork = itdb_artwork_new ();
+
+	photo_id = itdb_get_free_photo_id( db );
+	artwork->id = photo_id;
+
+	/* Add a thumbnail for every supported format */
+	format = itdb_device_get_artwork_formats(db->device);
+	for( result = TRUE; format->type != -1 && result == TRUE; format++)
+	{
+	    if((format->type == ITDB_THUMB_COVER_SMALL) ||
+	       (format->type == ITDB_THUMB_COVER_LARGE))
+			continue;
+	    if (filename)
+	    {
+		result = itdb_artwork_add_thumbnail (artwork,
+						     format->type,
+						     filename);
+	    }
+	    if (image_data)
+	    {
+		result = itdb_artwork_add_thumbnail_from_data (artwork,
+							       format->type,
+							       image_data,
+							       image_data_len);
+	    }
+	}
+
+	if (result != TRUE)
+	{
+		itdb_artwork_remove_thumbnails (artwork);
+		return result;
+	}
+	db->photos = g_list_append (db->photos, artwork);
+
+	photoalbum = itdb_get_photoalbum( db, albumname );
+	if( photoalbum == NULL )
+		photoalbum = itdb_photodb_photoalbum_new( db, albumname );
+	photoalbum->num_images++;
+	photoalbum->members = g_list_append (photoalbum->members, GINT_TO_POINTER(photo_id));
+
+	return result;
+}
+
+
+gboolean itdb_photodb_add_photo (Itdb_PhotoDB *db,
+				 const gchar *albumname,
+				 const gchar *filename)
+{
+    g_return_val_if_fail (db, FALSE);
+    g_return_val_if_fail (filename, FALSE);
+
+    return itdb_photodb_add_photo_internal (db, albumname, filename,
+					    NULL, 0);
+}
+
+
+gboolean itdb_photodb_add_photo_from_data (Itdb_PhotoDB *db,
+					   const gchar *albumname,
+					   const guchar *image_data,
+					   gsize image_data_len)
+{
+    g_return_val_if_fail (db, FALSE);
+    g_return_val_if_fail (image_data, FALSE);
+
+    return itdb_photodb_add_photo_internal (db, albumname, NULL,
+					    image_data, image_data_len);
+}
+
+
+gboolean itdb_photodb_remove_photo (Itdb_PhotoDB *db,
+		const gint photo_id )
+{
+	gboolean result = TRUE;
+	GList *it;
+
+	g_return_val_if_fail (db, FALSE);
+
+	/* Remove the photo from the image list */
+	for (it = db->photos; it != NULL; it = it->next) {
+		Itdb_Artwork *artwork;
+
+		artwork = (Itdb_Artwork *)it->data;
+		if( artwork->id == photo_id ) {
+			db->photos = g_list_remove (db->photos, artwork);
+			break;
+		}
+	}
+
+	/* Remove the photo from any albums containing it */
+	for (it = db->photoalbums; it != NULL; it = it->next) {
+		Itdb_PhotoAlbum *album;
+
+		album = (Itdb_PhotoAlbum *)it->data;
+		album->members = g_list_remove (album->members, GINT_TO_POINTER(photo_id));
+		album->num_images = g_list_length( album->members );
+	}
+	return result;
+}
+
+Itdb_PhotoAlbum *itdb_photodb_photoalbum_new (Itdb_PhotoDB *db,
+		const gchar *album_name)
+{
+	Itdb_PhotoAlbum *photoalbum;
+
+	g_return_val_if_fail (db, FALSE);
+	g_return_val_if_fail (album_name, FALSE);
+
+	photoalbum = g_new0 (Itdb_PhotoAlbum, 1);
+	photoalbum->album_id = itdb_get_free_photoalbum_id( db );
+	photoalbum->prev_album_id = photoalbum->album_id - 1;
+	photoalbum->name = g_strdup( album_name );
+	db->photoalbums = g_list_append (db->photoalbums, photoalbum);
+
+	return photoalbum;
+}
+
+/**
+ * itdb_photodb_write:
+ * @photodb: the #Itdb_PhotoDB to write to disk
+ * @error: return location for a #GError or NULL
+ *
+ * Write out a PhotoDB.
+ *
+ * FIXME: error is not set yet.
+ *
+ * Return value: TRUE on success, FALSE on error, in which case @error is
+ * set accordingly.
+ **/
+gboolean itdb_photodb_write (Itdb_PhotoDB *photodb, GError **error)
+{
+    gboolean result;
+
+    g_return_val_if_fail (photodb, FALSE);
+    g_return_val_if_fail (photodb->device, FALSE);
+
+    if (photodb->device->byte_order == 0)
+	itdb_device_autodetect_endianess (photodb->device);
+
+    result = ipod_write_photo_db (photodb);
+
+    /* Write SysInfo file if it has changed */
+    if (!(*error) && photodb->device->sysinfo_changed)
+    {
+	itdb_device_write_sysinfo (photodb->device, error);
+    }
+
+    if (result == -1)
+	return FALSE;
+    else
+	return TRUE;
+}

Modified: libgpod/branches/upstream/current/src/itdb_playlist.c
===================================================================
--- libgpod/branches/upstream/current/src/itdb_playlist.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_playlist.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-11-19 16:24:56 jcs>
+/* Time-stamp: <2006-09-23 21:25:39 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -24,7 +24,7 @@
 |
 |  This product is not supported/written/published by Apple!
 |
-|  $Id: itdb_playlist.c,v 1.15 2006/02/03 18:44:48 jcsjcs Exp $
+|  $Id: itdb_playlist.c,v 1.19 2006/09/23 12:28:23 jcsjcs Exp $
 */
 
 #include "itdb_private.h"
@@ -38,8 +38,15 @@
  * for a complete copy of his original C++-classes.
  * */
 
-/* return TRUE if the smart playlist action @action is
-   known. Otherwise a warning is displayed and FALSE is returned. */
+/**
+ * itdb_spl_action_known:
+ * @action: an #SPLAction
+ *
+ * Checks if @action is a known (to libgpod) smart playlist action.
+ *
+ * Return value: TRUE if @action is known. Otherwise a warning is displayed 
+ * and FALSE is returned. 
+ **/
 gboolean itdb_spl_action_known (SPLAction action)
 {
     gboolean result = FALSE;
@@ -73,7 +80,15 @@
     return result;
 }
 
-/* return the logic type (string, int, date...) of the action field */
+/**
+ * itdb_splr_get_field_type:
+ * @splr: an #SPLRule
+ *
+ * Gets the type of the field of the @splr rule
+ *
+ * Return value: an #SPLFieldType corresponding to @splr field type 
+ * (string, int, date, ...)
+ **/
 SPLFieldType itdb_splr_get_field_type (const SPLRule *splr)
 {
     g_return_val_if_fail (splr != NULL, splft_unknown);
@@ -114,7 +129,14 @@
 }
 
 
-/* return the type (range, date, string...) of the action field */
+/**
+ * itdb_splr_get_action_type:
+ * @splr: an #SPLRule
+ * 
+ * Gets the type of the action associated with @splr.
+ *
+ * Return value: type (range, date, string...) of the action field 
+ **/
 SPLActionType itdb_splr_get_action_type (const SPLRule *splr)
 {
     SPLFieldType fieldType;
@@ -268,8 +290,15 @@
  */
 
 
-/* function to evaluate a rule's truth against a track */
-/* track->itdb must be set. */
+/**
+ * itdb_splr_eval:
+ * @splr: an #SPLRule
+ * @track: an #Itdb_Track
+ *
+ * Evaluates @splr's truth against @track. track-&gt;itdb must be set.
+ *
+ * Return value: TRUE if @track matches @splr, FALSE otherwise.
+ **/
 gboolean itdb_splr_eval (SPLRule *splr, Itdb_Track *track)
 {
     SPLFieldType ft;
@@ -566,7 +595,12 @@
 }
 
 
-/* Randomizes a playlist */
+/**
+ * itdb_playlist_randomize:
+ * @pl: an #Itdb_Playlist to randomize
+ *
+ * Randomizes @pl
+ **/
 void itdb_playlist_randomize (Itdb_Playlist *pl)
 {
     g_return_if_fail (pl);
@@ -575,6 +609,15 @@
 }
 
 
+/**
+ * itdb_spl_update:
+ * @spl: an #Itdb_Playlist
+ *
+ * Updates the content of the smart playlist @spl (meant to be called if the 
+ * tracks stored in the #Itdb_iTunesDB associated with @spl have changed 
+ * somehow and you want spl-&gt;members to be accurate with regards to those 
+ * changes. Does nothing if @spl isn't a smart playlist.
+ **/
 void itdb_spl_update (Itdb_Playlist *spl)
 {
     GList *gl;
@@ -600,7 +643,7 @@
 	g_return_if_fail (t);
 	/* skip non-checked songs if we have to do so (this takes care
 	   of *all* the match_checked functionality) */
-	if (spl->splpref.matchcheckedonly && (t->checked == 0))
+	if (spl->splpref.matchcheckedonly && (t->checked != 0))
 	    continue;
 	/* first, match the rules */
 	if (spl->splpref.checkrules)
@@ -782,25 +825,21 @@
 }
 
 
-void spl_update (Itdb_Playlist *playlist, gpointer data);
-void spl_update (Itdb_Playlist *playlist, gpointer data)
-{
-    g_return_if_fail (playlist);
-    itdb_spl_update (playlist);
-}
-
-
-/* update all smart playlists */
+/**
+ * itdb_spl_update_all:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Updates all smart playlists contained in @itdb
+ **/
 void itdb_spl_update_all (Itdb_iTunesDB *itdb)
 {
     g_return_if_fail (itdb);
 
-    g_list_foreach (itdb->playlists, (GFunc)spl_update, NULL);
+    g_list_foreach (itdb->playlists, (GFunc)itdb_spl_update, NULL);
 }
 
 
-void spl_update2 (Itdb_Playlist *playlist, gpointer data);
-void spl_update2 (Itdb_Playlist *playlist, gpointer data)
+static void spl_update2 (Itdb_Playlist *playlist, gpointer data)
 {
     g_return_if_fail (playlist);
     if (playlist->is_spl && playlist->splpref.liveupdate)
@@ -808,7 +847,13 @@
 }
 
 
-/* update all smart playlists with 'live updating' set*/
+/** 
+ * itdb_spl_update_live:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Updates all 'live' smart playlists contained in @itdb, ie those which have 
+ * the 'live updating' flag set
+ **/
 void itdb_spl_update_live (Itdb_iTunesDB *itdb)
 {
     g_return_if_fail (itdb);
@@ -821,7 +866,12 @@
 /* ------------------------------------------------------------------- */
 
 
-/* Validate a rule */
+/**
+ * itdb_splr_validate:
+ * @splr: an #SPLRule
+ *
+ * Validates a rule 
+ **/
 void itdb_splr_validate (SPLRule *splr)
 {
     SPLActionType at;
@@ -873,7 +923,12 @@
 }
 
 
-/* Free memory of SPLRule @splr */
+/**
+ * itdb_splr_free:
+ * @splr: an #SPLRule
+ *
+ * Frees the memory used by @splr 
+ **/
 void itdb_splr_free (SPLRule *splr)
 {
     if (splr)
@@ -883,7 +938,14 @@
     }
 }
 
-/* remove @splr from playlist @pl */
+/**
+ * itdb_splr_remove:
+ * @pl: an #Itdb_Playlist
+ * @splr: an SPLRule
+ *
+ * Removes the smart playlist rule @splr from playlist @pl. The memory used by
+ * @splr is freed.
+ **/
 void itdb_splr_remove (Itdb_Playlist *pl, SPLRule *splr)
 {
     g_return_if_fail (pl);
@@ -893,7 +955,16 @@
     itdb_splr_free (splr);
 }
 
-/* add smart rule @splr to playlist @pl at position @pos */
+/**
+ * itdb_splr_add:
+ * @pl: an #Itdb_Playlist
+ * @splr: an #SPLRule
+ * @pos: position of the rule
+ *
+ * Adds the smart rule @splr to @pl at position @pos. If @pos is -1, @splr gets
+ * appended to the end. After this call, @splr memory is managed by @pl, so 
+ * you no longer need to call itdb_splr_free()
+ **/
 void itdb_splr_add (Itdb_Playlist *pl, SPLRule *splr, gint pos)
 {
     g_return_if_fail (pl);
@@ -904,7 +975,14 @@
 }
 
 
-/* Create new default rule */
+/**
+ * itdb_splr_new:
+ * 
+ * Creates a new default smart rule 
+ *
+ * Return value: a new #SPLRule that must be freed with itdb_splr_free() when 
+ * no longer needed
+ **/
 SPLRule *itdb_splr_new (void)
 {
     SPLRule *splr = g_new0 (SPLRule, 1);
@@ -922,8 +1000,17 @@
 }
 
 
-/* create a new smart rule and insert it at position @pos of playlist
- * @pl. A pointer to the newly created rule is returned. */
+/**
+ * itdb_splr_add_new:
+ * @pl: an #Itdb_Playlist
+ * @pos: position to insert the rule at
+ *
+ * Creates a new smart rule and inserts it at position @pos in @pl. If @pos is
+ * -1, the new rule gets appended to the end.
+ *
+ * Return value: pointer to the newly created #SPLRule. Its memory is handled 
+ * by @pl though, so you don't need to explicitly call itdb_splr_free() on it
+ **/
 SPLRule *itdb_splr_add_new (Itdb_Playlist *pl, gint pos)
 {
     SPLRule *splr;
@@ -951,8 +1038,17 @@
 }
 
 
-/* Duplicate an existing playlist. pl_dup->id is set to zero, so that
- * it will be set to a unique value when adding it to the itdb. */
+/**
+ * itdb_playlist_duplicate:
+ * @pl: an #Itdb_Playlist
+ *
+ * Duplicates an existing playlist. pl_dup-&gt;id is set to zero, so that
+ * it will be set to a unique value when adding it to an #Itdb_iTunesDB. The
+ * returned playlist won't be associated with an #Itdb_iTunesDB.
+ *
+ * Return value: a newly allocated #Itdb_Playlist that you'll have to free
+ * with itdb_playlist_free() when you no longer need it. 
+ **/
 Itdb_Playlist *itdb_playlist_duplicate (Itdb_Playlist *pl)
 {
     Itdb_Playlist *pl_dup;
@@ -995,9 +1091,15 @@
 }
 
 
-/* copy all relevant information for smart playlist from playlist @src
-   to playlist @dest. Already available information is
-   overwritten/deleted. */
+/**
+ * itdb_spl_copy_rules:
+ * @dest: destination #Itdb_Playlist
+ * @src: source #Itdb_Playlist
+ *
+ * Copy all relevant information for smart playlist from playlist @src
+ * to playlist @dest. If @dest is already a smart playlist, the existing data
+ * is overwritten/deleted. 
+ **/
 void itdb_spl_copy_rules (Itdb_Playlist *dest, Itdb_Playlist *src)
 {
     GList *gl;
@@ -1027,9 +1129,18 @@
 
 
 
-/* Generate a new playlist structure. If @spl is TRUE, a smart
- * playlist is generated. pl->id is set when adding to an itdb by
- * itdb_playlist_add()*/
+/**
+ * itdb_playlist_new:
+ * @title: playlist title
+ * @spl: smart playlist flag
+ *
+ * Creates a new playlist. If @spl is TRUE, a smart
+ * playlist is generated. pl->id is set by itdb_playlist_add() when the 
+ * playlist is added to an #Itdb_iTunesDB
+ * 
+ * Return value: a new #Itdb_Playlist which must be freed with 
+ * itdb_playlist_free() after use
+ **/
 Itdb_Playlist *itdb_playlist_new (const gchar *title, gboolean spl)
 {
     Itdb_Playlist *pl = g_new0 (Itdb_Playlist, 1);
@@ -1058,7 +1169,12 @@
 }
 
 
-/* Free the memory taken by playlist @pl. */
+/**
+ * itdb_playlist_free:
+ * @pl: an #Itdb_Playlist
+ *
+ * Frees the memory used by playlist @pl. 
+ **/
 void itdb_playlist_free (Itdb_Playlist *pl)
 {
     g_return_if_fail (pl);
@@ -1074,10 +1190,17 @@
 
 
 
-/* add playlist @pl to the database @itdb at position @pos (-1 for
- * "append to end"). A unique id is created if pl->id is equal to
- * zero. */
-/* a critical message is logged if either itdb or pl is NULL */
+/**
+ * itdb_playlist_add:
+ * @itdb: an #Itdb_iTunesDB
+ * @pl: an #Itdb_Playlist
+ * @pos: position to insert @pl at
+ *
+ * Adds playlist @pl to the database @itdb at position @pos (-1 for
+ * "append to end"). A unique id is created if pl-&gt;id is equal to
+ * zero. After calling this function, @itdb manages the memory of @pl, which
+ * means you no longer need to explicitly call itdb_playlist_free()
+ **/
 void itdb_playlist_add (Itdb_iTunesDB *itdb, Itdb_Playlist *pl, gint32 pos)
 {
     g_return_if_fail (itdb);
@@ -1115,7 +1238,13 @@
 
 
 
-/* move playlist @pl to position @pos */
+/**
+ * itdb_playlist_move:
+ * @pl: an #Itdb_Playlist
+ * @pos: new position
+ *
+ * Moves playlist @pl to position @pos 
+ **/
 void itdb_playlist_move (Itdb_Playlist *pl, guint32 pos)
 {
     Itdb_iTunesDB *itdb;
@@ -1129,7 +1258,13 @@
 }
 
 
-/* Remove playlist @pl and free memory */
+/**
+ * itdb_playlist_remove:
+ * @pl: an #Itdb_Playlist
+ * 
+ * Removes @pl from the #Itdb_iTunesDB it's associated with 
+ * and frees memory 
+ **/
 void itdb_playlist_remove (Itdb_Playlist *pl)
 {
     Itdb_iTunesDB *itdb;
@@ -1143,8 +1278,13 @@
 }
 
 
-/* Remove playlist @pl but do not free memory */
-/* pl->itdb is set to NULL */
+/**
+ * itdb_playlist_unlink:
+ * @pl: an #Itdb_Playlist
+ *
+ * Remove @pl from the #Itdb_iTunesDB it's associated with but do not free 
+ * memory. pl-&gt;itdb is set to NULL after this function returns
+ **/
 void itdb_playlist_unlink (Itdb_Playlist *pl)
 {
     Itdb_iTunesDB *itdb;
@@ -1158,7 +1298,15 @@
 }
 
 
-/* Return TRUE if the playlist @pl exists, FALSE otherwise */
+/**
+ * itdb_playlist_exists:
+ * @itdb: an #Itdb_iTunesDB
+ * @pl: an #Itdb_Playlist
+ *
+ * Checks if @pl is present in @db
+ *
+ * Return value: TRUE if @pl exists in @db, FALSE otherwise 
+ **/
 gboolean itdb_playlist_exists (Itdb_iTunesDB *itdb, Itdb_Playlist *pl)
 {
     g_return_val_if_fail (itdb, FALSE);
@@ -1169,10 +1317,15 @@
 }
 
 
-/* add @track to playlist @pl position @pos (-1 for "append to
- * end") */
-/* a critical message is logged if either @itdb, @pl or @track is
-   NULL */
+/**
+ * itdb_playlist_add_track:
+ * @pl: an #Itdb_Playlist
+ * @track: an #Itdb_Track
+ * @pos: position to insert @track at
+ *
+ * Adds @track to @pl at position @pos (-1 for "append to
+ * end") 
+ **/
 void itdb_playlist_add_track (Itdb_Playlist *pl,
 			      Itdb_Track *track, gint32 pos)
 {
@@ -1188,8 +1341,16 @@
 
 
 
-/* Remove track @track from playlist *pl. If @pl == NULL remove from
- * master playlist. */
+/**
+ * itdb_playlist_remove_track:
+ * @pl: an #Itdb_Playlist
+ * @track: an #Itdb_Track
+ *
+ * Removes @track from @pl. If @pl is NULL, removes @track from the
+ * master playlist. If @track can't be found in @pl, nothing happens. If after
+ * removing @track, @pl is empty, it's not removed from the database
+ * The memory used by @track isn't freed.
+ **/
 void itdb_playlist_remove_track (Itdb_Playlist *pl, Itdb_Track *track)
 {
     g_return_if_fail (track);
@@ -1203,8 +1364,16 @@
 }
 
 
-/* Returns the playlist with the ID @id or NULL if the ID cannot be
- * found. */
+/**
+ * itdb_playlist_by_id:
+ * @itdb: an #Itdb_iTunesDB
+ * @id: ID of the playlist to look for
+ *
+ * Looks up a playlist whose ID is @id 
+ *
+ * Return value: the #Itdb_Playlist with ID @id or NULL if there is no such
+ * playlist.
+ **/
 Itdb_Playlist *itdb_playlist_by_id (Itdb_iTunesDB *itdb, guint64 id)
 {
     GList *gl;
@@ -1220,7 +1389,15 @@
 }
 
 
-/* Return playlist at position @num in @itdb */
+/**
+ * itdb_playlist_by_nr:
+ * @itdb: an #Itdb_iTunesDB
+ * @num: the position of the playlist, counting from 0
+ *
+ * Gets the playlist at the given position in @itdb
+ *
+ * Return value: the #Itdb_Playlist, or NULL if there is no playlist at @pos
+ **/
 Itdb_Playlist *itdb_playlist_by_nr (Itdb_iTunesDB *itdb, guint32 num)
 {
     Itdb_Playlist *pl;
@@ -1231,7 +1408,16 @@
 }
 
 
-/* Return first playlist with name @name. */
+/**
+ * itdb_playlist_by_name:
+ * @itdb: an #Itdb_iTunesDB
+ * @name: name of the playlist to look for
+ *
+ * Searches a playlist whose name is @name in @itdb
+ *
+ * Return value: the first #Itdb_Playlist with name @name, NULL if there is no
+ * such playlist
+ **/
 Itdb_Playlist *itdb_playlist_by_name (Itdb_iTunesDB *itdb, gchar *name)
 {
     GList *gl;
@@ -1249,7 +1435,14 @@
 }
 
 
-/* check if playlist is master playlist */
+/**
+ * itdb_playlist_is_mpl:
+ * @pl: an #Itdb_Playlist
+ *
+ * Checks if @pl is the master playlist 
+ *
+ * Return value: TRUE if @pl is the master playlist, FALSE otherwise 
+ **/
 gboolean itdb_playlist_is_mpl (Itdb_Playlist *pl)
 {
     g_return_val_if_fail (pl, FALSE);
@@ -1258,7 +1451,14 @@
 }
 
 
-/* check if playlist is podcasts playlist */
+/**
+ * itdb_playlist_is_podcasts:
+ * @pl: an #Itdb_Playlist
+ *
+ * Checks if @pl is the podcasts playlist
+ *
+ * Return value: TRUE if @pl is the podcasts playlist, FALSE otherwise 
+ **/
 gboolean itdb_playlist_is_podcasts (Itdb_Playlist *pl)
 {
     g_return_val_if_fail (pl, FALSE);
@@ -1267,7 +1467,12 @@
 }
 
 
-/* set playlist to MPL */
+/**
+ * itdb_playlist_set_mpl:
+ * @pl: an #Itdb_Playlist
+ *
+ * Sets @pl to be a master playlist
+ **/
 void itdb_playlist_set_mpl (Itdb_Playlist *pl)
 {
     g_return_if_fail (pl);
@@ -1276,7 +1481,12 @@
 }
 
 
-/* set playlist to Podcasts */
+/**
+ * itdb_playlist_set_podcasts:
+ * @pl: an #Itdb_Playlist
+ *
+ * Set @pl to be a podcasts playlist 
+ **/
 void itdb_playlist_set_podcasts (Itdb_Playlist *pl)
 {
     g_return_if_fail (pl);
@@ -1285,7 +1495,14 @@
 }
 
 
-/* return the master playlist of @itdb */
+/**
+ * itdb_playlist_mpl:
+ * @itdb: an #Itdb_iTunesDB
+ * 
+ * Gets the master playlist of @itdb
+ *
+ * Return value: the master playlist of @itdb 
+ **/
 Itdb_Playlist *itdb_playlist_mpl (Itdb_iTunesDB *itdb)
 {
     Itdb_Playlist *pl;
@@ -1302,7 +1519,14 @@
 }
 
 
-/* return the podcasts playlist of @itdb, if available */
+/**
+ * itdb_playlist_podcasts:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Gets the podcasts playlist of @itdb
+ *
+ * Return value: the podcasts playlist of @itdb, or NULL if it's there is none
+ **/
 Itdb_Playlist *itdb_playlist_podcasts (Itdb_iTunesDB *itdb)
 {
     GList *gl;
@@ -1322,8 +1546,15 @@
 
 
 
-/* checks if @track is in playlist @pl. TRUE, if yes, FALSE
-   otherwise. If @pl is NULL, the */
+/**
+ * itdb_playlist_contains_track:
+ * @pl: an #Itdb_Playlist
+ * @track: an #Itdb_Track
+ *
+ * Checks if @track is in @pl.
+ * 
+ * Return value: TRUE if @track is in @pl, FALSE otherwise
+ **/
 gboolean itdb_playlist_contains_track (Itdb_Playlist *pl, Itdb_Track *tr)
 {
     g_return_val_if_fail (tr, FALSE);
@@ -1338,8 +1569,15 @@
 }
 
 
-/* returns in how many playlists (other than the MPL) @track is a
-   member of */
+/**
+ * itdb_playlist_contain_track_number:
+ * @tr: an #Itdb_Track
+ *
+ * Counts the number of playlist @track is a member of (not including the 
+ * master playlist)
+ *
+ * Return value: number of playlist containing @track
+ **/
 guint32 itdb_playlist_contain_track_number (Itdb_Track *tr)
 {
     Itdb_iTunesDB *itdb;
@@ -1363,7 +1601,14 @@
 
 
 
-/* return number of tracks in playlist */
+/**
+ * itdb_playlist_tracks_number:
+ * @pl: an #Itdb_Playlist
+ *
+ * Counts the number of tracks in @pl
+ *
+ * Return value: track count
+ **/
 guint32 itdb_playlist_tracks_number (Itdb_Playlist *pl)
 {
     g_return_val_if_fail (pl, 0);

Modified: libgpod/branches/upstream/current/src/itdb_private.h
===================================================================
--- libgpod/branches/upstream/current/src/itdb_private.h	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_private.h	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-10-15 22:14:26 jcs>
+/* Time-stamp: <2006-06-01 23:31:27 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -24,7 +24,7 @@
 |
 |  This product is not supported/written/published by Apple!
 |
-|  $Id: itdb_private.h,v 1.8 2005/11/21 20:09:53 teuf Exp $
+|  $Id: itdb_private.h,v 1.14 2006/06/01 15:45:28 jcsjcs Exp $
 */
 
 #ifndef __ITDB_PRIVATE_H__
@@ -57,6 +57,9 @@
 {
     gchar *filename;
     gchar *contents;
+    /* indicate that endian order is reversed as in the case of the
+       iTunesDBs for mobile phones */
+    gboolean reversed;
     gsize length;
     GError *error;
 } FContents;
@@ -67,7 +70,7 @@
 typedef struct
 {
     Itdb_iTunesDB *itdb;
-    FContents *itunesdb;
+    FContents *fcontents;
     GList *pos_glist;    /* temporary list to store position indicators */
     gint32 pos_len;      /* current length of above list */
     GList *playcounts;   /* contents of Play Counts file */
@@ -97,6 +100,9 @@
 {
     gchar *filename;
     gchar *contents;     /* pointer to contents */
+    /* indicate that endian order is reversed as in the case of the
+       iTunesDBs for mobile phones */
+    gboolean reversed;
     gulong pos;          /* current write position ("end of file") */
     gulong total;        /* current total size of *contents array  */
     GError *error;       /* place to report errors to */
@@ -111,13 +117,35 @@
 typedef struct
 {
     Itdb_iTunesDB *itdb;
-    WContents *itunesdb;
+    WContents *wcontents;
     guint32 next_id;     /* next free ID to use       */
     GError *error;       /* where to report errors to */
 } FExport;
 
 
+enum _DbType {
+    DB_TYPE_ITUNES,
+    DB_TYPE_PHOTO
+};
+
+typedef enum _DbType DbType;
+
+struct _Itdb_DB{
+	DbType db_type;
+	union {
+		Itdb_PhotoDB *photodb; 
+		Itdb_iTunesDB *itdb;
+	} db;
+};
+
+typedef struct _Itdb_DB Itdb_DB;
+
 G_GNUC_INTERNAL gboolean itdb_spl_action_known (SPLAction action);
 G_GNUC_INTERNAL void itdb_splr_free (SPLRule *splr);
-
+G_GNUC_INTERNAL const gchar *itdb_photodb_get_mountpoint (Itdb_PhotoDB *photodb);
+G_GNUC_INTERNAL gchar *db_get_mountpoint (Itdb_DB *db);
+G_GNUC_INTERNAL Itdb_Device *db_get_device(Itdb_DB *db);
+G_GNUC_INTERNAL gint itdb_get_free_photo_id ( Itdb_PhotoDB *db );
+G_GNUC_INTERNAL Itdb_iTunesDB *db_get_itunesdb (Itdb_DB *db);
+G_GNUC_INTERNAL Itdb_PhotoDB *db_get_photodb (Itdb_DB *db);
 #endif

Modified: libgpod/branches/upstream/current/src/itdb_track.c
===================================================================
--- libgpod/branches/upstream/current/src/itdb_track.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/itdb_track.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2005-12-04 19:10:42 jcs>
+/* Time-stamp: <2006-09-18 01:33:31 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -24,28 +24,41 @@
 |
 |  This product is not supported/written/published by Apple!
 |
-|  $Id: itdb_track.c,v 1.15 2005/12/04 10:26:14 jcsjcs Exp $
+|  $Id: itdb_track.c,v 1.21 2006/09/17 17:14:21 jcsjcs Exp $
 */
 
 #include <config.h>
 
 #include "itdb_private.h"
+#include "itdb_device.h"
 #include <string.h>
 
-static gboolean is_video_ipod (IpodDevice *ipod) 
+static gboolean is_video_ipod (Itdb_Device *device) 
 {
-	guint model;
+    const Itdb_IpodInfo *info;
 
-	if (ipod == NULL) {
-		return FALSE;
-	}
-	g_object_get (G_OBJECT (ipod), "device-model", &model, NULL);
-	return ((model == MODEL_TYPE_VIDEO_WHITE) 
-		|| (model == MODEL_TYPE_VIDEO_BLACK));
+    g_return_val_if_fail (device, FALSE);
+
+    info = itdb_device_get_ipod_info (device);
+
+    if (!info) return FALSE;
+
+    if ((info->ipod_model == ITDB_IPOD_MODEL_VIDEO_WHITE) ||
+	(info->ipod_model == ITDB_IPOD_MODEL_VIDEO_BLACK))
+	return TRUE;
+    else
+	return FALSE;
 }
 
 
-/* Generate a new Itdb_Track structure */
+/**
+ * itdb_track_new:
+ * 
+ * Creates an empty #Itdb_Track 
+ *
+ * Return Value: the new #Itdb_Track, free it with itdb_track_free() when no
+ * longer needed
+ **/
 Itdb_Track *itdb_track_new (void)
 {
     Itdb_Track *track = g_new0 (Itdb_Track, 1);
@@ -80,6 +93,14 @@
     g_return_if_fail (tr);
     g_return_if_fail (tr->itdb);
 
+    if (tr->mark_unplayed == 0)
+    {
+	/* don't have the iPod mark this track with a bullet as
+	   unplayed. Should be set to 0x02 for podcasts that have not
+	   yet been played. */
+	tr->mark_unplayed = 0x01;
+    }
+
     /* The exact meaning of unk126 is unknown, but always seems to be
        0xffff for MP3/AAC tracks, 0x0 for uncompressed tracks (like WAVE
        format), 0x1 for Audible. */
@@ -117,26 +138,26 @@
     {
 	if (haystack (tr->filetype, mp3_desc))
 	{
-	    tr->unk144 = 0x0000000c;
+	    tr->unk144 = 0x000c;
 	}
 	else if (haystack (tr->filetype, mp4_desc))
 	{
 	    if (haystack (tr->filetype, audible_subdesc))
 	    {
-		tr->unk144 = 0x01000029;
+		tr->unk144 = 0x0029;
 	    }
 		else
 	    {
-		tr->unk144 = 0x01000033;
+		tr->unk144 = 0x0033;
 	    }
 	}
 	else if (haystack (tr->filetype, wav_desc))
 	{
-	    tr->unk144 = 0x00;
+	    tr->unk144 = 0x0000;
 	}
 	else
 	{
-	    tr->unk144 = 0x00;  /* default value */
+	    tr->unk144 = 0x0000;  /* default value */
 	}
     }
     if (is_video_ipod (tr->itdb->device))
@@ -192,9 +213,17 @@
     
 
 
-/* Add @track to @itdb->tracks at position @pos (or at the end if pos
-   is -1). Application is responsible to also add it to the master
-   playlist. */
+/**
+ * itdb_track_add:
+ * @itdb: an #Itdb_iTunesDB
+ * @track: an #Itdb_Track
+ * @pos: position of the track to add
+ * 
+ * Adds @track to @itdb->tracks at position @pos (or at the end if pos
+ * is -1). The application is responsible to also add it to the master
+ * playlist. The @itdb gets ownership of the @track and will take care of 
+ * freeing the memory it uses when it's no longer necessary.
+ **/
 void itdb_track_add (Itdb_iTunesDB *itdb, Itdb_Track *track, gint32 pos)
 {
     g_return_if_fail (itdb);
@@ -209,7 +238,12 @@
     else  itdb->tracks = g_list_insert (itdb->tracks, track, pos);
 }
 
-/* Free the memory taken by @track */
+/**
+ * itdb_track_free:
+ * @track: an #Itdb_Track
+ *
+ * Frees the memory used by @track 
+ **/
 void itdb_track_free (Itdb_Track *track)
 {
     g_return_if_fail (track);
@@ -236,7 +270,14 @@
     g_free (track);
 }
 
-/* Remove track @track and free memory */
+/**
+ * itdb_track_remove:
+ * @track: an #Itdb_Track
+ *
+ * Removes @track from the #Itdb_iTunesDB it's associated with, and frees the
+ * memory it uses. It doesn't remove the track from the playlists it may have
+ * been added to, in particular it won't be removed from the master playlist.
+ **/
 void itdb_track_remove (Itdb_Track *track)
 {
     Itdb_iTunesDB *itdb;
@@ -249,8 +290,15 @@
     itdb_track_free (track);
 }
 
-/* Remove track @track but do not free memory */
-/* track->itdb is set to NULL */
+/**
+ * itdb_track_unlink:
+ * @track: an #Itdb_Track
+ * 
+ * Removes @track from the #Itdb_iTunesDB it's associated with, but do not free
+ * memory. It doesn't remove the track from the playlists it may have been 
+ * added to, in particular it won't be removed from the master playlist.
+ * track->itdb is set to NULL.
+ **/
 void itdb_track_unlink (Itdb_Track *track)
 {
     Itdb_iTunesDB *itdb;
@@ -263,7 +311,14 @@
     track->itdb = NULL;
 }
 
-/* Duplicate an existing track */
+/**
+ * itdb_track_duplicate:
+ * @tr: an #Itdb_Track
+ *
+ * Duplicates an existing track
+ *
+ * Return value: a newly allocated #Itdb_Track 
+ **/
 Itdb_Track *itdb_track_duplicate (Itdb_Track *tr)
 {
     Itdb_Track *tr_dup;
@@ -311,22 +366,41 @@
 }
 
 
-gboolean itdb_track_set_thumbnails (Itdb_Track *track,
-				    const gchar *filename)
-{
-    gboolean result;
+/* called by itdb_track_set_thumbnails() and
+   itdb_track_set_thumbnails_from_data() */
+static gboolean itdb_track_set_thumbnails_internal (Itdb_Track *track,
+						    const gchar *filename,
+						    const guchar *image_data,
+						    gsize image_data_len)
+{					     
+    gboolean result = FALSE;
 
     g_return_val_if_fail (track, FALSE);
-    g_return_val_if_fail (filename, FALSE);
 
     itdb_artwork_remove_thumbnails (track->artwork);
-    result = itdb_artwork_add_thumbnail (track->artwork,
-					 ITDB_THUMB_COVER_SMALL,
-					 filename);
-    if (result == TRUE)
+
+    if (filename)
+    {
 	result = itdb_artwork_add_thumbnail (track->artwork,
-					     ITDB_THUMB_COVER_LARGE,
+					     ITDB_THUMB_COVER_SMALL,
 					     filename);
+	if (result == TRUE)
+	    result = itdb_artwork_add_thumbnail (track->artwork,
+						 ITDB_THUMB_COVER_LARGE,
+						 filename);
+    }
+    if (image_data)
+    {
+	result = itdb_artwork_add_thumbnail_from_data (track->artwork,
+						       ITDB_THUMB_COVER_SMALL,
+						       image_data,
+						       image_data_len);
+	if (result == TRUE)
+	    result = itdb_artwork_add_thumbnail_from_data (track->artwork,
+							   ITDB_THUMB_COVER_LARGE,
+							   image_data,
+							   image_data_len);
+    }
 
     if (result == TRUE)
     {
@@ -340,34 +414,102 @@
 	/* for some reason artwork->artwork_size is always
 	   track->artwork_size + track->artwork_count */
 	track->artwork->artwork_size += track->artwork_count;
+	/* indicate artwork is present */
+	track->has_artwork = 0x01;
     }
     else
     {
-	itdb_artwork_remove_thumbnails (track->artwork);
+	itdb_track_remove_thumbnails (track);
     }
 
     return result;
 }
 
 
+/**
+ * itdb_track_set_thumbnails:
+ * @track: an #Itdb_Track
+ * @filename: image file to use as a thumbnail
+ *
+ * Uses the image contained in @filename to generate iPod thumbnails. The image
+ * can be in any format supported by gdk-pixbuf. To save memory, the thumbnails
+ * will only be generated when necessary, ie when itdb_save() or a similar 
+ * function is called.
+ *
+ * Return value: TRUE if the thumbnail could be added, FALSE otherwise.
+ **/
+gboolean itdb_track_set_thumbnails (Itdb_Track *track,
+				    const gchar *filename)
+{
+    g_return_val_if_fail (track, FALSE);
+    g_return_val_if_fail (filename, FALSE);
+
+    return itdb_track_set_thumbnails_internal (track, filename, NULL, 0);
+}
+
+
+
+
+/**
+ * itdb_track_set_thumbnails_from_data:
+ * @track: an #Itdb_Track
+ * @image_data: data used to create the thumbnail (the raw contents of
+ *              an image file)
+ * @image_data_len: length of above data block
+ *
+ * Uses @image_data to generate iPod thumbnails. The image can be in
+ * any format supported by gdk-pixbuf. To save memory, the thumbnails
+ * will only be generated when necessary, ie when itdb_save() or a
+ * similar function is called.
+ *
+ * Return value: TRUE if the thumbnail could be added, FALSE otherwise.
+ **/
+gboolean itdb_track_set_thumbnails_from_data (Itdb_Track *track,
+					      const guchar *image_data,
+					      gsize image_data_len)
+{
+    g_return_val_if_fail (track, FALSE);
+    g_return_val_if_fail (image_data, FALSE);
+
+    return itdb_track_set_thumbnails_internal (track, NULL,
+					       image_data, image_data_len);
+}
+
+
+/**
+ * itdb_track_remove_thumbnails:
+ * @track: an #Itdb_Track
+ * 
+ * Removes the thumbnails associated with @track
+ **/
 void itdb_track_remove_thumbnails (Itdb_Track *track)
 {
     g_return_if_fail (track);
     itdb_artwork_remove_thumbnails (track->artwork);
     track->artwork_size = 0;
     track->artwork_count = 0;
+    /* indicate no artwork is present */
+    track->has_artwork = 0x02;
 }
 
 
-/* Returns the track with the ID @id or NULL if the ID cannot be
- * found. */
-/* Looking up tracks by ID is not really a good idea because the IDs
-   are created by itdb just before export. The functions are here
-   because they are needed during import of the iTunesDB which is
-   referencing tracks by IDs */
-/* This function is very slow -- if you need to lookup many IDs use
-   the functions itdb_track_id_tree_create(),
-   itdb_track_id_tree_destroy(), and itdb_track_id_tree_by_id() below. */
+/**
+ * itdb_track_by_id:
+ * @itdb: an #Itdb_iTunesDB
+ * @id: ID of the track to look for
+ *
+ * Looks up a track using its ID in @itdb. 
+ * Looking up tracks by ID is not really a good idea because the IDs
+ * are created by itdb just before export. The functions are here
+ * because they are needed during import of the iTunesDB which is
+ * referencing tracks by IDs.
+ * This function is very slow (linear in the number of tracks contained in the 
+ * database). If you need to lookup many IDs use itdb_track_id_tree_create(), 
+ * itdb_track_id_tree_destroy(), and itdb_track_id_tree_by_id().
+ *
+ * Return value: #Itdb_Track with the ID @id or NULL if the ID cannot be
+ * found. 
+ **/
 Itdb_Track *itdb_track_by_id (Itdb_iTunesDB *itdb, guint32 id)
 {
     GList *gl;
@@ -392,8 +534,16 @@
 }
 
 
-/* Creates a balanced-binary tree for quick ID lookup that is used in
-   itdb_track_by_id_tree() function below */
+/**
+ * itdb_track_id_tree_create:
+ * @itdb: an #Itdb_iTunesDB
+ *
+ * Creates a balanced-binary tree for quick ID lookup that is used in
+ * itdb_track_by_id_tree() function below 
+ *
+ * Return value: a #GTree indexed by track IDs to be freed with 
+ * itdb_track_id_tree_destroy() when no longer used
+ **/
 GTree *itdb_track_id_tree_create (Itdb_iTunesDB *itdb)
 {
     GTree *idtree;
@@ -412,7 +562,12 @@
     return idtree;
 }
 
-/* free memory of @idtree */
+/**
+ * itdb_track_id_tree_destroy:
+ * @idtree: a #GTree
+ *
+ * Frees the memory used by @idtree 
+ **/
 void itdb_track_id_tree_destroy (GTree *idtree)
 {
     g_return_if_fail (idtree);
@@ -420,7 +575,17 @@
     g_tree_destroy (idtree);
 }
 
-/* lookup track by @id using @idtree for quicker reference */
+/**
+ * itdb_track_id_tree_by_id:
+ * @idtree: a #GTree created using itdb_track_id_tree_create()
+ * @id: the ID of the track to search for
+ *
+ * Lookup an #Itdb_Track by @id using @idtree for faster lookup (compared to
+ * itdb_track_by_id)
+ *
+ * Return value: the #Itdb_Track whose ID is @id, or NULL if such a track 
+ * couldn't be found
+ **/
 Itdb_Track *itdb_track_id_tree_by_id (GTree *idtree, guint32 id)
 {
     g_return_val_if_fail (idtree, NULL);

Modified: libgpod/branches/upstream/current/src/ithumb-writer.c
===================================================================
--- libgpod/branches/upstream/current/src/ithumb-writer.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/src/ithumb-writer.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -29,6 +29,7 @@
 #ifdef HAVE_GDKPIXBUF
 
 #include "itdb_private.h"
+#include "itdb_endianness.h"
 
 #include <errno.h>
 #include <locale.h>
@@ -45,8 +46,9 @@
 	off_t cur_offset;
 	FILE *f;
         gchar *filename;
-	IpodArtworkFormat *img_info;
-	GHashTable *cache;
+	Itdb_ArtworkFormat *img_info;
+        DbType db_type;
+        guint byte_order;
 };
 typedef struct _iThumbWriter iThumbWriter;
 
@@ -56,7 +58,8 @@
  * square
  */
 static guint16 *
-pack_RGB_565 (GdkPixbuf *pixbuf, int dst_width, int dst_height)
+pack_RGB_565 (GdkPixbuf *pixbuf, iThumbWriter *writer,
+	      gint horizontal_padding, gint vertical_padding)
 {
 	guchar *pixels;
 	guint16 *result;
@@ -66,19 +69,30 @@
 	gint height;
 	gint w;
 	gint h;
+	gint byte_order;
 
 	g_object_get (G_OBJECT (pixbuf), 
 		      "rowstride", &row_stride, "n-channels", &channels,
 		      "height", &height, "width", &width,
 		      "pixels", &pixels, NULL);
-	g_return_val_if_fail ((width <= dst_width) && (height <= dst_height), NULL);
+	g_return_val_if_fail ((width <= writer->img_info->width) && (height <= writer->img_info->height), NULL);
 	/* dst_width and dst_height come from a width/height database 
 	 * hardcoded in libipoddevice code, so dst_width * dst_height * 2 can't
 	 * overflow, even on an iPod containing malicious data
 	 */
-	result = g_malloc0 (dst_width * dst_height * 2);
+	result = g_malloc0 (writer->img_info->width * writer->img_info->height * 2);
 
+	/* Swap the byte order on full screen nano photos */
+	byte_order = writer->byte_order;
+	if ( writer->img_info->correlation_id == 1023) {
+		if (byte_order == G_LITTLE_ENDIAN)
+			byte_order = G_BIG_ENDIAN;
+		else
+			byte_order = G_LITTLE_ENDIAN; 
+	}
+
 	for (h = 0; h < height; h++) {
+	        gint line = (h+vertical_padding)*writer->img_info->width;
 		for (w = 0; w < width; w++) {
 			gint r;
 			gint g;
@@ -87,54 +101,87 @@
 			r = pixels[h*row_stride + w*channels];
 			g = pixels[h*row_stride + w*channels + 1]; 
 			b = pixels[h*row_stride + w*channels + 2]; 
+
 			r >>= (8 - RED_BITS);
 			g >>= (8 - GREEN_BITS);
 			b >>= (8 - BLUE_BITS);
 			r = (r << RED_SHIFT) & RED_MASK;
 			g = (g << GREEN_SHIFT) & GREEN_MASK;
 			b = (b << BLUE_SHIFT) & BLUE_MASK;
-			result[h*dst_width + w] =  (GINT16_TO_LE (r | g | b));
+			result[line + w + horizontal_padding] =
+			    get_gint16 (r | g | b, byte_order);
 		}
 	}
 	return result;
 }
 
 
-
-
 static char *
-ipod_image_get_ithmb_filename (const char *mount_point, gint correlation_id, gint index) 
+ipod_image_get_ithmb_filename (const char *mount_point, gint correlation_id, gint index, DbType db_type ) 
 {
-	char *paths[] = {"iPod_Control", "Artwork", NULL, NULL};
-	char *filename, *buf;
+	gchar *artwork_dir = NULL, *filename, *buf;
 
+	g_return_val_if_fail (mount_point, NULL);
+	switch( db_type ) {
+	case DB_TYPE_PHOTO:
+		artwork_dir = itdb_get_photos_thumb_dir (mount_point);
+		if (!artwork_dir)
+		{
+			/* attempt to create Thumbs dir */
+			gchar *photos_dir = itdb_get_photos_dir (mount_point);
+			gchar *dir;
+			if (!photos_dir)
+			{   /* give up */
+				return NULL;
+			}
+			dir = g_build_filename (photos_dir, "Thumbs", NULL);
+			mkdir (dir, 0777);
+			g_free (dir);
+			g_free (photos_dir);
+
+			/* try again */
+			artwork_dir = itdb_get_photos_thumb_dir (mount_point);
+			if (!artwork_dir)
+			{   /* give up */
+				return NULL;
+			}
+		}
+		break;
+	case DB_TYPE_ITUNES:
+	artwork_dir = itdb_get_artwork_dir (mount_point);
+	if (!artwork_dir)
+	{
+		/* attempt to create Artwork dir */
+		gchar *control_dir = itdb_get_control_dir (mount_point);
+		gchar *dir;
+		if (!control_dir)
+		{   /* give up */
+			return NULL;
+		}
+		dir = g_build_filename (control_dir, "Artwork", NULL);
+		mkdir (dir, 0777);
+		g_free (dir);
+		g_free (control_dir);
+
+		/* try again */
+		artwork_dir = itdb_get_artwork_dir (mount_point);
+		if (!artwork_dir)
+		{   /* give up */
+			return NULL;
+		}
+	}
+	}
+
 	buf = g_strdup_printf ("F%04u_%d.ithmb", correlation_id, index);
 
-	paths[2] = buf;
+	filename = itdb_get_path (artwork_dir, buf);
 
-	filename = itdb_resolve_path (mount_point, (const char **)paths);
-
-	/* itdb_resolve_path() only returns existing paths */
+	/* itdb_get_path() only returns existing paths */
 	if (!filename)
 	{
-	    gchar *path;
-	    paths[2] = NULL;
-	    path = itdb_resolve_path (mount_point, (const char **)paths);
-	    if (path == NULL)
-	    {   /* attempt to create directory */
-		gchar *pth = g_build_filename (mount_point,
-					       paths[0], paths[1], NULL);
-		mkdir (pth, 0777);
-		g_free (pth);
-		path = itdb_resolve_path (mount_point,
-					  (const char **)paths);
-	    }
-	    if (path)
-	    {
-		filename = g_build_filename (path, buf, NULL);
-	    }
-	    g_free (path);
+	    filename = g_build_filename (artwork_dir, buf, NULL);
 	}
+/*	printf ("%s %s\n", buf, filename);*/
 
 	g_free (buf);
 
@@ -147,34 +194,44 @@
 ithumb_writer_write_thumbnail (iThumbWriter *writer, 
 			       Itdb_Thumb *thumb)
 {
-    GdkPixbuf *pixbuf;
+    GdkPixbuf *pixbuf = NULL;
     guint16 *pixels;
-    gchar *filename;
     gint width, height;
 
-    Itdb_Thumb *old_thumb;
-
     g_return_val_if_fail (writer, FALSE);
     g_return_val_if_fail (thumb, FALSE);
 
-    /* If the same filename was written before, just use the old
-       thumbnail to save space on the iPod */
-    old_thumb = g_hash_table_lookup (writer->cache, thumb->filename);
-    if (old_thumb != NULL)
-    {
-	g_free (thumb->filename);
-	memcpy (thumb, old_thumb, sizeof (Itdb_Thumb));
-	thumb->filename = g_strdup (old_thumb->filename);
-	return TRUE;
+    if (thumb->filename)
+    {   /* read image from filename */
+	pixbuf = gdk_pixbuf_new_from_file_at_size (thumb->filename, 
+						   writer->img_info->width, 
+						   writer->img_info->height,
+						   NULL);
+
     }
+    else if (thumb->image_data)
+    {   /* image data is stored in image_data and image_data_len */
+	GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
+	g_return_val_if_fail (loader, FALSE);
+	gdk_pixbuf_loader_set_size (loader,
+				    writer->img_info->width, 
+				    writer->img_info->height);
+	gdk_pixbuf_loader_write (loader,
+				 thumb->image_data,
+				 thumb->image_data_len,
+				 NULL);
+	gdk_pixbuf_loader_close (loader, NULL);
+	pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+	g_object_ref (pixbuf);
+	g_object_unref (loader);
 
-    filename = g_strdup (thumb->filename);
+	g_free (thumb->image_data);
+	thumb->image_data = NULL;
+	thumb->image_data_len = 0;
+    }
 
-    pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 
-					       writer->img_info->width, 
-					       writer->img_info->height,
-					       NULL);
-    if (pixbuf == NULL) {
+    if (pixbuf == NULL)
+    {
 	return FALSE;
     }
 
@@ -186,19 +243,53 @@
 		  "height", &height,
 		  NULL);
 
-    thumb->width = width;
-    thumb->height = height;
-    thumb->offset = writer->cur_offset;
-    thumb->size = writer->img_info->width * writer->img_info->height * 2;
-/*     printf("offset: %d type: %d, size: %d\n", thumb->offset, thumb->type, thumb->size); */
+    g_free (thumb->filename);
+    thumb->filename = NULL;
+
     /* FIXME: under certain conditions (probably related to
      * writer->offset getting too big), this should be :F%04u_2.ithmb
      * and so on
      */
-    thumb->filename = g_strdup_printf (":F%04u_1.ithmb", 
-				       writer->img_info->correlation_id);
-    pixels = pack_RGB_565 (pixbuf, writer->img_info->width, 
-			   writer->img_info->height);
+    if( thumb->type == ITDB_THUMB_PHOTO_LARGE ||
+	thumb->type == ITDB_THUMB_PHOTO_SMALL ||
+	thumb->type == ITDB_THUMB_PHOTO_FULL_SCREEN )
+    {
+	thumb->filename = g_strdup_printf (":Thumbs:F%04u_1.ithmb", 
+					   writer->img_info->correlation_id);
+	
+    } else {
+	thumb->filename = g_strdup_printf (":F%04u_1.ithmb", 
+					   writer->img_info->correlation_id);
+    }
+
+    switch (writer->db_type)
+    {
+    case DB_TYPE_PHOTO:
+	thumb->horizontal_padding = (writer->img_info->width - width)/2;
+	thumb->vertical_padding = (writer->img_info->height - height)/2;
+	break;
+    case DB_TYPE_ITUNES:
+	/* IPOD_COVER_LARGE will be centered automatically using
+	   the info in mhni->width/height. Free space around
+	   IPOD_COVER_SMALL will be used to display track
+	   information -> no padding (tested on iPod
+	   Nano). mhni->hor_/ver_padding is working */
+	thumb->horizontal_padding = 0;
+	thumb->vertical_padding = 0;
+	break;
+    default:
+	g_return_val_if_reached (FALSE);
+    }
+
+    /* The thumbnail width/height is inclusive padding */
+    thumb->width = thumb->horizontal_padding + width;
+    thumb->height = thumb->vertical_padding + height;
+    thumb->offset = writer->cur_offset;
+    thumb->size = writer->img_info->width * writer->img_info->height * 2;
+
+    pixels = pack_RGB_565 (pixbuf, writer,
+			   thumb->horizontal_padding,
+			   thumb->vertical_padding);
     g_object_unref (G_OBJECT (pixbuf));
 
     if (pixels == NULL)
@@ -212,11 +303,7 @@
     }
     g_free (pixels);
     writer->cur_offset += thumb->size;
-    g_hash_table_insert (writer->cache, filename, thumb);
 
-    /* !! filename is g_free()d when destroying the hash table. Do not
-       do it here */
-
     return TRUE;
 }
 
@@ -239,23 +326,26 @@
 }
 
 static iThumbWriter *
-ithumb_writer_new (const char *mount_point, const IpodArtworkFormat *info)
+ithumb_writer_new (const char *mount_point,
+		   const Itdb_ArtworkFormat *info,
+		   DbType db_type,
+		   guint byte_order)
 {
 	char *filename;
 	iThumbWriter *writer;
 
 	writer = g_new0 (iThumbWriter, 1);
 
-	writer->img_info = g_memdup (info, sizeof (IpodArtworkFormat));
+	writer->img_info = g_memdup (info, sizeof (Itdb_ArtworkFormat));
 
-	writer->cache = g_hash_table_new_full (g_str_hash, g_str_equal, 
-					       g_free, NULL);
+	writer->byte_order = byte_order;
+	writer->db_type = db_type;
 
 	filename = ipod_image_get_ithmb_filename (mount_point, 
 						  info->correlation_id,
-						  1);
+						  1, 
+						  db_type);
 	if (filename == NULL) {
-		g_hash_table_destroy (writer->cache);
 		g_free (writer->img_info);
 		g_free (writer);
 		return NULL;
@@ -264,7 +354,6 @@
 	if (writer->f == NULL) {
 		g_print ("Error opening %s: %s\n", filename, strerror (errno));
 		g_free (filename);
-		g_hash_table_destroy (writer->cache);
 		g_free (writer->img_info);
 		g_free (writer);
 		return NULL;
@@ -284,7 +373,6 @@
 	{   /* Remove empty file */
 	    unlink (writer->filename);
 	}
-	g_hash_table_destroy (writer->cache);
 	g_free (writer->img_info);
 	g_free (writer->filename);
 	g_free (writer);
@@ -498,8 +586,8 @@
    slots are filled, the file is truncated to the new length.
 */
 static gboolean
-ithmb_rearrange_existing_thumbnails (Itdb_iTunesDB *itdb,
-				     const IpodArtworkFormat *info)
+ithmb_rearrange_existing_thumbnails (Itdb_DB *db,
+				     const Itdb_ArtworkFormat *info)
 {
     GList *gl;
     GHashTable *filenamehash;
@@ -507,11 +595,16 @@
     GList *thumbs;
     gint i;
     gchar *filename;
+    const gchar *mountpoint;
 
-    g_return_val_if_fail (itdb, FALSE);
+    g_return_val_if_fail (db, FALSE);
     g_return_val_if_fail (info, FALSE);
-    g_return_val_if_fail (itdb->mountpoint, FALSE);
+    g_return_val_if_fail (db_get_device(db), FALSE);
 
+    mountpoint = db_get_mountpoint (db);
+
+    g_return_val_if_fail (mountpoint, FALSE);
+
     filenamehash = g_hash_table_new_full (g_str_hash, g_str_equal, 
 					  g_free, NULL);
 
@@ -519,25 +612,54 @@
        This will usually be a number of "F%04d_%d.ithmb" files. A
        GList is kept with pointers to all images in a given file which
        allows to adjust the offset pointers */
-    for (gl=itdb->tracks; gl; gl=gl->next)
-    {
-	Itdb_Thumb *thumb;
-	Itdb_Track *track = gl->data;
-	g_return_val_if_fail (track, FALSE);
+	switch (db->db_type) {
+	case DB_TYPE_ITUNES:
+		for (gl=db_get_itunesdb(db)->tracks; gl; gl=gl->next)
+		{
+			Itdb_Thumb *thumb;
+			Itdb_Track *track = gl->data;
+			g_return_val_if_fail (track, FALSE);
 
-	thumb = itdb_artwork_get_thumb_by_type (track->artwork,
-						info->type);
-	if (thumb && thumb->filename && (thumb->size != 0))
+			thumb = itdb_artwork_get_thumb_by_type (track->artwork,
+					info->type);
+			if (thumb && thumb->filename && (thumb->size != 0))
+			{
+				filename = itdb_thumb_get_filename (
+				        db_get_device(db),
+				        thumb);
+				if (filename)
+				{
+					thumbs = g_hash_table_lookup (filenamehash, filename);
+					thumbs = g_list_append (thumbs, thumb);
+					g_hash_table_insert (filenamehash, filename, thumbs);
+				}
+			}
+		}
+		break;
+    case DB_TYPE_PHOTO:
+	for (gl=db_get_photodb(db)->photos; gl; gl=gl->next)
 	{
-	    filename = itdb_thumb_get_filename (itdb->device,
-						thumb);
-	    if (filename)
-	    {
-		thumbs = g_hash_table_lookup (filenamehash, filename);
-		thumbs = g_list_append (thumbs, thumb);
-		g_hash_table_insert (filenamehash, filename, thumbs);
-	    }
+		Itdb_Thumb *thumb;
+		Itdb_Artwork *artwork = gl->data;
+
+		thumb = itdb_artwork_get_thumb_by_type (artwork,
+				info->type);
+		if (thumb && thumb->filename && (thumb->size != 0))
+		{
+			filename = itdb_thumb_get_filename (
+			        db_get_device (db),
+			        thumb);
+			if (filename)
+			{
+				thumbs = g_hash_table_lookup (filenamehash, filename);
+				thumbs = g_list_append (thumbs, thumb);
+				g_hash_table_insert (filenamehash, filename, thumbs);
+			}
+		}
 	}
+	break;
+    default:
+	g_return_val_if_reached (FALSE);
     }
 
     /* Check for files present on the iPod but no longer referenced by
@@ -545,9 +667,10 @@
 
     for (i=0; i<10; ++i)
     {
-	filename = ipod_image_get_ithmb_filename (itdb->mountpoint,
+	filename = ipod_image_get_ithmb_filename (mountpoint,
 						  info->correlation_id,
-						  i);
+						  i,
+						  db->db_type);
 	if (g_file_test (filename, G_FILE_TEST_EXISTS))
 	{
 	    if (g_hash_table_lookup (filenamehash, filename) == NULL)
@@ -569,43 +692,45 @@
 #endif
 
 G_GNUC_INTERNAL int
-itdb_write_ithumb_files (Itdb_iTunesDB *db) 
+itdb_write_ithumb_files (Itdb_DB *db) 
 {
 #ifdef HAVE_GDKPIXBUF
 	GList *writers;
 	GList *it;
-	gchar *mount_point;
-	const IpodArtworkFormat *format;
-/*	g_print ("%s\n", G_GNUC_FUNCTION);*/
+	Itdb_Device *device;
+	const Itdb_ArtworkFormat *format;
+	const gchar *mount_point;
 
 	g_return_val_if_fail (db, -1);
+	device = db_get_device(db);
+	g_return_val_if_fail (device, -1);
 
-	mount_point = db->mountpoint;
+	mount_point = db_get_mountpoint (db);
 	/* FIXME: support writing to directory rather than writing to
 	   iPod */
 	if (mount_point == NULL)
 	    return -1;
 	
-	if (db->device == NULL) {
-		return -1;
-	}
-
-	g_object_get (G_OBJECT (db->device), "artwork-formats", 
-		      &format, NULL);
+	format = itdb_device_get_artwork_formats (device);
 	if (format == NULL) {
 		return -1;
 	}
-
 	writers = NULL;
 	while (format->type != -1) {
 		iThumbWriter *writer;
 
 		switch (format->type) {
-		case IPOD_COVER_SMALL:
-		case IPOD_COVER_LARGE:
-		        ithmb_rearrange_existing_thumbnails (db,
-							     format);
-			writer = ithumb_writer_new (mount_point, format);
+		case ITDB_THUMB_COVER_SMALL:
+		case ITDB_THUMB_COVER_LARGE:
+		case ITDB_THUMB_PHOTO_SMALL:
+		case ITDB_THUMB_PHOTO_LARGE:
+		case ITDB_THUMB_PHOTO_FULL_SCREEN:
+		    ithmb_rearrange_existing_thumbnails (db,
+							     format );
+			writer = ithumb_writer_new (mount_point, 
+						    format,
+						    db->db_type, 
+						    device->byte_order);
 			if (writer != NULL) {
 				writers = g_list_prepend (writers, writer);
 			}
@@ -615,20 +740,34 @@
 		}
 		format++;
 	}
-
 	if (writers == NULL) {
 		return -1;
 	}
+	switch (db->db_type) {
+	case DB_TYPE_ITUNES:
+		for (it = db_get_itunesdb(db)->tracks; it != NULL; it = it->next) {
+			Itdb_Track *track;
 
-	for (it = db->tracks; it != NULL; it = it->next) {
-		Itdb_Track *track;
+			track = it->data;
+			g_return_val_if_fail (track, -1);
 
-		track = it->data;
-		g_return_val_if_fail (track, -1);
+			g_list_foreach (writers, write_thumbnail, track->artwork);
+		}
+		break;
+	case DB_TYPE_PHOTO:
+		for (it = db_get_photodb(db)->photos; it != NULL; it = it->next) {
+			Itdb_Artwork *photo;
 
-		g_list_foreach (writers, write_thumbnail, track->artwork);
+			photo = it->data;
+			g_return_val_if_fail (photo, -1);
+
+			g_list_foreach (writers, write_thumbnail, photo);
+		}
+		break;
+	default:
+	        g_return_val_if_reached (-1);
 	}
-
+	
 	g_list_foreach (writers, (GFunc)ithumb_writer_free, NULL);
 	g_list_free (writers);
 

Modified: libgpod/branches/upstream/current/tests/Makefile.am
===================================================================
--- libgpod/branches/upstream/current/tests/Makefile.am	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/tests/Makefile.am	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,21 +1,43 @@
 if HAVE_GDKPIXBUF
-TESTTHUMBS=test-thumbnails test-write-thumbnails
+TESTTHUMBS=test-thumbnails test-write-thumbnails test-photos
 else
 TESTTHUMBS=
 endif
 
-noinst_PROGRAMS=test-ipod-device test-itdb $(TESTTHUMBS)
+TESTMISC=test-init-ipod
 
+if HAVE_TAGLIB
+TESTTAGLIB=test-rebuild-db
+else
+TESTTAGLIB=
+endif
+
+noinst_PROGRAMS=test-itdb test-ls $(TESTTHUMBS) $(TESTTAGLIB) $(TESTMISC)
+
 INCLUDES=$(LIBGPOD_CFLAGS) -I$(top_srcdir)/src -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
 LIBS=$(LIBGPOD_LIBS) $(top_builddir)/src/libgpod.la
 
 test_itdb_SOURCES = itdb_main.c
 test_itdb_LDADD = 
 
+test_ls_SOURCES = test-ls.c
+test_ls_LDADD = 
+
+if HAVE_TAGLIB
+test_rebuild_db_SOURCES = test-rebuild-db.cc
+test_rebuild_db_LDADD = $(TAGLIB_LIBS)
+test_rebuild_db_CXXFLAGS = $(TAGLIB_CFLAGS)
+endif
+
 if HAVE_GDKPIXBUF
 test_thumbnails_SOURCES = test-covers.c
 test_thumbnails_CFLAGS = $(AM_CFLAGS)
 
+test_photos_SOURCES = test-photos.c
+test_photos_CFLAGS = $(AM_CFLAGS)
+
+test_init_ipod_SOURCES = test-init-ipod.c
+
 test_write_thumbnails_SOURCES = test-write-covers.c
 test_write_thumbnails_CFLAGS = $(AM_CFLAGS)
 endif

Modified: libgpod/branches/upstream/current/tests/Makefile.in
===================================================================
--- libgpod/branches/upstream/current/tests/Makefile.in	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/tests/Makefile.in	2006-09-29 21:50:32 UTC (rev 134)
@@ -38,6 +38,7 @@
 host_triplet = @host@
 ACLOCAL = @ACLOCAL@
 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+ALL_LINGUAS = @ALL_LINGUAS@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
@@ -66,7 +67,8 @@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
-EJECT_PATH = @EJECT_PATH@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
@@ -75,10 +77,16 @@
 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
 GMOFILES = @GMOFILES@
 GMSGFMT = @GMSGFMT@
-HAL_CFLAGS = @HAL_CFLAGS@
-HAL_LIBS = @HAL_LIBS@
+GREP = @GREP@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
 HAVE_GDKPIXBUF_FALSE = @HAVE_GDKPIXBUF_FALSE@
 HAVE_GDKPIXBUF_TRUE = @HAVE_GDKPIXBUF_TRUE@
+HAVE_PYTHON_FALSE = @HAVE_PYTHON_FALSE@
+HAVE_PYTHON_TRUE = @HAVE_PYTHON_TRUE@
+HAVE_TAGLIB_FALSE = @HAVE_TAGLIB_FALSE@
+HAVE_TAGLIB_TRUE = @HAVE_TAGLIB_TRUE@
+HTML_DIR = @HTML_DIR@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -101,6 +109,7 @@
 INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
 INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
 INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
+INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
 INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
 INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
 INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
@@ -141,22 +150,27 @@
 POSUB = @POSUB@
 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
 RANLIB = @RANLIB@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-UNMOUNT_PATH = @UNMOUNT_PATH@
-UNMOUNT_PATH_ALT = @UNMOUNT_PATH_ALT@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
+TAGLIB_CFLAGS = @TAGLIB_CFLAGS@
+TAGLIB_LIBS = @TAGLIB_LIBS@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -171,40 +185,67 @@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
-mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 @HAVE_GDKPIXBUF_FALSE at TESTTHUMBS = 
- at HAVE_GDKPIXBUF_TRUE@TESTTHUMBS = test-thumbnails test-write-thumbnails
+ at HAVE_GDKPIXBUF_TRUE@TESTTHUMBS = test-thumbnails test-write-thumbnails test-photos
 
-noinst_PROGRAMS = test-ipod-device test-itdb $(TESTTHUMBS)
+TESTMISC = test-init-ipod
+ at HAVE_TAGLIB_FALSE@TESTTAGLIB = 
 
+ at HAVE_TAGLIB_TRUE@TESTTAGLIB = test-rebuild-db
+
+noinst_PROGRAMS = test-itdb test-ls $(TESTTHUMBS) $(TESTTAGLIB) $(TESTMISC)
+
 INCLUDES = $(LIBGPOD_CFLAGS) -I$(top_srcdir)/src -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
 
 test_itdb_SOURCES = itdb_main.c
 test_itdb_LDADD = 
 
+test_ls_SOURCES = test-ls.c
+test_ls_LDADD = 
+
+ at HAVE_TAGLIB_TRUE@test_rebuild_db_SOURCES = test-rebuild-db.cc
+ at HAVE_TAGLIB_TRUE@test_rebuild_db_LDADD = $(TAGLIB_LIBS)
+ at HAVE_TAGLIB_TRUE@test_rebuild_db_CXXFLAGS = $(TAGLIB_CFLAGS)
+
 @HAVE_GDKPIXBUF_TRUE at test_thumbnails_SOURCES = test-covers.c
 @HAVE_GDKPIXBUF_TRUE at test_thumbnails_CFLAGS = $(AM_CFLAGS)
 
+ at HAVE_GDKPIXBUF_TRUE@test_photos_SOURCES = test-photos.c
+ at HAVE_GDKPIXBUF_TRUE@test_photos_CFLAGS = $(AM_CFLAGS)
+
+ at HAVE_GDKPIXBUF_TRUE@test_init_ipod_SOURCES = test-init-ipod.c
+
 @HAVE_GDKPIXBUF_TRUE at test_write_thumbnails_SOURCES = test-write-covers.c
 @HAVE_GDKPIXBUF_TRUE at test_write_thumbnails_CFLAGS = $(AM_CFLAGS)
 subdir = tests
@@ -212,23 +253,61 @@
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
- at HAVE_GDKPIXBUF_TRUE@noinst_PROGRAMS = test-ipod-device$(EXEEXT) \
- at HAVE_GDKPIXBUF_TRUE@	test-itdb$(EXEEXT) \
- at HAVE_GDKPIXBUF_TRUE@	test-thumbnails$(EXEEXT) \
- at HAVE_GDKPIXBUF_TRUE@	test-write-thumbnails$(EXEEXT)
- at HAVE_GDKPIXBUF_FALSE@noinst_PROGRAMS = test-ipod-device$(EXEEXT) \
- at HAVE_GDKPIXBUF_FALSE@	test-itdb$(EXEEXT)
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_TRUE at noinst_PROGRAMS = \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_TRUE@	test-itdb$(EXEEXT) \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_TRUE@	test-ls$(EXEEXT) \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_TRUE@	test-rebuild-db$(EXEEXT) \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_TRUE@	test-init-ipod$(EXEEXT)
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_FALSE at noinst_PROGRAMS = \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_FALSE@	test-itdb$(EXEEXT) \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_FALSE@	test-ls$(EXEEXT) \
+ at HAVE_GDKPIXBUF_FALSE@@HAVE_TAGLIB_FALSE@	test-init-ipod$(EXEEXT)
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE at noinst_PROGRAMS = \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-itdb$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-ls$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-thumbnails$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-write-thumbnails$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-photos$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-rebuild-db$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_TRUE@	test-init-ipod$(EXEEXT)
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE at noinst_PROGRAMS = \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE@	test-itdb$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE@	test-ls$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE@	test-thumbnails$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE@	test-write-thumbnails$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE@	test-photos$(EXEEXT) \
+ at HAVE_GDKPIXBUF_TRUE@@HAVE_TAGLIB_FALSE@	test-init-ipod$(EXEEXT)
 PROGRAMS = $(noinst_PROGRAMS)
 
-test_ipod_device_SOURCES = test-ipod-device.c
-test_ipod_device_OBJECTS = test-ipod-device.$(OBJEXT)
-test_ipod_device_LDADD = $(LDADD)
-test_ipod_device_DEPENDENCIES =
-test_ipod_device_LDFLAGS =
+am__test_init_ipod_SOURCES_DIST = test-init-ipod.c
+ at HAVE_GDKPIXBUF_TRUE@am_test_init_ipod_OBJECTS = \
+ at HAVE_GDKPIXBUF_TRUE@	test-init-ipod.$(OBJEXT)
+test_init_ipod_OBJECTS = $(am_test_init_ipod_OBJECTS)
+test_init_ipod_LDADD = $(LDADD)
+test_init_ipod_DEPENDENCIES =
+test_init_ipod_LDFLAGS =
 am_test_itdb_OBJECTS = itdb_main.$(OBJEXT)
 test_itdb_OBJECTS = $(am_test_itdb_OBJECTS)
 test_itdb_DEPENDENCIES =
 test_itdb_LDFLAGS =
+am_test_ls_OBJECTS = test-ls.$(OBJEXT)
+test_ls_OBJECTS = $(am_test_ls_OBJECTS)
+test_ls_DEPENDENCIES =
+test_ls_LDFLAGS =
+am__test_photos_SOURCES_DIST = test-photos.c
+ at HAVE_GDKPIXBUF_TRUE@am_test_photos_OBJECTS = \
+ at HAVE_GDKPIXBUF_TRUE@	test_photos-test-photos.$(OBJEXT)
+test_photos_OBJECTS = $(am_test_photos_OBJECTS)
+test_photos_LDADD = $(LDADD)
+test_photos_DEPENDENCIES =
+test_photos_LDFLAGS =
+am__test_rebuild_db_SOURCES_DIST = test-rebuild-db.cc
+ at HAVE_TAGLIB_TRUE@am_test_rebuild_db_OBJECTS = \
+ at HAVE_TAGLIB_TRUE@	test_rebuild_db-test-rebuild-db.$(OBJEXT)
+test_rebuild_db_OBJECTS = $(am_test_rebuild_db_OBJECTS)
+ at HAVE_TAGLIB_TRUE@test_rebuild_db_DEPENDENCIES =
+ at HAVE_TAGLIB_FALSE@test_rebuild_db_DEPENDENCIES =
+test_rebuild_db_LDFLAGS =
 am__test_thumbnails_SOURCES_DIST = test-covers.c
 @HAVE_GDKPIXBUF_TRUE at am_test_thumbnails_OBJECTS = \
 @HAVE_GDKPIXBUF_TRUE@	test_thumbnails-test-covers.$(OBJEXT)
@@ -248,7 +327,10 @@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 @AMDEP_TRUE at DEP_FILES = ./$(DEPDIR)/itdb_main.Po \
- at AMDEP_TRUE@	./$(DEPDIR)/test-ipod-device.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test-init-ipod.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test-ls.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_photos-test-photos.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_rebuild_db-test-rebuild-db.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/test_thumbnails-test-covers.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/test_write_thumbnails-test-write-covers.Po
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -258,16 +340,26 @@
 CCLD = $(CC)
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = test-ipod-device.c $(test_itdb_SOURCES) \
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(am__test_init_ipod_SOURCES_DIST) $(test_itdb_SOURCES) \
+	$(test_ls_SOURCES) $(am__test_photos_SOURCES_DIST) \
+	$(am__test_rebuild_db_SOURCES_DIST) \
 	$(am__test_thumbnails_SOURCES_DIST) \
 	$(am__test_write_thumbnails_SOURCES_DIST)
 DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
-SOURCES = test-ipod-device.c $(test_itdb_SOURCES) $(test_thumbnails_SOURCES) $(test_write_thumbnails_SOURCES)
+SOURCES = $(test_init_ipod_SOURCES) $(test_itdb_SOURCES) $(test_ls_SOURCES) $(test_photos_SOURCES) $(test_rebuild_db_SOURCES) $(test_thumbnails_SOURCES) $(test_write_thumbnails_SOURCES)
 
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .cc .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
 	cd $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu  tests/Makefile
@@ -280,12 +372,21 @@
 	  echo " rm -f $$p $$f"; \
 	  rm -f $$p $$f ; \
 	done
-test-ipod-device$(EXEEXT): $(test_ipod_device_OBJECTS) $(test_ipod_device_DEPENDENCIES) 
-	@rm -f test-ipod-device$(EXEEXT)
-	$(LINK) $(test_ipod_device_LDFLAGS) $(test_ipod_device_OBJECTS) $(test_ipod_device_LDADD) $(LIBS)
+test-init-ipod$(EXEEXT): $(test_init_ipod_OBJECTS) $(test_init_ipod_DEPENDENCIES) 
+	@rm -f test-init-ipod$(EXEEXT)
+	$(LINK) $(test_init_ipod_LDFLAGS) $(test_init_ipod_OBJECTS) $(test_init_ipod_LDADD) $(LIBS)
 test-itdb$(EXEEXT): $(test_itdb_OBJECTS) $(test_itdb_DEPENDENCIES) 
 	@rm -f test-itdb$(EXEEXT)
 	$(LINK) $(test_itdb_LDFLAGS) $(test_itdb_OBJECTS) $(test_itdb_LDADD) $(LIBS)
+test-ls$(EXEEXT): $(test_ls_OBJECTS) $(test_ls_DEPENDENCIES) 
+	@rm -f test-ls$(EXEEXT)
+	$(LINK) $(test_ls_LDFLAGS) $(test_ls_OBJECTS) $(test_ls_LDADD) $(LIBS)
+test-photos$(EXEEXT): $(test_photos_OBJECTS) $(test_photos_DEPENDENCIES) 
+	@rm -f test-photos$(EXEEXT)
+	$(LINK) $(test_photos_LDFLAGS) $(test_photos_OBJECTS) $(test_photos_LDADD) $(LIBS)
+test-rebuild-db$(EXEEXT): $(test_rebuild_db_OBJECTS) $(test_rebuild_db_DEPENDENCIES) 
+	@rm -f test-rebuild-db$(EXEEXT)
+	$(CXXLINK) $(test_rebuild_db_LDFLAGS) $(test_rebuild_db_OBJECTS) $(test_rebuild_db_LDADD) $(LIBS)
 test-thumbnails$(EXEEXT): $(test_thumbnails_OBJECTS) $(test_thumbnails_DEPENDENCIES) 
 	@rm -f test-thumbnails$(EXEEXT)
 	$(LINK) $(test_thumbnails_LDFLAGS) $(test_thumbnails_OBJECTS) $(test_thumbnails_LDADD) $(LIBS)
@@ -300,7 +401,10 @@
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/itdb_main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test-ipod-device.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test-init-ipod.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test-ls.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_photos-test-photos.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_rebuild_db-test-rebuild-db.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_thumbnails-test-covers.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_write_thumbnails-test-write-covers.Po at am__quote@
 
@@ -337,6 +441,39 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
 
+test_photos-test-photos.o: test-photos.c
+ at am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_photos_CFLAGS) $(CFLAGS) -MT test_photos-test-photos.o -MD -MP -MF "$(DEPDIR)/test_photos-test-photos.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o test_photos-test-photos.o `test -f 'test-photos.c' || echo '$(srcdir)/'`test-photos.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/test_photos-test-photos.Tpo" "$(DEPDIR)/test_photos-test-photos.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/test_photos-test-photos.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='test-photos.c' object='test_photos-test-photos.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/test_photos-test-photos.Po' tmpdepfile='$(DEPDIR)/test_photos-test-photos.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_photos_CFLAGS) $(CFLAGS) -c -o test_photos-test-photos.o `test -f 'test-photos.c' || echo '$(srcdir)/'`test-photos.c
+
+test_photos-test-photos.obj: test-photos.c
+ at am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_photos_CFLAGS) $(CFLAGS) -MT test_photos-test-photos.obj -MD -MP -MF "$(DEPDIR)/test_photos-test-photos.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o test_photos-test-photos.obj `if test -f 'test-photos.c'; then $(CYGPATH_W) 'test-photos.c'; else $(CYGPATH_W) '$(srcdir)/test-photos.c'; fi`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/test_photos-test-photos.Tpo" "$(DEPDIR)/test_photos-test-photos.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/test_photos-test-photos.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='test-photos.c' object='test_photos-test-photos.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/test_photos-test-photos.Po' tmpdepfile='$(DEPDIR)/test_photos-test-photos.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_photos_CFLAGS) $(CFLAGS) -c -o test_photos-test-photos.obj `if test -f 'test-photos.c'; then $(CYGPATH_W) 'test-photos.c'; else $(CYGPATH_W) '$(srcdir)/test-photos.c'; fi`
+
+test_photos-test-photos.lo: test-photos.c
+ at am__fastdepCC_TRUE@	if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_photos_CFLAGS) $(CFLAGS) -MT test_photos-test-photos.lo -MD -MP -MF "$(DEPDIR)/test_photos-test-photos.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o test_photos-test-photos.lo `test -f 'test-photos.c' || echo '$(srcdir)/'`test-photos.c; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/test_photos-test-photos.Tpo" "$(DEPDIR)/test_photos-test-photos.Plo"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/test_photos-test-photos.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='test-photos.c' object='test_photos-test-photos.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/test_photos-test-photos.Plo' tmpdepfile='$(DEPDIR)/test_photos-test-photos.TPlo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_photos_CFLAGS) $(CFLAGS) -c -o test_photos-test-photos.lo `test -f 'test-photos.c' || echo '$(srcdir)/'`test-photos.c
+
 test_thumbnails-test-covers.o: test-covers.c
 @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_thumbnails_CFLAGS) $(CFLAGS) -MT test_thumbnails-test-covers.o -MD -MP -MF "$(DEPDIR)/test_thumbnails-test-covers.Tpo" \
 @am__fastdepCC_TRUE@	  -c -o test_thumbnails-test-covers.o `test -f 'test-covers.c' || echo '$(srcdir)/'`test-covers.c; \
@@ -403,6 +540,72 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_write_thumbnails_CFLAGS) $(CFLAGS) -c -o test_write_thumbnails-test-write-covers.lo `test -f 'test-write-covers.c' || echo '$(srcdir)/'`test-write-covers.c
 
+.cc.o:
+ at am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCXX_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCXX_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+
+.cc.obj:
+ at am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCXX_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+ at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCXX_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+
+.cc.lo:
+ at am__fastdepCXX_TRUE@	if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCXX_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
+ at am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCXX_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+
+test_rebuild_db-test-rebuild-db.o: test-rebuild-db.cc
+ at am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rebuild_db_CXXFLAGS) $(CXXFLAGS) -MT test_rebuild_db-test-rebuild-db.o -MD -MP -MF "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo" \
+ at am__fastdepCXX_TRUE@	  -c -o test_rebuild_db-test-rebuild-db.o `test -f 'test-rebuild-db.cc' || echo '$(srcdir)/'`test-rebuild-db.cc; \
+ at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo" "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Po"; \
+ at am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo"; exit 1; \
+ at am__fastdepCXX_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='test-rebuild-db.cc' object='test_rebuild_db-test-rebuild-db.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/test_rebuild_db-test-rebuild-db.Po' tmpdepfile='$(DEPDIR)/test_rebuild_db-test-rebuild-db.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rebuild_db_CXXFLAGS) $(CXXFLAGS) -c -o test_rebuild_db-test-rebuild-db.o `test -f 'test-rebuild-db.cc' || echo '$(srcdir)/'`test-rebuild-db.cc
+
+test_rebuild_db-test-rebuild-db.obj: test-rebuild-db.cc
+ at am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rebuild_db_CXXFLAGS) $(CXXFLAGS) -MT test_rebuild_db-test-rebuild-db.obj -MD -MP -MF "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo" \
+ at am__fastdepCXX_TRUE@	  -c -o test_rebuild_db-test-rebuild-db.obj `if test -f 'test-rebuild-db.cc'; then $(CYGPATH_W) 'test-rebuild-db.cc'; else $(CYGPATH_W) '$(srcdir)/test-rebuild-db.cc'; fi`; \
+ at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo" "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Po"; \
+ at am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo"; exit 1; \
+ at am__fastdepCXX_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='test-rebuild-db.cc' object='test_rebuild_db-test-rebuild-db.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/test_rebuild_db-test-rebuild-db.Po' tmpdepfile='$(DEPDIR)/test_rebuild_db-test-rebuild-db.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rebuild_db_CXXFLAGS) $(CXXFLAGS) -c -o test_rebuild_db-test-rebuild-db.obj `if test -f 'test-rebuild-db.cc'; then $(CYGPATH_W) 'test-rebuild-db.cc'; else $(CYGPATH_W) '$(srcdir)/test-rebuild-db.cc'; fi`
+
+test_rebuild_db-test-rebuild-db.lo: test-rebuild-db.cc
+ at am__fastdepCXX_TRUE@	if $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rebuild_db_CXXFLAGS) $(CXXFLAGS) -MT test_rebuild_db-test-rebuild-db.lo -MD -MP -MF "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo" \
+ at am__fastdepCXX_TRUE@	  -c -o test_rebuild_db-test-rebuild-db.lo `test -f 'test-rebuild-db.cc' || echo '$(srcdir)/'`test-rebuild-db.cc; \
+ at am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo" "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Plo"; \
+ at am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/test_rebuild_db-test-rebuild-db.Tpo"; exit 1; \
+ at am__fastdepCXX_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='test-rebuild-db.cc' object='test_rebuild_db-test-rebuild-db.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/test_rebuild_db-test-rebuild-db.Plo' tmpdepfile='$(DEPDIR)/test_rebuild_db-test-rebuild-db.TPlo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rebuild_db_CXXFLAGS) $(CXXFLAGS) -c -o test_rebuild_db-test-rebuild-db.lo `test -f 'test-rebuild-db.cc' || echo '$(srcdir)/'`test-rebuild-db.cc
+
 mostlyclean-libtool:
 	-rm -f *.lo
 

Added: libgpod/branches/upstream/current/tests/test-init-ipod.c
===================================================================
--- libgpod/branches/upstream/current/tests/test-init-ipod.c	                        (rev 0)
+++ libgpod/branches/upstream/current/tests/test-init-ipod.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,102 @@
+/* Copyright (c) 2006, Jorg Schuler
+ * <jcsjcs at users dot sourceforge dot net>
+ *
+ * The code contained in this file is free software; you can redistribute
+ * it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either version
+ * 2.1 of the License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this code; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * iTunes and iPod are trademarks of Apple
+ *
+ * This product is not supported/written/published by Apple!
+ *
+ * $Id: test-init-ipod.c,v 1.2 2006/05/30 14:09:44 jcsjcs Exp $
+ *
+ */
+
+#include "itdb.h"
+
+#include <locale.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib/gi18n-lib.h>
+
+
+static void usage (const char *argv0)
+{
+    g_print ("Usage: %s mountpoint [modelnumber]\n", argv0);
+    g_print ("This test program will create the standard directories on your iPod\n");
+    g_print ("including empty iTunesDB and ArtworkDB.\n\n");
+    g_print ("Valid model numbers are listed in itdb_device.c, e.g. 'MA350' for a\n");
+    g_print ("1 GB iPod nano\n\n");
+    g_print ("Often the model number can be found in <mountpoint>/iTunes/Device/SysInfo,\n");
+    g_print ("which is written automatically by most iPods when you reset it.\n\n");
+    g_print ("If you omit the model number, this program will try to detect the model\n");
+    g_print ("number and print it.\n");
+}
+
+
+int
+main (int argc, char **argv)
+{
+    if ((argc < 2) || (argc > 3))
+    {
+	usage (argv[0]);
+        return 1;
+    }
+    setlocale (LC_ALL, "");
+    g_type_init ();
+
+    if (argc == 3)
+    {
+	GError *error = NULL;
+
+	if (!itdb_init_ipod (argv[1], argv[2], "iPod", &error))
+	{
+	    if (error)
+	    {
+		g_print (_("Error initialising iPod: %s\n"),
+			 error->message);
+		g_error_free (error);
+		error = NULL;
+	    }
+	    else
+	    {
+		g_print (_("Error initialising iPod, unknown error\n"));
+	    }
+	}
+    }
+    if (argc == 2)
+    {
+	gchar *model_num;
+	Itdb_Device *device = itdb_device_new ();
+	itdb_device_set_mountpoint (device, argv[1]);
+
+	model_num = itdb_device_get_sysinfo (device, "ModelNumStr");
+
+	if (model_num)
+	{
+	    g_print ("Your iPod model number seems to be '%s'.\n",
+		     model_num);
+	}
+	else
+	{
+	    g_print ("Your iPod model number could not be detected.\n");
+	    g_print ("Maybe you have an iPod Shuffle? In that case specify  'M9724' (512 MB)\n");
+	    g_print ("or 'M9725' (1 GB) to setup your iPod.\n");
+	    g_print ("If you have a mobile phone, specify 'Mmobile1'.\n");
+	    g_print ("Otherwise look up the model number on the ipod package or in\n");
+	    g_print ("itdb_device.c (prepend 'M').\n");
+	}
+	itdb_device_free (device);
+    }
+    return 0;
+}

Deleted: libgpod/branches/upstream/current/tests/test-ipod-device.c
===================================================================
--- libgpod/branches/upstream/current/tests/test-ipod-device.c	2006-09-29 21:49:31 UTC (rev 133)
+++ libgpod/branches/upstream/current/tests/test-ipod-device.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -1,65 +0,0 @@
-/* Copyright (c) 2005, Jorg Schuler <jcsjcs at users.sourceforge.net>
- * All rights reserved.
-
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *    * Redistributions of source code must retain the above copyright
- *      notice, this list of conditions and the following disclaimer.
- *    * Redistributions in binary form must reproduce the above
- *      copyright notice, this list of conditions and the following
- *      disclaimer in the documentation and/or other materials provided
- *      with the distribution.
- *    * Neither the name of the <ORGANIZATION> nor the names of its
- *      contributors may be used to endorse or promote products derived
- *      from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "ipod-device.h"
-#include <locale.h>
-#include <stdio.h>
-
-int
-main (int argc, char **argv)
-{
-    IpodDevice *device=NULL;
-
-
-    if (argc < 2) {
-	g_print ("Usage: %s mountpoint\n", argv[0]);
-	return 1;
-    }
-    setlocale (LC_ALL, "");
-    g_type_init ();
-
-    device = itdb_device_new (argv[1]);
-
-    if (!device)
-    {
-	g_print ("Error accessing iPod at '%s'\n", argv[1]);
-	return 0;
-    }
-
-    /* Have a look at itdb_device_debug() in ipod-device.c to see how
-       the information is retrieved */
-    itdb_device_debug (device);
-
-    /* This is how to free the memory */
-    g_object_unref (device);
-
-    return 0;
-}

Added: libgpod/branches/upstream/current/tests/test-ls.c
===================================================================
--- libgpod/branches/upstream/current/tests/test-ls.c	                        (rev 0)
+++ libgpod/branches/upstream/current/tests/test-ls.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,139 @@
+/*
+|   Copyright (C) 2002-2003 Jorg Schuler <jcsjcs at users.sourceforge.net>
+|   Copyright (C) 2006 Christophe Fergeau  <teuf at gnome.org>
+|
+|   This program is free software; you can redistribute it and/or modify
+|   it under the terms of the GNU General Public License as published by
+|   the Free Software Foundation; either version 2 of the License, or
+|   (at your option) any later version.
+|
+|   This program is distributed in the hope that it will be useful,
+|   but WITHOUT ANY WARRANTY; without even the implied warranty of
+|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+|   GNU General Public License for more details.
+|
+|   You should have received a copy of the GNU General Public License
+|   along with this program; if not, write to the Free Software
+|   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+|
+|  iTunes and iPod are trademarks of Apple
+|
+|  This product is not supported/written/published by Apple!
+|
+*/
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <libintl.h>
+
+#include "itdb.h"
+
+#define LOCALDB "/.gtkpod/local_0.itdb"
+
+static void
+display_track (Itdb_Track *track, const char *prefix) 
+{
+    g_print ("%s%s - %s - %s\n", prefix,  
+	     track->artist, track->album, track->title);
+    g_print ("%s\t%s\n", prefix, track->ipod_path);
+}
+
+static void
+display_playlist (Itdb_Playlist *playlist, const char *prefix)
+{
+    char *track_prefix;
+    GList *it;
+
+    if (itdb_playlist_is_mpl (playlist)) {
+	g_print ("%s%s (Master Playlist)\n", prefix, playlist->name);
+    } else if (itdb_playlist_is_podcasts (playlist)) {
+	g_print ("%s%s (Podcasts Playlist)\n", prefix, playlist->name);
+    } else {
+	g_print ("%s%s\n", prefix, playlist->name);
+    }
+
+    printf ("%stracks: %d\n", prefix, g_list_length (playlist->members));
+    track_prefix = g_strdup_printf ("%s\t", prefix);
+    for (it = playlist->members; it != NULL; it = it->next) {
+	Itdb_Track *track;
+	
+	track = (Itdb_Track *)it->data;
+	display_track (track, "\t");
+    }
+    g_print ("\n\n");
+    g_free (track_prefix);
+}
+
+int
+main (int argc, char *argv[])
+{
+  GError *error=NULL;
+  const gchar *homeenv="HOME";
+  Itdb_iTunesDB *itdb;
+  gchar *mountpoint = NULL, *playlistname = NULL;
+
+  if (argc >= 2)
+      mountpoint = argv[1];
+
+    if (argc >= 3)
+      playlistname = argv[2];
+ 
+  if (mountpoint == NULL)
+  {
+      g_print ("Usage: %s <mountpoint>|-l [<playlistname>]\n\n"
+               "-l - List from the local repository (~" LOCALDB ")\n"
+	       "<playlistname> - name of the playlist to list (optional)\n",  
+                g_basename(argv[0]));
+      exit (0);
+  }
+
+  if (strcmp(mountpoint, "-l") == 0) {
+      mountpoint = g_build_filename(g_getenv(homeenv), LOCALDB, NULL);
+      itdb = itdb_parse_file (mountpoint, &error);
+  }
+  else
+      itdb = itdb_parse (mountpoint, &error);
+  
+  if (error)
+  {
+      if (error->message) {
+	  g_print("%s\n", error->message);
+      }
+      g_error_free (error);
+      error = NULL;
+  }
+
+  if (itdb)
+  {
+      GList *it;
+
+      printf ("playlists: %d\n", g_list_length (itdb->playlists));
+      for (it = itdb->playlists; it != NULL; it = it->next) {
+	  Itdb_Playlist *playlist;
+
+	  playlist = (Itdb_Playlist *)it->data;
+	  
+	  if (playlistname == NULL || strcmp(playlist->name, playlistname) == 0) 
+	    display_playlist (playlist, "");
+      }
+
+      if (error)
+      {
+	  if (error->message) {
+	      g_print ("%s\n", error->message);
+	  }
+	  g_error_free (error);
+	  error = NULL;
+      }
+  }
+
+  itdb_free (itdb);
+
+  return 0;
+}

Added: libgpod/branches/upstream/current/tests/test-photos.c
===================================================================
--- libgpod/branches/upstream/current/tests/test-photos.c	                        (rev 0)
+++ libgpod/branches/upstream/current/tests/test-photos.c	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,190 @@
+/* Copyright (c) 2006, Michael McLellan <mikey at mclellan.org.nz>
+ *
+ * The code contained in this file is free software; you can redistribute
+ * it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either version
+ * 2.1 of the License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this code; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * iTunes and iPod are trademarks of Apple
+ *
+ * This product is not supported/written/published by Apple!
+ *
+ * $Id: test-photos.c,v 1.4 2006/06/02 18:08:14 jcsjcs Exp $
+ *
+ */
+
+#include "itdb.h"
+
+#include <locale.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <string.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib/gi18n-lib.h>
+
+static void
+save_itdb_thumb (Itdb_PhotoDB *itdb, Itdb_Thumb *thumb,
+		 const gchar *filename)
+{
+	GdkPixbuf *pixbuf;
+	
+	pixbuf = itdb_thumb_get_gdk_pixbuf (itdb->device, thumb);
+
+	if (pixbuf != NULL) {
+		gdk_pixbuf_save (pixbuf, filename, "png", NULL, NULL);
+		gdk_pixbuf_unref (pixbuf);
+	}
+}
+
+static void
+dump_thumbs (Itdb_PhotoDB *db, Itdb_Artwork *artwork,
+	     const gchar *album_name, const gchar *dir)
+{
+	GList *it;
+	gint i = 0;
+
+	for (it = artwork->thumbnails; it != NULL; it = it->next, i++) {
+		Itdb_Thumb *thumb;
+		gchar *filename, *path;
+
+		thumb = (Itdb_Thumb *)it->data;
+		g_return_if_fail (thumb);
+
+		filename = g_strdup_printf ("%s-%d-%d.png",
+					    album_name, artwork->id, i );
+		path = g_build_filename (dir, filename, NULL);
+		g_free (filename);
+		save_itdb_thumb (db, thumb, path);
+		g_free (path);
+	}
+}
+
+static void
+dump_artwork (Itdb_PhotoDB *db, gint photo_id,
+	      const gchar *album_name, const gchar *dir)
+{
+	GList *it;
+
+	for (it = db->photos; it != NULL; it = it->next) {
+		Itdb_Artwork *artwork;
+
+		artwork = (Itdb_Artwork *)it->data;
+		g_return_if_fail (artwork);
+		if( artwork->id == photo_id ) {
+			dump_thumbs (db, artwork, album_name, dir);
+			break;
+		}
+	}
+}
+
+static void
+dump_albums (Itdb_PhotoDB *db, const gchar *dir)
+{
+	GList *it;
+	
+	for (it = db->photoalbums; it != NULL; it = it->next) {
+		Itdb_PhotoAlbum *album;
+		GList *it2;
+
+		album = (Itdb_PhotoAlbum *)it->data;
+		g_return_if_fail (album);
+
+		for (it2 = album->members; it2 != NULL; it2 = it2->next) {
+		        gint photo_id = GPOINTER_TO_INT(it2->data);
+			dump_artwork (db, photo_id, album->name, dir);
+		}
+	}
+}
+
+int
+main (int argc, char **argv)
+{
+    GError *error = NULL;
+    Itdb_PhotoDB *db;
+    gint i; 
+
+    if (argc < 4) {
+	g_print (_("Usage to add photos:\n"));
+        g_print (_("%s <mountpoint> <albumname> <filename(s)>\n"), argv[0]);
+        g_print (_("albumname should be set to 'master' to add photos to the master photo album\n"));
+	g_print (_("\n"));
+	g_print (_("Usage to dump all photos to <output_dir>:\n"));
+	g_print (_("%s dump <mountpoint> <output_dir>\n"), argv[0]);
+        return 1;
+    }
+    setlocale (LC_ALL, "");
+    g_type_init ();
+
+    if (strcmp (argv[1], "dump") == 0)
+    {
+	if (!g_file_test (argv[3], G_FILE_TEST_EXISTS))
+	{
+	    if (mkdir (argv[3], 0777) == -1)
+	    {
+		g_print (_("Error creating '%s' (mkdir)\n"), argv[3]);
+		return 1;
+	    }
+	}
+	if (!g_file_test (argv[3], G_FILE_TEST_IS_DIR))
+	{
+	    g_print (_("Error: '%s' is not a directory\n"), argv[3]);
+	    return 1;
+	}
+
+	db = itdb_photodb_parse (argv[2], &error);
+	if (db == NULL)
+	{
+	    if (error)
+	    {
+		g_print (_("Error reading iPod photo database (%s).\n"), error->message);
+		g_error_free (error);
+		error = NULL;
+	    }
+	    else
+	    {
+		g_print (_("Error reading iPod photo database.\n"));
+	    }
+	    return 1;
+	}
+        dump_albums (db, argv[3]);
+	itdb_photodb_free (db);
+    }
+    else
+    {
+	db = itdb_photodb_parse (argv[1], &error);
+	if (db == NULL)
+	{
+	    if (error)
+	    {
+		g_print (_("Error reading iPod photo database (%s).\nWill attempt to create a new database.\n"), error->message);
+		g_error_free (error);
+		error = NULL;
+	    }
+	    else
+	    {
+		g_print (_("Error reading iPod photo database, will attempt to create a new database\n"));
+	    }
+	    db = itdb_photodb_new ();
+	    itdb_device_set_mountpoint (db->device, argv[1]);
+	}
+	for (i=3; i<argc; ++i)
+	{
+	    itdb_photodb_add_photo (db, argv[2], argv[i]);
+	}
+
+	itdb_photodb_write (db, NULL);
+	itdb_photodb_free (db);
+    }
+
+    return 0;
+}
+

Added: libgpod/branches/upstream/current/tests/test-rebuild-db.cc
===================================================================
--- libgpod/branches/upstream/current/tests/test-rebuild-db.cc	                        (rev 0)
+++ libgpod/branches/upstream/current/tests/test-rebuild-db.cc	2006-09-29 21:50:32 UTC (rev 134)
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2006 Christophe Fergeau
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <typeinfo>
+#include <unistd.h>
+
+#include <glib/gstdio.h>
+
+#include <id3v2tag.h>
+#include <mpegfile.h>
+
+#include "itdb.h"
+
+static char *
+itdb_resolve_path (Itdb_iTunesDB *db, const char *filename)
+{
+	const char *mountpoint;
+	char *ipod_path;
+
+	mountpoint = itdb_get_mountpoint (db);
+	if (!g_str_has_prefix (filename, mountpoint)) {
+		return NULL;
+	}
+	if (mountpoint[strlen(mountpoint)-1] == G_DIR_SEPARATOR) {
+		ipod_path = g_strdup (filename + strlen (mountpoint)-1);
+	} else {
+		ipod_path = g_strdup (filename + strlen (mountpoint));
+	}
+	itdb_filename_fs2ipod (ipod_path);
+#ifdef VERBOSE
+	g_print ("Filename: %s\n", filename);
+	g_print ("Mount point: %s (%d)\n", mountpoint, strlen (mountpoint));
+	g_print ("Path resolved to %s\n", ipod_path);
+#endif
+	return ipod_path;
+}
+
+static Itdb_Track *
+track_from_file (const char *filename)
+{
+	TagLib::MPEG::File file(filename);
+	TagLib::Tag *tag;
+	Itdb_Track *track;
+	struct stat st;
+
+	tag = file.tag();
+	if (tag == NULL) {
+		g_print ("Couldn't read tag\n");
+		return NULL;
+	}
+/*	if (typeid (*tag) != typeid (TagLib::ID3v2::Tag)) {
+		g_print ("Unknown tag type\n");
+		return NULL;
+		}*/
+
+	/* FIXME: what happens if we try to open a non-MP3 file? */
+#ifdef VERBOSE
+	g_print ("%s:\n", filename);
+	g_print ("\t%s\n", tag->artist().toCString(true));
+	g_print ("\t%s\n", tag->album().toCString(true));
+	g_print ("\t%s\n", tag->title().toCString(true));
+	g_print ("\t%s\n", tag->genre().toCString(true));
+	g_print ("\t%d\n", tag->year());
+	g_print ("\t%d\n", tag->track());
+	g_print ("\n");
+#endif
+	track = itdb_track_new ();
+	track->title = g_strdup (tag->title().toCString(true));
+	track->album = g_strdup (tag->album().toCString(true));
+	track->artist = g_strdup (tag->artist().toCString(true));
+	track->genre = g_strdup (tag->genre().toCString(true));
+	track->comment = g_strdup (tag->comment().toCString(true));
+	track->filetype = g_strdup ("MP3-file");
+	if (g_stat (filename, &st) == 0) {
+		track->size = st.st_size;
+	}
+	track->tracklen = file.audioProperties()->length() * 1000;
+	track->track_nr = tag->track();
+	track->bitrate = file.audioProperties()->bitrate();
+	track->samplerate = file.audioProperties()->sampleRate();
+	track->year = tag->year();
+	return track;
+}
+
+
+static void
+process_one_file (const char *filename, gpointer data)
+{
+	Itdb_iTunesDB *db;
+	Itdb_Track *track;
+
+	db = (Itdb_iTunesDB *)data;
+	track = track_from_file (filename);
+	track->ipod_path = itdb_resolve_path (db, filename);
+	if (track->ipod_path == NULL) {
+		itdb_track_free (track);
+		return;
+	}
+
+	itdb_track_add (db, track, -1);
+	itdb_playlist_add_track (itdb_playlist_mpl(db), track, -1);
+}
+
+typedef void (*DirTraversalFunc)(const char *filename, gpointer data);
+
+static void
+foreach_file (const char *basedir,
+	      DirTraversalFunc func, gpointer data,
+	      GError **error)
+{
+	GError *tmp_error;
+	const char *name;
+	GDir *dir;
+
+	g_assert (func != NULL);
+
+	tmp_error = NULL;
+	dir = g_dir_open (basedir, 0, &tmp_error);
+ 	if (tmp_error != NULL) {
+		g_propagate_error (error, tmp_error);
+		return;
+	}
+
+	name = g_dir_read_name (dir);
+	while (name != NULL) {
+		char *absolute_path;
+
+		absolute_path = g_build_filename (basedir, name, NULL);
+
+		if (g_file_test (absolute_path, G_FILE_TEST_IS_DIR)) {
+			tmp_error = NULL;
+			foreach_file (absolute_path, func, data, &tmp_error);
+			if (tmp_error != NULL) {
+				g_propagate_error (error, tmp_error);
+				g_free (absolute_path);
+				g_dir_close (dir);
+				return;
+			}
+		} else if (g_file_test (absolute_path, G_FILE_TEST_IS_REGULAR)){
+			func (absolute_path, data);
+		}
+		g_free (absolute_path);
+		name = g_dir_read_name (dir);
+	}
+
+	g_dir_close (dir);
+
+
+}
+
+static void
+fill_db (Itdb_iTunesDB *db, GError **error)
+{
+	GError *err = NULL;
+	char *music_dir;
+
+	music_dir = itdb_get_music_dir (itdb_get_mountpoint (db));
+	foreach_file (music_dir, process_one_file, db, &err);
+	g_free (music_dir);
+	if (err != NULL) {
+		g_propagate_error (error, err);
+		return;
+	}
+	g_print ("Found %d files\n",
+		 g_list_length (itdb_playlist_mpl(db)->members));
+}
+
+static Itdb_iTunesDB *
+itdb_create (const char *mountpoint)
+{
+	Itdb_Playlist *mpl;
+	Itdb_iTunesDB *db;
+
+	db = itdb_new ();
+	if (db == NULL) {
+		return NULL;
+	}
+	itdb_set_mountpoint (db, mountpoint);
+	mpl = itdb_playlist_new ("iPod", FALSE);
+	itdb_playlist_set_mpl (mpl);
+	itdb_playlist_add (db, mpl, -1);
+
+	return db;
+}
+
+int main (int argc, char **argv)
+{
+	Itdb_iTunesDB *db;
+	GError *error;
+
+	if (argc != 2) {
+		g_print ("Usage:\n");
+		g_print ("%s <mountpoint>\n", g_basename (argv[0]));
+		exit (1);
+	}
+
+	db = itdb_create (argv[1]);
+
+	if (db == NULL) {
+		g_print ("Error creating iPod database\n");
+		exit (1);
+	}
+
+	error = NULL;
+	fill_db (db, &error);
+	if (error) {
+		g_print ("Error reading music files\n");
+		if (error->message) {
+			g_print("%s\n", error->message);
+		}
+		g_error_free (error);
+		exit (1);
+	}
+
+	itdb_write (db, &error);
+	if (error) {
+		g_print ("Error writing iPod database\n");
+		if (error->message) {
+			g_print("%s\n", error->message);
+		}
+		g_error_free (error);
+		exit (1);
+	}
+
+	itdb_free (db);
+
+	return 0;
+}




More information about the Pkg-gtkpod-devel mailing list