diff -Nurd -x'*~' paragui-1.1.8.orig/bindings/python/Makefile.in paragui-1.1.8/bindings/python/Makefile.in
--- paragui-1.1.8.orig/bindings/python/Makefile.in	2004-10-18 14:58:35.000000000 -0400
+++ paragui-1.1.8/bindings/python/Makefile.in	2008-09-15 00:55:03.000000000 -0400
@@ -208,13 +208,13 @@
 	$(SDL_LIBS) \
 	$(IMAGE_LIBS) \
 	$(LIBSTDCPP) \
-	-lparagui -L$(top_srcdir)/src
+	-L$(top_srcdir)/src/libparagui.la
 
 INCLUDES = \
-	$(SDL_CFLAGS) \
 	-I$(top_srcdir)/include \
-	-I$(PYTHON_INCLUDE_DIR) \
-	-I../../include
+	-I../../include \
+	$(SDL_CFLAGS) \
+	-I$(PYTHON_INCLUDE_DIR)
 
 OBJECTS = \
 	paraguic_wrap.o
diff -Nurd -x'*~' paragui-1.1.8.orig/bindings/ruby/Makefile.in paragui-1.1.8/bindings/ruby/Makefile.in
--- paragui-1.1.8.orig/bindings/ruby/Makefile.in	2004-10-18 14:58:36.000000000 -0400
+++ paragui-1.1.8/bindings/ruby/Makefile.in	2008-09-15 00:54:26.000000000 -0400
@@ -204,14 +204,13 @@
 PGHEADERS = $(shell ls $(top_srcdir)/include/*.h)
 LINK = $(COMPILE) -shared \
 	-L@prefix@/lib \
-	-L$(top_srcdir)/src \
 	$(PARAGUI_LIBS)
 
 INCLUDES = \
-	$(SDL_CFLAGS) \
 	-I$(top_srcdir)/include \
-	-I$(RUBY_INCLUDE_DIR) \
-	-I../../include
+	-I../../include \
+	$(SDL_CFLAGS) \
+	-I$(RUBY_INCLUDE_DIR)
 
 OBJECTS = \
 	paraguic_wrap.o
diff -Nurd -x'*~' paragui-1.1.8.orig/configure paragui-1.1.8/configure
--- paragui-1.1.8.orig/configure	2004-10-18 14:58:43.000000000 -0400
+++ paragui-1.1.8/configure	2008-09-15 09:20:44.000000000 -0400
@@ -19340,7 +19340,7 @@
 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
 # Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+LIBTOOL='@PREFIX@/bin/glibtool'
 
 # Prevent multiple expansion
 
@@ -21257,8 +21257,7 @@
 fi
 
 # check name of shared lib SDL_image
-SDLimage_PATH=`ls $SDL_PREFIX/lib/*SDL_image*.* | head -1`
-SDLimage_lib=`basename $SDLimage_PATH`
+SDL_LIBS="$SDL_LIBS -lSDL_image"
 
 cat >>confdefs.h <<_ACEOF
 #define SDLIMAGE_LIB "$SDLimage_lib"
diff -Nurd -x'*~' paragui-1.1.8.orig/src/Makefile.in paragui-1.1.8/src/Makefile.in
--- paragui-1.1.8.orig/src/Makefile.in	2004-10-18 14:58:38.000000000 -0400
+++ paragui-1.1.8/src/Makefile.in	2008-09-15 09:15:09.000000000 -0400
@@ -238,6 +238,7 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 
 libparagui_la_LIBADD = \
+	$(FREETYPE_LIBS) \
 	$(SIGC_LIBS) \
 	$(SDL_LIBS) \
 	$(EXPAT_LIB) \
@@ -251,9 +252,9 @@
 	$(LIBSTDCPP)
 
 INCLUDES = \
+	-I$(top_srcdir)/include \
 	$(SIGC_CFLAGS) \
-	$(SDL_CFLAGS) \
-	-I$(top_srcdir)/include
+	$(SDL_CFLAGS)
 
 all: all-recursive
 
diff -Nurd -x'*~' paragui-1.1.8.orig/src/core/Makefile.in paragui-1.1.8/src/core/Makefile.in
--- paragui-1.1.8.orig/src/core/Makefile.in	2004-10-18 14:58:38.000000000 -0400
+++ paragui-1.1.8/src/core/Makefile.in	2008-09-15 00:39:05.000000000 -0400
@@ -261,10 +261,10 @@
 	physfsrwops.h
 
 INCLUDES = \
+	-I$(top_srcdir)/include \
 	$(SIGC_CFLAGS) \
 	$(SDL_CFLAGS) \
-	$(PHYSFS_INCLUDE) \
-	-I$(top_srcdir)/include
+	$(PHYSFS_INCLUDE)
 
 all: all-am
 
diff -Nurd -x'*~' paragui-1.1.8.orig/src/core/pgfilearchive.cpp paragui-1.1.8/src/core/pgfilearchive.cpp
--- paragui-1.1.8.orig/src/core/pgfilearchive.cpp	2004-03-13 08:45:44.000000000 -0500
+++ paragui-1.1.8/src/core/pgfilearchive.cpp	2008-09-15 00:24:09.000000000 -0400
@@ -39,10 +39,14 @@
 
 Uint32 PG_FileArchive::my_instance_count = 0;
 PG_SurfaceCache PG_FileArchive::my_cache;
+#ifndef EXPLICITLY_LINKING_SDL_IMAGE
 static void* SDL_image_obj = NULL;
 
 typedef SDL_Surface* (*IMG_Load_RW_FT)(SDL_RWops* src, int freesrc);
 static IMG_Load_RW_FT IMG_Load_RW_FUNC = NULL;
+#else
+#    include "SDL_image.h"
+#endif
 
 PG_FileArchive::PG_FileArchive() {
 
@@ -56,6 +60,7 @@
 			return;
 		}
 
+#ifndef EXPLICITLY_LINKING_SDL_IMAGE
 		// try different names to find SDL_image
 		SDL_image_obj = SDL_LoadObject(SDLIMAGE_LIB);
 		if(SDL_image_obj == NULL) {
@@ -69,6 +74,7 @@
 				SDL_image_obj = NULL;
 			}
 		}
+#endif
 	}
 
 }
@@ -84,10 +90,12 @@
 
 	if(my_instance_count == 0) {
 		Deinit();
+#ifndef EXPLICITLY_LINKING_SDL_IMAGE
 		if(SDL_image_obj != NULL) {
 			SDL_UnloadObject(SDL_image_obj);
 			SDL_image_obj = NULL;
 		}
+#endif
 	}
 }
 
@@ -308,12 +316,16 @@
 		return NULL;
 	}
 
+#ifndef EXPLICITLY_LINKING_SDL_IMAGE
 	if(IMG_Load_RW_FUNC != NULL) {
 		surface = IMG_Load_RW_FUNC(rw, 1);
 	}
 	else {
 		surface = SDL_LoadBMP_RW(rw, 1);
 	}
+#else
+	surface = IMG_Load_RW(rw, 1);
+#endif
 
 	if(surface == NULL) {
 		PG_LogWRN("Failed to load imagedata from '%s' !", filename);
diff -Nurd -x'*~' paragui-1.1.8.orig/src/draw/Makefile.in paragui-1.1.8/src/draw/Makefile.in
--- paragui-1.1.8.orig/src/draw/Makefile.in	2004-10-18 14:58:38.000000000 -0400
+++ paragui-1.1.8/src/draw/Makefile.in	2008-09-15 00:39:00.000000000 -0400
@@ -235,9 +235,9 @@
 
 EXTRA_DIST = 
 INCLUDES = \
+	-I$(top_srcdir)/include \
 	$(SDL_CFLAGS) \
-	$(SIGC_CFLAGS) \
-	-I$(top_srcdir)/include
+	$(SIGC_CFLAGS)
 
 all: all-am
 
diff -Nurd -x'*~' paragui-1.1.8.orig/src/font/Makefile.in paragui-1.1.8/src/font/Makefile.in
--- paragui-1.1.8.orig/src/font/Makefile.in	2004-10-18 14:58:39.000000000 -0400
+++ paragui-1.1.8/src/font/Makefile.in	2008-09-15 00:38:53.000000000 -0400
@@ -225,9 +225,9 @@
 	facecache.h
 
 INCLUDES = \
+	-I$(top_srcdir)/include \
 	$(SIGC_CFLAGS) \
-	$(SDL_CFLAGS) \
-	-I$(top_srcdir)/include
+	$(SDL_CFLAGS)
 
 all: all-am
 
diff -Nurd -x'*~' paragui-1.1.8.orig/src/themes/Makefile.in paragui-1.1.8/src/themes/Makefile.in
--- paragui-1.1.8.orig/src/themes/Makefile.in	2004-10-18 14:58:39.000000000 -0400
+++ paragui-1.1.8/src/themes/Makefile.in	2008-09-15 00:38:23.000000000 -0400
@@ -222,10 +222,10 @@
 	theme_priv.cpp
 
 INCLUDES = \
+	-I$(top_srcdir)/include \
 	$(SIGC_CFLAGS) \
 	$(EXPAT_INCLUDE) \
-	$(SDL_CFLAGS) \
-	-I$(top_srcdir)/include
+	$(SDL_CFLAGS)
 
 EXTRA_DIST = \
 	theme_priv.h
diff -Nurd -x'*~' paragui-1.1.8.orig/src/widgets/Makefile.in paragui-1.1.8/src/widgets/Makefile.in
--- paragui-1.1.8.orig/src/widgets/Makefile.in	2004-10-18 14:58:40.000000000 -0400
+++ paragui-1.1.8/src/widgets/Makefile.in	2008-09-15 00:38:17.000000000 -0400
@@ -286,10 +286,10 @@
 
 EXTRA_DIST = 
 INCLUDES = \
+	-I$(top_srcdir)/include \
 	$(SIGC_CFLAGS) \
 	$(EXPAT_INCLUDE) \
-	$(SDL_CFLAGS) \
-	-I$(top_srcdir)/include
+	$(SDL_CFLAGS)
 
 all: all-am
 
diff -Nurd -x'*~' paragui-1.1.8.orig/src/ystring/Makefile.in paragui-1.1.8/src/ystring/Makefile.in
--- paragui-1.1.8.orig/src/ystring/Makefile.in	2004-10-18 14:58:40.000000000 -0400
+++ paragui-1.1.8/src/ystring/Makefile.in	2008-09-15 00:38:09.000000000 -0400
@@ -222,8 +222,8 @@
 
 EXTRA_DIST = 
 INCLUDES = \
-	$(SDL_CFLAGS) \
-	-I$(top_srcdir)/include
+	-I$(top_srcdir)/include \
+	$(SDL_CFLAGS)
 
 all: all-am
 
diff -Nurd -x'*~' paragui-1.1.8.orig/test/Makefile.in paragui-1.1.8/test/Makefile.in
--- paragui-1.1.8.orig/test/Makefile.in	2004-10-18 14:58:41.000000000 -0400
+++ paragui-1.1.8/test/Makefile.in	2008-09-15 00:53:28.000000000 -0400
@@ -317,7 +317,7 @@
 	fireworks \
 	colorselector
 
-LFLAGS = $(SDL_LIBS) -L../src ../src/libparagui.la $(FREETYPE_LIBS)
+LFLAGS = $(SDL_LIBS) ../src/libparagui.la $(FREETYPE_LIBS)
 cairotest_SOURCES = cairotest.cpp
 cairotest_LDADD = $(LFLAGS) -lcairo -lpixman
 unicodetest_SOURCES = unicodetest.cpp
@@ -358,7 +358,7 @@
 windowtest_LDADD = $(LFLAGS)
 layouttest_SOURCES = layouttest.cpp
 layouttest_LDADD = $(LFLAGS)
-INCLUDES = $(PARAGUI_CFLAGS) -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include $(PARAGUI_CFLAGS)
 EXTRA_DIST = \
 	dblbuffer.xml \
 	pokus.xml \
diff -Nurd -x'*~' paragui-1.1.8.orig/test/colorselector/Makefile.in paragui-1.1.8/test/colorselector/Makefile.in
--- paragui-1.1.8.orig/test/colorselector/Makefile.in	2004-10-18 14:58:41.000000000 -0400
+++ paragui-1.1.8/test/colorselector/Makefile.in	2008-09-15 00:53:44.000000000 -0400
@@ -223,7 +223,7 @@
 	pgcolorselector.cpp \
 	main.cpp
 
-colorselector_LDADD = $(SDL_LIBS) -L../../src ../../src/libparagui.la $(FREETYPE_LIBS)
+colorselector_LDADD = $(SDL_LIBS) ../../src/libparagui.la $(FREETYPE_LIBS)
 EXTRA_DIST = \
 	pgcolorselector.h
 
diff -Nurd -x'*~' paragui-1.1.8.orig/test/fireworks/Makefile.in paragui-1.1.8/test/fireworks/Makefile.in
--- paragui-1.1.8.orig/test/fireworks/Makefile.in	2004-10-18 14:58:41.000000000 -0400
+++ paragui-1.1.8/test/fireworks/Makefile.in	2008-09-15 00:53:39.000000000 -0400
@@ -222,7 +222,7 @@
 	blob.cpp \
 	main.cpp
 
-fireworks_LDADD = $(SDL_LIBS) -L../../src ../../src/libparagui.la $(FREETYPE_LIBS)
+fireworks_LDADD = $(SDL_LIBS) ../../src/libparagui.la $(FREETYPE_LIBS)
 EXTRA_DIST = \
 	blob.h
 
diff -Nurd -x'*~' paragui-1.1.8.orig/test/keyboard/Makefile.in paragui-1.1.8/test/keyboard/Makefile.in
--- paragui-1.1.8.orig/test/keyboard/Makefile.in	2004-10-18 14:58:42.000000000 -0400
+++ paragui-1.1.8/test/keyboard/Makefile.in	2008-09-15 00:53:35.000000000 -0400
@@ -222,7 +222,7 @@
 	keyboard.cpp \
 	main.cpp
 
-keyboard_LDADD = $(SDL_LIBS) -L../../src ../../src/libparagui.la $(FREETYPE_LIBS)
+keyboard_LDADD = $(SDL_LIBS) ../../src/libparagui.la $(FREETYPE_LIBS)
 EXTRA_DIST = \
 	keyboard.h
 
