diff --git a/Changes b/Changes index 221c02261..1d22fd519 100644 --- a/Changes +++ b/Changes @@ -7,11 +7,11 @@ indicates the contributor was also the author of the fix; Thanks! *** Support $ceil, $floor, etc. [Alex Solomatnikov] -*** Fix --help output to go to stderr, not stdout, bug397. [R. Diez] +*** Fix --help output to go to stderr, not stdout, bug397. [Ruben Diez] **** Fix MSVC compile warning with trunc/round, bug394. [Amir Gonnen] -**** Fix autoconf warnings, bug396. [R. Diez] +**** Fix autoconf and Makefile warnings, bug396. [Ruben Diez] * Verilator 3.821 2011/09/14 diff --git a/bin/verilator b/bin/verilator index 6837278c9..98a2e2956 100755 --- a/bin/verilator +++ b/bin/verilator @@ -70,7 +70,7 @@ if (! GetOptions ( # "version!" => \&version, # Also passthru'ed # Switches "gdb=s" => \$opt_gdb, # Undocumented debugging - "gdbbt!" => \$opt_gdbbt, # Undocumented debugging + "gdbbt!" => \$opt_gdbbt, # Additional parameters "<>" => sub {}, # Ignored )) { @@ -125,7 +125,14 @@ sub verilator_bin { $bin = "$dir/$basename"; # From pointing to kit directory } } else { - $bin = $basename; + if (-x "$RealBin/$basename") { + $bin = "$RealBin/$basename"; # From path/to/verilator with verilator_bin installed + } else { + $bin = $basename; # Find in PATH + } + # Note we don't look under bin/$basename which would be right if running + # in the kit dir. Running that would likely break, since + # VERILATOR_ROOT wouldn't be set and Verilator won't find internal files. } return $bin; } diff --git a/nodist/install_test b/nodist/install_test index 7911f82dd..ef243b24f 100755 --- a/nodist/install_test +++ b/nodist/install_test @@ -33,12 +33,14 @@ sub test { $ENV{VERILATOR_NO_OPT_BUILD} = 1; # Don't build optimized executables; just slows this down run("make distclean") if -r "Makefile"; + my $stage = $ENV{VERILATOR_INSTALL_TEST_STAGE}||0; # For debugging this process + # Try building from a scratch area my $srcdir = getcwd(); my $blddir = $srcdir."/test_regress/obj_dir/install_test_bld"; my $prefix = $srcdir."/test_regress/obj_dir/install_test_prefix"; my $testdir = $srcdir."/test_regress/obj_dir/install_test_test"; - if (1) { + if ($stage <= 0) { run("/bin/rm -rf $blddir"); run("/bin/mkdir -p $blddir"); run("cd $blddir && $srcdir/configure --prefix $prefix"); @@ -46,14 +48,14 @@ sub test { } # Install it under the prefix - if (1) { + if ($stage <= 1) { run("/bin/rm -rf $prefix"); run("/bin/mkdir -p $prefix"); run("cd $blddir && make install"); } # Run a test using just the path - if (1) { + if ($stage <= 2) { run("/bin/rm -rf $testdir"); run("/bin/mkdir -p $testdir"); my $bin1 = $prefix."/bin"; diff --git a/src/Makefile.in b/src/Makefile.in index 6c7cbac14..d73216265 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -24,6 +24,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ PERL = @PERL@ +EXEEXT = @EXEEXT@ #### End of system configuration section. #### @@ -65,8 +66,7 @@ opt: ../verilator_bin ifeq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... One build ../verilator_bin: ../verilator_bin_dbg -rm -rf $@ $@.exe - -cp -p $< $@ - -cp -p $<.exe $@.exe + -cp -p $<$(EXEEXT) $@$(EXEEXT) else ../verilator_bin: obj_opt prefiles cd obj_opt && $(MAKE) -j 1 TGT=../$@ -f ../Makefile_obj serial diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in index bdf5d0aab..67e6a63db 100644 --- a/src/Makefile_obj.in +++ b/src/Makefile_obj.in @@ -60,6 +60,7 @@ pkgdatadir = @pkgdatadir@ CFG_WITH_DEFENV = @CFG_WITH_DEFENV@ CPPFLAGS += @CPPFLAGS@ LDFLAGS += @LDFLAGS@ +EXEEXT = @EXEEXT@ #### End of system configuration section. #### @@ -140,6 +141,7 @@ clean mostlyclean distclean maintainer-clean:: distclean maintainer-clean:: clean maintainer-clean:: + -rm -f config_rev.h maintainer-copy:: @@ -251,8 +253,9 @@ $(TGT): V3Ast__gen_classes.h $(OBJS) @echo " Linking $@..." -rm -rf $@ $@.exe ${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS} - @-(cp $@.exe $@ || true) -# ok if cp failes on linux, it's there to insure executable works on NT +ifneq ($(EXEEXT),) + cp $@$(EXEEXT) $@ +endif V3Number_test: V3Number_test.o ${LINK} ${LDFLAGS} -o $@ $^ ${LIBS}