Index: libstxxl1/lib/GNUmakefile
===================================================================
--- libstxxl1.orig/lib/GNUmakefile	2013-08-31 00:41:46.000000000 +0200
+++ libstxxl1/lib/GNUmakefile	2013-08-31 00:47:44.000000000 +0200
@@ -21,7 +21,7 @@
 ifeq ($(strip $(ENABLE_SHARED)),yes)
 	$(RM) $@.*
 	# build shared library
-	$(LINKER) -shared -Wl,-soname=lib$(LIBNAME).so.$(SOVERSION) -lpthread -o lib$(LIBNAME).so.$(LIBVERSION) $(LIB_OBJECTS)
+	$(LINKER) $(LDFLAGS) $(CPPFLAGS) -shared -Wl,-soname=lib$(LIBNAME).so.$(SOVERSION) -lpthread -o lib$(LIBNAME).so.$(LIBVERSION) $(LIB_OBJECTS) $(LD_FLAGS)
 	ln -sf lib$(LIBNAME).so.$(LIBVERSION) lib$(LIBNAME).so.$(SOVERSION)
 	ln -sf lib$(LIBNAME).so.$(SOVERSION) lib$(LIBNAME).so
 else
Index: libstxxl1/Makefile.gnu
===================================================================
--- libstxxl1.orig/Makefile.gnu	2013-08-31 00:41:46.000000000 +0200
+++ libstxxl1/Makefile.gnu	2013-08-31 00:47:19.000000000 +0200
@@ -28,7 +28,7 @@
 
 # compute STXXL_CPPFLAGS/STXXL_LDLIBS for stxxl.mk
 # don't include optimization, warning and debug flags
-stxxl_mk_cppflags	+= $(STXXL_CPPFLAGS_CXX)
+stxxl_mk_cppflags	+= $(STXXL_CPPFLAGS_CXX) $(CPPFLAGS) $(CXXFLAGS)
 stxxl_mk_ldlibs		+= $(STXXL_LDLIBS_CXX)
 stxxl_mk_cppflags	+= $$(STXXL_CPPFLAGS_STXXL)
 stxxl_mk_ldlibs		+= $$(STXXL_LDLIBS_STXXL)
