Browse Source

Add support for exclude files in extension modules.

Rodrigo Kumpera 12 years ago
parent
commit
f9adf72b40
2 changed files with 22 additions and 6 deletions
  1. 14 5
      mcs/build/gensources.sh
  2. 8 1
      mcs/build/library.make

+ 14 - 5
mcs/build/gensources.sh

@@ -4,6 +4,7 @@ outfile=$1
 incfile=$2
 excfile=$3
 extfile=$4
+extexcfile=$5
 
 process_includes_1() {
     sed -e '/^[ \t]*$/d' -e '/^[ \t]*#/d' $1 > $2
@@ -39,16 +40,24 @@ fi
 sort -u $outfile.inc > $outfile.inc_s
 rm -f $outfile.inc
 
-if test -z "$excfile"; then
-    mv $outfile.inc_s $outfile
-else
+
+if test -n "$excfile"; then
     process_includes $excfile $outfile.exc
+fi
 
-    sort -u $outfile.exc > $outfile.exc_s
-    rm -f $outfile.exc
+if test -n "$extexcfile"; then
+    process_includes $extexcfile $outfile.ext_exc
+	cat $outfile.ext_exc >> $outfile.exc
+	rm -f $outfile.ext_exc
+fi
 
+if test -f $outfile.exc; then
+	sort -u $outfile.exc > $outfile.exc_s
+	rm -f $outfile.exc
     sort -m $outfile.inc_s $outfile.exc_s | uniq -u > $outfile
     rm -f $outfile.inc_s $outfile.exc_s
+else
+	mv $outfile.inc_s $outfile
 fi
 
 

+ 8 - 1
mcs/build/library.make

@@ -23,11 +23,18 @@ else
 EXTENSION_include = $(wildcard $(PROFILE)_opt_$(LIBRARY).sources)
 endif
 
+
+ifdef EXTENSION_MODULE
+EXTENSION_exclude = $(wildcard $(topdir)/../../mono-extensions/mcs/$(thisdir)/$(PROFILE)_$(LIBRARY).exclude.sources)
+else
+EXTENSION_exclude = $(wildcard $(PROFILE)_opt_$(LIBRARY).exclude.sources)
+endif
+
 # Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
 # We don't include it in the dependencies since it isn't always created
 $(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh $(EXTENSION_include)
 	@echo Creating the per profile list $@ ...
-	$(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)' '$(EXTENSION_include)'
+	$(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)' '$(EXTENSION_include)' '$(EXTENSION_exclude)'
 endif
 
 PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes)