From: Matthias Andree Date: Tue, 18 Jul 2006 18:04:14 +0000 (+0000) Subject: Long-overdue build system overhaul. X-Git-Tag: mutt-1-5-13-rel~76 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a20f98cfbd963828a7068d315e14f666c332a1f;p=mutt Long-overdue build system overhaul. --- diff --git a/Makefile.am b/Makefile.am index 9dcbb1e3..5340f5aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@ mutt_SOURCES = $(BUILT_SOURCES) \ addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \ - crypt.c cryptglue.c \ + crypt.c cryptglue.c \ commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \ edit.c enter.c flags.c init.c filter.c from.c \ getdomain.c group.c \ @@ -42,7 +42,7 @@ makedoc_LDADD = makedoc_DEPENDENCIES = # $(makedoc_OBJECTS): $(makedoc_SOURCES) -# $(HOST_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) -c $< +# $(HOST_CC) $(DEFS) $(AM_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) -c $< # makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES) # @rm -rf makedoc @@ -54,7 +54,7 @@ DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \ -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \ -DHAVE_CONFIG_H=1 -INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl +AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl CPPFLAGS=@CPPFLAGS@ -I$(includedir) @@ -99,6 +99,8 @@ CLEANFILES = mutt_dotlock.c stamp-doc-rc makedoc \ keymap_alldefs.h keymap_defs.h patchlist.c \ reldate.h +DISTCLEANFILES= flea Muttrc smime_keys + ACLOCAL_AMFLAGS = -I m4 LDADD = @LIBOBJS@ @INTLLIBS@ @@ -113,12 +115,12 @@ smime_keys: $(srcdir)/smime_keys.pl cp $(srcdir)/smime_keys.pl smime_keys chmod +x smime_keys -Makefile: $(BUILT_SOURCES) - keymap_defs.h: $(OPS) $(srcdir)/gen_defs $(srcdir)/gen_defs $(OPS) > keymap_defs.h -keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs +$(srcdir)/keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs + chmod u+w $(srcdir) + rm -f $@ $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \ $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \ > $(srcdir)/keymap_alldefs.h @@ -142,6 +144,8 @@ install-exec-hook: install-data-local: Muttrc $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir) + $(INSTALL) -m644 Muttrc $(DESTDIR)$(sysconfdir)/Muttrc.dist + $(INSTALL) -m644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/mime.types.dist -if [ -f $(DESTDIR)$(pkgdatadir)/Muttrc ] ; then \ mv $(DESTDIR)$(pkgdatadir)/Muttrc* $(DESTDIR)$(sysconfdir) ; \ elif [ -f $(DESTDIR)$(pkgdatadir)/../Muttrc ] ; then \ @@ -153,6 +157,13 @@ install-data-local: Muttrc $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir); \ fi +uninstall-local: + for i in Muttrc mime.types ; do \ + if cmp -s $(DESTDIR)$(sysconfdir)/$$i.dist $(DESTDIR)$(sysconfdir)/$$i ; then \ + rm $(DESTDIR)$(sysconfdir)/$$i ; \ + fi ; \ + rm $(DESTDIR)$(sysconfdir)/$${i}.dist ; \ + done # Don't make this one ChangeLog - it's intended to be # used manually. @@ -192,7 +203,7 @@ Muttrc: stamp-doc-rc stamp-doc-rc: $(srcdir)/init.h makedoc Muttrc.head -rm -f Muttrc stamp-doc-rc - $(CPP) $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \ + $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \ $(srcdir)/init.h | ./makedoc -c | cat Muttrc.head - > Muttrc touch stamp-doc-rc diff --git a/build-release b/build-release index 8f5bac58..41a38750 100755 --- a/build-release +++ b/build-release @@ -50,7 +50,6 @@ make update-changelog # now, prepare the distribution tar balls -(cd m4 && rm -f Makefile Makefile.in Makefile.am && make -f Makefile.am.in) automake touch configure.in make config.status diff --git a/contrib/.cvsignore b/contrib/.cvsignore index f3c7a7c5..282522db 100644 --- a/contrib/.cvsignore +++ b/contrib/.cvsignore @@ -1 +1,2 @@ Makefile +Makefile.in diff --git a/contrib/Makefile.am b/contrib/Makefile.am new file mode 100644 index 00000000..363e7928 --- /dev/null +++ b/contrib/Makefile.am @@ -0,0 +1,39 @@ +# $Id$ + +subdir = contrib + +SAMPLES = Mush.rc Pine.rc gpg.rc pgp2.rc pgp5.rc pgp6.rc Tin.rc \ + sample.muttrc sample.mailcap sample.muttrc-tlr \ + colors.default colors.linux smime.rc \ + ca-bundle.crt smime_keys_test.pl + +EXTRA_DIST = language.txt language50.txt \ + patch.slang-1.2.2.keypad.1 \ + $(SAMPLES) \ + iconv/README \ + iconv/make.sh + +install-data-local: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/samples $(DESTDIR)$(docdir)/samples/iconv + for f in $(SAMPLES) ; do \ + $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir)/samples ; \ + done + for f in $(srcdir)/iconv/*.rc ; do \ + $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir)/samples/iconv ; \ + done + +uninstall-local: + for f in $(SAMPLES) ; do \ + rm -f $(DESTDIR)$(docdir)/samples/$$f ; \ + done + -rm -rf $(DESTDIR)$(docdir)/samples/iconv + -rmdir $(DESTDIR)$(docdir)/samples + -rmdir $(DESTDIR)$(docdir) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist-hook: Makefile $(DISTFILES) + mkdir -p $(distdir)/iconv + for file in $(srcdir)/iconv/*.rc ; do \ + ln $$file $(distdir)/iconv 2> /dev/null \ + || cp -p $$file $(distdir)/iconv ; \ + done diff --git a/contrib/Makefile.in b/contrib/Makefile.in deleted file mode 100644 index df234ba4..00000000 --- a/contrib/Makefile.in +++ /dev/null @@ -1,79 +0,0 @@ -# $Id$ - -SHELL = /bin/sh - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -datarootdir = @datarootdir@ -mandir = @mandir@ -srcdir = @srcdir@ -docdir = @docdir@ -top_srcdir = @top_srcdir@ -top_builddir = .. -INSTALL = @INSTALL@ -VPATH = @srcdir@ -@SET_MAKE@ - -subdir = contrib - -SAMPLES = Mush.rc Pine.rc gpg.rc pgp2.rc pgp5.rc pgp6.rc Tin.rc \ - sample.muttrc sample.mailcap sample.muttrc-tlr \ - colors.default colors.linux smime.rc \ - ca-bundle.crt smime_keys_test.pl - -DISTFILES = Makefile.in language.txt language50.txt \ - patch.slang-1.2.2.keypad.1 \ - $(SAMPLES) - -ICONV_DISTFILES = README make.sh - -all clean: - -distclean: - -rm -f Makefile - -check: - -install: - $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)/samples $(DESTDIR)$(docdir)/samples/iconv - for f in $(SAMPLES) ; do \ - $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir)/samples ; \ - done - for f in $(srcdir)/iconv/*.rc ; do \ - $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir)/samples/iconv ; \ - done - -uninstall: - for f in $(SAMPLES) ; do \ - rm -f $(DESTDIR)$(docdir)/samples/$$f ; \ - done - -rm -rf $(DESTDIR)$(docdir)/samples/iconv - -rmdir $(DESTDIR)$(docdir)/samples - -rmdir $(DESTDIR)$(docdir) - -maintainer-clean: distclean - -Makefile: ../config.status Makefile.in - cd .. \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: Makefile $(DISTFILES) - for file in $(DISTFILES) ; do \ - ln $(srcdir)/$$file $(distdir) 2> /dev/null \ - || cp -p $(srcdir)/$$file $(distdir); \ - done - mkdir -p $(distdir)/iconv - for file in $(ICONV_DISTFILES) ; do \ - ln $(srcdir)/iconv/$$file $(distdir)/iconv 2> /dev/null \ - || cp -p $(srcdir)/iconv/$$file $(distdir)/iconv; \ - done - for file in $(srcdir)/iconv/*.rc ; do \ - ln $$file $(distdir)/iconv 2> /dev/null \ - || cp -p $$file $(distdir)/iconv ; \ - done diff --git a/doc/.cvsignore b/doc/.cvsignore index 0e86a3c5..a811a00a 100644 --- a/doc/.cvsignore +++ b/doc/.cvsignore @@ -1,4 +1,5 @@ Makefile +Makefile.in *.html muttrc.man mutt.1 diff --git a/doc/Makefile.in b/doc/Makefile.am similarity index 73% rename from doc/Makefile.in rename to doc/Makefile.am index f5fcbf7f..f97f83e3 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.am @@ -1,44 +1,15 @@ # $Id$ -SHELL = /bin/sh - -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -datarootdir = @datarootdir@ -sysconfdir = @sysconfdir@ -bindir = @bindir@ -libdir = @libdir@ -mandir = @mandir@ -srcdir = @srcdir@ -docdir = @docdir@ -includedir = @includedir@ -top_srcdir=@top_srcdir@ -top_builddir = .. -VPATH = @srcdir@ -@SET_MAKE@ - -INSTALL = @INSTALL@ -CC = @CC@ -CPP = @CPP@ -EXEEXT = @EXEEXT@ -XCPPFLAGS = -I. @CPPFLAGS@ -CFLAGS = @CFLAGS@ $(XCPPFLAGS) -LDFLAGS = @LDFLAGS@ subdir = doc -CPPFLAGS = @CPPFLAGS@ - DSLROOT = @DSLROOT@ DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1 -INCLUDES = -I. -I.. -I$(includedir) -I$(top_srcdir) +AM_CPPFLAGS = -I. -I.. -I$(includedir) -I$(top_srcdir) -MAKEDOC_CPP = $(CPP) $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C +MAKEDOC_CPP = $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C -DISTFILES = Makefile.in dotlock.man \ +EXTRA_DIST = dotlock.man \ muttbug.man \ mutt.man \ PGP-Notes.txt \ @@ -53,7 +24,7 @@ DISTFILES = Makefile.in dotlock.man \ instdoc.sh.in \ patch-notes.txt \ smime-notes.txt \ - html.xsl chunk.xsl + html.xsl chunk.xsl $(BUILT_DISTFILES) HTML_DOCFILES = manual.html index.html intro.html gettingstarted.html \ configuration.html mimesupport.html advancedusage.html \ @@ -73,7 +44,7 @@ all: ../makedoc$(EXEEXT) makedoc-all: mutt.1 muttrc.man manual.html stamp-doc-chunked manual.txt -install: makedoc-all instdoc +install-data-local: makedoc-all instdoc $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man5 ./instdoc mutt.1 $(DESTDIR)$(mandir)/man1/mutt.1 @@ -96,7 +67,7 @@ install: makedoc-all instdoc $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir) ; \ done -uninstall: +uninstall-local: for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \ rm -f $(DESTDIR)$(mandir)/man1/$$f ; \ done @@ -128,42 +99,16 @@ manual.tex: stamp-doc-xml openjade -t tex -D $(DSLROOT) -d print/docbook.dsl dtds/decls/xml.dcl manual.xml; \ fi -clean: +clean-local: rm -f *~ *.html *.orig *.rej stamp-doc-* *.ps mutt.1 muttrc.man rm -f *.aux *.log *.tex *.out -clean-real: - rm -f manual.txt manual.html manual.xml manual.pdf - rm -rf html - -maintainer-clean: clean clean-real distclean - -distclean: clean - rm -f Makefile - -Makefile: Makefile.in ../config.status - cd .. \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status +DISTCLEANFILES=manual.txt manual.html manual.xml manual.pdf html instdoc instdoc: instdoc.sh cat instdoc.sh > instdoc chmod a+x instdoc -instdoc.sh: instdoc.sh.in ../config.status - cd .. \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: Makefile $(DISTFILES) - for file in $(DISTFILES) ; do \ - ln $(srcdir)/$$file $(distdir) 2> /dev/null \ - || cp -p $(srcdir)/$$file $(distdir); \ - done - for file in $(BUILT_DISTFILES) ; do \ - ln $$file $(distdir) 2> /dev/null \ - || cp -p $$file $(distdir) ; \ - done - ../makedoc$(EXEEXT): $(top_srcdir)/makedoc.c (cd .. && $(MAKE) makedoc$(EXEEXT)) diff --git a/imap/Makefile.am b/imap/Makefile.am index 9c86f4f7..7a1a4297 100644 --- a/imap/Makefile.am +++ b/imap/Makefile.am @@ -16,7 +16,7 @@ endif EXTRA_DIST = BUGS README TODO auth_anon.c auth_cram.c auth_gss.c auth_sasl.c -INCLUDES = -I$(top_srcdir) -I../intl +AM_CPPFLAGS = -I$(top_srcdir) -I../intl noinst_LIBRARIES = libimap.a noinst_HEADERS = auth.h imap_private.h message.h diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 00000000..26eb235b --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = README + +dist-hook: + for i in $(srcdir)/*.m4 ; do \ + echo cp -p $$i $(distdir) ; \ + done diff --git a/m4/Makefile.am.in b/m4/Makefile.am.in deleted file mode 100644 index d4802c38..00000000 --- a/m4/Makefile.am.in +++ /dev/null @@ -1,15 +0,0 @@ -## Process this file with automake to produce Makefile.in -*-Makefile-*- - -##m4-files-begin -##m4-files-end - -Makefile.am: Makefile.am.in - rm -f $@ $@t - sed -n '1,/^##m4-files-begin/p' Makefile.am.in > $@t - ( (echo EXTRA_DIST = README Makefile.am.in | tr '\012' @); \ - (echo *.m4|tr ' ' @) ) \ - |sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \ - >> $@t - sed -n '/^##m4-files-end/,$$p' Makefile.am.in >> $@t - chmod a-w $@t - mv $@t $@ diff --git a/m4/README b/m4/README index 5e9b3a89..ac32e284 100644 --- a/m4/README +++ b/m4/README @@ -2,7 +2,3 @@ These files are used by a program called aclocal (part of the GNU automake package). aclocal uses these files to create aclocal.m4 which is in turn used by autoconf to create the configure script at the the top level in this distribution. - -The Makefile.am file in this directory is automatically generated -from the template file, Makefile.am.in. - diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 09fb7035..b31ff828 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -86,6 +86,8 @@ $(top_srcdir)/keymap_alldefs.h: # have been downloaded. $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in + chmod u+w $(srcdir) + rm -f $@ $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ --add-comments --keyword=_ --keyword=N_ \ --files-from=$(srcdir)/POTFILES.in \ diff --git a/prepare b/prepare index b382ef08..fc9c44e2 100755 --- a/prepare +++ b/prepare @@ -7,7 +7,7 @@ else include_deps="-i" fi -if aclocal -I m4 && autoheader && (cd m4 && make -f Makefile.am.in ) \ +if aclocal -I m4 && autoheader \ && automake $include_deps && autoconf && ./configure "$@" then echo