Skip to content

Commit

Permalink
Automatically generate a list of installed frameworks in project/incl…
Browse files Browse the repository at this point in the history
…ude/project/frameworks.h
  • Loading branch information
hjelmn committed Mar 20, 2013
1 parent 4d6f3ee commit 8577ab4
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 48 deletions.
32 changes: 32 additions & 0 deletions autogen.pl
Expand Up @@ -362,6 +362,36 @@ sub mca_process_framework {


############################################################################## ##############################################################################


sub mca_generate_framework_header(\$\@) {
my ($project, @frameworks) = @_;
my $framework_array_output="";
my $framework_decl_output="";

foreach my $framework (@frameworks) {
# There is no common framework object
if ($framework ne "common") {
my $framework_name = "${project}_${framework}_base_framework";

$framework_array_output .= " &$framework_name,\n";
$framework_decl_output .= "extern mca_base_framework_t $framework_name;\n";
}
}

open(FRAMEWORKS_OUT, ">$project/include/$project/frameworks.h");
printf FRAMEWORKS_OUT "%s", "/*
* This file is autogenerated by autogen.pl. Do not edit this file by hand.
*/
#include <opal/mca/base/mca_base_framework.h>
$framework_decl_output
static mca_base_framework_t *${project}_frameworks[] = {
$framework_array_output NULL
};\n";
close(FRAMEWORKS_OUT);
}

##############################################################################

sub mca_process_project { sub mca_process_project {
my ($topdir, $project) = @_; my ($topdir, $project) = @_;


Expand Down Expand Up @@ -472,6 +502,8 @@ sub mca_run_global {
} }
$frameworks_comma =~ s/^, //; $frameworks_comma =~ s/^, //;


&mca_generate_framework_header($pname, @mykeys);

$m4 .= "$dnl_line $m4 .= "$dnl_line
dnl Frameworks in the $pname project and their corresponding directories dnl Frameworks in the $pname project and their corresponding directories
Expand Down
2 changes: 1 addition & 1 deletion config/ompi_mca.m4
Expand Up @@ -233,7 +233,7 @@ AC_DEFUN([OMPI_MCA],[


m4_undefine([mca_component_configure_active]) m4_undefine([mca_component_configure_active])
]) ])



###################################################################### ######################################################################
# #
Expand Down
3 changes: 2 additions & 1 deletion ompi/include/ompi/Makefile.am
Expand Up @@ -23,7 +23,8 @@ headers += \
ompi/constants.h \ ompi/constants.h \
ompi/types.h \ ompi/types.h \
ompi/memchecker.h \ ompi/memchecker.h \
ompi/totalview.h ompi/totalview.h \
ompi/frameworks.h


nodist_headers += \ nodist_headers += \
ompi/version.h ompi/version.h
44 changes: 0 additions & 44 deletions ompi/mca/allocator/base/allocator_base_close.c

This file was deleted.

3 changes: 2 additions & 1 deletion opal/include/opal/Makefile.am
Expand Up @@ -25,7 +25,8 @@ headers += \
opal/opal_socket_errno.h \ opal/opal_socket_errno.h \
opal/types.h \ opal/types.h \
opal/prefetch.h \ opal/prefetch.h \
opal/hash_string.h opal/hash_string.h \
opal/frameworks.h


nodist_headers += \ nodist_headers += \
opal/version.h opal/version.h
Expand Down
6 changes: 6 additions & 0 deletions opal/runtime/opal_info_support.c
Expand Up @@ -25,6 +25,10 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>


#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include "opal/class/opal_list.h" #include "opal/class/opal_list.h"
#include "opal/class/opal_pointer_array.h" #include "opal/class/opal_pointer_array.h"


Expand All @@ -36,6 +40,8 @@
#include "opal/runtime/opal.h" #include "opal/runtime/opal.h"
#include "opal/dss/dss.h" #include "opal/dss/dss.h"


#include "opal/include/opal/frameworks.h"

#include "opal/mca/installdirs/installdirs.h" #include "opal/mca/installdirs/installdirs.h"
#include "opal/mca/event/base/base.h" #include "opal/mca/event/base/base.h"
#include "opal/mca/base/base.h" #include "opal/mca/base/base.h"
Expand Down
3 changes: 2 additions & 1 deletion orte/include/orte/Makefile.am
Expand Up @@ -21,7 +21,8 @@


headers += \ headers += \
orte/constants.h \ orte/constants.h \
orte/types.h orte/types.h \
orte/frameworks.h


nodist_headers += \ nodist_headers += \
orte/version.h orte/version.h

0 comments on commit 8577ab4

Please sign in to comment.