Index: converter/other/jpeg2000/jpeg2ktopam.c
--- converter/other/jpeg2000/jpeg2ktopam.c.orig	2007-12-27 23:32:59 +0100
+++ converter/other/jpeg2000/jpeg2ktopam.c	2009-09-28 17:42:28 +0200
@@ -10,7 +10,6 @@
 
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 /* Make sure strdup() is in string.h and int_fast32_t is in inttypes.h */
-#define _XOPEN_SOURCE 600
 #include <string.h>
 
 #include "pam.h"
Index: converter/other/jpeg2000/pamtojpeg2k.c
--- converter/other/jpeg2000/pamtojpeg2k.c.orig	2007-12-27 23:32:59 +0100
+++ converter/other/jpeg2000/pamtojpeg2k.c	2009-09-28 17:42:41 +0200
@@ -10,7 +10,6 @@
 
 #define _BSD_SOURCE 1    /* Make sure strdup() is in string.h */
 /* Make sure strdup() is in string.h and int_fast32_t is in inttypes.h */
-#define _XOPEN_SOURCE 600
 #include <string.h>
 
 #include "pam.h"
Index: lib/libpm.c
--- lib/libpm.c.orig	2006-08-19 05:12:28 +0200
+++ lib/libpm.c	2009-09-28 17:41:00 +0200
@@ -669,7 +669,7 @@
 pm_openr(const char * const name) {
     FILE* f;
 
-    if (strcmp(name, "-") == 0)
+    if (name == NULL || strcmp(name, "-") == 0)
         f = stdin;
     else {
 #ifndef VMS
@@ -691,7 +691,7 @@
 pm_openw(const char * const name) {
     FILE* f;
 
-    if (strcmp(name, "-") == 0)
+    if (name == NULL || strcmp(name, "-") == 0)
         f = stdout;
     else {
 #ifndef VMS
Index: lib/pm_gamma.h
--- lib/pm_gamma.h.orig	2006-08-19 05:12:28 +0200
+++ lib/pm_gamma.h	2009-09-28 17:41:00 +0200
@@ -12,7 +12,7 @@
 } /* to fake out automatic code indenters */
 #endif
 
-static __inline__ float
+static float
 pm_gamma709(float const intensity) {
 
     /* Here are parameters of the gamma transfer function
@@ -41,7 +41,7 @@
 
 
 
-static __inline__ float
+static float
 pm_ungamma709(float const brightness) {
 
     /* These are the same parameters as in pm_gamma, above */
Index: GNUmakefile
--- GNUmakefile.orig	2008-09-27 03:37:09 +0200
+++ GNUmakefile	2009-12-12 12:46:13 +0100
@@ -263,11 +263,7 @@
   MERGELIBS += $(X11LIB)
 endif
 
-ifeq ($(shell libpng-config --version),)
   PNGLD = $(shell $(LIBOPT) $(LIBOPTR) $(PNGLIB) $(ZLIB))
-else
-  PNGLD = $(shell libpng-config --ldflags)
-endif
 
 ifeq ($(shell xml2-config --version),)
   XML2LD=
Index: converter/other/Makefile
--- converter/other/Makefile.orig	2009-09-18 21:04:37 +0200
+++ converter/other/Makefile	2009-12-12 12:54:11 +0100
@@ -27,7 +27,6 @@
   endif
 endif
 
-ifeq ($(shell libpng-config --version),)
   ifneq ($(PNGLIB),NONE)
     HAVE_PNGLIB = Y
     ifneq ($(PNGHDR_DIR)x,x)
@@ -37,10 +36,6 @@
       INCLUDES += -I$(ZHDR_DIR)
     endif
   endif
-else
-  HAVE_PNGLIB = Y
-  INCLUDES += $(shell libpng-config --cflags)
-endif
 
 ifneq ($(JPEGLIB),NONE)
   ifneq ($(JPEGHDR_DIR)x,x)
@@ -148,11 +143,7 @@
 	$(LD) -o $@ $@.o tiff.o \
 	  $(LIBOPTS_TIFF) $(MATHLIB) $(LDFLAGS) $(LDLIBS) $(RPATH) $(LADD)
 
-ifeq ($(shell libpng-config --version),)
   PNGLIB_LIBOPTS = $(shell $(LIBOPT) $(LIBOPTR) $(PNGLIB) $(ZLIB))
-else
-  PNGLIB_LIBOPTS = $(shell libpng-config --ldflags)
-endif
 
 pngtopnm: %: %.o $(NETPBMLIB) $(LIBOPT)
 	$(LD) -o $@ $@.o \
