@@ -462,11 +462,11 @@ find_or_install()
462462 printf " $this_script : Checking whether $package executable $executable in PATH is version < $minimum_version ... "
463463 if [[ " $package_version_in_path " < " $package (GNU Bison) $minimum_version " ]]; then
464464 printf " yes.\n"
465- export YACC=" $package_install_path /bin/yacc "
466- # Halt the recursion and signal that there are no prerequisites to build
467- stack_push dependency_pkg " none "
468- stack_push dependency_exe " none "
469- stack_push dependency_path " none "
465+ export YACC=" $package_install_path /bin/$executable "
466+ # Trigger 'find_or_install m4' and subsequent build of $package
467+ stack_push dependency_pkg " m4 "
468+ stack_push dependency_exe " m4 "
469+ stack_push dependency_path ` ./build m4 --default --query-path `
470470 else
471471 printf " no.\n"
472472 printf " $this_script : Using the $package executable $executable found in the PATH.\n"
@@ -487,7 +487,7 @@ find_or_install()
487487 fi
488488
489489 else # $package not in PATH and not yet installed by this script
490- # Trigger 'find_or_install bison ' and subsequent build of $package
490+ # Trigger 'find_or_install m4 ' and subsequent build of $package
491491 stack_push dependency_pkg " m4"
492492 stack_push dependency_exe " m4"
493493 stack_push dependency_path ` ./build m4 --default --query-path`
@@ -665,6 +665,9 @@ find_or_install()
665665 elif [[ $package == " flex" ]]; then
666666 echo " $this_script : export FLEX=$package_install_path /bin/$executable "
667667 export FLEX=" $package_install_path /bin/$executable "
668+ elif [[ $package == " m4" ]]; then
669+ echo " $this_script : export M4=$package_install_path /bin/$executable "
670+ export M4=" $package_install_path /bin/$executable "
668671 elif [[ $package == " gcc" ]]; then
669672 echo " $this_script : export FC=$package_install_path /bin/gfortran"
670673 export FC=" $package_install_path /bin/gfortran"
@@ -849,6 +852,14 @@ report_results()
849852 echo " export PATH=\" $bison_install_path /bin\" :\$ PATH " >> setup.sh
850853 echo " fi " >> setup.sh
851854 fi
855+ m4_install_path=` ./build m4 --default --query-path`
856+ if [[ -x " $m4_install_path /bin/yacc" ]]; then
857+ echo " if [[ -z \"\$ PATH\" ]]; then " >> setup.sh
858+ echo " export PATH=\" $m4_install_path /bin\" " >> setup.sh
859+ echo " else " >> setup.sh
860+ echo " export PATH=\" $m4_install_path /bin\" :\$ PATH " >> setup.sh
861+ echo " fi " >> setup.sh
862+ fi
852863 setup_sh_location=$install_path
853864 $SUDO mv setup.sh $install_path || setup_sh_location=${PWD}
854865 echo " *** Before using caf, cafrun, or build, please execute the following command ***"
0 commit comments