This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Help with CVS (Was: Conditionals in CVS Automake)


On Tue, Mar 27, 2001 at 10:52:52PM +0200, akim@lrde.epita.fr wrote:
> 
> I'm home currently, which means... I have my prcs handy :)  Starting to
> track down more precisely...

It's between revision 0.119 and 0.120, diffs attached.  I'm looking for
the problem.
Index: 0.119/ChangeLog
--- 0.119/ChangeLog Sun, 04 Mar 2001 15:17:55 +0100 akim (am/f/47_ChangeLog 1.110 644)
+++ 0.120/ChangeLog Sun, 04 Mar 2001 20:02:14 +0100 akim (am/f/47_ChangeLog 1.111 644)
@@ -1,5 +1,22 @@
 2001-03-04  Akim Demaille  <akim@epita.fr>
 
+	If OBJEXT and EXEEXT are not set, provide a default value, and use
+	them unconditionally.
+
+	* automake.in (&generate_makefile): Provide default values for
+	EXEEXT and OBJEXT.
+	(&get_object_extension, &finish_languages)
+	(&handle_single_transform_list, &handle_programs, &add_depend2)
+	(&check_cygnus, &lang_c_finish, am_install_var): Don't bother with
+	them, they are defined.
+	* compile.am, depend2.am, program.am, progs.am: Likewise.
+	* remake-hdr.am: Fix a typo.
+	* tests/cxxo.test, tests/fo.test, tests/implicit.test,
+	* tests/interp.test, tests/subobj.test, tests/subobj2.test,
+	* tests/suffix2.test: Adjust.
+
+2001-03-04  Akim Demaille  <akim@epita.fr>
+
 	Standardize the handing of `all' targets.
 
 	* automake.in (@all): Remove.
Index: 0.119/automake.in
--- 0.119/automake.in Sun, 04 Mar 2001 15:17:55 +0100 akim (am/f/39_automake.i 1.109 755)
+++ 0.120/automake.in Sun, 04 Mar 2001 20:02:14 +0100 akim (am/f/39_automake.i 1.110 755)
@@ -1115,6 +1115,14 @@
 	return;
     }
 
+    # If OBJEXT/EXEEXT were not set in configure.in, do it, it
+    # simplifies our task, and anyway starting with Autoconf 2.50, it
+    # will always be defined, and this code will be dead.
+    $output_vars .= "EXEEXT =\n"
+      unless $seen_exeext;
+    $output_vars .= "OBJEXT = o\n"
+      unless $seen_objext;
+
     # Must do this after reading .am file.  See read_main_am_file to
     # understand weird tricks we play there with variables.
     &define_variable ('subdir', $relative_dir);
@@ -1319,8 +1327,7 @@
     my ($out) = @_;
 
     # Maybe require libtool library object files.
-    my $extension = '.o';
-    $extension = '.$(OBJEXT)' if $seen_objext;
+    my $extension = '.$(OBJEXT)';
     $extension = '.lo' if ($out =~ /\.la$/);
 
     if (! $included_generic_compile)
@@ -1344,8 +1351,7 @@
 			  &transform ('DEFAULT_INCLUDES' => $default_include));
 
 	$output_rules .=
-	  &file_contents ('compile',
-			  &transform ('OBJEXT' => $seen_objext));
+	  &file_contents ('compile');
 
 	# If using X, include some extra variable definitions.  NOTE
 	# we don't want to force these into CFLAGS or anything,
@@ -1359,8 +1365,7 @@
 	    }
 	}
 
-	push (@suffixes, '.c', '.o');
-	push (@suffixes, '.obj') if $seen_objext;
+	push (@suffixes, '.c', '.o', '.obj');
 
 	$included_generic_compile = 1;
     }
@@ -1402,26 +1407,25 @@
 	    # Generate rules to build ansi2knr.  If it is in some
 	    # other directory, then generate dependencies but have the
 	    # rule just run elsewhere.
-	    my $objext = $seen_objext ? ".\$(OBJEXT)" : ".o";
 	    $output_rules .= ($options{'ansi2knr'} . ': '
-			      . $options{'ansi2knr'} . $objext . "\n");
+			      . $options{'ansi2knr'} . '.$(OBJEXT)' . "\n");
 	    if ($options{'ansi2knr'} eq 'ansi2knr')
 	    {
-		$output_rules .= ("\t\$(LINK) ansi2knr" . $objext
+		$output_rules .= ("\t\$(LINK) ansi2knr.\$(OBJEXT)"
 				  . " \$(LIBS)\n"
-				  . "ansi2knr" . $objext
+				  . 'ansi2knr.$(OBJEXT)'
 				  . ": \$(CONFIG_HEADER)\n\n");
 	    }
 	    else
 	    {
 		$output_rules .= ("\tcd " . dirname ($options{'ansi2knr'})
-				  . " && \$(MAKE) \$(AM_MAKEFLAGS) "
+				  . ' && $(MAKE) $(AM_MAKEFLAGS) '
 				  . "ansi2knr\n\n");
 		# This is required for non-GNU makes.
-	        $output_rules .= ($options{'ansi2knr'} . $objext . ":\n");
+	        $output_rules .= ($options{'ansi2knr'} . '.$(OBJEXT)' . ":\n");
 		$output_rules .= ("\tcd " . dirname ($options{'ansi2knr'})
-				  . " && \$(MAKE) \$(AM_MAKEFLAGS)"
-				  . " ansi2knr" . $objext . "\n\n");
+				  . ' && $(MAKE) $(AM_MAKEFLAGS)'
+				  . ' ansi2knr.$(OBJEXT)' . "\n\n");
 	    }
 
 	    # Make sure ansi2knr can be found: if no path specified,
@@ -1497,8 +1501,7 @@
 	    # FIXME: Using cygpath should be somehow conditional.
 	    $output_rules .= (".$ext.obj:\n"
 			      . $full
-			      . " \`cygpath -w \$<\`\n")
-		if $seen_objext;
+			      . " \`cygpath -w \$<\`\n");
 	    $output_rules .= (".$ext.lo:\n"
 			      . "\t\$(LT"
 			      . $language_map{$lang . '-compiler-name'}
@@ -1908,7 +1911,7 @@
         {
             my $depfile = $object;
             $depfile =~ s/\.([^.]*)$/.P$1/;
-            $depfile =~ s/\$\(OBJEXT\)$/o/ if $seen_objext;
+            $depfile =~ s/\$\(OBJEXT\)$/o/;
             $dep_files{'$(DEPDIR)/' . $depfile} = 1;
         }
     }
@@ -2299,15 +2302,8 @@
 	    $xlink = $linker ? $linker : 'LINK';
 	}
 
-	my $exeext = '';
-	if ($seen_exeext && $one_file !~ /\./)
-	{
-	    $exeext = '$(EXEEXT)';
-	}
-
 	$output_rules .= &file_contents ('program',
-					 &transform ('EXEEXT'   => $exeext,
-						     'PROGRAM'  => $one_file,
+					 &transform ('PROGRAM'  => $one_file,
 						     'XPROGRAM' => $xname,
 						     'XLINK'    => $xlink));
     }
@@ -3220,7 +3216,6 @@
     # First include code for ordinary objects.
     my $xform = &transform ('PFX'  => $pfx,
 			    'FPFX' => $fpfx,
-			    'OBJEXT'  => $seen_objext,
 			    'LIBTOOL' => $seen_libtool,
 			    'AMDEP'   => $use_dependencies);
 
@@ -4822,11 +4817,6 @@
     {
 	&am_conf_error ("\`AM_MAINTAINER_MODE' required when --cygnus specified");
     }
-
-    if (! $seen_exeext)
-    {
-	&am_conf_error ("\`AC_EXEEXT' required when --cygnus specified");
-    }
 }
 
 # Do any extra checking for GNU standards.
@@ -5082,9 +5072,9 @@
 			      . '; else echo ' . $base . '.c; fi` '
 			      . "| sed 's/^# \\([0-9]\\)/#line \\1/' "
 			      . '| $(ANSI2KNR) > ' . $base . "_.c\n");
- 	    push (@objects, $base . '_'
-		  . ($seen_objext ? '.$(OBJEXT)' : '.o'));
- 	    push (@objects, $base . '_.lo') if $seen_libtool;
+ 	    push (@objects, $base . '_.$(OBJEXT)');
+ 	    push (@objects, $base . '_.lo')
+	      if $seen_libtool;
  	}
 
  	# Make all _.o (and _.lo) files depend on ansi2knr.
@@ -7039,7 +7029,7 @@
 
 	    # A blatant hack: we rewrite each _PROGRAMS primary to
 	    # include EXEEXT when in Cygwin32 mode.
-	    if ($seen_exeext && $primary eq 'PROGRAMS')
+	    if ($primary eq 'PROGRAMS')
 	    {
 		my @conds = &variable_conditions ($one_name);
 
Index: 0.119/compile.am
--- 0.119/compile.am Fri, 09 Feb 2001 04:37:00 +0100 akim (am/g/48_compile.am 1.3 644)
+++ 0.120/compile.am Sun, 04 Mar 2001 20:02:14 +0100 akim (am/g/48_compile.am 1.4 644)
@@ -20,8 +20,7 @@
 mostlyclean-compile:
 ## Don't remove 'core.*' because some distributions have eg "core.c".
 ## 4.4BSD systems use `PROG.core'.
-	-rm -f *.o core *.core
-?OBJEXT?	-rm -f *.$(OBJEXT)
+	-rm -f *.$(OBJEXT) core *.core
 
 distclean-am: distclean-compile
 distclean-compile:
Index: 0.119/depend2.am
--- 0.119/depend2.am Tue, 27 Feb 2001 22:23:36 +0100 akim (am/g/43_depend2.am 1.7 644)
+++ 0.120/depend2.am Sun, 04 Mar 2001 20:02:14 +0100 akim (am/g/43_depend2.am 1.8 644)
@@ -30,16 +30,16 @@
 ?AMDEP?@AMDEP@	$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 	%COMPILE% -c -o %OBJ% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE%
 
-?GENERIC??LIBTOOL?%EXT%.lo:
-?!GENERIC??LIBTOOL?LTOBJ%: %SOURCE%
+?LIBTOOL??GENERIC?%EXT%.lo:
+?LIBTOOL??!GENERIC?%LTOBJ%: %SOURCE%
 ?LIBTOOL??AMDEP?@AMDEP@	source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
 ?LIBTOOL??AMDEP?@AMDEP@	depfile='$(DEPDIR)/%BASE%.Plo' tmpdepfile='$(DEPDIR)/%BASE%.TPlo' @AMDEPBACKSLASH@
 ?LIBTOOL??AMDEP?@AMDEP@	$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 ?LIBTOOL?	%LTCOMPILE% -c -o %LTOBJ% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE%
 
-?GENERIC??OBJEXT?%EXT%.obj:
-?!GENERIC??OBJEXT?%OBJOBJ%: %SOURCE%
-?OBJEXT??AMDEP?@AMDEP@	source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
-?OBJEXT??AMDEP?@AMDEP@	depfile='$(DEPDIR)/%BASE%.Po' tmpdepfile='$(DEPDIR)/%BASE%.TPo' @AMDEPBACKSLASH@
-?OBJEXT??AMDEP?@AMDEP@	$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
-?OBJEXT?	%COMPILE% -c -o %OBJOBJ% `cygpath -w %SOURCE%`
+?GENERIC?%EXT%.obj:
+?!GENERIC?%OBJOBJ%: %SOURCE%
+?AMDEP?@AMDEP@	source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
+?AMDEP?@AMDEP@	depfile='$(DEPDIR)/%BASE%.Po' tmpdepfile='$(DEPDIR)/%BASE%.TPo' @AMDEPBACKSLASH@
+?AMDEP?@AMDEP@	$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
+	%COMPILE% -c -o %OBJOBJ% `cygpath -w %SOURCE%`
Index: 0.119/program.am
--- 0.119/program.am Mon, 26 Feb 2001 23:44:40 +0100 akim (am/g/22_program.am 1.4 644)
+++ 0.120/program.am Sun, 04 Mar 2001 20:02:14 +0100 akim (am/g/22_program.am 1.5 644)
@@ -15,11 +15,11 @@
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
-%PROGRAM%%EXEEXT%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES)
+%PROGRAM%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES)
 ## Remove program before linking.  Otherwise the link will fail if the
 ## program is running somewhere.  FIXME: this could be a loss if
 ## you're using an incremental linker.  Maybe we should think twice?
 ## Or maybe not... sadly, incremental linkers are rarer than losing
 ## systems.
-	@rm -f %PROGRAM%%EXEEXT%
+	@rm -f %PROGRAM%
 	$(%XLINK%) $(%XPROGRAM%_LDFLAGS) $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_LDADD) $(LIBS)
Index: 0.119/progs.am
--- 0.119/progs.am Thu, 01 Mar 2001 22:55:36 +0100 akim (am/g/20_progs.am 1.5 644)
+++ 0.120/progs.am Sun, 04 Mar 2001 20:02:14 +0100 akim (am/g/20_progs.am 1.6 644)
@@ -1,5 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2001
+##  Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -16,6 +17,11 @@
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 
+
+## ------------ ##
+## Installing.  ##
+## ------------ ##
+
 _am_installdirs += $(DESTDIR)$(%NDIR%dir)
 ?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
 ?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
@@ -29,7 +35,7 @@
 ## Note that we explicitly set the libtool mode.  This avoids any
 ## lossage if the install program doesn't have a name that libtool
 ## expects.
-	    f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
+	    f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
 ?LIBTOOL?	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
 ?LIBTOOL?	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(%NDIR%dir)/$$f; \
 ?!LIBTOOL?	    echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(%NDIR%dir)/$$f"; \
@@ -37,11 +43,16 @@
 	  else :; fi; \
 	done
 
+
+## -------------- ##
+## uninstalling.  ##
+## -------------- ##
+
 .PHONY uninstall-am: uninstall-%DIR%PROGRAMS
 uninstall-%DIR%PROGRAMS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
-	  f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
 	  echo " rm -f $(DESTDIR)$(%NDIR%dir)/$$f"; \
 	  rm -f $(DESTDIR)$(%NDIR%dir)/$$f; \
 	done
Index: 0.119/remake-hdr.am
--- 0.119/remake-hdr.am Sun, 04 Mar 2001 15:17:55 +0100 akim (am/g/17_remake-hdr 1.6 644)
+++ 0.120/remake-hdr.am Sun, 04 Mar 2001 20:02:14 +0100 akim (am/g/17_remake-hdr 1.7 644)
@@ -48,7 +48,7 @@
 		rm -f $(srcdir)/%SRC_STAMP%.in; \
 		$(MAKE) $(srcdir)/%SRC_STAMP%.in; \
 	else :; fi
-$(srcdir)/%SRC_STAMP%.in: $(top_srcdir)/%CONFIGURE_AC% $(ACLOCAL_M4) %FILES%
+$(srcdir)/%SRC_STAMP%.in: $(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) %FILES%
 	@rm -f $(srcdir)/%SRC_STAMP%.in $(srcdir)/%SRC_STAMP%.inT
 ## We used to try to get a real timestamp here.  But the fear is that
 ## that will cause unnecessary cvs conflicts
Index: 0.119/tests/cxxo.test
--- 0.119/tests/cxxo.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/d/33_cxxo.test 1.1 775)
+++ 0.120/tests/cxxo.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/d/33_cxxo.test 1.2 775)
@@ -16,4 +16,4 @@
 
 $AUTOMAKE || exit 1
 
-fgrep doe.o Makefile.in
+fgrep 'doe.$(OBJEXT)' Makefile.in
Index: 0.119/tests/fo.test
--- 0.119/tests/fo.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/d/3_fo.test 1.1 775)
+++ 0.120/tests/fo.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/d/3_fo.test 1.2 775)
@@ -18,4 +18,4 @@
 
 $AUTOMAKE || exit 1
 
-fgrep doe.o Makefile.in
+fgrep 'doe.$(OBJEXT)' Makefile.in
Index: 0.119/tests/implicit.test
--- 0.119/tests/implicit.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/c/46_implicit.t 1.1 775)
+++ 0.120/tests/implicit.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/c/46_implicit.t 1.2 775)
@@ -15,4 +15,4 @@
 
 $AUTOMAKE || exit 1
 
-grep '^libapp_1_OBJECTS' Makefile.in | grep '\.o'
+grep '^libapp_1_OBJECTS' Makefile.in | fgrep '.$(OBJEXT)'
Index: 0.119/tests/interp.test
--- 0.119/tests/interp.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/c/33_interp.tes 1.1 775)
+++ 0.120/tests/interp.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/c/33_interp.tes 1.2 775)
@@ -16,4 +16,4 @@
 
 $AUTOMAKE || exit 1
 
-grep 'z\.o' Makefile.in
+fgrep 'z.$(OBJEXT)' Makefile.in
Index: 0.119/tests/subobj.test
--- 0.119/tests/subobj.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/39_subobj.tes 1.1 775)
+++ 0.120/tests/subobj.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/39_subobj.tes 1.2 775)
@@ -19,8 +19,8 @@
 
 $AUTOMAKE || exit 1
 
-fgrep 'generic/a.o' Makefile.in || exit 1
-grep '[^/]a\.o' Makefile.in && exit 1
+fgrep 'generic/a.$(OBJEXT)' Makefile.in || exit 1
+grep '[^/]a\.\$(OBJEXT)' Makefile.in && exit 1
 
 # Opportunistically test for a different bug.
-grep '^generic/b.o:.*dirstamp' Makefile.in
+grep '^generic/b.\$(OBJEXT):.*dirstamp' Makefile.in
Index: 0.119/tests/subobj2.test
--- 0.119/tests/subobj2.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/38_subobj2.te 1.1 775)
+++ 0.120/tests/subobj2.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/38_subobj2.te 1.2 775)
@@ -18,6 +18,6 @@
 
 $AUTOMAKE || exit 1
 
-fgrep 'generic/a.o' Makefile.in || exit 1
-grep '[^/]a\.o' Makefile.in && exit 1
+fgrep 'generic/a.$(OBJEXT)' Makefile.in || exit 1
+grep '[^/]a\.\$(OBJEXT)' Makefile.in && exit 1
 fgrep -e '-c -o' Makefile.in
Index: 0.119/tests/suffix2.test
--- 0.119/tests/suffix2.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/34_suffix2.te 1.1 775)
+++ 0.120/tests/suffix2.test Sun, 04 Mar 2001 20:02:14 +0100 akim (am/34_suffix2.te 1.2 775)
@@ -27,4 +27,5 @@
 
 $AUTOMAKE -a || exit 1
 
-test "`fgrep '.c.o' Makefile.in | wc -l`" -eq 1
+grep '^\.c\.o:' Makefile.in
+grep '^\.c\.obj:' Makefile.in

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]