diff --git a/m4/moo-flags.m4 b/m4/moo-flags.m4 index 222a7324..43fba9a1 100644 --- a/m4/moo-flags.m4 +++ b/m4/moo-flags.m4 @@ -23,6 +23,7 @@ AC_DEFUN_ONCE([MOO_AC_FLAGS],[ MOO_AC_PYTHON dnl must be called after MOO_AC_PYTHON MOO_AC_LIB + MOO_AC_TOOLS([$1]) MOO_ENABLE_GENERATED_FILES="yes" AC_ARG_ENABLE(generated-files, @@ -83,6 +84,11 @@ AC_DEFUN_ONCE([MOO_AC_FLAGS],[ MOO_CFLAGS="$MOO_CFLAGS -DWIN32_LEAN_AND_MEAN -DUNICODE" MOO_WIN32_CFLAGS="-I$moo_top_src_dir/$1/mooutils/moowin32/mingw" AC_DEFINE(HAVE_MMAP, [1], [using fake mmap on windows]) + + # gettimeofday is present in recent mingw + AC_CHECK_FUNC(gettimeofday,[:],[ + MOO_WIN32_CFLAGS="$MOO_WIN32_CFLAGS -I$moo_top_src_dir/$1/mooutils/moowin32/ms" + ]) fi ################################################################################ diff --git a/m4/moo-tools.m4 b/m4/moo-tools.m4 new file mode 100644 index 00000000..2a54e223 --- /dev/null +++ b/m4/moo-tools.m4 @@ -0,0 +1,8 @@ +AC_DEFUN_ONCE([MOO_AC_TOOLS],[ + moo_srcdir=`cd $srcdir && pwd` + moo_srcdir="$moo_srcdir/$1" + AC_SUBST(moo_srcdir) + + MOO_XML2H="$moo_srcdir/mooutils/xml2h.sh" + AC_SUBST(MOO_XML2H) +]) diff --git a/medit/Makefile.am b/medit/Makefile.am index 08327de3..60b8b6f4 100644 --- a/medit/Makefile.am +++ b/medit/Makefile.am @@ -28,7 +28,6 @@ EXTRA_DIST = CLEANFILES = include ../mk/rc.mk -XML2H = $(srcdir)/../moo/mooutils/xml2h.sh medit-credits.h: ../THANKS $(XML2H) $(SHELL) $(XML2H) THANKS $(srcdir)/../THANKS > $@.tmp && \ mv $@.tmp $(srcdir)/medit-credits.h diff --git a/mk/glade.mk b/mk/glade.mk index 9542a369..c465c880 100644 --- a/mk/glade.mk +++ b/mk/glade.mk @@ -3,10 +3,10 @@ # $(glade_files) should be a list of glade files # $(glade_sources) is defined to be a list of generated *-glade.h files -%-glade.h: glade/%.glade $(top_srcdir)/moo/mooutils/xml2h.sh - $(SHELL) $(top_srcdir)/moo/mooutils/xml2h.sh `basename "$*" | sed -e "s/-/_/"`_glade_xml $< > $@.tmp && mv $@.tmp $@ -%-glade.h: %.glade $(top_srcdir)/moo/mooutils/xml2h.sh - $(SHELL) $(top_srcdir)/moo/mooutils/xml2h.sh `basename "$*" | sed -e "s/-/_/"`_glade_xml $< > $@.tmp && mv $@.tmp $@ +%-glade.h: glade/%.glade $(MOO_XML2H) + $(SHELL) $(MOO_XML2H) `basename "$*" | sed -e "s/-/_/"`_glade_xml $< > $@.tmp && mv $@.tmp $@ +%-glade.h: %.glade $(MOO_XML2H) + $(SHELL) $(MOO_XML2H) `basename "$*" | sed -e "s/-/_/"`_glade_xml $< > $@.tmp && mv $@.tmp $@ # glade_sources = $(patsubst glade/%.glade,%-glade.h,$(glade_files)) glade_sources = $(patsubst %.glade,%-glade.h,$(patsubst glade/%.glade,%-glade.h,$(glade_files))) diff --git a/mk/ui.mk b/mk/ui.mk index d0b4b941..c2e3a1a2 100644 --- a/mk/ui.mk +++ b/mk/ui.mk @@ -3,8 +3,8 @@ # $(ui_files) should be a list of ui xml files # $(ui_sources) is defined to be a list of generated *-ui.h files -%-ui.h: %.ui $(top_srcdir)/moo/mooutils/xml2h.sh - $(SHELL) $(top_srcdir)/moo/mooutils/xml2h.sh `basename "$*" | sed -e "s/-/_/"`_ui_xml $< > $@.tmp && mv $@.tmp $@ +%-ui.h: %.ui $(MOO_XML2H) + $(SHELL) $(MOO_XML2H) `basename "$*" | sed -e "s/-/_/"`_ui_xml $< > $@.tmp && mv $@.tmp $@ ui_sources = $(patsubst %.ui,%-ui.h,$(ui_files)) BUILT_SOURCES += $(ui_sources) diff --git a/moo/mooedit/plugins/activestrings/Makefile.am b/moo/mooedit/plugins/activestrings/Makefile.am index ee517169..20584ffa 100644 --- a/moo/mooedit/plugins/activestrings/Makefile.am +++ b/moo/mooedit/plugins/activestrings/Makefile.am @@ -17,7 +17,6 @@ astrings_sources = \ BUILT_SOURCES = \ as-plugin-glade.h -XML2H = $(srcdir)/../../../mooutils/xml2h.sh as-plugin-glade.h: as-plugin.glade $(XML2H) $(SHELL) $(XML2H) AS_PLUGIN_GLADE_UI $(srcdir)/as-plugin.glade > $@.tmp && \ mv $@.tmp $@ diff --git a/moo/mooedit/plugins/completion/Makefile.am b/moo/mooedit/plugins/completion/Makefile.am index 3fb86bf8..9e6a89ad 100644 --- a/moo/mooedit/plugins/completion/Makefile.am +++ b/moo/mooedit/plugins/completion/Makefile.am @@ -18,7 +18,6 @@ completion_sources = \ BUILT_SOURCES = \ completion-glade.h -XML2H = $(srcdir)/../../../mooutils/xml2h.sh completion-glade.h: completion.glade $(XML2H) $(SHELL) $(XML2H) COMPLETION_PLUGIN_GLADE_XML $(srcdir)/completion.glade > $@.tmp && \ mv $@.tmp $@