This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Maintainer mode and NLS requires srcdir = objdir?
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Subject: Re: Maintainer mode and NLS requires srcdir = objdir?
- From: Nick Clifton <nickc at redhat dot com>
- Date: 22 Mar 2001 19:29:12 -0800
- Cc: binutils at sources dot redhat dot com
- References: <200103230212.DAA12558@ignucius.axis.se>
Hi Hans-Peter,
> > I also noticed that "make distclean" does not work in maintainer
> > mode. I could not find a way around this problem, so instead I have
> > inserted a comment into Make-in explaining what is going on.
>
> If it can't be fixed cleanly, perhaps document it in
> README-maintainer-mode.
Good idea.
> > + # of po/POTFILES.in. Hence the presence of this rule.
> > + po/POTFILES.in:
>
> Remove this rule soon, or state a time there for its removal?
State a time I think. 6 months in the future ought to be enough.
> > ! # Note - the following line gets processed by bfd/configure and amened
> > ! # to contain the full list of build dir POTFILES.
>
> Amended?
Doh! Yes.
> ! --files-from=$(srcdir)/SRC-POTFILES.in \
> ! --files-from=$(srcdir)/BLD-POTFILES.in
>
> Problem here. These options do not accumulate. The last
> --files-from is chosen, at least with xgettext 0.10.32 and
> 0.10.35 (the latter shipped with RH 6.2).
Oh poo! I had not thought about that. I am using 0.10.36, but this
also does not accumulate these options.
> Do you see the same problem, or are you using a newer xgettext?
> If there's a newer xgettext where those options accumulate, that
> version could be required at configure --enable-maintainer-mode time.
>
> Anyway it seems there's the trivial solution of cat:ing those
> files.
Yup. Here is an amended patch:
Cheers
Nick
Index: Makefile.am
===================================================================
RCS file: /cvs/src//src/bfd/Makefile.am,v
retrieving revision 1.51
diff -p -r1.51 Makefile.am
*** Makefile.am 2001/03/08 21:03:56 1.51
--- Makefile.am 2001/03/23 03:16:23
*************** SOURCE_CFILES = \
*** 485,494 ****
$(BFD64_BACKENDS_CFILES) \
$(OPTIONAL_BACKENDS_CFILES)
! CFILES = \
! $(SOURCE_CFILES) \
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
## This is a list of all .h files which are in the source tree.
SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
--- 485,495 ----
$(BFD64_BACKENDS_CFILES) \
$(OPTIONAL_BACKENDS_CFILES)
! BUILD_CFILES = \
elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
+ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
+
## This is a list of all .h files which are in the source tree.
SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
*************** SOURCE_HFILES = \
*** 497,512 ****
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h
- HFILES = \
- elf32-target.h elf64-target.h targmatch.h \
- $(SOURCE_HFILES)
-
- POTFILES = $(CFILES) $(HFILES)
-
- po/POTFILES.in: @MAINT@ Makefile $(POTFILES)
- for file in $(POTFILES); do echo $$file; done | sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
diststuff: info
--- 498,530 ----
libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \
libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \
nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h xcoff-target.h
+
+ ## ... and all .h files which are in the build tree.
+ BUILD_HFILES = \
+ elf32-target.h elf64-target.h targmatch.h
+
+ HFILES = $(SOURCE_HFILES) $(BUILD_HFILES)
+
+ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
+ BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
+
+ po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
+ for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp \
+ && mv tmp $(srcdir)/po/SRC-POTFILES.in
+
+ po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
+ for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp \
+ && mv tmp $(srcdir)/po/BLD-POTFILES.in
+
+ # The following target is retained for upgrade purposes.
+ # This target used to exist in older versions of this makefile, and was
+ # referenced by <builddir>/po/Makefile (which is created from <srcdir>/po/Make-in)
+ # So old versions of <builddir>/po/Makefile will try to regenerate themselves
+ # when make is next run, but that dependency cannot be completed without a build
+ # of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted
+ # once it is no longer needed - probably in the fall of 2001.
+ po/POTFILES.in:
diststuff: info
*************** stmp-lcoff-h: $(LIBCOFF_H_FILES)
*** 714,724 ****
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
touch stmp-lcoff-h
! MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \
! targmatch.h
CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
# We want to rerun configure if config.bfd or configure.host change.
config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
--- 732,743 ----
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
touch stmp-lcoff-h
! MOSTLYCLEANFILES = ofiles stamp-ofiles
CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+
+ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
# We want to rerun configure if config.bfd or configure.host change.
config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
Index: configure.in
===================================================================
RCS file: /cvs/src//src/bfd/configure.in,v
retrieving revision 1.48
diff -p -r1.48 configure.in
*** configure.in 2001/03/20 18:24:28 1.48
--- configure.in 2001/03/23 03:16:24
*************** esac
*** 750,753 ****
rm -f doc/config.status
AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
! [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])
--- 750,754 ----
rm -f doc/config.status
AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
! [sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile])
!
Index: po/Make-in
===================================================================
RCS file: /cvs/src//src/bfd/po/Make-in,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 Make-in
*** Make-in 1999/05/03 07:28:58 1.1.1.1
--- Make-in 2001/03/23 03:27:57
*************** COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $
*** 46,55 ****
SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
! DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
! POTFILES = \
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
--- 46,61 ----
SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
! DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
! # Note - the following line gets processed by bfd/configure and amended
! # to contain the full list of source dir POTFILES.
! SRC-POTFILES = \
!
! # Note - the following line gets processed by bfd/configure and amended
! # to contain the full list of build dir POTFILES.
! BLD-POTFILES = \
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
*************** all: all-@USE_NLS@
*** 82,91 ****
all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
all-no:
! $(srcdir)/$(PACKAGE).pot: $(POTFILES)
! $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
! --files-from=$(srcdir)/POTFILES.in
rm -f $(srcdir)/$(PACKAGE).pot
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
--- 88,104 ----
all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
all-no:
! $(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
! $(XGETTEXT) --default-domain=$(PACKAGE) \
! --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
! --files-from=$(srcdir)/SRC-POTFILES.in
! $(XGETTEXT) --default-domain=$(PACKAGE) \
! --directory=.. \
! --directory=. \
! --add-comments --keyword=_ --keyword=N_ \
! --join-existing \
! --files-from=$(srcdir)/BLD-POTFILES.in
rm -f $(srcdir)/$(PACKAGE).pot
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
*************** mostlyclean:
*** 191,198 ****
clean: mostlyclean
distclean: clean
! rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
!
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
--- 204,212 ----
clean: mostlyclean
distclean: clean
! rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
! rm -f SRC-POTFILES BLD-POTFILES SRC-POTFILES.in BLD-POTFILES.in
!
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
*************** update-po: Makefile
*** 225,247 ****
fi; \
done
! POTFILES: POTFILES.in
( if test 'x$(srcdir)' != 'x.'; then \
posrcprefix='$(top_srcdir)/'; \
else \
posrcprefix="../"; \
fi; \
rm -f $@-t $@ \
! && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
| sed -e '$$s/\\$$//') > $@-t \
&& chmod a-w $@-t \
&& mv $@-t $@ )
! POTFILES.in: @MAINT@ ../Makefile
! cd .. && $(MAKE) po/POTFILES.in
! Makefile: Make-in ../config.status POTFILES
cd .. \
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
CONFIG_HEADERS= $(SHELL) ./config.status
--- 239,286 ----
fi; \
done
! SRC-POTFILES: SRC-POTFILES.in
( if test 'x$(srcdir)' != 'x.'; then \
posrcprefix='$(top_srcdir)/'; \
else \
posrcprefix="../"; \
fi; \
rm -f $@-t $@ \
! && (sed -e '/^#/d' \
! -e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
| sed -e '$$s/\\$$//') > $@-t \
&& chmod a-w $@-t \
&& mv $@-t $@ )
+
+ BLD-POTFILES: BLD-POTFILES.in
+ ( rm -f $@-t $@ \
+ && (sed -e '/^#/d' \
+ -e '/^[ ]*$$/d' \
+ -e "s@.*@ ../& \\\\@" < $(srcdir)/$@.in \
+ | sed -e '$$s/\\$$//') > $@-t \
+ && chmod a-w $@-t \
+ && mv $@-t $@ )
+
+ SRC-POTFILES.in: @MAINT@ ../Makefile
+ cd .. && $(MAKE) po/SRC-POTFILES.in
! BLD-POTFILES.in: @MAINT@ ../Makefile
! cd .. && $(MAKE) po/BLD-POTFILES.in
! # Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies
! # here breaks the implementation of the 'distclean' rule for maintainers.
! # This is because if 'make distclean' is run in the BFD directory, the
! # Makefile there will be deleted before 'distclean' is made here, and so
! # the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot
! # be satisfied.
! #
! # The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed,
! # however since it is necessary that these files be built during
! # *configure* time, so that configure can insert them into the
! # po/Makefile that it is creating, so that the Makefile will have
! # the correct dependencies.
! Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
cd .. \
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
CONFIG_HEADERS= $(SHELL) ./config.status
Index: README-maintainer-mode
===================================================================
RCS file: /cvs/src//src/README-maintainer-mode,v
retrieving revision 1.1
diff -p -r1.1 README-maintainer-mode
*** README-maintainer-mode 2000/06/07 21:31:48 1.1
--- README-maintainer-mode 2001/03/23 03:28:56
***************
*** 4,6 ****
--- 4,14 ----
Note that if you configure with --enable-maintainer-mode, you will need
special versions of automake, autoconf, libtool and gettext. You will
find the sources for these in ftp://sourceware.cygnus.com/pub/binutils.
+
+ Note - "make distclean" does not work with maintainer mode enabled.
+ The Makefiles in the po/ subdirectories depend upon the Makefiles in
+ their parent directories, and distclean will delete the Makefiles in
+ the parent directories before running the Makefiles in the child
+ directories. There is no easy way around this (short of changing the
+ automake macros) as these dependencies need to exist in order to
+ correctly build the NLS files.