summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-03-26 00:18:00 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-03-26 00:18:00 +0000
commit55357998e19e21fd85218f30eb7415ad4135bc15 (patch)
tree887840de59f7aea99e18b515b6e0a21a5a02a69d
parentcf724d39baa6101da7ef202958a72d1c872f0656 (diff)
Implementation of configuration.ccl spec from Yaakoub Y El-Khamra.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3602 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/make/make.configuration14
-rw-r--r--lib/make/make.thornlib10
-rw-r--r--lib/sbin/CST30
-rw-r--r--lib/sbin/ConfigScriptParser.pl89
-rw-r--r--lib/sbin/ConfigurationParser.pl121
-rw-r--r--lib/sbin/CreateConfigurationBindings.pl198
6 files changed, 418 insertions, 44 deletions
diff --git a/lib/make/make.configuration b/lib/make/make.configuration
index 8ec66b13..4e27b316 100644
--- a/lib/make/make.configuration
+++ b/lib/make/make.configuration
@@ -16,6 +16,11 @@ CONFIG = $(TOP)/config-data
BINDINGS_DIR = $(TOP)/bindings
FLESH_DIR = $(CCTK_HOME)/src
+# Some empty strings yye00 fills from configuration.ccl files
+#ConfigInc =
+#ConfigLibdir =
+#ConfigLib =
+
# Scratch build area - need this to make sure F90 module files end up all
# in one directory.
export SCRATCH_BUILD=$(TOP)/scratch
@@ -63,7 +68,7 @@ endif
# pretty confusing during a make clean !
ifeq ($(strip $(MAKECMDGOALS)),)
--include $(CONFIG)/make.thornlist
+-include $(CONFIG)/make.thornlist
endif
ifeq ($(strip $(MAKECMDGOALS)), utils)
@@ -76,7 +81,7 @@ endif
# Allow each thorn to include some global definitions
ifneq ($(strip $(THORNS)),)
--include $(THORNS:%=$(PACKAGE_DIR)/%/src/make.configuration.defn)
+-include $(THORNS:%=$(PACKAGE_DIR)/%/src/make.configuration.defn)
endif
ifeq ($(strip $(UTILS)),)
@@ -89,9 +94,10 @@ UTIL_DIR=$(EXEDIR)$(DIRSEP)$(CONFIG_NAME)
# Build the list of all libraries
ALLCACTUSLIBS = $(notdir $(CACTUSLIBS) $(THORN_LINKLIST) $(CACTUSLIBS))
+# Include all required external libraries from configuration
+-include $(TOP)/bindings/Configuration/make.link
# Build the executable
-
$(EXEDIR)$(DIRSEP)$(EXE): $(CONFIG)/make.thornlist $(CONFIG)/cctki_version.h $(patsubst %,$(CCTK_LIBDIR)/$(LIBNAME_PREFIX)%$(LIBNAME_SUFFIX),$(notdir $(THORNS) $(CACTUSLIBS)))
@echo Creating $(EXE) in $(EXEDIR) from $(THORNS)
$(CC) $(OPTIMISE_C) $(DEBUG_C) $(CFLAGS) $(CCOMPILEONLY)$(OPTIONSEP)$(TOP)$(DIRSEP)datestamp.o -I$(subst /,$(DIRSEP),$(CCTK_HOME)/src/include) -I$(CONFIG) $(subst /,$(DIRSEP),$(DATESTAMP))
@@ -203,7 +209,7 @@ $(TOP)/ThornList:
# Allow each thorn to include some global dependencies
ifneq ($(strip $(THORNS)),)
--include $(THORNS:%=$(PACKAGE_DIR)/%/src/make.configuration.deps)
+-include $(THORNS:%=$(PACKAGE_DIR)/%/src/make.configuration.deps) $(THORNS:%=$(BINDINGS_DIR)/Configuration/%/src/make.configuration.deps)
endif
# Catch the special case of a thorn being removed from the disk entirely.
diff --git a/lib/make/make.thornlib b/lib/make/make.thornlib
index cc98eefe..45fa91ac 100644
--- a/lib/make/make.thornlib
+++ b/lib/make/make.thornlib
@@ -17,9 +17,17 @@ DIVIDER = $(DIVEL)$(DIVEL)$(DIVEL)$(DIVEL)
# Include the main make definitions for this configuration
include $(CONFIG)/make.config.defn
+
+# Include the configuration make.code.def for the thorn if it is not cactus or cactusbindings
+INC_DIRS =
+ifneq ($(THORN), CactusBindings)
+ifneq ($(THORN), Cactus)
+-include $(TOP)/bindings/Configuration/$(THORN)/make.configuration.defn
+endif
+endif
# Add appropriate include lines
-INC_DIRS = $(SYS_INC_DIRS) $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(TOP)/bindings/include $(CCTK_HOME)/src/include $(CCTK_HOME)/arrangements
+INC_DIRS += $(SYS_INC_DIRS) $(SRCDIR) $(SRCDIR)/include $(CONFIG) $(TOP)/bindings/include $(CCTK_HOME)/src/include $(CCTK_HOME)/arrangements
# Allow subdirectories to inherit these include directories
export INC_DIRS
diff --git a/lib/sbin/CST b/lib/sbin/CST
index 82c0ede1..345fbd69 100644
--- a/lib/sbin/CST
+++ b/lib/sbin/CST
@@ -6,7 +6,7 @@
# @desc
# Parses the the configuration files for thorns.
# @enddesc
-# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.61 2004-01-19 20:52:40 schnetter Exp $
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.62 2004-03-26 00:18:00 goodale Exp $
#@@*/
# Global parameter to track the number of errors from the CST
@@ -69,6 +69,8 @@ require "$sbin_dir/CreateImplementationBindings.pl";
require "$sbin_dir/CreateScheduleBindings.pl";
require "$sbin_dir/CreateFunctionBindings.pl";
require "$sbin_dir/BuildHeaders.pl";
+require "$sbin_dir/CreateConfigurationBindings.pl";
+require "$sbin_dir/ConfigScriptParser.pl";
#######################################################################
#
@@ -82,7 +84,10 @@ print "Reading ThornList...\n";
# Parse the interface.ccl files
print "Parsing configuration files...\n";
-$configuration_database = &CreateConfigurationDatabase(%thorns);
+$configuration_database = &CreateConfigurationDatabase($config_dir, %thorns);
+
+#$debug_configuration = 1;
+&print_configuration_database($configuration_database) if($debug_configuration);
# Restrict the rest of this to thorns with source
@@ -159,6 +164,7 @@ else
}
&WriteFile("$config_dir/make.thornlist", \$make_thornlist);
+&CreateConfigurationBindings($bindings_dir, $configuration_database,\%thorns);
print "CST finished.\n";
exit;
@@ -326,9 +332,8 @@ sub CreateMakeThornlist
}
$thorn_linklist .= ' ' . &CreateThornLinkList($thorns, $config);
-
+ print "\n\n$thorn_linklist\n";
$thorn_dependencies = join ("\n", &CreateThornDependencyList($thorns, $config));
-
return ($thornlist . "\n" . $thorn_linklist . "\n" . $config_thornlist . "\n" . $thorn_dependencies . "\n");
}
@@ -351,7 +356,7 @@ sub CreateThornLinkList
foreach $thorn (sort keys %$thorns)
{
next if ($config->{"\U$thorn OPTIONS\E"} eq 'NO_SOURCE' ||
- $thorn eq 'Cactus');
+ "\U$thorn\E" eq "\UCactus\E");
# add this thorn to the thorn liblist
# as well as any other thorns it requires (directly or indirectly)
@@ -359,7 +364,7 @@ sub CreateThornLinkList
}
# remove duplicate entries from the list, only keeping the rightmost
- for ($i = 0; $i <= $#liblist; $i++)
+ for ($i = 0; $i <= $#liblist; $i++)
{
for ($j = 0; $j < $i; $j++)
{
@@ -390,12 +395,12 @@ sub CreateThornDependencyList
# Find list of all thorns
foreach my $thorn (sort keys %thorns) {
next if ($configuration_database->{"\U$thorn OPTIONS\E"} eq 'NO_SOURCE'
- || $thorn eq 'Cactus');
+ || "\U$thorn\E" eq "\UCactus\E");
# Add the thorn and the thorn's requirements
- my $line = "USESTHORNS_$thorn =";
+ my $line = "USESTHORNS_\U$thorn\E = Cactus CactusBindings";
foreach my $dep (sort (split (' ', $configuration_database->{"\U$thorn\E REQUIRES THORNS"}),
- split (' ', $configuration_database->{"\U$thorn\E USES THORNS"})),
- "Cactus", "CactusBindings") {
+ split (' ', $configuration_database->{"\U$thorn\E USES THORNS"})))
+ {
$line .= " $dep";
}
push (@varlist, $line);
@@ -426,10 +431,9 @@ sub RequiredThorns
my($i);
my(@requires, @result);
-
@result = ();
- foreach $i (split (' ', $config->{"\U$thorn\E REQUIRES THORNS"}))
- {
+ foreach $i (split (' ', $config->{"\U$thorn\E USES THORNS"}) )
+ {
if ($i eq $top)
{
CST_error (0, "Cross dependency detected between thorns '$thorn' and " .
diff --git a/lib/sbin/ConfigScriptParser.pl b/lib/sbin/ConfigScriptParser.pl
new file mode 100644
index 00000000..b15cde1f
--- /dev/null
+++ b/lib/sbin/ConfigScriptParser.pl
@@ -0,0 +1,89 @@
+#! /usr/bin/perl -s
+#/*@@
+# @file ConfigScriptParser
+# @date Thu Mar 25 14:25:13 2004
+# @author Yaakoub El-Khamra
+# @desc
+# Parses the Config Script Output
+# @enddesc
+# @version $Header$
+#@@*/
+
+#/*@@
+# @routine ParseConfigScript
+# @date Thu Mar 25 14:25:13 2004
+# @author Yaakoub El-Khamra
+# @desc
+# Parses the Config Script Ouput
+# @enddesc
+#@@*/
+sub ParseConfigScript
+{
+ my($config_dir, $provides, $lang, $script, $thorn, $cfg, $thorns, $filename)=@_;
+ my($line_number, $line, $temp);
+
+ $start_dir = `pwd`;
+ chdir $config_dir;
+
+ # Run the configuration script in the config_dir folder
+ @data=`$lang $thorns{thorn}/$script`;
+
+ for($line_number = 0; $line_number < @data; $line_number++)
+ {
+ $line = $data[$line_number];
+
+ # Parse the line
+ if($line =~ m/^\s*BEGIN\s+DEFINE\s*/i)
+ {
+ $line_number++;
+ $line = $data[$line_number];
+ while($line !~ m/^\s*END\s+DEFINE\s*/i)
+ {
+ $cfg->{"\U$thorn $provides\E DEFINE"} .= $line;
+ $line_number++;
+ $line = $data[$line_number];
+ }
+ }
+ elsif($line =~ m/^\s*BEGIN\s+DEFINITION\s*/i)
+ {
+ $line_number++;
+ $line = $data[$line_number];
+ while($line !~ m/^\s*END\s+DEFINITION\s*/i)
+ {
+ $cfg->{"\U$thorn $provides\E DEFINITION"} .= $line;
+ $line_number++;
+ $line = $data[$line_number];
+ }
+ }
+ elsif($line =~ m/^\s*BEGIN\s+DEPENDENCY\s*/i)
+ {
+ $line_number++;
+ $line = $data[$line_number];
+ while($line !~ m/^\s*END\s+DEPENDENCY\s*/i)
+ {
+ $cfg->{"\U$thorn $provides\E DEPENDENCY"} .= $line;
+ $line_number++;
+ $line = $data[$line_number];
+ }
+ }
+ elsif($line =~ m/^\s*INCLUDE_DIRECTORY[^\s]*\s*(.*)$/i)
+ {
+ $cfg->{"\U$thorn $provides\E INCLUDE_DIRECTORY"} .=' ' . $1;
+ }
+ elsif($line =~ m/^\s*LIBRARY[^\s]*\s*(.*)$/i)
+ {
+ $cfg->{"\U$thorn $provides\E LIBRARY"} .= ' ' . $1;
+ }
+ elsif($line =~ m/^\s*LIBRARY_DIRECTORY[^\s]*\s*(.*)$/i)
+ {
+ $cfg->{"\U$thorn $provides\E LIBRARY_DIRECTORY"} .= ' ' . $1;
+ }
+ else
+ {
+ &CST_error (0, "Unrecognised line in ConfigScriptParser.ccl '$line'");
+ }
+ }
+ return ($cfg );
+}
+
+1;
diff --git a/lib/sbin/ConfigurationParser.pl b/lib/sbin/ConfigurationParser.pl
index d0a90391..8e5f3920 100644
--- a/lib/sbin/ConfigurationParser.pl
+++ b/lib/sbin/ConfigurationParser.pl
@@ -10,6 +10,7 @@
# @version $Header$
#@@*/
+
#/*@@
# @routine CreateConfigurationDatabase
# @date Tue Feb 8 17:47:26 2000
@@ -21,10 +22,11 @@
#@@*/
sub CreateConfigurationDatabase
{
- my(%thorns) = @_;
- my(%cfg) = ();
- my($thorn, $required, @missing, $filename);
+
+ my($config_dir, %thorns) = @_;
+ my(%cfg) = ();
+ my($thorn, $required, @missing, @foundlist, $founderrlist, $filename, %thorncap, $foundcap, $temp,$cap);
# Loop through each thorn's configuration file.
foreach $thorn (sort keys %thorns)
@@ -33,23 +35,24 @@ sub CreateConfigurationDatabase
next if (! -r $filename);
# Get the configuration data from it
- &ParseConfigurationCCL($thorn, \%cfg, $filename);
+ &ParseConfigurationCCL($config_dir, $thorn, \%cfg, \%thorns, $filename);
- print " $thorn\n";
- print " Provides: ", $cfg{"\U$thorn\E PROVIDES"}, "\n"
- if ($cfg{"\U$thorn\E PROVIDES"});
- print " Requires: ", $cfg{"\U$thorn\E REQUIRES"}, "\n"
- if ($cfg{"\U$thorn\E REQUIRES"});
+ if($debug)
+ {
+ print " $thorn\n";
+ print " Provides: ", $cfg{"\U$thorn\E PROVIDES"}, "\n"
+ if ($cfg{"\U$thorn\E PROVIDES"});
+ print " Requires: ", $cfg{"\U$thorn\E REQUIRES"}, "\n"
+ if ($cfg{"\U$thorn\E REQUIRES"});
+ }
# verify that all required thorns are there in the ThornList
if ($cfg{"\U$thorn\E REQUIRES THORNS"})
{
- print " Requires thorns: ", $cfg{"\U$thorn\E REQUIRES THORNS"}, "\n";
-
@missing = ();
foreach $required (split (' ', $cfg{"\U$thorn\E REQUIRES THORNS"}))
{
- if (! $thorns{"$required"})
+ if ((! $thorns{"$required"}) && (! $thorns{"\U$required\E"}))
{
push (@missing, $required);
}
@@ -69,15 +72,63 @@ sub CreateConfigurationDatabase
"remove $thorn from it !");
}
}
+ else
+ {
+ $cfg{"\U$thorn\E USES THORNS"} .= $cfg{"\U$thorn\E REQUIRES THORNS"} . " ";
+ }
+ }
+ }
+
+ foreach $thorn (sort keys %thorns)
+ {
+ # verify that all required capabilities are there in the ThornList
+ if ( $cfg{"\U$thorn\E REQUIRES"})
+ {
+ foreach $requiredcap (split (' ', $cfg{"\U$thorn\E REQUIRES"}))
+ {
+ $foundcap = 0;
+ @foundlist = ();
+
+ foreach $thorncap (sort keys %thorns)
+ {
+ foreach $cap (split (' ', $cfg{"\U$thorncap\E PROVIDES"}))
+ {
+ if ( "\U$cap\E" eq "\U$requiredcap\E" )
+ {
+ @foundlist[$foundcap] = $cap;
+ $foundthorn = $thorncap;
+ $foundcap = $foundcap + 1;
+ }
+ }
+ }
+ if ($foundcap == 0)
+ {
+ &CST_error (0, "Thorn $thorn requires the capability $requiredcap. " .
+ "Please add a thorn that provides $requiredcap " .
+ "to your ThornList or remove ".
+ "$thorn from it !");
+ }
+ if ($foundcap > 1)
+ {
+ foreach $thorncap (@foundlist)
+ {
+ $founderrlist .= "$thorncap ";
+ }
+ &CST_error (0, "More than one thorn provides the capability $requiredcap. " .
+ "These thorns are: $founderrlist. \nPlease use only one.\n" );
+ }
+ $cfg{"\U$thorn\E USES THORNS"} .= $foundthorn, " ";
+ }
}
}
- # Print configuration database
- # my($field);
- # foreach $field ( sort keys %cfg)
- # {
- # print "$field has value ", $cfg{$field}, "\n";
- # }
+ # # Print configuration database
+# my($field);
+# foreach $field ( sort keys %cfg)
+# {
+# print "$field has value ", $cfg{$field}, "\n";
+# }
+
return \%cfg;
}
@@ -93,7 +144,7 @@ sub CreateConfigurationDatabase
#@@*/
sub ParseConfigurationCCL
{
- my($thorn, $cfg, $filename) = @_;
+ my($config_dir, $thorn, $cfg, $thorns, $filename) = @_;
my(@data);
my($line_number, $line);
my($provides, $script, $lang);
@@ -106,6 +157,7 @@ sub ParseConfigurationCCL
$cfg->{"\U$thorn REQUIRES THORNS\E"} = '';
$cfg->{"\U$thorn OPTIONAL\E"} = '';
$cfg->{"\U$thorn OPTIONS\E"} = '';
+ $cfg->{"\U$thorn\E USES THORNS"} = '';
# Read the data
@data = &read_file($filename);
@@ -113,29 +165,35 @@ sub ParseConfigurationCCL
for($line_number = 0; $line_number < @data; $line_number++)
{
$line = $data[$line_number];
-
# Parse the line
if($line =~ m/^\s*PROVIDES\s*/i)
{
($provides, $script, $lang, $line_number) = &ParseProvidesBlock($line_number, \@data);
- $cfg->{"\U$thorn\E PROVIDES"} .= "$provides";
+ $cfg->{"\U$thorn\E PROVIDES"} .= "$provides ";
$cfg->{"\U$thorn\E PROVIDES \U$provides\E SCRIPT"} = "$script";
$cfg->{"\U$thorn\E PROVIDES \U$provides\E LANG"} = "$lang";
+
+ $cfg = &ParseConfigScript($config_dir, $provides, $lang, $script ,$thorn, $cfg, $thorns, $filename);
+
next;
}
elsif($line =~ m/^\s*REQUIRES\s+THORNS\s*:\s*(.*)/i)
{
$cfg->{"\U$thorn\E REQUIRES THORNS"} .= "$1";
+ if ($cfg->{"\U$thorn\E REQUIRES THORNS"})
+ {
+ &CST_error (3, 'This feature will not be supported in release beta-14' .
+ "\n Please make sure you adjust thorn \U$thorn\E accordingly ");
+ }
}
- elsif($line =~ m/^\s*REQUIRES\s*(.*)/i)
+ elsif($line =~ m/^\s*REQUIRES\s*(.*)/i)
{
- $cfg->{"\U$thorn\E REQUIRES"} .= "$1";
+ $cfg->{"\U$thorn\E REQUIRES"} .= "$1 ";
}
elsif($line =~ m/^\s*OPTIONAL\s*/i)
{
($optional, $define, $line_number) = &ParseOptionalBlock($line_number, \@data);
- $cfg->{"\U$thorn\E OPTIONAL"} .= "$provides";
- $cfg->{"\U$thorn\E OPTIONAL \U$optional\E DEFINE"} = "$define";
+ $cfg->{"\U$thorn\E OPTIONAL"} .= "$optional ";
}
elsif($line =~ m/^\s*NO_SOURCE\s*/i)
{
@@ -209,7 +267,7 @@ sub ParseProvidesBlock
#/*@@
-# @routine ParseProvidesBlock
+# @routine ParseOptionalBlock
# @date Mon May 8 15:52:40 2000
# @author Tom Goodale
# @desc
@@ -266,4 +324,15 @@ sub ParseOptionalBlock
return ($optional, $define, $line_number);
}
+sub print_configuration_database
+{
+ my($database) = @_;
+ my($field);
+
+ foreach $field ( sort keys %$database )
+ {
+ print "$field has value $database->{$field}\n";
+ }
+}
+
1;
diff --git a/lib/sbin/CreateConfigurationBindings.pl b/lib/sbin/CreateConfigurationBindings.pl
new file mode 100644
index 00000000..b7fdda8a
--- /dev/null
+++ b/lib/sbin/CreateConfigurationBindings.pl
@@ -0,0 +1,198 @@
+#/*@@
+# @file CreateConfigurationBindings.pl
+# @date Thu Mar 25 14:25:13 2004
+# @author Yaakoub Y El-Khamra
+# @desc
+# New Configuration.ccl script processing
+# @enddesc
+# @version $Header$
+#@@*/
+
+
+require "$sbin_dir/CSTUtils.pl";
+
+#/*@@
+# @routine CreateScheduleBindings
+# @date Thu Mar 25 14:25:13 2004
+# @author Yaakoub Y El-Khamra
+# @desc
+# Creates the configuration bindings.
+# @enddesc
+#@@*/
+sub CreateConfigurationBindings
+{
+ my($bindings_dir, $cfg, $thorns)=@_;
+ my($field, $providedcap, $thorn, $temp);
+
+ if(! $build_dir)
+ {
+ $build_dir = "$bindings_dir/build";
+ }
+
+ if(! -d $bindings_dir)
+ {
+ mkdir("$bindings_dir", 0755) || die "Unable to create $bindings_dir";
+ }
+
+ $start_dir = `pwd`;
+
+ chdir $bindings_dir;
+
+ if(! -d 'Configuration')
+ {
+ mkdir('Configuration', 0755) || die 'Unable to create Configuration directory';
+ }
+
+ if(! -d 'include')
+ {
+ mkdir('include', 0755) || die 'Unable to create include directory';
+ }
+
+ if(! -d "$build_dir")
+ {
+ mkdir("$build_dir", 0755) || die "Unable to create $build_dir";
+ }
+
+ foreach $thorn (sort keys %thorns)
+ {
+ if ($cfg->{"\U$thorn\E REQUIRES"} || $cfg->{"\U$thorn\E OPTIONAL"})
+ {
+ if(! -d "$bindings_dir/Configuration/$thorn")
+ {
+ mkdir("$bindings_dir/Configuration/$thorn", 0755) || die "Unable to create Thorn $thorn Configuration directory";
+ }
+ }
+ }
+
+ # this string goes into the cactus executable directly
+ $linkerflagdirs = 'LDFLAGS +=';
+ $linkerflaglibs = '';
+
+ # here we put all the PROVIDES to where they belong
+ foreach $thorn (sort keys %thorns)
+ {
+ # we know that all the requirements have been satisfied
+ # so all we need to do is put the provides where they belong
+ # and make references to them from the requirements and optional
+ # since we can have multiple provides, we make each capability
+ # separate
+ if ($cfg->{"\U$thorn\E PROVIDES"})
+ {
+ $codedef = '';
+ $codedep = '';
+ $incdir = '';
+ $lib = '';
+ $libdir = '';
+ $thornDefnFile = '';
+ $thornDepsFile = '';
+
+ foreach $providedcap (split (' ', $cfg->{"\U$thorn\E PROVIDES"}))
+ {
+ $providedcaplist .= $providedcap;
+ if ( $cfg->{"\U$thorn $providedcap\E DEFINE"} )
+ {
+ &WriteFile("include/\U$providedcap\E.h",\$cfg->{"\U$thorn $providedcap\E DEFINE"});
+ }
+ if ( $cfg->{"\U$thorn $providedcap\E DEFINITION"} )
+ {
+ $codedef = $cfg->{"\U$thorn $providedcap\E DEFINITION"};
+ &WriteFile("$bindings_dir/Configuration/make.$\Uprovidedcap\E.defn",\$cfg->{"\U$thorn $providedcap\E DEFINITION"});
+ }
+ if ( $cfg->{"\U$thorn $providedcap\E DEPENDENCY"} )
+ {
+ $codedep = $cfg->{"\U$thorn $providedcap\E DEPENDENCY"};
+ &WriteFile("$bindings_dir/Configuration/make.\U$providedcap\E.deps",\$cfg->{"\U$thorn $providedcap\E DEPENDENCY"});
+ }
+ if ( $cfg->{"\U$thorn $providedcap\E INCLUDE_DIRECTORY"} )
+ {
+ $incdir = $cfg->{"\U$thorn $providedcap\E INCLUDE_DIRECTORY"};
+ }
+ if ( $cfg->{"\U$thorn $providedcap\E LIBRARY"} )
+ {
+ $lib = $cfg->{"\U$thorn $providedcap\E LIBRARY"};
+ }
+ if ( $cfg->{"\U$thorn $providedcap\E LIBRARY_DIRECTORY"} )
+ {
+ $libdir = $cfg->{"\U$thorn $providedcap\E LIBRARY_DIRECTORY"};
+ }
+
+ # Now put the stuff from the provide in the required and options
+ foreach $temp (sort keys %thorns)
+ {
+ foreach $requiredcap (split (' ', $cfg->{"\U$temp\E REQUIRES"}))
+ {
+ if ( $requiredcap eq $providedcap )
+ {
+ if ( $codedef ne '' )
+ {
+ $thornDefnFile .= "-include $bindings_dir/Configuration/make.\U$providedcap\E.defn\n";
+ }
+ if ( $codedep ne '' )
+ {
+ $thornDepsFile .= "-include $bindings_dir/Configuration/make.\U$providedcap\E.deps\n";
+ }
+ if ( $incdir ne '' )
+ {
+ $thornDefnFile .= "INC_DIRS += $incdir\n";
+ }
+ if ( $libdir ne '' )
+ {
+ $linkerflagdirs .= $libdir . " ";
+ }
+ if ( $lib ne '' )
+ {
+ $linkerflaglibs .= $lib . " ";
+ }
+ if(! -d "Configuration/$temp")
+ {
+ mkdir("Configuration/$temp", 0755) || die "Unable to create Configuration/$temp directory";
+ }
+ &WriteFile("$bindings_dir/Configuration/$temp/make.configuration.defn",\$thornDefnFile);
+ &WriteFile("$bindings_dir/Configuration/$temp/make.configuration.deps",\$thornDepsFile);
+ }
+ }
+ foreach $requiredcap (split (' ', $cfg->{"\U$temp\E OPTIONAL"}))
+ {
+ if ( $requiredcap eq $providedcap )
+ {
+ if ( $codedef ne '' )
+ {
+ $thornDefnFile .= "-include $bindings_dir/Configuration/make.\U$providedcap\E.defn\n";
+ }
+ if ( $codedep ne '' )
+ {
+ $thornDepsFile .= "-include $bindings_dir/Configuration/make.\U$providedcap\E.deps\n";
+ }
+ if ( $incdir ne '' )
+ {
+ $thornDefnFile .= "INC_DIRS += $incdir\n";
+ }
+ if ( $libdir ne '' )
+ {
+ $linkerflagdirs .= $libdir . " ";
+ }
+ if ( $lib ne '' )
+ {
+ $linkerflaglibs .= $lib . " ";
+ }
+ if(! -d "Configuration/$temp")
+ {
+ mkdir("Configuration/$temp", 0755) || die "Unable to create Configuration/$temp directory";
+ }
+ &WriteFile("$bindings_dir/Configuration/$temp/make.configuration.defn",\$thornDefnFile);
+ &WriteFile("$bindings_dir/Configuration/$temp/make.configuration.deps",\$thornDepsFile);
+ }
+ }
+
+
+ }
+ }
+
+ }
+ }
+ $linkerflagdirs .= $linkerflaglibs;
+ &WriteFile("$bindings_dir/Configuration/make.link",\$linkerflagdirs);
+
+}
+
+return 1;