public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Use modern AC_INIT in configure.in
@ 2014-07-04  3:24 Alan Modra
  2014-07-04  3:58 ` Alan Modra
  2014-07-08 15:38 ` H.J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Modra @ 2014-07-04  3:24 UTC (permalink / raw)
  To: binutils

This removes usage of the obsolete AC_INIT and AM_INIT_AUTOMAKE in all
binutils configure.in files.  The BFD version is now in bfd/version.m4
rather than bfd/configure.in, which allows automake to automatically
track this dependency.

Tristan, I made what I think are the necessary changes to
gas/configure.com but can't test it, so please check that I didn't
break anything there.

bfd/
	* version.m4: New file.
	* configure.in: Include version.m4.
	(AC_INIT): Update.
	* Makefile.am (RELEASE): Delete.
	(bfdver.h): Depend on development.sh, use instead of RELEASE.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
opcodes/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
binutils/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* configure.com: Get bfd version from bfd/version.m4.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
ld/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 595c489..72ee0bf 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -20,9 +20,6 @@
 AUTOMAKE_OPTIONS = 1.11 no-dist foreign
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
-# Uncomment the following line when doing a release.
-# RELEASE=y
-
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 
@@ -1027,14 +1024,15 @@ CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
 
 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) libtool-soversion
 
-bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
+bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in
 	@echo "creating $@"
 	@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
 	bfd_version_string="\"$(VERSION)\"" ;\
 	bfd_soversion="$(VERSION)" ;\
 	bfd_version_package="\"$(PKGVERSION)\"" ;\
 	report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
-	if test "x$(RELEASE)" = x ; then \
+	. $(srcdir)/development.sh ;\
+	if test "$$development" = true ; then \
 	  bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
 	  bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\
 	  bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
diff --git a/bfd/configure.in b/bfd/configure.in
index 2cc4499..017304f 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -18,7 +18,8 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_PREREQ(2.59)
-AC_INIT([bfd], [2.24.51])
+m4_include([version.m4])
+AC_INIT([bfd], BFD_VERSION)
 AC_CONFIG_SRCDIR([libbfd.c])
 
 AC_CANONICAL_TARGET
diff --git a/bfd/version.m4 b/bfd/version.m4
new file mode 100644
index 0000000..e032e68
--- /dev/null
+++ b/bfd/version.m4
@@ -0,0 +1 @@
+m4_define([BFD_VERSION], [2.24.51])
diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index aca2610..7f5f0c4 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -512,10 +512,8 @@ EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
 diststuff: $(EXTRA_DIST) info
 all: info
 
-# We extract version from bfd/configure.in, make sure to rerun configure
-# when BFD's version changes.
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
-	$(BFDDIR)/development.sh
+# development.sh is used to determine -Werror default.
+CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
 
 DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak embedspu
 
diff --git a/binutils/configure.in b/binutils/configure.in
index f3e6130..ff0d4dc 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -18,16 +18,14 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_PREREQ(2.59)
-AC_INIT
+m4_include([../bfd/version.m4])
+AC_INIT([binutils], BFD_VERSION)
 AC_CONFIG_SRCDIR(ar.c)
 
 AC_CANONICAL_TARGET
 AC_ISC_POSIX
 
-changequote(,)dnl
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
-changequote([,])dnl
-AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
+AM_INIT_AUTOMAKE
 
 AC_PROG_CC
 AC_GNU_SOURCE
diff --git a/gas/Makefile.am b/gas/Makefile.am
index 669ab19..5727c75 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -693,6 +693,6 @@ de-stage3:
 	- (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
 	- rmdir stage3
 
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
-	$(srcdir)/configure.tgt \
-	$(BFDDIR)/development.sh
+# Reconfigure if configure.tgt changes.
+# development.sh is used to determine -Werror default.
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.tgt $(BFDDIR)/development.sh
diff --git a/gas/configure.com b/gas/configure.com
index 982d331..ceb50c2 100644
--- a/gas/configure.com
+++ b/gas/configure.com
@@ -185,17 +185,17 @@ $  create config-vms.in
 
 /* Version number of package */
 $!
-$! Get VERSION from ../bfd/configure.in
+$! Get VERSION from ../bfd/version.m4
 $!
 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input
 $DECK
    set (success, off);
-   mfile := CREATE_BUFFER("mfile", "[-.bfd]configure.in");
-   match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, mfile);
+   mfile := CREATE_BUFFER("mfile", "[-.bfd]version.m4");
+   match_pos := SEARCH_QUIETLY('m4_define([BFD_VERSION], [', FORWARD, EXACT, mfile);
    IF match_pos <> 0 THEN;
      POSITION(BEGINNING_OF(match_pos));
      ERASE(match_pos);
-     vers := CURRENT_LINE-")";
+     vers := CURRENT_LINE-"])";
    ELSE;
      vers := "unknown";
    ENDIF;
diff --git a/gas/configure.in b/gas/configure.in
index b9f9a98..cc4fc54 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -21,7 +21,8 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 dnl v2.5 needed for --bindir et al
 AC_PREREQ(2.59)
-AC_INIT
+m4_include([../bfd/version.m4])
+AC_INIT([gas], BFD_VERSION)
 AC_CONFIG_SRCDIR(as.h)
 
 dnl Autoconf 2.57 will find the aux dir without this.  However, unless
@@ -31,10 +32,7 @@ AC_CONFIG_AUX_DIR(..)
 AC_CANONICAL_TARGET
 AC_ISC_POSIX
 
-changequote(,)dnl
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
-changequote([,])dnl
-AM_INIT_AUTOMAKE(gas, ${BFD_VERSION})
+AM_INIT_AUTOMAKE
 
 AC_PROG_CC
 AC_GNU_SOURCE
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 2daefac..ef54c38 100644
--- a/gprof/Makefile.am
+++ b/gprof/Makefile.am
@@ -58,10 +58,8 @@ EXTRA_DIST    = $(BUILT_SOURCES) bbconv.pl $(man_MANS)
 
 diststuff: $(BUILT_SOURCES) info $(man_MANS)
 
-# We extract version from bfd/configure.in, make sure to rerun configure
-# when BFD's version changes.
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
-	$(BFDDIR)/development.sh
+# development.sh is used to determine -Werror default.
+CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
 
 # This empty rule is a hack against gmake patched by Apple.
 %.o:%.m
diff --git a/gprof/configure.in b/gprof/configure.in
index 20c2a57..583ad24 100644
--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -17,16 +17,14 @@ dnl along with this program; see the file COPYING3.  If not see
 dnl <http://www.gnu.org/licenses/>.
 dnl
 AC_PREREQ(2.59)
-AC_INIT
+m4_include([../bfd/version.m4])
+AC_INIT([gprof], BFD_VERSION)
 AC_CONFIG_SRCDIR([gprof.c])
 
 AC_CANONICAL_TARGET([])
 AC_ISC_POSIX
 
-changequote(,)dnl
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
-changequote([,])dnl
-AM_INIT_AUTOMAKE(gprof, ${BFD_VERSION})
+AM_INIT_AUTOMAKE
 
 dnl For simplicity, we use the BFD configuration file for most
 dnl things.  However, we also need our own configuration file for
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 2bb2cac..8e8ae20 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -2069,11 +2069,10 @@ ld.1: $(srcdir)/ld.texinfo configdoc.texi
 
 MAINTAINERCLEANFILES = configdoc.texi ld.1
 
-# We want to reconfigure if configure.host or configure.tgt changes.  We
-# extract version from bfd/configure.in, so we must depend on that also.
+# We want to reconfigure if configure.host or configure.tgt changes.
+# development.sh is used to determine -Werror default.
 CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
-	$(srcdir)/../bfd/configure.in \
-	$(srcdir)/../bfd/development.sh
+	$(BFDDIR)/development.sh
 
 MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
 	ldemul-list.h crtbegin.@OBJEXT@ crtend.@OBJEXT@ ld.log ld.sum
diff --git a/ld/configure.in b/ld/configure.in
index 1ac69a3..d1bf1e4 100644
--- a/ld/configure.in
+++ b/ld/configure.in
@@ -18,17 +18,15 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_PREREQ(2.59)
-AC_INIT
+m4_include([../bfd/version.m4])
+AC_INIT([ld], BFD_VERSION)
 AC_CONFIG_SRCDIR(ldmain.c)
 
 AC_CANONICAL_TARGET
 AC_CANONICAL_BUILD
 AC_ISC_POSIX
 
-changequote(,)dnl
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
-changequote([,])dnl
-AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})
+AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE
 
 AC_ARG_WITH(lib-path, [  --with-lib-path=dir1:dir2...  set default LIB_PATH],LIB_PATH=$withval)
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 9ff6a38..4acc436 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -294,10 +294,8 @@ ALL_MACHINES = $(TARGET_LIBOPCODES_CFILES:.c=.lo)
 
 OFILES = @BFD_MACHINES@
 
-# We should reconfigure whenever bfd/configure.in changes, because
-# that's where the version number in Makefile comes from.
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in \
-	$(BFDDIR)/development.sh
+# development.sh is used to determine -Werror default.
+CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
 
 AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
 
diff --git a/opcodes/configure.in b/opcodes/configure.in
index 3ffcaa0..b93e855 100644
--- a/opcodes/configure.in
+++ b/opcodes/configure.in
@@ -18,20 +18,14 @@ dnl <http://www.gnu.org/licenses/>.
 dnl
 
 AC_PREREQ(2.59)
-AC_INIT
+m4_include([../bfd/version.m4])
+AC_INIT([opcodes], BFD_VERSION)
 AC_CONFIG_SRCDIR([z8k-dis.c])
 
 AC_CANONICAL_TARGET
 AC_ISC_POSIX
 
-# We currently only use the version number for the name of any shared
-# library.  For user convenience, we always use the same version
-# number that BFD is using.
-changequote(,)dnl
-BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
-changequote([,])dnl
-
-AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION})
+AM_INIT_AUTOMAKE
 
 AC_PROG_CC
 AC_GNU_SOURCE

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use modern AC_INIT in configure.in
  2014-07-04  3:24 Use modern AC_INIT in configure.in Alan Modra
@ 2014-07-04  3:58 ` Alan Modra
  2014-07-08 15:38 ` H.J. Lu
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Modra @ 2014-07-04  3:58 UTC (permalink / raw)
  To: binutils

Missed from 2e98a7bd

bfd/
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove configure.in.
	* Makefile.in: Regenerate.
gas/
	* doc/Makefile.am (CONFIG_STATUS_DEPENDENCIES): Delete.
	* doc/Makefile.in: Regenerate.

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 72ee0bf..3c59c87 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -732,11 +732,9 @@ OPTIONAL_BACKENDS_CFILES = \
 	sco5-core.c \
 	trad-core.c
 
-# We want to rerun configure if configure.in, config.bfd or
-# configure.host change. configure.in is needed since the version
-# number in Makefile comes from configure.in.
+# Reconfigure if config.bfd or configure.host changes.
+# development.sh is used to determine -Werror default.
 CONFIG_STATUS_DEPENDENCIES = \
-	$(srcdir)/configure.in \
 	$(srcdir)/config.bfd \
 	$(srcdir)/configure.host \
 	$(srcdir)/development.sh
diff --git a/gas/doc/Makefile.am b/gas/doc/Makefile.am
index 10f2e68..c2ddc02 100644
--- a/gas/doc/Makefile.am
+++ b/gas/doc/Makefile.am
@@ -112,8 +112,6 @@ MAINTAINERCLEANFILES = asconfig.texi
 BASEDIR = $(srcdir)/../..
 BFDDIR = $(BASEDIR)/bfd
 
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in
-
 # Maintenance
 
 # We need it for the taz target in ../../Makefile.in.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use modern AC_INIT in configure.in
  2014-07-04  3:24 Use modern AC_INIT in configure.in Alan Modra
  2014-07-04  3:58 ` Alan Modra
@ 2014-07-08 15:38 ` H.J. Lu
  2014-07-08 23:54   ` Alan Modra
  1 sibling, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2014-07-08 15:38 UTC (permalink / raw)
  To: Binutils

On Thu, Jul 3, 2014 at 8:24 PM, Alan Modra <amodra@gmail.com> wrote:
> This removes usage of the obsolete AC_INIT and AM_INIT_AUTOMAKE in all
> binutils configure.in files.  The BFD version is now in bfd/version.m4
> rather than bfd/configure.in, which allows automake to automatically
> track this dependency.
>
> Tristan, I made what I think are the necessary changes to
> gas/configure.com but can't test it, so please check that I didn't
> break anything there.
>
> bfd/
>         * version.m4: New file.
>         * configure.in: Include version.m4.
>         (AC_INIT): Update.
>         * Makefile.am (RELEASE): Delete.
>         (bfdver.h): Depend on development.sh, use instead of RELEASE.
>         * Makefile.in: Regenerate.
>         * doc/Makefile.in: Regenerate.
> opcodes/
>         * configure.in: Include bfd/version.m4.
>         (AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
>         (BFD_VERSION): Delete.
>         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
>         * configure: Regenerate.
>         * Makefile.in: Regenerate.
> binutils/
>         * configure.in: Include bfd/version.m4.
>         (AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
>         (BFD_VERSION): Delete.
>         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
>         * configure: Regenerate.
>         * Makefile.in: Regenerate.
>         * doc/Makefile.in: Regenerate.
> gas/
>         * configure.in: Include bfd/version.m4.
>         (AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
>         (BFD_VERSION): Delete.
>         * configure.com: Get bfd version from bfd/version.m4.
>         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
>         * configure: Regenerate.
>         * Makefile.in: Regenerate.
>         * doc/Makefile.in: Regenerate.
> gprof/
>         * configure.in: Include bfd/version.m4.
>         (AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
>         (BFD_VERSION): Delete.
>         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
>         * configure: Regenerate.
>         * Makefile.in: Regenerate.
> ld/
>         * configure.in: Include bfd/version.m4.
>         (AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
>         (BFD_VERSION): Delete.
>         * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
>         * configure: Regenerate.
>         * Makefile.in: Regenerate.

The old one has

changequote(,)dnl
BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
changequote([,])dnl
AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})

When BFD_VERSION is changed, we only need to regenerate
configure in bfd.  Can we make it to work with the new scheme?

H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use modern AC_INIT in configure.in
  2014-07-08 15:38 ` H.J. Lu
@ 2014-07-08 23:54   ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2014-07-08 23:54 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Binutils

On Tue, Jul 08, 2014 at 08:38:30AM -0700, H.J. Lu wrote:
> The old one has
> 
> changequote(,)dnl
> BFD_VERSION=`${srcdir}/../bfd/configure --version | sed -n -e '1s,.* ,,p'`
> changequote([,])dnl
> AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})
> 
> When BFD_VERSION is changed, we only need to regenerate
> configure in bfd.  Can we make it to work with the new scheme?

You can, by using m4_esyscmd to extract the version from
bfd/configure.ac to set versions in other configure dirs, but that way
is a bit messy.  I wrote it like that at first, then saw that the
automake docs recommend using an m4 version file.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-08 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-04  3:24 Use modern AC_INIT in configure.in Alan Modra
2014-07-04  3:58 ` Alan Modra
2014-07-08 15:38 ` H.J. Lu
2014-07-08 23:54   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).