Thu Mar 20 00:16:54 1997 Tom Tromey <tromey@cygnus.com>
+ * automake.in (handle_programs): Remove CYGWIN lines unless
+ AM_CYGWIN32 seen.
+ (am_install_var): Remove CYGWIN lines from -clean file as well.
+
+ * progs.am: Put @EXEEXT@ where appropriate.
+
+ * program.am (@PROGRAM@): If using Cygwin32, then create actual
+ name in addition to ".exe" name.
+
+ * progs-clean.am (clean-@DIR@PROGRAMS): Conditionalize on CYGWIN.
+
+ * automake.in (check_cygnus): Require AM_CYGWIN32 in --cygnus mode.
+ (am_install_var): If AM_CYGWIN32 not seen, then remove @EXEEXT@
+ from .am files.
+
+ * automake.in (seen_cygwin32): New global.
+ (scan_one_configure_file): Check for AM_CYGWIN32.
+
+ * m4/cygwin.m4: New file.
+
* automake.in (scan_one_configure_file): Explicitly handle
AC_CONFIG_HEADER so we can avoid spurious warnings.
(obsolete_macros): Removed AC_CONFIG_HEADER.
AM_CONFIG_HEADER handles it automatically
* Texinfo output files no longer need .info extension
* Added `missing' support
+* Cygwin32 support
\f
New in 1.0:
* Bug fixes
* should not put texiname_TEXINFOS into distribution
should rename this macro anyway, to foo_texi_DEPENDENCIES
+* should be able to specify path to texinfo.tex so that 'make dvi'
+ will work even when it isn't in this dir.
+
+* *all* installed scripts should support --version, --help
+
+* have aclocal diagnose unrecognized AM_ macros
+
For now I guess I'll just have automake give an error if it encounters
non-C source in a libtool library specification.
}
elsif ($arglist[0] eq '--version')
{
- print "aclocal (GNU $PACKAGE) $VERSION\n";
+ print "aclocal (GNU $PACKAGE) $VERSION\n\n";
print "Copyright (C) 1996, 1997 Free Software Foundation, Inc.\n";
print "This is free software; see the source for copying conditions. There is NO\n";
- print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+ print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n";
+ print "Written by Tom Tromey <tromey\@cygnus.com>\n";
exit 0;
}
elsif ($arglist[0] eq '--help')
# TRUE if we've seen AM_PATH_LISPDIR.
$seen_lispdir = 0;
+# TRUE if we've seen AM_CYGWIN32.
+$seen_cygwin32 = 0;
+
# Hash table of discovered configure substitutions. Keys are names,
# values are meaningless.
%configure_vars = ();
# Note that we do not handle this one, because it is still run
# from AM_CONFIG_HEADER. So we deal with it specially in
- # handle_configure.
+ # scan_configure.
# 'AC_CONFIG_HEADER', "use \`AM_CONFIG_HEADER'",
'fp_C_PROTOTYPES', "use \`AM_C_PROTOTYPES'",
{
if ($arglist[0] eq "--version")
{
- print "automake (GNU $PACKAGE) $VERSION\n";
+ print "automake (GNU $PACKAGE) $VERSION\n\n";
print "Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.\n";
print "This is free software; see the source for copying conditions. There is NO\n";
- print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+ print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n";
+ print "Written by Tom Tromey <tromey\@cygnus.com>\n";
exit 0;
}
$xlink = $linker ? $linker : 'LINK';
}
+ local ($cygxform) = '';
+ if (! $seen_cygwin32)
+ {
+ $cygxform .= 's/^CYGWIN.*$//;';
+ }
+
$output_rules .=
&file_contents_with_transform
('s/\@PROGRAM\@/' . $one_file . '/go;'
. 's/\@XPROGRAM\@/' . $xname . '/go;'
- . 's/\@XLINK\@/' . $xlink . '/go;',
+ . 's/\@XLINK\@/' . $xlink . '/go;'
+ . $cygxform,
'program');
}
# Check for ansi2knr.
$am_c_prototypes = 1 if /AM_C_PROTOTYPES/;
+ # Check for Cygwin32.
+ if (/AM_CYGWIN32/)
+ {
+ $seen_cygwin32 = 1;
+ $configure_vars{'EXEEXT'} = 1;
+ }
+
# Check for NLS support.
if (/AM_GNU_GETTEXT/)
{
{
&am_conf_error ("\`AM_MAINTAINER_MODE' required when --cygnus specified");
}
+
+ if (! $seen_cygwin32)
+ {
+ &am_conf_error ("\`AM_CYGWIN32' required when --cygnus specified");
+ }
}
# Do any extra checking for GNU standards.
$ltxform = 's/\@LIBTOOL([^\@]*)\@//;';
}
+ local ($cygxform);
+ if (! $seen_cygwin32)
+ {
+ $cygxform = 's/\@EXEEXT\@//g; s/^NOTCYGWIN.*$//;';
+ }
+ else
+ {
+ $cygxform .= 's/^CYGWIN.*$//;';
+ }
+
while (@args)
{
if ($args[0] eq '-clean')
if ($do_clean)
{
$output_rules .=
- &file_contents_with_transform ('s/\@DIR\@/' . $X . '/go;',
+ &file_contents_with_transform ('s/\@DIR\@/' . $X . '/go;'
+ . $cygxform,
$clean_file);
push (@clean, $X . $primary);
next;
}
- $output_rules .=
- &file_contents_with_transform ('s/\@DIR\@/' . $X . '/g;'
- . $ltxform,
- $file);
+ $output_rules .=
+ &file_contents_with_transform ('s/\@DIR\@/' . $X . '/g;'
+ . $ltxform . $cygxform,
+ $file);
push (@uninstall, 'uninstall-' . $X . $primary);
push (@phony, 'uninstall-' . $X . $primary);
@file{stamp-h.in} in your source directory. It can be empty.
@cvindex AM_CONFIG_HEADER
+@item AM_CYGWIN32
+Check to see if this @code{configure} is being run in the
+@samp{Cygwin32} environment. (FIXME xref). If so, define output
+variable @code{EXEEXT} to @samp{.exe}; otherwise define it to the empty
+string. Automake recognizes this macro and uses it to generate
+@file{Makefile.in}s which will automatically work under @samp{Cygwin32}.
+In the @samp{Cygwin32} environment, @code{gcc} generates executables
+whose names end in @samp{.exe}, even if this was not specified on the
+command line. Automake adds special code to @file{Makefile.in} to
+gracefully deal with this.
+
@item AM_FUNC_STRTOD
If the @code{strtod} function is not available, or does not work
correctly (like the one on SunOS 5.4), add @file{strtod.o} to output
implied.
@item
-The macro @samp{AM_MAINTAINER_MODE} is required.
+The macros @samp{AM_MAINTAINER_MODE} and @samp{AM_CYGWIN32} are
+required.
@end itemize
GNU maintainers are advised to use @samp{gnu} strictness in preference
## 02111-1307, USA.
@PROGRAM@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES)
$(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS)
+CYGWIN @test -n "$(EXEEXT)" && echo timestamp > @PROGRAM@
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list="$(@DIR@_PROGRAMS)"; for p in $$list; do \
+## This works even in Cygwin32, because we've explicitly touched the
+## "real" program name after building it.
if test -f $$p; then \
## Note that we explicitly set the libtool mode. This avoids any
## lossage if the install program doesn't have a name that libtool
## expects.
echo " @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`"; \
- @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
+ @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p@EXEEXT@ $(@DIR@dir)/`echo $$p|sed '$(transform)'`@EXEEXT@; \
else :; fi; \
done
uninstall-@DIR@PROGRAMS:
list="$(@DIR@_PROGRAMS)"; for p in $$list; do \
- rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
+ rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`@EXEEXT@; \
done
m4datadir = $(datadir)/aclocal
m4data_DATA = ccstdc.m4 dmalloc.m4 init.m4 install.m4 lispdir.m4 \
maintainer.m4 protos.m4 ptrdiff.m4 regex.m4 strtod.m4 termios.m4 \
-winsz.m4 mktime.m4 error.m4 obstack.m4 sanity.m4 header.m4 missing.m4
+winsz.m4 mktime.m4 error.m4 obstack.m4 sanity.m4 header.m4 missing.m4 \
+cygwin.m4
EXTRA_DIST = $(m4data_DATA)
m4datadir = $(datadir)/aclocal
m4data_DATA = ccstdc.m4 dmalloc.m4 init.m4 install.m4 lispdir.m4 \
maintainer.m4 protos.m4 ptrdiff.m4 regex.m4 strtod.m4 termios.m4 \
-winsz.m4 mktime.m4 error.m4 obstack.m4 sanity.m4 header.m4 missing.m4
+winsz.m4 mktime.m4 error.m4 obstack.m4 sanity.m4 header.m4 missing.m4 \
+cygwin.m4
EXTRA_DIST = $(m4data_DATA)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
--- /dev/null
+# Check to see if we're running under Cygwin32, without using
+# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
+# Otherwise set it to "".
+
+dnl AM_CYGWIN32()
+AC_DEFUN(AM_CYGWIN32,
+[AC_MSG_CHECKING(for Cygwin32 environment)
+AC_EGREP_CPP(lose, [
+#ifdef __CYGWIN32__
+lose
+#endif], [EXEEXT=.exe
+AC_MSG_RESULT(yes)], [EXEEXT=
+AC_MSG_RESULT(no)])
+AC_SUBST(EXEEXT)])
## 02111-1307, USA.
@PROGRAM@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES)
$(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS)
+CYGWIN @test -n "$(EXEEXT)" && echo timestamp > @PROGRAM@
mostlyclean-@DIR@PROGRAMS:
clean-@DIR@PROGRAMS:
- test -z "$(@DIR@_PROGRAMS)" || rm -f $(@DIR@_PROGRAMS)
+NOTCYGWIN test -z "$(@DIR@_PROGRAMS)" || rm -f $(@DIR@_PROGRAMS)
+CYGWIN @list="$(@DIR@_PROGRAMS)"; for p in $$list; do \
+CYGWIN rm -f $$p $$p$(EXEEXT); \
+CYGWIN done
distclean-@DIR@PROGRAMS:
## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list="$(@DIR@_PROGRAMS)"; for p in $$list; do \
+## This works even in Cygwin32, because we've explicitly touched the
+## "real" program name after building it.
if test -f $$p; then \
## Note that we explicitly set the libtool mode. This avoids any
## lossage if the install program doesn't have a name that libtool
## expects.
echo " @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`"; \
- @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
+ @LIBTOOL --mode=install@ $(INSTALL_PROGRAM) $$p@EXEEXT@ $(@DIR@dir)/`echo $$p|sed '$(transform)'`@EXEEXT@; \
else :; fi; \
done
uninstall-@DIR@PROGRAMS:
list="$(@DIR@_PROGRAMS)"; for p in $$list; do \
- rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \
+ rm -f $(@DIR@dir)/`echo $$p|sed '$(transform)'`@EXEEXT@; \
done
-@set UPDATED 19 March 1997
+@set UPDATED 20 March 1997
@set EDITION 1.1m
@set VERSION 1.1m
-@set UPDATED 19 March 1997
+@set UPDATED 20 March 1997
@set EDITION 1.1m
@set VERSION 1.1m