Index: palm/trunk/SCRIPTS/mbuild
===================================================================
--- palm/trunk/SCRIPTS/mbuild	(revision 807)
+++ palm/trunk/SCRIPTS/mbuild	(revision 811)
@@ -126,4 +126,6 @@
      #                    check program) has been added to the utility branch),
      #                    modfified the compilation of mrungui
+     # 31/01/12 - BjornM- bugfix for compilation of utility programs on 
+     #                    multiple localhost branches
 
 
@@ -138,4 +140,5 @@
  makefile=""
  module_calls=""
+ util_compiled_localhost=false
  scirocco=false
  silent=false
@@ -424,5 +427,4 @@
     tar -cf  ${mainprog}_sources_check.tar  Makefile_check  $line
     printf "\n"
-
  fi
 
@@ -1390,38 +1392,49 @@
 
              # CHECK IF QMAKE IS AVAILABLE AND COMPILE MRUNGUI
-          printf "\n\n"
-          echo "  *** compiling the mrun GUI"
-          if which qmake >/dev/null; then
-             cd mrungui
-             touch *
-             qmake
-             make
-             make clean
-             rm Makefile
-             cd ..
-          else
-             echo "  +++ no qmake found. The (optional) GUI will not be compiled."
-          fi
-
-             # COMPILE CHECK_NAMELIST_FILES
-          printf "\n\n"
-          echo "  *** compiling check_namelist_files ..."
-
-          check_depository_path=${local_source_path}/../UTIL
-          cd $check_depository_path
-          mkdir check_tmp
-          mv ${local_source_path}/${mainprog}_sources_check.tar ./check_tmp
-          cd check_tmp
-          tar -xf  ${mainprog}_sources_check.tar
-          rm -rf ${mainprog}_sources_check.tar
-
-          copts_check="-cpp -D_parallel -D__check"
-          make  -f Makefile_check $make_options F90=$compiler_name_ser  COPT="$copts_check"
-
-          tar -cf  check_namelist_files.tar Makefile_check check_namelist_files.x *.f90 *.o *.mod
-          mv check_namelist_files.tar $check_depository_path
-          mv check_namelist_files.x $PALM_BIN
-          cd $check_depository_path
-          rm -rf check_tmp
+          if [[ $util_compiled_localhost == false ]]
+          then
+             printf "\n\n"
+             echo "  *** compiling the mrun GUI"
+             if which qmake >/dev/null; then
+                cd mrungui
+                touch *
+                qmake
+                make
+                make clean
+                rm Makefile
+                cd ..
+             else
+                echo "  +++ no qmake found. The (optional) GUI will not be compiled."
+             fi
+
+             # COMPILE CHECK_NAMELIST_FILES (ONLY FOR ONE BRANCH on LOCALHOST NEEDED)
+
+             printf "\n\n"
+             echo "  *** compiling check_namelist_files ..."
+
+             check_depository_path=${local_source_path}/../UTIL
+             cd $check_depository_path
+             mkdir check_tmp
+             cp ${local_source_path}/${mainprog}_sources_check.tar ./check_tmp
+             cd check_tmp
+             tar -xf  ${mainprog}_sources_check.tar
+             rm -rf ${mainprog}_sources_check.tar
+
+             copts_check="-cpp -D_parallel -D__check"
+             make  -f Makefile_check $make_options F90=$compiler_name_ser  COPT="$copts_check"
+
+             tar -cf  check_namelist_files.tar Makefile_check check_namelist_files.x *.f90 *.o *.mod
+             mv check_namelist_files.tar $check_depository_path
+             mv check_namelist_files.x $PALM_BIN
+             cd $check_depository_path
+             rm -rf check_tmp
+             util_compiled_localhost=true
+          else
+             cd $check_depository_path
+             printf "\n\n"
+             echo "  *** skipped compilation of mrun GUI (already."       
+             printf "\n\n"
+             echo "  *** skipped compilation of check_namelist_files."            
+          fi
 
        fi
@@ -1445,3 +1458,4 @@
     # FINAL WORK
  rm -f  hosts_found_in_config_file
-
+ rm -f ${local_source_path}/${mainprog}_sources_check.tar
+
