Separate ICG & SWIG exclusion constructs

Refs #392
This commit is contained in:
Derek Bankieris 2017-03-27 15:19:43 -05:00
parent 2335f6bb69
commit b53c52ac33
9 changed files with 187 additions and 209 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@ bin/trick-trk2csv
aclocal.m4
autom4te.cache
trick_test
gmon.out

View File

@ -116,11 +116,12 @@ build/Makefile_src: build/Makefile_src_deps build/Makefile_io_src S_source.hh
build/Makefile_src_deps: ;
# Create makefile for SWIG code
#build/Makefile_swig: build/ICG_processed
build/Makefile_swig: build/Makefile_io_src
build/Makefile_swig: S_source.hh build/Makefile_swig_deps
$(PRINT_MAKEFILE_SWIG)
$(ECHO_CMD)${TRICK_HOME}/$(LIBEXEC)/trick/make_makefile_swig
build/Makefile_swig_deps: ;
# Forcibly (re)create all SWIG input (.i) files. This rule is never run by the normal
# build process.
.PHONY: convert_swig
@ -148,6 +149,7 @@ ifeq ($(findstring ${MAKECMDGOALS},$(CLEAN_TARGETS)),)
-include build/Makefile_src_deps
-include build/Makefile_io_src
-include build/Makefile_swig
-include build/Makefile_swig_deps
-include build/Makefile_ICG
endif
-include S_overrides.mk

View File

@ -13,6 +13,7 @@ use gte ;
use trick_version ;
use Digest::MD5 qw(md5_hex) ;
use File::Path qw(make_path) ;
use html ;
##
## ================================================================================
@ -51,8 +52,9 @@ my $help = ''; # option variable with default value (false)
my $stls = 0; # option variable with default value (false)
my ( @include_dirs , @defines) ;
my ( @swig_exclude_dirs) ;
my ( @exclude_dirs) ;
my @exclude_paths ;
my @swig_exclude_paths ;
my @ext_lib_paths ;
my %sim ;
my %out_of_date ;
my ($version, $thread, $year) ;
@ -122,11 +124,9 @@ if ( $help ) {
@include_dirs = $ENV{"TRICK_CFLAGS"} =~ /-I\s*(\S+)/g ; # get include paths from TRICK_CFLAGS
@swig_exclude_dirs = split /:/ , $ENV{"TRICK_SWIG_EXCLUDE"} ;
if ( scalar @swig_exclude_dirs == 0 ) {
@swig_exclude_dirs = split /:/ , $ENV{"TRICK_ICG_EXCLUDE"} ;
}
@exclude_dirs = split /:/ , $ENV{"TRICK_EXCLUDE"} ;
@exclude_paths = map abs_path($_), split /:/ , $ENV{"TRICK_EXCLUDE"} ;
@swig_exclude_paths = map abs_path($_), split /:/ , $ENV{"TRICK_SWIG_EXCLUDE"} ;
@ext_lib_paths = map abs_path($_), split /:/ , $ENV{"TRICK_EXT_LIB_DIRS"} ;
@defines = $ENV{"TRICK_CFLAGS"} =~ /(-D\S+)/g ; # get defines from TRICK_CFLAGS
if ( $ENV{"TRICK_CFLAGS"} !~ /DTRICK_VER=/ ) {
push @defines , "-DTRICK_VER=$year" ;
@ -222,54 +222,50 @@ sub process_file() {
## For each of the #includes in the out_of_date header file
## create a corresponding %import directive.
outer:
foreach (split /^/, $raw_contents) {
if ( /^(\s*\#\s*include\s+)([^\n]+)/ ) {
my ( $include ) = $1 ;
my ( $file_name ) = $2 ;
if ( /^\s*\#\s*include\s+([^\n]+)/ ) {
my $file_name = $1 ;
# strip trailing whitespace
$file_name =~ s/\s+$// ;
if ( $file_name !~ /\</ ) {
if ( $file_name !~ /\"sim_services/ and $file_name !~ /\"trick_utils/ and $file_name !~ /\"trick\//) {
my $exclude = 0 ;
my $temp_file_name ;
$temp_file_name = $file_name ;
$temp_file_name =~ s/"//g ;
# Check if include file's path begins with dot dot (..)
if ( $temp_file_name =~ /^\.\./ ) {
# include file location is relative to the input file's path.
# Get the absolute path to this include file... use this from now on.
$file_name = abs_path(dirname($f)) . "/" . $temp_file_name ;
# Re-insert double quotes around include file.
#$file_name = "\"" . $file_name . "\"" ;
} elsif ( $temp_file_name !~ /^\// ) {
foreach my $i ( dirname($f) , @include_dirs ) {
if ( -e ( "$i/$temp_file_name" ) ) {
$file_name = abs_path(dirname("$i/$temp_file_name")) . "/" . basename($temp_file_name) ;
last ;
}
}
} else {
$file_name = $temp_file_name ;
}
# ignore <> includes
if ( $file_name =~ /\</ ) {
next ;
}
foreach my $i ( @swig_exclude_dirs ) {
if ( $file_name =~ /^\"\Q$i/ ) {
$exclude = 1 ;
last ;
}
}
$file_name =~ s/^"// ;
$file_name = "\"build" . $file_name . "\"" ;
# normalize trick includes
$file_name =~ s/"//g ;
if ( $file_name =~ /sim_services/ or $file_name =~ /trick_utils/ or $file_name =~ /trick\//) {
$contents .= "\%import \"trick/" . basename($file_name) . "\"\n" ;
next ;
}
if ( $exclude == 0 ) {
$file_name =~ s/\.[^\.]+\"/\_py.i\"/ ;
# Convert relative paths to absolute paths
if ( $file_name !~ /^\// ) {
foreach my $i ( dirname($f) , @include_dirs ) {
my $candidate_path = "$i/$file_name" ;
if ( -e $candidate_path ) {
$file_name = $candidate_path ;
last ;
}
$contents .= "\%import $file_name\n" ;
} else {
$contents .= "\%import(module=\"sim_services\") $file_name\n" ;
}
}
# Get the canonical path (resolve ., .., and symbolic links)
$file_name = abs_path($file_name) ;
foreach my $i ( @exclude_paths, @swig_exclude_paths, @ext_lib_paths ) {
if ( $file_name =~ /^\Q$i/ ) {
next outer ;
}
}
$file_name = "build" . $file_name ;
$file_name =~ s/\.[^\.]+?$/\_py.i/ ;
$contents .= "\%import \"$file_name\"\n" ;
} else {
$contents .= $_ ;
}
@ -310,7 +306,7 @@ sub process_file() {
print OUT "\%module m$md5_sum\n\n" ;
print OUT "#include \"trick/swig/trick_swig.i\"\n\n" ;
print OUT "%include \"trick/swig/trick_swig.i\"\n\n" ;
print OUT "
\%insert(\"begin\") \%{

View File

@ -2,10 +2,9 @@
import os
path = os.path.abspath(os.getcwd())
with open('build/CP_instances') as cp_instances:
with open('build/top.i', 'w') as top:
path = os.path.abspath(os.getcwd())
instances = ''.join(cp_instances.readlines())
top.write(
'%module top\n'

View File

@ -9,157 +9,147 @@ use Cwd 'abs_path';
use gte ;
use Digest::MD5 qw(md5_hex) ;
use trick_version ;
use html ;
use strict ;
my @exclude_dirs ;
my @swig_exclude_dirs ;
my @exclude_paths ;
my @swig_exclude_paths ;
my @ext_lib_paths ;
my @files_to_process ;
my @ext_lib_files ;
my %md5s ;
my $verbose_build = exists($ENV{'TRICK_VERBOSE_BUILD'}) ;
sub get_exclude_dirs() {
@exclude_dirs = split /:/ , $ENV{"TRICK_EXCLUDE"};
# See if there are any elements in the exclude_dirs array
if (scalar @exclude_dirs) {
@exclude_dirs = sort(@exclude_dirs );
# Error check - delete any element that is null
# (note: sort forced all blank names to front of array
@exclude_dirs = map { s/(^\s+|\s+$)//g ; $_ } @exclude_dirs ;
while ( not length @exclude_dirs[0] ) {
# Delete an element from the left side of an array (element zero)
shift @exclude_dirs ;
}
@exclude_dirs = map { (-e $_) ? abs_path($_) : $_ } @exclude_dirs ;
}
@swig_exclude_dirs = split /:/ , $ENV{"TRICK_SWIG_EXCLUDE"};
# See if there are any elements in the swig_exclude_dirs array
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 ;
}
# If there were no directories listed in TRICK_SWIG_EXCLUDE then copy the ones from ICG_EXCLUDE.
if ( scalar @swig_exclude_dirs == 0 ) {
@swig_exclude_dirs = split /:/ , $ENV{"TRICK_ICG_EXCLUDE"};
# See if there are any elements in the swig_exclude_dirs array
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 ;
sub get_paths {
my @paths = split /:/ , $ENV{$_[0]} ;
if (scalar @paths) {
@paths = sort(@paths ) ;
# trim whitespace
@paths = map { s/(^\s+|\s+$)//g ; $_ } @paths ;
# Remove empty elements. Sort forced all blank names to the front.
while ( not length @paths[0] ) {
shift @paths ;
}
@paths = map { (-e $_) ? abs_path($_) : $_ } @paths ;
}
return @paths ;
}
sub read_files_to_process() {
my @include_paths ;
my @icg_processed ;
my $cc ;
my @defines ;
my ($version, $thread, $year) ;
my $s_source_full_path = abs_path("S_source.hh") ;
my %compiler_file_list ;
open FILE, "build/ICG_processed" or die 'could not open build/ICG_processed' ;
@icg_processed = <FILE> ;
close FILE ;
chomp @icg_processed ;
($version, $thread) = get_trick_version() ;
($year) = $version =~ /^(\d+)/ ;
($cc = gte("TRICK_CC")) =~ s/\n// ;
@include_paths = $ENV{"TRICK_CFLAGS"} =~ /(-I\s*\S+)/g ; # get include paths from TRICK_CFLAGS
# add -I paths and #defines
foreach my $value ( "TRICK_CFLAGS", "TRICK_CXXFLAGS" ) {
push @include_paths, $ENV{$value} =~ /(-I\s*\S+)/g ;
push @defines, $ENV{$value} =~ /(-D\S+)/g ;
}
push @include_paths , ("-I".$ENV{"TRICK_HOME"}."/include") ;
push @include_paths , ("-I".$ENV{"TRICK_HOME"}."/include/trick/compat") ;
push @include_paths , ("-I".$ENV{"TRICK_HOME"}."/trick_source" , "-I../include") ;
@defines = $ENV{"TRICK_CFLAGS"} =~ /(-D\S+)/g ; # get defines from TRICK_CFLAGS
push @defines , "-DTRICK_VER=$year" ;
push @defines , "-DSWIG" ;
push @defines , "-std=c++11" ;
# Get the list header files from the compiler to compare to what get_headers processed.
# get the list of header files from the compiler
open FILE_LIST, "$cc -MM @include_paths @defines S_source.hh |" ;
my $dir ;
$dir = dirname($s_source_full_path) ;
$dir = dirname(abs_path("S_source.hh")) ;
my %files ;
my %ext_libs ;
while ( <FILE_LIST> ) {
next if ( /^#/ or /^\s+\\/ ) ;
my $word ;
foreach $word ( split ) {
outer:
foreach my $word ( split ) {
next if ( $word eq "\\" or $word =~ /o:/ ) ;
if ( $word !~ /^\// and $dir ne "\/" ) {
$word = "$dir/$word" ;
}
$word = abs_path(dirname($word)) . "/" . basename($word) ;
# filter out system headers that are missed by the compiler -MM flag
next if ( $word =~ /^\/usr\/include/) ;
#print "gcc found $word\n" ;
$compiler_file_list{$word} = 1 ;
# skip duplicate files
next if (exists($md5s{$word})) ;
# remove system headers that are missed by the compiler -MM flag
next if ( $word =~ /^\/usr\/include/ ) ;
# remove Trick headers
my $trick_home = $ENV{'TRICK_HOME'} ;
next if ( $word =~ /^\Q$trick_home\/include/ ) ;
next if ( $word =~ /^\Q$trick_home\/trick_source/ ) ;
# remove paths in TRICK_EXCLUDE
foreach my $path ( @exclude_paths ) {
if ( $word =~ /^\Q$path\E(.*)/ ) {
print "SWIG Skip TRICK_EXCLUDE: $path$1\n" if $verbose_build ;
next outer ;
}
}
# remove paths in TRICK_SWIG_EXCLUDE
foreach my $path ( @swig_exclude_paths ) {
if ( $word =~ /^\Q$path\E(.*)/ ) {
print "SWIG Skip TRICK_SWIG_EXCLUDE: $path$1\n" if $verbose_build ;
next outer ;
}
}
# we'll be needing this later
$md5s{$word} = md5_hex($word) ;
# separate paths in TRICK_EXT_LIB_DIRS
foreach my $path ( @ext_lib_paths ) {
if ( $word =~ /^\Q$path\E(.*)/ ) {
print "SWIG Skip TRICK_EXT_LIB_DIRS: $path$1\n" if $verbose_build ;
$ext_libs{$word} = 1 ;
next outer ;
}
}
$files{$word} = 1 ;
}
}
foreach my $i ( @icg_processed ) {
$i = abs_path(dirname($i)) . "/" . basename($i) ;
if ( exists $compiler_file_list{$i} ) {
push @files_to_process , $i ;
}
}
open FILE, "build/ICG_ext_lib" or die 'could not open build/ICG_ext_lib' ;
my @unfiltered_ext_lib_files = <FILE> ;
close FILE ;
chomp @unfiltered_ext_lib_files ;
foreach my $e ( @unfiltered_ext_lib_files ) {
$e = abs_path(dirname($e)) . "/" . basename($e) ;
if ( exists $compiler_file_list{$e} ) {
push @ext_lib_files , $e ;
}
}
@ext_lib_files = sort keys %ext_libs ;
@files_to_process = sort keys %files ;
}
sub make_swig_makefile() {
sub write_makefile_swig_deps() {
open DEPENDENCIES_FILE , ">build/Makefile_swig_deps" or return ;
print DEPENDENCIES_FILE "build/Makefile_swig: \\\n" ;
foreach my $file ( @files_to_process, @ext_lib_files ) {
print DEPENDENCIES_FILE " " . $file . " \\\n" ;
}
}
sub has_swig_no($) {
my %trick_header = extract_trick_header( $_[0], do { local( @ARGV, $/ ) = $_[0] ; <> }, 0, 0 ) ;
my $result = $trick_header{swig} =~ /^NO$/i ;
print "SWIG Skip SWIG: (NO): $_[0]\n" if $verbose_build and $result ;
return $result ;
}
sub purge_swig_no_files() {
@files_to_process = grep { !has_swig_no($_) } @files_to_process ;
@ext_lib_files = grep { !has_swig_no($_) } @ext_lib_files ;
}
sub write_makefile_swig() {
my ($n , $f , $k , $m);
my %temp_hash ;
my ($ii) ;
my ($swig_sim_dir, $swig_src_dir) ;
my (%py_module_map) ;
my $s_source_full_path = abs_path("S_source.hh") ;
my $s_source_md5 = md5_hex($s_source_full_path) ;
my $s_source_md5 = md5_hex(abs_path("S_source.hh")) ;
$swig_sim_dir = "trick" ;
$swig_src_dir = "build" ;
foreach $n (@files_to_process) {
$f = abs_path(dirname($n)) . "/" . basename($n) ;
my ($continue) = 1 ;
foreach my $ie ( @swig_exclude_dirs ) {
# if file location begins with $ie (a SWIG exclude dir)
if ( $f =~ /^\Q$ie/ ) {
print "CP(swig) skipping $f (SWIG exclude dir $ie)\n" ;
$continue = 0 ;
last ; # break out of loop
}
}
next if ( $continue == 0 ) ;
$temp_hash{$f} = 1;
}
@files_to_process = sort keys %temp_hash ;
open MAKEFILE , ">build/Makefile_swig" or return ;
open PY_LINK_LIST , ">build/py_link_list" or return ;
print PY_LINK_LIST "build/init_swig_modules.o\n" ;
@ -221,13 +211,13 @@ build/top.i: build/CP_instances
SWIG_SRC = \$(subst .i,.cpp,\$(SWIG_I)) $swig_src_dir/top.cpp
\$(SWIG_SRC) : %.cpp: %.i | \$(SWIG_I)
\$(SWIG_SRC) : %.cpp: %.i %.d | \$(SWIG_I)
\t\$(PRINT_SWIG)
\t\$(ECHO_CMD)\$(SWIG) \$(TRICK_INCLUDE) \$(TRICK_DEFINES) \$(TRICK_VERSIONS) \$(SWIG_FLAGS) -c++ -python -includeall -ignoremissing -w201,303,325,362,389,401,451 -MMD -MP -outdir trick -o \$@ \$<
\$(SWIG_OBJECTS:.o=.d): ;
\$(SWIG_SRC:.cpp=.d): ;
-include \$(SWIG_OBJECTS:.o=.d)
-include \$(SWIG_SRC:.cpp=.d)
# SWIG_OBJECTS =================================================================
@ -300,14 +290,11 @@ LINK_LISTS += \$(LD_FILELIST)build/py_link_list
print INITSWIGFILE "#include <Python.h>\n" ;
print INITSWIGFILE "#if PY_VERSION_HEX >= 0x03000000\n" ;
print INITSWIGFILE "extern \"C\" {\n\n" ;
foreach $f ( @files_to_process ) {
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE "PyObject * PyInit__m${md5_sum}(void) ; /* $f */\n" ;
}
foreach $f ( @ext_lib_files ) {
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE "PyObject * PyInit__m${md5_sum}(void) ; /* $f */\n" ;
foreach $f ( @files_to_process, @ext_lib_files ) {
print INITSWIGFILE "PyObject * PyInit__m$md5s{$f}(void) ; /* $f */\n" ;
}
print INITSWIGFILE "PyObject * PyInit__sim_services(void) ;\n" ;
print INITSWIGFILE "PyObject * PyInit__top(void) ;\n" ;
print INITSWIGFILE "PyObject * PyInit__swig_double(void) ;\n" ;
@ -315,17 +302,11 @@ LINK_LISTS += \$(LD_FILELIST)build/py_link_list
print INITSWIGFILE "PyObject * PyInit__swig_ref(void) ;\n" ;
print INITSWIGFILE "\nvoid init_swig_modules(void) {\n\n" ;
foreach $f ( @files_to_process ) {
foreach $f ( @files_to_process, @ext_lib_files ) {
next if ( $f =~ /S_source.hh/ ) ;
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE " PyImport_AppendInittab(\"_m${md5_sum}\", PyInit__m${md5_sum}) ;\n" ;
}
foreach $f ( @ext_lib_files ) {
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE " PyImport_AppendInittab(\"_m${md5_sum}\", PyInit__m${md5_sum}) ;\n" ;
print INITSWIGFILE " PyImport_AppendInittab(\"_m$md5s{$f}\", PyInit__m$md5s{$f}) ;\n" ;
}
print INITSWIGFILE " PyImport_AppendInittab(\"_m${s_source_md5}\", PyInit__m${s_source_md5}) ;\n" ;
print INITSWIGFILE " PyImport_AppendInittab(\"_sim_services\", PyInit__sim_services) ;\n" ;
print INITSWIGFILE " PyImport_AppendInittab(\"_top\", PyInit__top) ;\n" ;
print INITSWIGFILE " PyImport_AppendInittab(\"_swig_double\", PyInit__swig_double) ;\n" ;
@ -335,14 +316,11 @@ LINK_LISTS += \$(LD_FILELIST)build/py_link_list
print INITSWIGFILE "#else\n" ;
print INITSWIGFILE "extern \"C\" {\n\n" ;
foreach $f ( @files_to_process ) {
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE "void init_m${md5_sum}(void) ; /* $f */\n" ;
}
foreach $f ( @ext_lib_files ) {
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE "void init_m${md5_sum}(void) ; /* $f */\n" ;
foreach $f ( @files_to_process, @ext_lib_files ) {
print INITSWIGFILE "void init_m$md5s{$f}(void) ; /* $f */\n" ;
}
print INITSWIGFILE "void init_sim_services(void) ;\n" ;
print INITSWIGFILE "void init_top(void) ;\n" ;
print INITSWIGFILE "void init_swig_double(void) ;\n" ;
@ -350,17 +328,11 @@ LINK_LISTS += \$(LD_FILELIST)build/py_link_list
print INITSWIGFILE "void init_swig_ref(void) ;\n" ;
print INITSWIGFILE "\nvoid init_swig_modules(void) {\n\n" ;
foreach $f ( @files_to_process ) {
foreach $f ( @files_to_process, @ext_lib_files) {
next if ( $f =~ /S_source.hh/ ) ;
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE " init_m${md5_sum}() ;\n" ;
}
foreach $f ( @ext_lib_files ) {
my $md5_sum = md5_hex($f) ;
print INITSWIGFILE " init_m${md5_sum}() ;\n" ;
print INITSWIGFILE " init_m$md5s{$f}() ;\n" ;
}
print INITSWIGFILE " init_m${s_source_md5}() ;\n" ;
print INITSWIGFILE " init_sim_services() ;\n" ;
print INITSWIGFILE " init_top() ;\n" ;
print INITSWIGFILE " init_swig_double() ;\n" ;
@ -415,10 +387,9 @@ LINK_LISTS += \$(LD_FILELIST)build/py_link_list
}
foreach $f ( @ext_lib_files ) {
my $md5_sum = md5_hex($f) ;
print INITFILE "# $f\n" ;
print INITFILE "import _m${md5_sum}\n" ;
print INITFILE "from m${md5_sum} import *\n" ;
print INITFILE "import _m$md5s{$f}\n" ;
print INITFILE "from m$md5s{$f} import *\n" ;
print INITFILE "combine_cvars(all_cvars, cvar)\n" ;
print INITFILE "cvar = None\n\n" ;
}
@ -458,13 +429,20 @@ LINK_LISTS += \$(LD_FILELIST)build/py_link_list
while ( $temp_str =~ s/\/.*?$// ) {
open INITFILE , ">trick/$temp_str/__init__.py" or return ;
close INITFILE ;
close initfile ;
}
}
return ;
}
get_exclude_dirs() ;
@exclude_paths = get_paths( "TRICK_EXCLUDE" ) ;
@swig_exclude_paths = get_paths( "TRICK_SWIG_EXCLUDE" ) ;
@ext_lib_paths = get_paths( "TRICK_EXT_LIB_DIRS" ) ;
read_files_to_process() ;
make_swig_makefile() ;
write_makefile_swig_deps() ;
# Remove SWIG: (NO) files, but not before they're written to the dependency file.
# If SWIG: (NO) is removed, Makefile_swig needs to be regenerated.
purge_swig_no_files() ;
write_makefile_swig() ;

View File

@ -29,23 +29,25 @@ sub extract_trick_header($$$$) {
$header{libdep} = $2 if $trick_header =~ /LIBRARY[ _]DEPENDENC(Y|IES):[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{iodep} = $2 if $trick_header =~ /IO DEPENDENC(Y|IES):[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{icg_ignore} = $2 if $trick_header =~ /ICG[ _]IGNORE[ _]TYPE(S)?:[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{swig} = $1 if $trick_header =~ /SWIG:[^(]*\((.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{default_data} = $1 if $trick_header =~ /DEFAULT[ _]DATA:[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{python_module} = $1 if $trick_header =~ /PYTHON[ _]MODULE:[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{programmers} = $1 if $trick_header =~ /PROGRAMMERS:[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
$header{language} = $1 if $trick_header =~ /LANGUAGE:[^(]*(.*?)\)([A-Z _\t\n\r]+:|[ \t\n\r]*$)/si ;
# if ( $verbose ) {
# print " "x$indent , "/*\n" ;
# print " "x($indent+3) , "DOC TITLE:\n\t$header{doc_title})\n" if ( exists $header{doc_title} ) ;
# print " "x($indent+3) , "PURPOSE:\n\t$header{purpose})\n" if ( exists $header{purpose} ) ;
# print " "x($indent+3) , "REFERENCE:\n\t$header{reference})\n" if ( exists $header{reference} ) ;
# print " "x($indent+3) , "ASSUMPTIONS AND LIMITATIONS:\n\t$header{assump})\n" if ( exists $header{assump} ) ;
# print " "x($indent+3) , "CLASS:\n\t$header{class})\n" if ( exists $header{class} ) ;
# print " "x($indent+3) , "LIBRARY DEPENDENCIES:\n\t$header{libdep})\n" if ( exists $header{libdep} ) ;
# print " "x($indent+3) , "PROGRAMMERS:\n\t$header{program})\n" if ( exists $header{program} ) ;
# print " "x($indent+3) , "LANGUAGE:\n\t$header{language})\n" if ( exists $header{language} ) ;
# print " "x$indent , "*/\n\n" ;
# }
if ( $verbose ) {
print " "x$indent , "/*\n" ;
print " "x($indent+3) , "DOC TITLE:\n\t$header{doc_title})\n" if ( exists $header{doc_title} ) ;
print " "x($indent+3) , "PURPOSE:\n\t$header{purpose})\n" if ( exists $header{purpose} ) ;
print " "x($indent+3) , "REFERENCE:\n\t$header{reference})\n" if ( exists $header{reference} ) ;
print " "x($indent+3) , "ASSUMPTIONS AND LIMITATIONS:\n\t$header{assump})\n" if ( exists $header{assump} ) ;
print " "x($indent+3) , "CLASS:\n\t$header{class})\n" if ( exists $header{class} ) ;
print " "x($indent+3) , "LIBRARY DEPENDENCIES:\n\t$header{libdep})\n" if ( exists $header{libdep} ) ;
print " "x($indent+3) , "SWIG:\n\t($header{swig})\n" if ( exists $header{swig} ) ;
print " "x($indent+3) , "PROGRAMMERS:\n\t$header{program})\n" if ( exists $header{program} ) ;
print " "x($indent+3) , "LANGUAGE:\n\t$header{language})\n" if ( exists $header{language} ) ;
print " "x$indent , "*/\n\n" ;
}
if ( $contents =~ /(?:@|\\)trick_li(?:nk|b)_dependency\s*{\s*(.*?)\s*}/) {
my @lib_list ;

View File

@ -126,9 +126,9 @@ $(SWIG_OBJECTS): %.o: %.cpp
$(info $(call COLOR,Compiling) $<)
@$(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) $(PYTHON_INCLUDES) -Wno-unused-parameter -Wno-shadow -c -o $@ $<
$(SWIG_OBJECTS:.o=.cpp): %.cpp: %.i %.d | $(TRICKIFY_PYTHON_DIR)
$(SWIG_OBJECTS:.o=.cpp): %.cpp: %.i %.d | $(TRICKIFY_PYTHON_DIR) $(SWIG_OBJECTS:.o=.i)
$(info $(call COLOR,SWIGing) $<)
@$(SWIG) $(TRICK_INCLUDE) $(TRICK_DEFINES) $(TRICK_VERSIONS) $(SWIG_FLAGS) -c++ -python -includeall -w201,303,325,362,389,401,451 -MMD -MP -outdir $(TRICKIFY_PYTHON_DIR) -o $@ $<
@$(SWIG) $(TRICK_INCLUDE) $(TRICK_DEFINES) $(TRICK_VERSIONS) $(SWIG_FLAGS) -c++ -python -includeall -ignoremissing -w201,303,325,362,389,401,451 -MMD -MP -outdir $(TRICKIFY_PYTHON_DIR) -o $@ $<
$(SWIG_OBJECTS:.o=.d): ;

View File

@ -161,7 +161,7 @@ void HeaderSearchDirs::AddDirsAndFiles(std::string env_var, std::vector<std::str
}
} else {
std::cout << bold(color(WARNING, "Warning")) << " Cannot find " <<
env_var << " directory " << quote(bold(item)) << std::endl ;
env_var << " path " << quote(bold(item)) << std::endl ;
}
}
}

View File

@ -61,7 +61,7 @@ class PrintAttributes {
protected:
const bool verboseBuild = getenv("TRICK_VERBOSE_BUILD");
const std::string skipping = color(SKIP, "Skipping ");
const std::string skipping = color(SKIP, "ICG Skip ");
/** Directory to put class and enum map files */
std::string map_dir ;