2004-01-12 00:35:37 +03:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
#
|
2004-11-22 04:38:40 +03:00
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
# All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
# All rights reserved.
|
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
2004-01-12 00:35:37 +03:00
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Carp;
|
|
|
|
use Cwd;
|
|
|
|
use Getopt::Long;
|
|
|
|
use File::Basename;
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Local variables
|
|
|
|
############################################################################
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
my $ompi_topdir;
|
2004-08-02 04:24:22 +04:00
|
|
|
my $component_topdir;
|
2004-01-12 00:35:37 +03:00
|
|
|
my %config_values;
|
|
|
|
my %config_params;
|
|
|
|
|
|
|
|
my $initial_cwd = cwd();
|
2004-08-06 18:30:18 +04:00
|
|
|
my $announce_str = "Open MPI MCA component configure generator";
|
2004-01-12 00:35:37 +03:00
|
|
|
my %config_param_names = (PIFILE => "PARAM_INIT_FILE",
|
|
|
|
PCFGAUXDIR => "PARAM_CONFIG_AUX_DIR",
|
|
|
|
PC => "PARAM_WANT_C",
|
|
|
|
PCXX => "PARAM_WANT_CXX",
|
|
|
|
PVERFILE => "PARAM_VERSION_FILE",
|
|
|
|
PVARPREFIX => "PARAM_VAR_PREFIX",
|
|
|
|
PAMNAME => "PARAM_AM_NAME",
|
|
|
|
PCFGHDRFILE => "PARAM_CONFIG_HEADER_FILE",
|
2004-10-21 05:47:18 +04:00
|
|
|
PCFGFILES => "PARAM_CONFIG_FILES",
|
|
|
|
PCOMPILEEXT => "PARAM_WANT_COMPILE_EXTERNAL",
|
2004-01-12 00:35:37 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Command line arg procemcang
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
Getopt::Long::Configure("bundling", "require_order");
|
2004-06-07 19:33:53 +04:00
|
|
|
my $ok = Getopt::Long::GetOptions("ompidir|l=s" => \$ompi_topdir,
|
2004-08-02 04:24:22 +04:00
|
|
|
"componentdir|m=s" => \$component_topdir);
|
2004-01-12 00:35:37 +03:00
|
|
|
if (!$ok) {
|
2004-08-02 04:24:22 +04:00
|
|
|
print "Usage: $0 [--ompidir=DIR] [--componentdir=DIR]\n";
|
2004-01-12 00:35:37 +03:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
############################################################################
|
2004-08-02 04:24:22 +04:00
|
|
|
# Try to figure out the ompi and component topdirs
|
2004-01-12 00:35:37 +03:00
|
|
|
############################################################################
|
|
|
|
|
|
|
|
print "$announce_str starting\n";
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if (!$ompi_topdir) {
|
|
|
|
$ompi_topdir = dirname($0);
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
2004-06-07 19:33:53 +04:00
|
|
|
chdir($ompi_topdir);
|
|
|
|
$ompi_topdir = cwd();
|
2004-01-12 00:35:37 +03:00
|
|
|
chdir($initial_cwd);
|
2004-06-07 19:33:53 +04:00
|
|
|
if (!$ompi_topdir || ! -f "$ompi_topdir/autogen.sh") {
|
|
|
|
croak("Unable to find OMPI base directory (try using --ompidir)");
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (!$component_topdir) {
|
|
|
|
$component_topdir = $initial_cwd;
|
|
|
|
if ($component_topdir eq $ompi_topdir) {
|
|
|
|
croak("Unable to determine which component to operate on");
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
|
|
|
}
|
2004-08-02 04:24:22 +04:00
|
|
|
chdir($component_topdir);
|
|
|
|
$component_topdir = cwd();
|
2004-01-12 00:35:37 +03:00
|
|
|
chdir($initial_cwd);
|
2004-08-02 04:24:22 +04:00
|
|
|
if (!$ompi_topdir || ! -d $component_topdir) {
|
|
|
|
croak("Unable to find component directory (try using --componentdir)");
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Print them out
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
print "--> Found OMPI top dir: $ompi_topdir\n";
|
2004-08-02 04:24:22 +04:00
|
|
|
print "--> Found component top dir: $component_topdir\n";
|
2004-01-12 00:35:37 +03:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
# If we have a configure.params file in the component topdir, we're good to
|
2004-01-12 00:35:37 +03:00
|
|
|
# go.
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (! -f "$component_topdir/configure.params") {
|
|
|
|
die("No configure.params in component topdir; nothing to do");
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Make a backup
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (-f "$component_topdir/acinclude.m4") {
|
|
|
|
printf(" *** WARNING: Replacing old acinclude.m4\n");
|
|
|
|
unlink("$component_topdir/acinclude.m4.bak");
|
|
|
|
rename("$component_topdir/acinclude.m4", "$component_topdir/acinclude.m4.bak");
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
2004-08-02 04:24:22 +04:00
|
|
|
if (-f "$component_topdir/configure.ac") {
|
|
|
|
printf(" *** WARNING: Replacing old configure.ac\n");
|
|
|
|
unlink("$component_topdir/configure.ac.bak");
|
|
|
|
rename("$component_topdir/configure.ac", "$component_topdir/configure.ac.bak");
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Set and calculate sensible default parameter values
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
# Unchangeable values
|
|
|
|
# MCA_TYPE: calculate
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
$config_values{"MCA_TYPE"} = dirname($component_topdir);
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_values{"MCA_TYPE"} = basename($config_values{"MCA_TYPE"});
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
# PROCESSED_MCA_TYPE: For "special" MCA types, like "crompi" and
|
2004-01-12 00:35:37 +03:00
|
|
|
# "crmpi".
|
|
|
|
|
|
|
|
$config_values{"PROCESSED_MCA_TYPE"} = $config_values{"MCA_TYPE"};
|
2004-06-07 19:33:53 +04:00
|
|
|
if ($config_values{"PROCESSED_MCA_TYPE"} eq "crompi" ||
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_values{"PROCESSED_MCA_TYPE"} eq "crmpi") {
|
|
|
|
$config_values{"PROCESSED_MCA_TYPE"} = "cr";
|
|
|
|
}
|
|
|
|
|
|
|
|
# MCA_NAME: calculate
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
$config_values{"MCA_COMPONENT_NAME"} = basename($component_topdir);
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
# Parameter (changeable) values
|
2004-10-21 05:47:18 +04:00
|
|
|
# PARAM_COMPILE_EXTERNAL: set
|
|
|
|
|
|
|
|
$config_params{$config_param_names{PCOMPILEEXT}} = 0;
|
|
|
|
|
2004-01-12 00:35:37 +03:00
|
|
|
# PARAM_CONFIG_AUX_DIR: set
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (-d "$component_topdir/config") {
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_params{$config_param_names{PCFGAUXDIR}} = "config";
|
|
|
|
} else {
|
|
|
|
$config_params{$config_param_names{PCFGAUXDIR}} = ".";
|
|
|
|
}
|
|
|
|
$config_params{$config_param_names{PC}} = 1;
|
|
|
|
$config_params{$config_param_names{PCXX}} = 0;
|
|
|
|
|
|
|
|
# PARAM_VERSION_FILE: calculate
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (-f "$component_topdir/VERSION") {
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_params{$config_param_names{PVERFILE}} = "\$srcdir/VERSION";
|
2004-08-02 04:24:22 +04:00
|
|
|
} elsif (-f "$component_topdir/$config_params{$config_param_names{PCFGAUXDIR}}/VERSION") {
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_params{$config_param_names{PVERFILE}} =
|
|
|
|
"\$srcdir/$config_params{$config_param_names{PCFGAUXDIR}}/VERSION";
|
|
|
|
}
|
|
|
|
|
|
|
|
# PARAM_VAR_PREFIX: calculate
|
|
|
|
|
|
|
|
$config_params{$config_param_names{PVARPREFIX}} =
|
2004-10-21 20:27:17 +04:00
|
|
|
"MCA_" . $config_values{"MCA_TYPE"} .
|
|
|
|
"_" . $config_values{"MCA_COMPONENT_NAME"};
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
# PARAM_AM_NAME: calculate
|
|
|
|
|
|
|
|
$config_params{$config_param_names{PAMNAME}} =
|
|
|
|
lc($config_values{"MCA_TYPE"}) .
|
2004-08-02 04:24:22 +04:00
|
|
|
"-" . lc($config_values{"MCA_COMPONENT_NAME"});
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
# PARAM_CONFIG_HEADER_FILE: calculate
|
|
|
|
|
|
|
|
$config_params{$config_param_names{PCFGHDRFILE}} =
|
|
|
|
"src/" . lc($config_values{"MCA_TYPE"}) .
|
2004-08-02 04:24:22 +04:00
|
|
|
"_" . lc($config_values{"MCA_COMPONENT_NAME"}) . "_config.h";
|
2004-01-12 00:35:37 +03:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
# Is there a config.stub file in the component topdir?
|
2004-01-12 00:35:37 +03:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
if (-f "$component_topdir/configure.stub") {
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_values{CONFIGURE_STUB_SINCLUDE} = "#
|
2004-08-02 04:24:22 +04:00
|
|
|
# Component-specific tests
|
2004-01-12 00:35:37 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
sinclude(configure.stub)\n";
|
|
|
|
$config_values{CONFIGURE_STUB_MACRO} =
|
2004-06-07 19:33:53 +04:00
|
|
|
"ompi_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
|
2004-08-02 04:24:22 +04:00
|
|
|
$config_values{"MCA_COMPONENT_NAME"} . "-specific setup\"
|
2004-01-12 00:35:37 +03:00
|
|
|
MCA_CONFIGURE_STUB";
|
|
|
|
|
|
|
|
# See if there's a CONFIGURE_DIST_STUB in configure.stub
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
open(STUB, "$component_topdir/configure.stub");
|
2004-01-12 00:35:37 +03:00
|
|
|
my $found = 0;
|
|
|
|
while (<STUB>) {
|
|
|
|
$found = 1
|
|
|
|
if ($_ =~ /MCA_CONFIGURE_DIST_STUB/);
|
|
|
|
}
|
|
|
|
close(STUB);
|
|
|
|
if ($found == 1) {
|
|
|
|
$config_values{CONFIGURE_DIST_STUB_MACRO} =
|
2004-06-07 19:33:53 +04:00
|
|
|
"ompi_show_subtitle \"MCA " . $config_values{"MCA_TYPE"} . " " .
|
2004-08-02 04:24:22 +04:00
|
|
|
$config_values{"MCA_COMPONENT_NAME"} .
|
2004-01-12 00:35:37 +03:00
|
|
|
"-specific setup (dist specific!)\"
|
|
|
|
MCA_CONFIGURE_DIST_STUB";
|
|
|
|
} else {
|
|
|
|
$config_values{CONFIGURE_DIST_STUB_MACRO} = "true";
|
|
|
|
}
|
|
|
|
} else {
|
2004-01-20 07:12:42 +03:00
|
|
|
$config_values{CONFIGURE_STUB_SINCLUDE} = "";
|
2004-01-12 00:35:37 +03:00
|
|
|
$config_values{CONFIGURE_STUB_MACRO} = "true";
|
|
|
|
$config_values{CONFIGURE_DIST_STUB_MACRO} = "true";
|
|
|
|
}
|
|
|
|
|
|
|
|
############################################################################
|
2004-10-21 05:47:18 +04:00
|
|
|
# Read in the configure.params file (possibly overriding the defaults
|
2004-01-12 00:35:37 +03:00
|
|
|
# set above)
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
my $found = 0;
|
|
|
|
my @names = values %config_param_names;
|
2004-08-02 04:24:22 +04:00
|
|
|
open(PARAMS, "$component_topdir/configure.params") ||
|
|
|
|
die("Could not open configure.params in $component_topdir");
|
2004-01-12 00:35:37 +03:00
|
|
|
while (<PARAMS>) {
|
|
|
|
chomp;
|
|
|
|
|
|
|
|
# Ignore comments and blank lines
|
|
|
|
|
|
|
|
my $line = $_;
|
|
|
|
$line =~ s/^[ \t]+(.*)[ \t]+$/\1/;
|
|
|
|
$line =~ s/(.*)[\#]+.*/\1/;
|
|
|
|
next if (length($line) == 0);
|
|
|
|
|
|
|
|
# So we have a key=value line
|
|
|
|
# Split into componenty, and remove quotes
|
|
|
|
|
|
|
|
my ($key, $value) = split(/=/, $line);
|
|
|
|
$key =~ s/^[ \t]+(.*)[ \t]+$/\1/;
|
|
|
|
$value =~ s/^[ \t]+(.*)[ \t]+$/\1/;
|
|
|
|
$value =~ s/^[\"](.*)[\"]$/\1/;
|
|
|
|
$value =~ s/^[\'](.*)[\']$/\1/;
|
|
|
|
|
|
|
|
for (my $i = 0; $i <= $#names; ++$i) {
|
|
|
|
if ($key eq $names[$i]) {
|
|
|
|
if (!$found) {
|
2004-08-02 04:24:22 +04:00
|
|
|
printf("--> Found parameter override(s):\n");
|
2004-01-12 00:35:37 +03:00
|
|
|
$found = 1;
|
|
|
|
}
|
|
|
|
printf(" $key = $value\n");
|
|
|
|
$config_params{$key} = $value;
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Print out the values
|
|
|
|
|
|
|
|
print "--> Final configuration values:\n";
|
|
|
|
foreach my $key (sort keys(%config_param_names)) {
|
|
|
|
print " $config_param_names{$key} = " .
|
|
|
|
$config_params{$config_param_names{$key}} . "\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-01-14 23:57:03 +03:00
|
|
|
# Do some error checking on the values that we've determined
|
|
|
|
|
|
|
|
if (! -f $config_params{PARAM_INIT_FILE}) {
|
|
|
|
print "*** WARNING: PARAM_INIT_FILE does not exist:\n";
|
|
|
|
print "*** WARNING: $config_params{PARAM_INIT_FILE}\n";
|
|
|
|
print "*** WARNING: resulting configure script will not run properly!\n";
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($config_params{PARAM_INIT_FILE} eq "" ||
|
|
|
|
! -f $config_params{PARAM_INIT_FILE}) {
|
|
|
|
print "*** WARNING: PARAM_VERSION_FILE does not exit:\n";
|
|
|
|
print "*** WARNING: $config_params{PARAM_VERSION_FILE} does not exist!\n";
|
|
|
|
print "*** WARNING: resulting configure script will not check for the version!!\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
my @files = split(/ /, $config_params{PARAM_CONFIG_FILES});
|
|
|
|
foreach my $file (@files) {
|
|
|
|
if (! -f "$file.in" && ! -f "$file.am") {
|
|
|
|
print "*** WARNING: PARAM_CONFIG_FILES file does not exist:\n";
|
|
|
|
print "*** WARNING: $file.[in|am]\n";
|
|
|
|
print "*** WARNING: resulting configure script may not run correctly!!\n";
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! -d $config_params{PARAM_CONFIG_AUX_DIR}) {
|
|
|
|
print "*** WARNING: PARAM_CONFIG_AUX_DIR does not exit:\n";
|
|
|
|
print "*** WARNING: $config_params{PARAM_CONFIG_AUX_DIR}\n";
|
|
|
|
print "*** WARNING: Taking the liberty of trying to make it...\n";
|
2004-10-21 05:47:18 +04:00
|
|
|
if (!mkdir($config_params{PARAM_CONFIG_AUX_DIR})) {
|
|
|
|
print "*** ERROR: Failed to make AUX_DIR: $config_params{PARAM_CONFIG_AUX_DIR}\n";
|
|
|
|
print "*** ERROR: Cannot continue\n";
|
2004-01-14 23:57:03 +03:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-10-21 05:47:18 +04:00
|
|
|
# If we want to be able to compile outside the Open MPI tree, we need
|
|
|
|
# to copy some files to the auxdir
|
|
|
|
|
|
|
|
if ($config_params{PARAM_WANT_COMPILE_EXTERNAL} != 0) {
|
|
|
|
my $auxdir = $config_params{PARAM_CONFIG_AUX_DIR};
|
|
|
|
open (ACINCLUDE, "$ompi_topdir/config/mca_acinclude.m4");
|
|
|
|
{
|
|
|
|
while (<ACINCLUDE>) {
|
|
|
|
chomp;
|
|
|
|
my $filename = $_;
|
|
|
|
if ($filename =~ /^.*sinclude\(\@M4DIR\@\/(.+)\).*$/) {
|
|
|
|
$filename =~ s/^.*sinclude\(\@M4DIR\@\/(.+)\).*$/\1/;
|
|
|
|
unlink("$auxdir/$filename")
|
|
|
|
if (-f "$auxdir/$filename");
|
|
|
|
print "--> Copying m4 file: $filename ==> $auxdir\n";
|
|
|
|
system("cp -f $ompi_topdir/config/$filename $config_params{PARAM_CONFIG_AUX_DIR}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(ACINCLUDE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-12 00:35:37 +03:00
|
|
|
############################################################################
|
|
|
|
# Read in the configure.ac template
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
sub make_template {
|
|
|
|
my ($src, $dest, $mode) = @_;
|
|
|
|
my $template;
|
|
|
|
my $search;
|
|
|
|
my $replace;
|
|
|
|
|
|
|
|
# Read in the template file
|
|
|
|
|
|
|
|
print "--> Reading template file: $src\n";
|
|
|
|
open(TEMPLATE, $src) ||
|
|
|
|
die("Cannot open template file: $src");
|
|
|
|
while (<TEMPLATE>) {
|
|
|
|
$template .= $_;
|
|
|
|
}
|
|
|
|
close(TEMPLATE);
|
|
|
|
|
|
|
|
# Transform the template
|
|
|
|
|
2004-10-21 20:27:17 +04:00
|
|
|
# If there's a PARAM_VERSION_FILE, then ensure that configure is
|
|
|
|
# set to write it out
|
2004-01-12 00:35:37 +03:00
|
|
|
|
2004-10-21 20:27:17 +04:00
|
|
|
$search = "\@WRITE_VERSION_HEADER_TEMPLATE\@";
|
|
|
|
if ($config_params{PARAM_VERSION_FILE} ne "") {
|
|
|
|
$replace = "AC_CONFIG_FILES([\@MCA_TYPE\@-\@MCA_COMPONENT_NAME\@-version.h.template])";
|
|
|
|
} else {
|
|
|
|
$replace = "";
|
2004-01-12 00:35:37 +03:00
|
|
|
}
|
2004-10-21 20:27:17 +04:00
|
|
|
$template =~ s/$search/$replace/g;
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
# If we want C or C++, substitute in the right setup macros
|
|
|
|
|
|
|
|
$search = "\@C_COMPILER_SETUP\@";
|
|
|
|
$replace = $config_params{$config_param_names{"PC"}} ?
|
2004-06-07 19:33:53 +04:00
|
|
|
"OMPI_SETUP_CC" : "";
|
2004-01-12 00:35:37 +03:00
|
|
|
$template =~ s/$search/$replace/;
|
|
|
|
|
|
|
|
$search = "\@CXX_COMPILER_SETUP\@";
|
|
|
|
$replace = $config_params{$config_param_names{"PCXX"}} ?
|
2004-06-07 19:33:53 +04:00
|
|
|
"OMPI_SETUP_CXX" : "";
|
2004-01-12 00:35:37 +03:00
|
|
|
$template =~ s/$search/$replace/;
|
|
|
|
|
2004-10-21 05:47:18 +04:00
|
|
|
# If we want to be able to compile outside the Open MPI tree, set
|
|
|
|
# the right include path for the M4 files
|
|
|
|
|
|
|
|
$search = "\@M4DIR\@";
|
2004-10-21 17:59:12 +04:00
|
|
|
$replace = ($config_params{PARAM_WANT_COMPILE_EXTERNAL} == 1) ?
|
2004-10-21 05:47:18 +04:00
|
|
|
$config_params{PARAM_CONFIG_AUX_DIR} : "../../../../config";
|
|
|
|
$template =~ s/$search/$replace/g;
|
|
|
|
|
2004-10-21 20:27:17 +04:00
|
|
|
# Do all the parameters. This is done last so that any of the
|
|
|
|
# above can use paramter values in their values, and expect to
|
|
|
|
# have their respective values substituted in (i.e., a [semi]
|
|
|
|
# recursive substitution).
|
|
|
|
|
|
|
|
print "--> Filling in the template...\n";
|
|
|
|
foreach my $key (sort keys(%config_values)) {
|
|
|
|
$search = "@" . $key . "@";
|
|
|
|
$template =~ s/$search/$config_values{$key}/g;
|
|
|
|
}
|
|
|
|
foreach my $key (sort keys(%config_param_names)) {
|
|
|
|
next if ($key eq "PC" || $key eq "PCXX");
|
|
|
|
|
|
|
|
$search = "@" . $config_param_names{$key} . "@";
|
|
|
|
$template =~
|
|
|
|
s/$search/$config_params{$config_param_names{$key}}/g;
|
|
|
|
}
|
|
|
|
|
2004-10-21 05:47:18 +04:00
|
|
|
# Write it out
|
|
|
|
|
2004-01-12 00:35:37 +03:00
|
|
|
print "--> Writing output file: $dest\n";
|
|
|
|
open(OUTPUT, ">$dest") ||
|
|
|
|
die("Cannot open output flie: $dest");
|
|
|
|
print OUTPUT $template;
|
|
|
|
close(OUTPUT);
|
|
|
|
|
|
|
|
chmod($dest, $mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Read and fill in the templates
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
make_template("$ompi_topdir/config/mca_configure.ac",
|
2004-08-02 04:24:22 +04:00
|
|
|
"$component_topdir/configure.ac", 0644);
|
2004-06-07 19:33:53 +04:00
|
|
|
make_template("$ompi_topdir/config/mca_acinclude.m4",
|
2004-08-02 04:24:22 +04:00
|
|
|
"$component_topdir/acinclude.m4", 0644);
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# All done
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
print "\n$announce_str finished\n";
|
2004-01-14 23:57:03 +03:00
|
|
|
|
|
|
|
exit(0);
|