diff --git a/bin/convert_swig b/bin/convert_swig index 81b3d734..395321d9 100755 --- a/bin/convert_swig +++ b/bin/convert_swig @@ -132,6 +132,18 @@ if ( $help ) { if ( scalar @swig_exclude_dirs == 0 ) { @swig_exclude_dirs = split /:/ , $ENV{"TRICK_ICG_EXCLUDE"} ; } +if (scalar @swig_exclude_dirs) { + @swig_exclude_dirs = sort(@swig_exclude_dirs ); + # Error check - delete any element that is null + # (note: sort forced all blank names to front of array + @swig_exclude_dirs = map { s/(^\s+|\s+$)//g ; $_ } @swig_exclude_dirs ; + while ( not length @swig_exclude_dirs[0] ) { + # Delete an element from the left side of an array (element zero) + shift @swig_exclude_dirs ; + } + @swig_exclude_dirs = map { (-e $_) ? abs_path($_) : $_ } @swig_exclude_dirs ; + } + push @include_paths , ("-I".$ENV{"TRICK_HOME"}."/trick_source" , "-I../include") ; @defines = $ENV{"TRICK_CFLAGS"} =~ /(-D\S+)/g ; # get defines from TRICK_CFLAGS if ( $ENV{"TRICK_CFLAGS"} !~ /DTRICK_VER=/ ) { @@ -391,6 +403,10 @@ sub process_file($$) { $exclude = 1 ; last ; } + if ( abs_path($file_name) =~ /^\"\Q$i/ ) { + $exclude = 1 ; + last ; + } } if ( $exclude == 0 ) { diff --git a/bin/pm/make_makefile.pm b/bin/pm/make_makefile.pm index d1ca45de..022c0e6b 100644 --- a/bin/pm/make_makefile.pm +++ b/bin/pm/make_makefile.pm @@ -166,11 +166,20 @@ sub make_makefile($$$) { my $dum = $_ ; # if file location begins with $ie (an IGC exclude dir) if ( $dum =~ s/^\Q$ie// ) { - if ( $dum =~ /^\// ) { + if ( $dum eq "" or $dum =~ /^\// ) { trick_print($$sim_ref{fh}, "CP skipping $f (ICG exclude dir $ie)\n" , "normal_yellow" , $$sim_ref{args}{v}) ; $continue = 0 ; last ; # break out of loop } + } else { + $dum = abs_path($dum) ; + if ( $dum =~ s/^\Q$ie// ) { + if ( $dum eq "" or $dum =~ /^\// ) { + trick_print($$sim_ref{fh}, "CP skipping $f (ICG exclude dir $ie)\n" , "normal_yellow" , $$sim_ref{args}{v}) ; + $continue = 0 ; + last ; # break out of loop + } + } } } next if ( $continue == 0 ) ; diff --git a/bin/pm/make_swig_makefile.pm b/bin/pm/make_swig_makefile.pm index bef950f0..0fc57861 100644 --- a/bin/pm/make_swig_makefile.pm +++ b/bin/pm/make_swig_makefile.pm @@ -169,6 +169,12 @@ sub make_swig_makefile($$$) { $continue = 0 ; last ; # break out of loop } + # if an exlude path is a file, then we need to check absolute path vs. absolute path of exclude directory. + if ( abs_path($f) =~ /^\Q$ie/ ) { + trick_print($$sim_ref{fh}, "CP(swig) skipping $f (ICG exclude dir $ie)\n" , "normal_yellow" , $$sim_ref{args}{v}) ; + $continue = 0 ; + last ; # break out of loop + } } next if ( $continue == 0 ) ; my $temp_str ; diff --git a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp index 54baf133..8114ec4d 100644 --- a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp +++ b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -132,9 +133,17 @@ void HeaderSearchDirs::AddICGExcludeDirs () { //icg_exclude_dirs.push_back(item); item = trim(item) ; if ( ! item.empty() ) { - char * resolved_path = realpath(item.c_str(), NULL) ; + //char * resolved_path = realpath(item.c_str(), NULL) ; + char * resolved_path = almostRealPath(item.c_str() ) ; if ( resolved_path ) { - icg_exclude_dirs.push_back(std::string(resolved_path) + std::string("/")); + std::ifstream file_or_dir(resolved_path) ; + file_or_dir.seekg(0, std::ios::end) ; + if ( !file_or_dir.good()) { + icg_exclude_dirs.push_back(std::string(resolved_path) + "/"); + } else { + icg_exclude_dirs.push_back(std::string(resolved_path)); + } + free(resolved_path) ; } else { std::cout << "Cannot find TRICK_ICG_EXCLUDE directory " << item << std::endl ; } @@ -156,7 +165,13 @@ void HeaderSearchDirs::AddICGNoCommentDirs () { if ( ! item.empty() ) { char * resolved_path = realpath(item.c_str(), NULL) ; if ( resolved_path ) { - icg_nocomment_dirs.push_back(std::string(resolved_path) + std::string("/")); + std::ifstream file_or_dir(resolved_path) ; + file_or_dir.seekg(0, std::ios::end) ; + if ( !file_or_dir.good()) { + icg_nocomment_dirs.push_back(std::string(resolved_path) + "/"); + } else { + icg_nocomment_dirs.push_back(std::string(resolved_path)); + } } else { std::cout << "Cannot find TRICK_ICG_NOCOMMENT directory " << item << std::endl ; } diff --git a/trick_source/sim_services/MemoryManager/include/parameter_types.h b/trick_source/sim_services/MemoryManager/include/parameter_types.h index e0286f45..30e4f703 100644 --- a/trick_source/sim_services/MemoryManager/include/parameter_types.h +++ b/trick_source/sim_services/MemoryManager/include/parameter_types.h @@ -38,6 +38,9 @@ extern "C" { const char* trickTypeCharString( TRICK_TYPE type, const char* name); +/* here for backwards compatibility */ +#define TRICK_USER_DEFINED_TYPE TRICK_OPAQUE_TYPE + /* Define int_64t and uint_64t depending on compiler options */ #if __linux # include