-for i in $plugin_subdirs
-do
- suffix=`echo $i | tr /a-z _A-Z`
- echo "/* enabled plugin: $i */" >> config.h
- echo "#define PLUGIN_$suffix 1" >> config.h
-done
-
-$AWK -f $CONF_DIR_NAME/filter.awk < config.h | sed -f $CONF_DIR_NAME/filter.sed > ir/config/firm_config.h
+AC_CONFIG_COMMANDS([firm_config.h],
+ [awk -f ${ac_top_srcdir}/filter.awk < ${ac_top_builddir}config.h > ${ac_top_builddir}ir/config/firm_config.h])
+
+BACKENDS=""
+if test "$enable_backend" == yes; then
+ BACKENDS="arm ia32 mips ppc32"
+fi
+AC_SUBST([BACKENDS])
+
+if test "$BACKENDS"; then
+ AC_CONFIG_FILES([ir/be/Makefile])
+ for backend in $BACKENDS; do
+ AC_CONFIG_FILES([ir/be/$backend/Makefile])
+ done
+fi
+
+AC_OUTPUT
+
+dnl output summary of firm configuration
+echo ""
+echo "firm configuration summary:"
+echo " backends $BACKENDS"
+echo " profiling $enable_profile_libfirm"
+echo " debug/verifiers $enable_debug_libfirm"
+echo " assertions $enable_assert"
+echo " hooks $enable_hooks"
+echo " statistics $enable_statistics"
+echo " libcore $enable_libcore"
+echo " ilp $enable_ilp"
+echo " jvm $enable_jvm"
+echo " wide char support $enable_wchar_support"
+echo " external effects xml $enable_external_effects"
+echo " plugins $plugin_subdirs"
+echo ""
+
+dnl FIXME: this is bad
+dnl for i in $plugin_subdirs
+dnl do
+dnl suffix=`echo $i | tr /a-z _A-Z`
+dnl echo "/* enabled plugin: $i */" >> config.h
+dnl echo "#define PLUGIN_$suffix 1" >> config.h
+dnl done