####################### GENERAL SETTINGS ############################
-
-EXTRALIBS = @EXTRA_LIBS@
+# see comment near LDFLAGS at the end of file
+EXTRALIBS = @LDFLAGS@ @EXTRA_LIBS@
LDLIBS = ${top_builddir}/lib/@WX_TARGET_LIBRARY@ $(EXTRALIBS)
TOOLKIT = @TOOLKIT@
CFLAGS = @TOOLKIT_DEF@ @CODE_GEN_FLAGS@ @WXDEBUG_DEFINE@ @CFLAGS@ @CPPFLAGS@
CPPFLAGS = @TOOLKIT_DEF@ @CODE_GEN_FLAGS@ @WXDEBUG_DEFINE@ @CXXFLAGS@ @CPPFLAGS@
PICFLAGS = @PIC_FLAG@
-LDFLAGS = @LDFLAGS@
+# taking into account how SHARED_LD is defined, appending LDFLAGS to it
+# doesn't work, so we put them in the end of the linker command line in
+# EXTRALIBS instead (see above)
+# LDFLAGS = @LDFLAGS@