From 7fd79f9d56545de37ba56f1dfadb56cd6270fe4d Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 19 Jan 2016 14:47:35 -0600 Subject: [PATCH] Bug in pre-built library support Moved the check to exclude directories in make_swig_makefile to after the test to see if we should expect them. This way we will write the code we are expecting even though we will not be generating the code itself. refs #163 --- bin/pm/make_swig_makefile.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/bin/pm/make_swig_makefile.pm b/bin/pm/make_swig_makefile.pm index ab674418..0a969a8d 100644 --- a/bin/pm/make_swig_makefile.pm +++ b/bin/pm/make_swig_makefile.pm @@ -1,5 +1,7 @@ package make_swig_makefile ; +# $Id: make_makefile.pm 591 2010-03-09 21:17:48Z lin $ + use Exporter (); use trick_version ; use File::Path ; @@ -250,8 +252,6 @@ sub make_swig_makefile($$$) { print MAKEFILE "\t\$(SWIG_MODULE_OBJECTS)\\\n" ; print MAKEFILE "\t\$(SIM_SWIG_OBJECTS)\n\n" ; - print MAKEFILE "\$(ALL_SWIG_OBJECTS) : | \$(LIB_DIR) \$(OBJECT_DIR)\n\n" ; - print MAKEFILE "# SWIG_PY_OBJECTS is a convienince list to modify rules for compilation\n" ; print MAKEFILE "SWIG_PY_OBJECTS =" ; foreach my $f ( @temp_array2 ) { @@ -285,20 +285,11 @@ sub make_swig_makefile($$$) { $ii = 0 ; foreach my $f ( @temp_array2 ) { - my ($continue) = 1 ; - foreach my $ie ( @exclude_dirs ) { - # if file location begins with $ie (an IGC exclude dir) - if ( $f =~ /^\Q$ie/ ) { - $continue = 0 ; - $ii++ ; - last ; # break out of loop - } - } - next if ( $continue == 0 ) ; - my ($swig_dir, $swig_object_dir , $swig_module_dir , $swig_file_only) ; my ($swig_f) = $f ; + # Add files to python_modules before testing exclude directories. + # This allows us to expect swig'ed files without compiling them (libraries). if ( $$sim_ref{python_module}{$f} ne "" ) { #print "python module for $f = $$sim_ref{python_module}{$f}\n" ; my ($temp_str) = $$sim_ref{python_module}{$f} ; @@ -312,6 +303,17 @@ sub make_swig_makefile($$$) { push @{$python_modules{"root"}} , $f ; } + my ($continue) = 1 ; + foreach my $ie ( @exclude_dirs ) { + # if file location begins with $ie (an IGC exclude dir) + if ( $f =~ /^\Q$ie/ ) { + $continue = 0 ; + $ii++ ; + last ; # break out of loop + } + } + next if ( $continue == 0 ) ; + my $md5_sum = md5_hex($f) ; # check if .sm file was accidentally ##included instead of #included if ( rindex($swig_f,".sm") != -1 ) {