+AM_CFLAGS = $(WX_CFLAGS)
+if WIN32
+AM_CPPFLAGS = $(WX_CPPFLAGS) -DBUILDING_PLUGIN -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0
+else
+AM_CPPFLAGS = $(WX_CPPFLAGS)
+endif
+AM_CXXFLAGS = $(WX_CXXFLAGS)
+if WIN32
+AM_LDFLAGS = $(WX_LIBS) -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import
+else
+AM_LDFLAGS = $(WX_LIBS)
+endif
+
Why are you doing this all over the place?
Have you tried to put it in the configure.in/.ac?
Why don't you define a CROSS_COMP_CFLAGS/LDFLAGS in the configure.in/.ac and then used them, when they are needed?
If the current compile is not for CrossComp, define them blank.
This way the ifdefs will be only in one file.