From 6c232fb9ff78cc66dea57a847485bd5a5b5f2a36 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Wed, 6 Jul 2005 18:38:57 +0000 Subject: [PATCH] * remove version file logic (now unused) from the no-configure component code * Add code to create m4_defined lists in mca_no_configure_components.m4 that list all the projects (opal, orte, ompi, etc.), all the frameworks in each project, and all the no-configure components in each framework. These will eventually be used to remove all those lists from ompi_mca.m4 This does not require an autogen / configure. Won't hurt, but not required. This commit was SVN r6361. --- autogen.sh | 400 +++++++++++++++++++++++++---------------------------- 1 file changed, 189 insertions(+), 211 deletions(-) diff --git a/autogen.sh b/autogen.sh index 9f6ba65a24..b62a03bbca 100755 --- a/autogen.sh +++ b/autogen.sh @@ -56,6 +56,7 @@ ompi_automake="" mca_no_configure_components_file="config/mca_no_configure_components.m4" mca_no_config_list_file="mca_no_config_list" mca_no_config_amc_file="mca_no_config_amc" +mca_no_config_env_file="mca_no_config_env" autogen_subdir_file="autogen.subdirs" # locations to look for mca modules @@ -402,6 +403,83 @@ EOF } + +############################################################################## +# +# run_no_configure_component +# Prepares the non-configure component +# +# INPUT: +# - OMPI top directory +# +# OUTPUT: +# none +# +# SIDE EFFECTS: +# +############################################################################## +run_no_configure_component() { + noconf_dir="$1" + noconf_ompi_topdir="$2" + noconf_project="$3" + noconf_framework="$4" + noconf_component="$5" + + # Write out to two files (they're merged at the end) + noconf_list_file="$noconf_ompi_topdir/$mca_no_config_list_file" + noconf_amc_file="$noconf_ompi_topdir/$mca_no_config_amc_file" + noconf_env_file="$noconf_ompi_topdir/$mca_no_config_env_file" + + cat >> "$noconf_list_file" <> "$noconf_amc_file" <> "$noconf_list_file" + done + + # Add this component directory to the list of + # subdirectories to traverse when building. + cat >> "$noconf_list_file" <> "$noconf_amc_file" < Adding to top-level configure no-configure subdirs: +--> $noconf_dir +--> Adding to top-level configure AC_CONFIG_FILES list: +--> $PARAM_CONFIG_FILES +EOF + + echo "component_list=\"\$component_list $noconf_component\"" >> "$noconf_env_file" +} + + ############################################################################## # # process_dir - look at the files present in a given directory, and do @@ -426,6 +504,10 @@ EOF process_dir() { pd_dir="$1" pd_ompi_topdir="$2" + pd_project="$3" + pd_framework="$4" + pd_component="$5" + pd_cur_dir="`pwd`" # Convert to absolutes @@ -534,177 +616,8 @@ EOF *** Nothing to do -- skipping this directory EOF else - pd_component_name="`basename \"$pd_abs_dir\"`" - pd_component_type="`dirname \"$pd_abs_dir\"`" - pd_component_type="`basename \"$pd_component_type\"`" - - # Write out to two files (they're merged at the end) - - pd_list_file="$pd_ompi_topdir/$mca_no_config_list_file" - pd_amc_file="$pd_ompi_topdir/$mca_no_config_amc_file" - - cat >> "$pd_list_file" <> "$pd_amc_file" <> "$pd_list_file" - done - - # Add this component directory to the list of - # subdirectories to traverse when building. - - cat >> "$pd_list_file" <--version.h.template.in. In there, - # have #define's with values that are @foo@ (i.e., - # the result of AC_SUBST) - - make_version_header_template "$pd_ver_header_base" "$pd_component_type" "$pd_component_name" - - # 2. Add the template header file to the list of - # AC_CONFIG_FILES so that AC_SUBST'ed things will - # be substituted in. - - cat >> "$pd_list_file" <--version.h file unchanged (and - # therefore its timestamp unaltered) if nothing - # changed. - - cat >> "$pd_list_file" < /dev/null 2>&1 - if test "\$?" != "0"; then - cp "$pd_ver_header.template" "$pd_ver_header" - echo "config.status: regenerating $pd_ver_header" - else - echo "config.status: $pd_ver_header unchanged" - fi -else - cp "$pd_ver_header.template" "$pd_ver_header" - echo "config.status: creating $pd_ver_header" -fi -rm $pd_ver_header.template]) - -EOF - fi - - # Setup the AM_CONDITIONAL to build this component - - cat >> "$pd_amc_file" < Adding to top-level configure no-configure subdirs: ---> $pd_dir ---> Adding to top-level configure AC_CONFIG_FILES list: ---> $PARAM_CONFIG_FILES -EOF + run_no_configure_component "$pd_dir" "$pd_ompi_topdir" \ + "$pd_project" "$pd_framework" "$pd_component" fi else cat </mca/*/* - # that has a configure.in or configure.ac script - - rg_cwd="`pwd`" - echo $rg_cwd - for project in $mca_locations; do - for type in $project/mca/*; do - if test -d "$type"; then - for component in "$type"/*; do - if test -d "$component"; then - if test -f "$component/configure.in" -o \ - -f "$component/configure.params" -o \ - -f "$component/configure.ac"; then - process_dir "$component" "$rg_cwd" - fi - fi - done - fi - done - done - - # Fill in the final m4 file - + #create header for the component config file cat > "$mca_no_configure_components_file" </mca/*/* + # that has a configure.in or configure.ac script + # + # In order to deal with components that have .m4 files, we need to + # build up m4_defined lists along the way. Unfortunately, there + # is no good way to do this at the end (stupid sh), so we have to + # do it as we are going through the lists of frameworks and + # components. Use a file to keep the list of components (we don't + # want every component in a framework included, as the + # determination about skipping components or whether the component + # has its own configure script are made later on in the process. + + rg_cwd="`pwd`" + echo $rg_cwd + project_list="" + for project_path in $mca_locations; do + project="`basename \"$project_path\"`" + project_list="$project_list $project" + + framework_list="" + for framework_path in $project_path/mca/*; do + framework="`basename \"$framework_path\"`" + + if test "$framework" != "base" -a \ + -d "$framework_path" -a \ + -r "${framework_path}/${framework}.h" ; then + framework_list="$framework_list $framework" + + rm -f "$mca_no_config_env_file" + touch "$mca_no_config_env_file" + echo "component_list=" >> "$mca_no_config_env_file" + + for component_path in "$framework_path"/*; do + if test -d "$component_path"; then + if test -f "$component_path/configure.in" -o \ + -f "$component_path/configure.params" -o \ + -f "$component_path/configure.ac"; then + + component="`basename \"$component_path\"`" + + process_dir "$component_path" "$rg_cwd" \ + "$project" "$framework" "$component" + fi + fi + done + + # make list of components for this framework + . "$mca_no_config_env_file" + component_list_define="m4_define(mca_${framework}_no_config_component_list, [" + component_list_define_first="1" + for component in $component_list ; do + if test "$component_list_define_first" = "1"; then + component_list_define="${component_list_define}${component}" + component_list_define_first="0" + else + component_list_define="${component_list_define}, ${component}" + fi + done + component_list_define="${component_list_define}])" + echo "$component_list_define" >> "$mca_no_configure_components_file" + + fi + done + + # make list of frameworks for this project + framework_list_define="m4_define(mca_${project}_framework_list, [" + framework_list_define_first="1" + for framework in $framework_list ; do + if test "$framework_list_define_first" = "1"; then + framework_list_define="${framework_list_define}${framework}" + framework_list_define_first="0" + else + framework_list_define="${framework_list_define}, ${framework}" + fi + done + framework_list_define="${framework_list_define}])" + echo "$framework_list_define" >> "$mca_no_configure_components_file" + + done + + # create the m4 defines for the list of projects. The list of + # frameworks for each project is already created and in the file. + project_list_define="m4_define(mca_project_list, [" + project_list_define_first="1" + for project in $project_list ; do + if test "$project_list_define_first" = "1"; then + project_list_define="${project_list_define}${project}" + project_list_define_first="0" + else + project_list_define="${project_list_define}, ${project}" + fi + done + project_list_define="${project_list_define}])" + echo "$project_list_define" >> "$mca_no_configure_components_file" + + + cat >> "$mca_no_configure_components_file" <