]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
cygwin32 support
authorTom Tromey <tromey@redhat.com>
Thu, 20 Mar 1997 23:51:34 +0000 (23:51 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 20 Mar 1997 23:51:34 +0000 (23:51 +0000)
16 files changed:
ChangeLog
NEWS
TODO
aclocal.in
automake.in
automake.texi
lib/am/program.am
lib/am/progs.am
m4/Makefile.am
m4/Makefile.in
m4/cygwin.m4 [new file with mode: 0644]
program.am
progs-clean.am
progs.am
stamp-vti
version.texi

index 6777b95c754cb5f877bfbdf8758910360f176a4b..eec4c3d36fc094ab9cfd5875e2c9cfaccef3483a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 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.
diff --git a/NEWS b/NEWS
index 90de2b86e60456842fec4c5a4de67f38786a8473..2de4a21d541ee294509a31ed084cc90cb9ac9bf0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ New in 1.1m:
   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
diff --git a/TODO b/TODO
index f9cdfeb8b7072f1d96e8d45356a06b23ae8b252f..7f87ab3f25623b76c78a97e151adc47ad7c3de61 100644 (file)
--- a/TODO
+++ b/TODO
@@ -4,6 +4,13 @@ Priorities for release:
 * 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.
 
index ed6b4498e25cdaa5c5ab7465fc7f48bd9798a208..3b3260262279eda6689d130ff4ef8df7f1b44fcf 100644 (file)
@@ -158,10 +158,11 @@ sub parse_arguments
        }
        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')
index 7696838a95a44df62b69b0bfa5a16144a4972a83..07f79493539b9dcf7ca5ddaa2f5e9cdf99545b85 100755 (executable)
@@ -190,6 +190,9 @@ $package_version_line = 0;
 # 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 = ();
@@ -228,7 +231,7 @@ $cygnus_mode = 0;
 
      # 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'",
@@ -304,10 +307,11 @@ sub parse_arguments
     {
        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;
        }
@@ -1409,11 +1413,18 @@ sub handle_programs
            $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');
     }
 
@@ -3634,6 +3645,13 @@ sub scan_one_configure_file
        # 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/)
        {
@@ -3821,6 +3839,11 @@ sub check_cygnus
     {
        &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.
@@ -4691,6 +4714,16 @@ sub am_install_var
        $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')
@@ -4775,7 +4808,8 @@ sub am_install_var
            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);
@@ -4796,10 +4830,10 @@ sub am_install_var
                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);
index 20fb25c41e023bb17b861250fcb475a5691dce6c..7355fa05e555528ad42eb632a1b5ef444870fb9d 100644 (file)
@@ -912,6 +912,17 @@ header.  If you do use this macro, you must create the file
 @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
@@ -2183,7 +2194,8 @@ The options @samp{no-installinfo} and @samp{no-dependencies} are
 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
index e91639ed6131210ddc45d14ce64a3fadb8fc2ccc..3d8d41169f81517fe80c3f62d56e0951ae7a8650 100644 (file)
@@ -17,3 +17,4 @@
 ## 02111-1307, USA.
 @PROGRAM@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES)
        $(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS)
+CYGWIN @test -n "$(EXEEXT)" && echo timestamp > @PROGRAM@
index debcf71ce95832a1361e8e9eb84333f92a18f396..3d255ef5db3216d570be3a31399b9c7da1d9f5c4 100644 (file)
@@ -21,16 +21,18 @@ install-@DIR@PROGRAMS: $(@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
index 8cccf1be0f7e142c6e04732db238775878a5d5c3..b04b26531cb266450bb52bbf466f1af213075a46 100644 (file)
@@ -6,6 +6,7 @@ MAINT_CHARSET = latin1
 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)
index 1b4aee3e22c96fdba71e2b088915458b2e85394e..801e4274a911a7e43612dc34d7e66e397cc2602b 100644 (file)
@@ -54,7 +54,8 @@ MAINT_CHARSET = latin1
 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
diff --git a/m4/cygwin.m4 b/m4/cygwin.m4
new file mode 100644 (file)
index 0000000..0c635f3
--- /dev/null
@@ -0,0 +1,14 @@
+# 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)])
index e91639ed6131210ddc45d14ce64a3fadb8fc2ccc..3d8d41169f81517fe80c3f62d56e0951ae7a8650 100644 (file)
@@ -17,3 +17,4 @@
 ## 02111-1307, USA.
 @PROGRAM@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES)
        $(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS)
+CYGWIN @test -n "$(EXEEXT)" && echo timestamp > @PROGRAM@
index cfe84d0d1daa646e703fd47f30ceeb706242898c..a4f14b44946acc206f306b820b17fb1a917898c3 100644 (file)
 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:
 
index debcf71ce95832a1361e8e9eb84333f92a18f396..3d255ef5db3216d570be3a31399b9c7da1d9f5c4 100644 (file)
--- a/progs.am
+++ b/progs.am
@@ -21,16 +21,18 @@ install-@DIR@PROGRAMS: $(@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
index 31205f9b2fb54710e174b13325e320426ba4ae69..44defd03affb9688d35326a4a4ced313ff7b1775 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,3 +1,3 @@
-@set UPDATED 19 March 1997
+@set UPDATED 20 March 1997
 @set EDITION 1.1m
 @set VERSION 1.1m
index 31205f9b2fb54710e174b13325e320426ba4ae69..44defd03affb9688d35326a4a4ced313ff7b1775 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 19 March 1997
+@set UPDATED 20 March 1997
 @set EDITION 1.1m
 @set VERSION 1.1m