[autoconf-conversion] Something to start with

Tom Tromey tromey at redhat.com
Sat Jun 14 00:31:32 UTC 2003


>>>>> "Daniel" == Daniel Jacobowitz <drow at false.org> writes:

Daniel>  - Because 2.57 still has the deprecated support for not cross
Daniel> compiling when $build = $host, we can get by in a partial
Daniel> per-directory conversion without needing any magic at the top
Daniel> level at all.  I did gas to prove the point.

Here's fastjar.

There are varying levels of conversion we could do.  For instance,
"proper" autoconf 2.5x style looks quite different from 2.13 style.
I didn't try to do this.

However, I did rename configure.in to configure.ac.  That will prevent
people from accidentally using 2.13.  I think we should do this in
every directory.

In a similar vein I added "1.6" to AUTOMAKE_OPTIONS, to prevent use of
earlier versions (I would have used 1.7 but at the moment 1.6 was
easier for me to access).  While 1.7 isn't shipped in RHL 9, I still
think we should require it and not 1.6.  1.7 has had a lot of bug
fixing, plus other enhancements which may actually be useful (in
places).

I only tested this in one configuration, namely native on x86 RHL 9.
I realize that isn't nearly enough.  What are we requiring?

I chose to enable automake's dependency tracking.  I think this is
reasonable, but as it may be troublesome I thought I'd point it out
explicitly.  I'm happy to share my perspective on the benefits and
tradeoffs if anybody wants.

We'll be able to remove config/accross.m4 -- the corresponding
standard macros in autoconf 2.57 work properly when cross-compiling.

No doubt I've made some embarrassing mistake.  Feel free to point it
out.

Tom


Index: fastjar/ChangeLog
from  Tom Tromey  <tromey at redhat.com>

	* depcomp: New file from automake.
	* config.h.in, Makefile.in: Rebuilt.
	* Makefile.am (AUTOMAKE_OPTIONS): Enable dependency tracking.
	Require 1.6.
	(AM_MAKEINFOFLAGS): New macro.
	(my_makei_flags): Removed.
	(fastjar.info): Likewise.
	* configure.ac: Use AC_CHECK_SIZEOF, AC_C_BIGENDIAN.
	Renamed from...
	* configure.in: ... here.
	* aclocal.m4: Rebuilt.
	* acinclude.m4: Don't include accross.m4.

Index: fastjar/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/fastjar/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- fastjar/Makefile.am 30 Dec 2002 21:32:30 -0000 1.11
+++ fastjar/Makefile.am 14 Jun 2003 00:26:45 -0000
@@ -1,7 +1,6 @@
 # Process this with automake to create Makefile.in
 
-## We definitely don't want dependency tracking when using automake 1.4.
-AUTOMAKE_OPTIONS = no-dependencies
+AUTOMAKE_OPTIONS = 1.6
 
 # Work around what appears to be a GNU make bug handling MAKEFLAGS
 # values defined in terms of make variables, as is the case for CC and
@@ -67,18 +66,7 @@
 man_MANS = jar.1 grepjar.1
 EXTRA_DIST = $(man_MANS)
 
-## This is a hack.  We can't set AM_MAKEINFOFLAGS, since that isn't
-## available in 1.4.  Nor can we override or append to MAKEINFO or
-## MAKEINFOFLAGS, since these are overridden by the top-level
-## Makefile.  So, we just duplicate the rules.  FIXME: remove this
-## when we upgrade automake.  Note that we don't include $(srcdir) in
-## my_makei_flags; makeinfo is run in srcdir.
-my_makei_flags += -I ../gcc/doc/include
-fastjar.info: fastjar.texi $(fastjar_TEXINFOS)
-	@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	cd $(srcdir) \
-	  && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'`
-
+AM_MAKEINFOFLAGS = -I ../gcc/doc/include
 
 TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
 POD2MAN = pod2man --center="GNU" --release="gcc- at gcc_version@"
Index: fastjar/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/fastjar/acinclude.m4,v
retrieving revision 1.2
diff -u -r1.2 acinclude.m4
--- fastjar/acinclude.m4 16 Dec 2002 18:18:45 -0000 1.2
+++ fastjar/acinclude.m4 14 Jun 2003 00:26:45 -0000
@@ -1,5 +1,3 @@
-sinclude(../config/accross.m4)
-
 dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
 dnl of the usual 2.
 AC_DEFUN(gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG,
Index: fastjar/configure.ac
===================================================================
RCS file: fastjar/configure.ac
diff -N fastjar/configure.ac
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ fastjar/configure.ac 14 Jun 2003 00:26:47 -0000
@@ -0,0 +1,81 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(jartool.h)
+AM_INIT_AUTOMAKE(fastjar, 0.92-gcc)
+AM_CONFIG_HEADER(config.h)
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/local/bin)
+AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/local/bin)
+AC_PATH_PROG(STRIP, strip, /usr/bin/strip, $PATH:/bin:/usr/bin:/usr/local/bin)
+AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/local/bin)
+AC_EXEEXT
+
+AM_MAINTAINER_MODE
+
+dnl Add warning flags if we are using gcc.
+if test "$GCC" = yes; then
+  fastjar_warn_cflags='-W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings'
+fi
+AC_SUBST(fastjar_warn_cflags)
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_STRUCT_TM
+AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_OFF_T
+AC_STRUCT_TM
+
+# mkdir takes a single argument on some systems.
+gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
+
+dnl Check for type-widths
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+dnl Check byte order
+AC_C_BIGENDIAN
+
+AC_ARG_WITH(system-zlib,
+[  --with-system-zlib      use installed libz])
+
+ZLIBS=
+ZDEPS=
+ZINCS=
+use_zlib=maybe
+if test "$with_system_zlib" = yes; then
+   AC_CHECK_LIB(z, deflate, ZLIBS=-lz, use_zlib=no)
+else
+   use_zlib=no
+fi
+
+if test "$use_zlib" = no; then
+   # Brain dead way to find tree's zlib.
+   ZDEPS='$(top_builddir)/../zlib/libz.a'
+   ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
+   ZINCS='-I$(top_srcdir)/../zlib'
+fi
+AC_SUBST(ZLIBS)
+AC_SUBST(ZDEPS)
+AC_SUBST(ZINCS)
+
+# Get the version trigger filename from the toplevel
+if test "${with_gcc_version_trigger+set}" = set; then
+   gcc_version_trigger=$with_gcc_version_trigger
+else
+   gcc_version_trigger=${srcdir}/version.c
+fi
+changequote(,)dnl
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
+gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+changequote([,])dnl
+AC_SUBST(gcc_version)
+
+AC_OUTPUT(Makefile install-defs.sh)
Index: fastjar/configure.in
===================================================================
RCS file: fastjar/configure.in
diff -N fastjar/configure.in
--- fastjar/configure.in 16 Dec 2002 18:18:45 -0000 1.12
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,81 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(jartool.h)
-AM_INIT_AUTOMAKE(fastjar, 0.92-gcc)
-AM_CONFIG_HEADER(config.h)
-
-dnl Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
-AC_PATH_PROG(RM, rm, /bin/rm, $PATH:/bin:/usr/bin:/usr/local/bin)
-AC_PATH_PROG(CP, cp, /bin/cp, $PATH:/bin:/usr/bin:/usr/local/bin)
-AC_PATH_PROG(STRIP, strip, /usr/bin/strip, $PATH:/bin:/usr/bin:/usr/local/bin)
-AC_PATH_PROG(CHMOD, chmod, /bin/chmod, $PATH:/bin:/usr/bin:/usr/local/bin)
-AC_EXEEXT
-
-AM_MAINTAINER_MODE
-
-dnl Add warning flags if we are using gcc.
-if test "$GCC" = yes; then
-  fastjar_warn_cflags='-W -Wall -pedantic -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings'
-fi
-AC_SUBST(fastjar_warn_cflags)
-
-dnl Checks for header files.
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_STRUCT_TM
-AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_OFF_T
-AC_STRUCT_TM
-
-# mkdir takes a single argument on some systems.
-gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
-
-dnl Check for type-widths
-AC_COMPILE_CHECK_SIZEOF(char)
-AC_COMPILE_CHECK_SIZEOF(short)
-AC_COMPILE_CHECK_SIZEOF(int)
-AC_COMPILE_CHECK_SIZEOF(long)
-AC_COMPILE_CHECK_SIZEOF(long long)
-
-dnl Check byte order
-AC_C_BIGENDIAN_CROSS
-
-AC_ARG_WITH(system-zlib,
-[  --with-system-zlib      use installed libz])
-
-ZLIBS=
-ZDEPS=
-ZINCS=
-use_zlib=maybe
-if test "$with_system_zlib" = yes; then
-   AC_CHECK_LIB(z, deflate, ZLIBS=-lz, use_zlib=no)
-else
-   use_zlib=no
-fi
-
-if test "$use_zlib" = no; then
-   # Brain dead way to find tree's zlib.
-   ZDEPS='$(top_builddir)/../zlib/libz.a'
-   ZLIBS="$ZDEPS -L\$(here)/../zlib/$libsubdir"
-   ZINCS='-I$(top_srcdir)/../zlib'
-fi
-AC_SUBST(ZLIBS)
-AC_SUBST(ZDEPS)
-AC_SUBST(ZINCS)
-
-# Get the version trigger filename from the toplevel
-if test "${with_gcc_version_trigger+set}" = set; then
-   gcc_version_trigger=$with_gcc_version_trigger
-else
-   gcc_version_trigger=${srcdir}/version.c
-fi
-changequote(,)dnl
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-changequote([,])dnl
-AC_SUBST(gcc_version)
-
-AC_OUTPUT(Makefile install-defs.sh)



More information about the autoconf-conversion mailing list