Index: src/main.cc
===================================================================
--- src/main.cc	(revision 136)
+++ src/main.cc	(working copy)
@@ -211,7 +211,11 @@
     // get the locale and export it to the environment
     CFLocaleRef locale = CFLocaleCopyCurrent();
     CFStringRef name = CFLocaleGetIdentifier(locale);
-    language = CFStringGetCStringPtr(name, NULL);
+    const char *tmp=CFStringGetCStringPtr(name, NULL);
+    if(tmp)
+    {
+        language = tmp;
+    }
     CFRelease(locale);
     return language;
 }
@@ -413,28 +417,9 @@
     // then chdir to ../Resources. The original SDL implementation chdirs to
     // "../../..", i.e. the directory the bundle is placed in. This breaks
     // the self-containedness.
-    char parentdir[1024];
-    char *c;
-
-    strncpy ( parentdir, progCallPath.c_str(), sizeof(parentdir) );
-    c = (char*) parentdir;
-
-    while (*c != '\0')     /* go to end */
-        c++;
-
-    while (*c != '/')      /* back up to parent */
-        c--;
-
-    *c++ = '\0';           /* cut off last part (binary name) */
-
-    chdir (parentdir);  /* chdir to the binary app's parent */
-    chdir ("../Resources/"); /* chdir to the .app's parent */
+	
+    systemAppDataPath = progDir + "/../Resources/data";
     
-    systemAppDataPath = "./data";
-    
-// to be tested and used as substitution for the code above:
-//     systemAppDataPath = progDir + "/../Resources/data";
-    
 #else
     // Unix -- we get our data path from the installation
     systemAppDataPath = systemPath;
@@ -450,6 +435,8 @@
     if (progDirExists) {
         l18nPath = progDir + "/" + l18nPath;
     }
+#elif MACOSX
+    l18nPath = progDir + "/../Resources/locale";
 #endif
     Log << "l18nPath = \"" << l18nPath << "\"\n"; 
     
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 136)
+++ src/Makefile.am	(working copy)
@@ -190,7 +190,6 @@
 #------------------ Packaging rules for Mac OSX ------------------------
 
 bundle_name = ../Enigma.app
-bundle_locales = de.gmo
 # Special target to copy all needed game files to Enigma.app/Contents/Resources.
 # For Mac OS X bundle.
 bundle:
@@ -198,39 +197,37 @@
 	mkdir -p $(bundle_name)/Contents/Resources
 	mkdir -p $(bundle_name)/Contents/Resources/data/
 	echo "APPL????" > $(bundle_name)/Contents/PkgInfo
-	cp ../$(top_builddir)/etc/Info.plist $(bundle_name)/Contents/
-	cp ../$(top_builddir)/etc/enigma.icns $(bundle_name)/Contents/Resources/
-	cp -R ../$(top_builddir)/data/levels $(bundle_name)/Contents/Resources/data/
-	cp ../$(top_builddir)/data/*.lua $(bundle_name)/Contents/Resources/data/
+	cp $(top_builddir)/etc/Info.plist $(bundle_name)/Contents/
+	cp $(top_builddir)/etc/enigma.icns $(bundle_name)/Contents/Resources/
+	cp -R $(top_builddir)/data/levels $(bundle_name)/Contents/Resources/data/
+	cp $(top_builddir)/data/*.lua $(bundle_name)/Contents/Resources/data/
 	mkdir -p $(bundle_name)/Contents/Resources/data/gfx
-	cp -R ../$(top_builddir)/data/gfx/*.png $(bundle_name)/Contents/Resources/data/gfx
+	cp -R $(top_builddir)/data/gfx/*.png $(bundle_name)/Contents/Resources/data/gfx
 	mkdir -p $(bundle_name)/Contents/Resources/data/gfx32
-	cp -R ../$(top_builddir)/data/gfx32/*.png $(bundle_name)/Contents/Resources/data/gfx32
-	cp -R ../$(top_builddir)/data/gfx32/*.jpg $(bundle_name)/Contents/Resources/data/gfx32
+	cp -R $(top_builddir)/data/gfx32/*.png $(bundle_name)/Contents/Resources/data/gfx32
+	cp -R $(top_builddir)/data/gfx32/*.jpg $(bundle_name)/Contents/Resources/data/gfx32
 	mkdir -p $(bundle_name)/Contents/Resources/data/gfx40
-	cp -R ../$(top_builddir)/data/gfx40/*.png $(bundle_name)/Contents/Resources/data/gfx40
-	cp -R ../$(top_builddir)/data/gfx40/*.jpg $(bundle_name)/Contents/Resources/data/gfx40
+	cp -R $(top_builddir)/data/gfx40/*.png $(bundle_name)/Contents/Resources/data/gfx40
+	cp -R $(top_builddir)/data/gfx40/*.jpg $(bundle_name)/Contents/Resources/data/gfx40
 	mkdir -p $(bundle_name)/Contents/Resources/data/gfx48
-	cp -R ../$(top_builddir)/data/gfx48/*.png $(bundle_name)/Contents/Resources/data/gfx48
-	cp -R ../$(top_builddir)/data/gfx48/*.jpg $(bundle_name)/Contents/Resources/data/gfx48
+	cp -R $(top_builddir)/data/gfx48/*.png $(bundle_name)/Contents/Resources/data/gfx48
+	cp -R $(top_builddir)/data/gfx48/*.jpg $(bundle_name)/Contents/Resources/data/gfx48
 	mkdir -p $(bundle_name)/Contents/Resources/data/sound
-	cp -R ../$(top_builddir)/data/sound/*.wav $(bundle_name)/Contents/Resources/data/sound
-	cp -R ../$(top_builddir)/data/sound/*.s3m $(bundle_name)/Contents/Resources/data/sound
+	cp -R $(top_builddir)/data/sound/*.wav $(bundle_name)/Contents/Resources/data/sound
+	cp -R $(top_builddir)/data/sound/*.s3m $(bundle_name)/Contents/Resources/data/sound
 	mkdir -p $(bundle_name)/Contents/Resources/data/fonts
-	cp ../$(top_builddir)/data/fonts/*.png $(bundle_name)/Contents/Resources/data/fonts
-	cp ../$(top_builddir)/data/fonts/*.bmf $(bundle_name)/Contents/Resources/data/fonts
-	cp ../$(top_builddir)/data/fonts/*.ttf $(bundle_name)/Contents/Resources/data/fonts
+	cp $(top_builddir)/data/fonts/*.png $(bundle_name)/Contents/Resources/data/fonts
+	cp $(top_builddir)/data/fonts/*.bmf $(bundle_name)/Contents/Resources/data/fonts
+	cp $(top_builddir)/data/fonts/*.ttf $(bundle_name)/Contents/Resources/data/fonts
 	mkdir -p $(bundle_name)/Contents/Frameworks
-	cp -r /Library/Frameworks/SDL.framework $(bundle_name)/Contents/Frameworks/
-	cp -r /Library/Frameworks/SDL_image.framework $(bundle_name)/Contents/Frameworks/
-	cp -r /Library/Frameworks/SDL_mixer.framework $(bundle_name)/Contents/Frameworks/
-	@catalogs='$(bundle_locales)'; \
-	for cat in $$catalogs; do \
-	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
-	  dir=$(bundle_name)/Contents/Resources/locale/$$lang/LC_MESSAGES; \
+	cp -R /Library/Frameworks/SDL.framework $(bundle_name)/Contents/Frameworks/
+	cp -R /Library/Frameworks/SDL_image.framework $(bundle_name)/Contents/Frameworks/
+	cp -R /Library/Frameworks/SDL_mixer.framework $(bundle_name)/Contents/Frameworks/
+	for cat in $(ALL_LINGUAS); do \
+	  dir=$(bundle_name)/Contents/Resources/locale/$$cat/LC_MESSAGES; \
 	  mkdir -p $$dir; \
 	  echo "installing $$cat as $$dir/enigma.mo"; \
-	  cp -r ../$(top_builddir)/po/$$cat $$dir/enigma.mo; \
+	  cp -r $(top_builddir)/po/$$cat.gmo $$dir/enigma.mo; \
 	done
 
 # Special target to copy the binary to Enigma.app/Contents/MacOS.
@@ -239,5 +236,6 @@
 	strip $(bundle_name)/Contents/MacOS/enigma
 
 # Special target to create a binary linked with Mac OS X frameworks
+static_prefix = /usr/fink
 enigma-fw-mosx: $(enigma_OBJECTS) $(enigma_DEPENDENCIES)
-	$(CXX) $(LDFLAGS) -o enigma-fw $(enigma_OBJECTS) $(enigma_DEPENDENCIES) /usr/fink/lib/libintl.a /usr/lib/libiconv.dylib -lsdlmain -lz -framework SDL -framework SDL_image -framework SDL_mixer -framework IOKit -framework Cocoa -framework OpenGL -framework Carbon -framework QuickTime -framework SDL_ttf /usr/fink/lib/libpng.a
+	$(CXX) $(LDFLAGS) -o enigma-fw $(enigma_OBJECTS) $(enigma_DEPENDENCIES) $(static_prefix)/lib/libintl.a $(static_prefix)/lib/libxerces-c.a /usr/lib/libiconv.dylib -L$(static_prefix)/lib -lsdlmain -lz -framework SDL -framework SDL_image -framework SDL_mixer -framework Cocoa -framework OpenGL -framework SDL_ttf $(static_prefix)/lib/libpng.a 
Index: lib-src/zipios++/src/directory.cpp
===================================================================
--- lib-src/zipios++/src/directory.cpp	(revision 136)
+++ lib-src/zipios++/src/directory.cpp	(working copy)
@@ -24,7 +24,7 @@
 
 #include "directory.h"
 
-#if defined(unix) || defined(__unix) || defined(OS2) || defined(__unix__) || defined(MACOSX) || defined(__NetBSD__) || defined (__FreeBSD__) || defined (__OpenBSD__)
+#if defined(unix) || defined(__unix) || defined(OS2) || defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined (__FreeBSD__) || defined (__OpenBSD__)
 #  define BOOST_UNIX 1
 #elif defined(_WINDOWS) || defined(__MINGW32__) || defined (_MSC_VER)
 #  define BOOST_WINNT 1
Index: configure.ac
===================================================================
--- configure.ac	(revision 136)
+++ configure.ac	(working copy)
@@ -26,6 +26,11 @@
         * ) LINUX=no;;
 esac
 
+case $host_os in
+ *darwin* ) MACOSX=yes;;
+       * ) MACOSX=no;;
+esac
+
 AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes)
 AM_CONDITIONAL(LINUX, test x$LINUX = xyes)
 
@@ -52,6 +57,13 @@
 fi
 AC_SUBST(WINDRES)
 
+dnl Add -DMACOSX to CXXFLAGS and CFLAGS if working under darwin
+if test "x$MACOSX" = xyes; then
+ CXXFLAGS="$CXXFLAGS -DMACOSX"
+ CFLAGS="$CFLAGS -DMACOSX"
+ CPPFLAGS="$CXXFLAGS -DMACOSX"
+fi
+
 dnl ---------- Texi2html ----------
 AC_PATH_PROG(TEXI2HTML, texi2html, "")
 
@@ -116,12 +128,17 @@
   AC_DEFINE(HAVE_SDLTTF, , [Whether SDL_ttf library was found during configure])
 else
   AC_MSG_CHECKING([for SDL_ttf >=2.0.6])
-  AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <SDL/SDL_ttf.h>]],
-        [[if (TTF_MAJOR_VERSION < 2)
+  AC_RUN_IFELSE([AC_LANG_SOURCE(
+        [[#include <SDL_ttf.h>
+         int
+         main(int argc, char *argv[])
+         {
+         if (TTF_MAJOR_VERSION < 2)
             return 1;
           else if (TTF_MAJOR_VERSION == 2 && TTF_MINOR_VERSION == 0 && TTF_PATCHLEVEL < 6) 
             return 1;
-          return 0;]])],
+          return 0;
+         }]])],
       [AC_MSG_RESULT([found])],
       [AC_MSG_ERROR([SDL_ttf >= 2.0.6 not found.])])
   AC_CHECK_LIB(SDL_ttf, main,,[AC_MSG_ERROR([SDL_ttf is required to compile Enigma])])
Index: doc/manual/Makefile.am
===================================================================
--- doc/manual/Makefile.am	(revision 136)
+++ doc/manual/Makefile.am	(working copy)
@@ -14,7 +14,7 @@
 $(HTML) : enigma.texi
 	@if [ "${TEXI2HTML}" ]; then \
 	  echo "Running texi2html"; \
-	  ${TEXI2HTML} -toc_file=index.html -split=chapter -output=. -nosec_nav $(srcdir)/enigma.texi; \
+	  ${TEXI2HTML} -toc_file=index.html -split=chapter -output=enigma.html -nosec_nav $(srcdir)/enigma.texi; \
 	else \
 	  echo "Warning: texi2html not found"; \
 	fi



