Index: cups-1.1.23/cups/Makefile
===================================================================
--- cups-1.1.23.orig/cups/Makefile
+++ cups-1.1.23/cups/Makefile
@@ -109,7 +109,7 @@ installhdrs:
 
 libcups.so.2 libcups.sl.2:	$(LIBOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS)
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS)
 	$(RM) `basename $@ .2`
 	$(LN) $@ `basename $@ .2`
 
@@ -120,7 +120,7 @@ libcups.so.2 libcups.sl.2:	$(LIBOBJS) ..
 
 libcups.2.dylib:	$(LIBOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -o $@ \
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -o $@ \
 		-install_name $(libdir)/$@ \
 		-current_version 2.7.0 \
 		-compatibility_version 2.0.0 \
@@ -137,7 +137,7 @@ libcups_s.a:	$(LIBOBJS) ../Makedefs
 	echo Creating $@...
 	$(RM) libcups_s.exp
 	(echo _ipp_add_attr; echo _ipp_free_attr) >libcups_s.exp
-	$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) -lm
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) -lm
 	$(RM) $@
 	$(AR) $(ARFLAGS) $@ libcups_s.o
 
@@ -148,7 +148,7 @@ libcups_s.a:	$(LIBOBJS) ../Makedefs
 
 libcups.la:    $(LIBOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
 		-version-info 2:7 $(SSLLIBS) $(COMMONLIBS)
 
 
Index: cups-1.1.23/filter/Makefile
===================================================================
--- cups-1.1.23.orig/filter/Makefile
+++ cups-1.1.23/filter/Makefile
@@ -130,7 +130,7 @@ hpgltops:	$(HPGLOBJS) common.o ../Makede
 
 libcupsimage.so.2 libcupsimage.sl.2:	$(IMAGEOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) -lm
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) -lm
 	$(RM) `basename $@ .2`
 	$(LN) $@ `basename $@ .2`
 
@@ -141,7 +141,7 @@ libcupsimage.so.2 libcupsimage.sl.2:	$(I
 
 libcupsimage.2.dylib:	$(IMAGEOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -o $@  \
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -o $@  \
 		-install_name $(libdir)/$@ \
 		-current_version 2.1.0 \
 		-compatibility_version 2.0.0 \
@@ -156,7 +156,7 @@ libcupsimage.2.dylib:	$(IMAGEOBJS) ../Ma
 
 libcupsimage_s.a:	$(IMAGEOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -Wl,-berok -o libcupsimage_s.o $(IMAGEOBJS) \
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -Wl,-berok -o libcupsimage_s.o $(IMAGEOBJS) \
 		$(DSOLIBS) -lm
 	$(RM) $@
 	$(AR) $(ARFLAGS) $@ libcupsimage_s.o
@@ -168,7 +168,7 @@ libcupsimage_s.a:	$(IMAGEOBJS) ../Makede
 
 libcupsimage.la:       $(IMAGEOBJS) ../Makedefs
 	echo Linking $@...
-	$(DSO) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
+	$(DSO) $(LDFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
 		-rpath $(LIBDIR) -version-info 2:1
 
 
