summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--bin/DependencyGenerator/DependencyEditor.pm5
-rw-r--r--bin/DependencyGenerator/DependencyGenerator.pm4
-rw-r--r--bin/DependencyGenerator/Preprocessor.pm6
-rwxr-xr-xbin/depgen.pl29
-rwxr-xr-xbin/g++dep3
-rw-r--r--include/makeinclude/rules.local.GNU6
7 files changed, 57 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 65563940917..b657c85d164 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+Thu Mar 4 13:19:06 2004 Chad Elliott <elliott_c@ociweb.com>
+
+ * bin/DependencyGenerator/DependencyEditor.pm:
+ * bin/DependencyGenerator/DependencyGenerator.pm:
+ * bin/DependencyGenerator/Preprocessor.pm:
+ * bin/depgen.pl:
+
+ Added an option to exclude dependency information from user
+ specified files.
+
+ * include/makeinclude/rules.local.GNU:
+
+ Added the option to exclude dependencies found from config.h to
+ avoid pulling in files such as config-linux.h, config-sunos5.6.h,
+ etc.
+
+ * bin/g++dep:
+
+ Added an option to be compatible with depgen.pl.
+
Thu Mar 4 11:17:27 2004 Chad Elliott <elliott_c@ociweb.com>
* bin/MakeProjectCreator/modules/AutomakeProjectCreator.pm:
diff --git a/bin/DependencyGenerator/DependencyEditor.pm b/bin/DependencyGenerator/DependencyEditor.pm
index bbdcd92f043..1e884360d9e 100644
--- a/bin/DependencyGenerator/DependencyEditor.pm
+++ b/bin/DependencyGenerator/DependencyEditor.pm
@@ -35,6 +35,7 @@ sub process {
my($macros) = shift;
my($ipaths) = shift;
my($replace) = shift;
+ my($exclude) = shift;
my($files) = shift;
## Back up the original file and receive the contents
@@ -62,8 +63,8 @@ sub process {
print $fh "# DO NOT DELETE THIS LINE -- " . basename($0) . " uses it.\n" .
"# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.\n\n";
- my($dep) = new DependencyGenerator($macros, $ipaths,
- $replace, $type, $noinline);
+ my($dep) = new DependencyGenerator($macros, $ipaths, $replace,
+ $type, $noinline, $exclude);
my($objgen) = ObjectGeneratorFactory::create($type);
## Sort the files so the dependencies are reproducible
foreach my $file (sort @$files) {
diff --git a/bin/DependencyGenerator/DependencyGenerator.pm b/bin/DependencyGenerator/DependencyGenerator.pm
index 7561a19c028..c28cae59c26 100644
--- a/bin/DependencyGenerator/DependencyGenerator.pm
+++ b/bin/DependencyGenerator/DependencyGenerator.pm
@@ -26,7 +26,9 @@ sub new {
my($replace) = shift;
my($type) = shift;
my($noinline) = shift;
- my($self) = bless {'pre' => new Preprocessor($macros, $ipaths),
+ my($exclude) = shift;
+ my($self) = bless {'pre' => new Preprocessor($macros,
+ $ipaths, $exclude),
'replace' => $replace,
'dwrite' => DependencyWriterFactory::create($type),
'noinline' => $noinline,
diff --git a/bin/DependencyGenerator/Preprocessor.pm b/bin/DependencyGenerator/Preprocessor.pm
index add462539bb..58c44325723 100644
--- a/bin/DependencyGenerator/Preprocessor.pm
+++ b/bin/DependencyGenerator/Preprocessor.pm
@@ -22,8 +22,10 @@ sub new {
my($class) = shift;
my($macros) = shift;
my($ipaths) = shift;
+ my($exclude) = shift;
return bless {'macros' => $macros,
'ipaths' => $ipaths,
+ 'exclude' => $exclude,
'files' => {},
'ifound' => {},
'recurse' => 0,
@@ -106,7 +108,9 @@ sub process {
push(@{$$files{$file}}, $inc);
if (!defined $$files{$inc}) {
## Process this file, but do not return the include files
- $self->process($inc, $noinline, 1);
+ if (!defined $self->{'exclude'}->{basename($inc)}) {
+ $self->process($inc, $noinline, 1);
+ }
}
}
}
diff --git a/bin/depgen.pl b/bin/depgen.pl
index 1aad30698bc..82384ba3f01 100755
--- a/bin/depgen.pl
+++ b/bin/depgen.pl
@@ -15,10 +15,10 @@ eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
use strict;
use Cwd;
+use Config;
use File::Basename;
-my($execPath) = getExecutePath($0);
-unshift(@INC, "$execPath/DependencyGenerator");
+unshift(@INC, getExecutePath($0) . '/DependencyGenerator');
require DependencyEditor;
@@ -26,8 +26,8 @@ require DependencyEditor;
# Data Section
# ************************************************************
-my($version) = '0.8';
-my($os) = ($^O eq 'MSWin32' || $^O eq 'cygwin' ? 'Windows' : 'UNIX');
+my($version) = '0.9';
+my($os) = ($^O eq 'MSWin32' ? 'Windows' : 'UNIX');
my(%types) = ('gnu' => 1,
'nmake' => 1,
);
@@ -44,7 +44,7 @@ sub which {
my($exec) = $prog;
if (defined $ENV{'PATH'}) {
- my($envSep) = ($^O eq 'MSWin32' ? ';' : ':');
+ my($envSep) = $Config{'path_sep'};
foreach my $part (split(/$envSep/, $ENV{'PATH'})) {
$part .= "/$prog";
if ( -x $part ) {
@@ -99,13 +99,15 @@ sub usageAndExit {
"Usage: $base [-D<MACRO>[=VALUE]] [-I<include dir>] [-A] " .
"[-R <VARNAME>]\n" .
" " . (" " x length($base)) .
- " [-f <output file>] [-t <type>] [-n] <files...>\n" .
+ " [-e <file>] [-f <output file>] [-t <type>] [-n] <files...>\n" .
"\n" .
"-D This option sets a macro to an optional value.\n" .
"-I The -I option adds an include directory.\n" .
"-A Replace \$ACE_ROOT and \$TAO_ROOT paths with \$(ACE_ROOT) " .
"and \$(TAO_ROOT)\n respectively.\n" .
"-R Replace \$VARNAME paths with \$(VARNAME).\n" .
+ "-e Exclude dependencies generated by <file>, but not <file> " .
+ "itself.\n" .
"-f Specifies the output file. This file will be edited if it " .
"already\n exists.\n" .
"-n Do not include inline files (ending in .i or .inl) in the " .
@@ -154,6 +156,7 @@ my(@files) = ();
my(%macros) = ();
my(@ipaths) = ();
my(%replace) = ();
+my(%exclude) = ();
my($output) = '-';
@@ -187,6 +190,16 @@ for(my $i = 0; $i <= $#ARGV; ++$i) {
usageAndExit($base, 'Invalid use of -R');
}
}
+ elsif ($arg eq '-e') {
+ ++$i;
+ $arg = $ARGV[$i];
+ if (defined $arg) {
+ $exclude{$arg} = 1;
+ }
+ else {
+ usageAndExit($base, 'Invalid use of -e');
+ }
+ }
elsif ($arg eq '-f') {
++$i;
$arg = $ARGV[$i];
@@ -227,5 +240,5 @@ if (!defined $files[0]) {
}
my($editor) = new DependencyEditor();
-exit($editor->process($output, $type, $noinline,
- \%macros, \@ipaths, \%replace, \@files));
+exit($editor->process($output, $type, $noinline, \%macros,
+ \@ipaths, \%replace, \%exclude, \@files));
diff --git a/bin/g++dep b/bin/g++dep
index f545be99162..081e4f4d3d0 100755
--- a/bin/g++dep
+++ b/bin/g++dep
@@ -19,6 +19,9 @@ STOPNOW=0
while [ $STOPNOW -eq 0 ]
do
case $1 in
+ # -e for compatibility with depgen.pl
+ -e) shift; shift ;;
+
# -f allows you to select a makefile name
-f) MAKE=$2
shift; shift ;;
diff --git a/include/makeinclude/rules.local.GNU b/include/makeinclude/rules.local.GNU
index b0f1b4401bf..2d9d081f880 100644
--- a/include/makeinclude/rules.local.GNU
+++ b/include/makeinclude/rules.local.GNU
@@ -381,16 +381,14 @@ depend.local: $(DEPENDENCY_FILE)
-include $(DEPENDENCY_FILE)
endif
-ifndef DEPGEN
- DEPGEN = $(ACE_ROOT)/bin/g++dep
-endif
+DEPGEN ?= $(ACE_ROOT)/bin/g++dep
depend.local: $(MAKEFILE) idl_stubs.local
@$(RM) $(DEPENDENCY_FILE).old
@cp $(DEPENDENCY_FILE) $(DEPENDENCY_FILE).old
ACE_PLATFORM_CONFIG=$(ACE_PLATFORM_CONFIG) OBJEXT=$(OBJEXT) SOEXT=$(SOEXT) \
VDIR=$(VDIR) VSHDIR=$(VSHDIR) ACE_DEPEND_SED_CMD="$(ACE_DEPEND_SED_CMD)" \
- $(DEPGEN) -A $(DEPEND_CMD_ARGS) -f $(DEPENDENCY_FILE) $(CPPFLAGS) \
+ $(DEPGEN) -A $(DEPEND_CMD_ARGS) -e config.h -f $(DEPENDENCY_FILE) $(CPPFLAGS) \
-DMAKEDEPEND $(LSRC) $(SRC) $(PSRC)
@if cmp -s $(DEPENDENCY_FILE) $(DEPENDENCY_FILE).old ;\
then echo "Makefile dependencies unchanged." ;\