- if ($todo eq 'import') {
- if ( $ModuleIn{$modname} ) {
- $follow_file = "$ModuleIn{$modname}/$modname.hi";
- } else { # hard way
- $follow_file
- = &find_in_Import_dirs($orig_src_file, $modname, $last_seen_dir, $source );
+ &process_dependency($todo,$source,$modname);
+ }
+ close(SRCFILE) || exit(1);
+ # remove temporary file, if any.
+ if ($cleanup) {
+ unlink("$read_from_file");
+ }
+}
+
+#
+# Handle
+sub process_dependency {
+ local($todo,$source,$modname) = @_;
+
+ if ($todo eq 'import') {
+ if ( $IgnoreMe{$modname} eq 'Y' ) {
+ # user specifically asked for this module
+ # to be ignored.
+ $follow_file = '__ignore__';
+ } elsif ( $ModuleIn{$modname} ) {
+ $follow_file = "$ModuleIn{$modname}/$modname.hi";
+ } else { # hard way
+ $follow_file =
+ &find_in_Import_dirs($orig_src_file, $modname, $last_seen_dir, $source );
+ }
+ } else {
+ $follow_file
+ = &find_in_Include_dirs($orig_src_file, $modname, $last_seen_dir);
+ }
+
+ if (! $follow_file) { # it didnae find anything
+ die "$orig_src_file: Couldn't handle: $_\n";
+
+ } else { # it found something
+ if ($follow_file ne '__ignore__') {
+ local($int_file) = $follow_file;
+
+ if ( $int_file !~ /\.(l?hs|hi|l?y)$/ ) {
+ local($str) = "";
+ foreach $obj (@Obj_suffix) {
+ $str .= "$bf.$obj ";
+ foreach $suff (@File_suffix) {
+ $str .= "$bf.${suff}_$obj ";
+ }