Salome HOME
suppress check on OMNIORBDIR variable.
[tools/hxx2salome.git] / scripts / hxx2salome
index 1e3575c59637062c81e40b5885d6996a2c51d8ee..c343ee0180faff48db94348d6b495ccbff46e2ce 100755 (executable)
@@ -28,7 +28,9 @@ usage()
     echo -e "                               of the Salome component\n"
     echo -e "\n  Options :"
     echo -e "    -h : help"
-    echo -e "    -e environment_script : to specify the name of a environment file that will be source for compiling"
+    echo -e "    -e environment_script : to specify the name of a environment file that will be updated with new necessary commands"
+    echo -e "                            (this file is also used for sourcing environment before compilation if it has sh or bash syntax,"
+    echo -e "                             if the syntax is csh, it is not sourced and for compiling (-c option) environment must be set up before)"
     echo -e "    -s script_extension   : to use if your environment file name doesn't have extension"
     echo -e "    -c                    : to compile after generation"
     echo -e "                            (use this option only if you don't have dependencies in your header or libraries"
@@ -442,25 +444,26 @@ then
    esac
 fi
 
-if [ ${KERNEL_ROOT_DIR} ] && [ -d ${KERNEL_ROOT_DIR} ] && [ ${OMNIORBDIR} ] && [ -d ${OMNIORBDIR} ]
+# Environment policy :
+#   - an existing sh file was specified : we source environment file
+#   - else (no file or csh syntax)      : we don't source environment file, and do compile 
+#                                         only if KERNEL_ROOT_DIR and MED_ROOT_DIR are defined
+if [ "${SHELL_EXT}" == "sh" ] && [ ${ENVIRON_FILE} ] && [ -f ${ENVIRON_FILE} ]
 then
-   # if KERNEL_ROOT_DIR ans OMNIORBDIR are defined, we consider that environment is set
-   echo -e "\n    Environment already set"
+   echo -e "\n    Environment file with sh syntax specified => we source ${ENVIRON_FILE}"
+   source ${ENVIRON_FILE}
 else
-   # if KERNEL_ROOT_DIR is not defined :
-   #   - sh file  : we source environment file
-   #   - csh file : we do not compile
-    if [ "${SHELL_EXT}" == "sh" ] && [ ${ENVIRON_FILE} ] && [ -f ${ENVIRON_FILE} ]
-    then
-       echo -e "\n    Environment not set : source ${ENVIRON_FILE}"
-       source ${ENVIRON_FILE}
-    else
+   if [ ${KERNEL_ROOT_DIR} ] && [ -d ${KERNEL_ROOT_DIR} ] && [ ${MED_ROOT_DIR} ] && [ -d ${MED_ROOT_DIR} ]
+   then
+       # if KERNEL_ROOT_DIR and MED_ROOT_DIR are defined, we consider that environment is set
+       echo -e "\n    Environment already set (KERNEL_ROOT_DIR and MED_ROOT_DIR are defined)"
+   else
        if [ $do_compile -eq 1 ]
        then 
-          echo -e "\n    Warning - Cannot compile : Environment shoud be set up for compiling!\n"
-          do_compile=0
+         echo -e "\n    Warning - Cannot compile : Environment shoud be set up before, or specify a environment file with sh syntax!\n"
+         do_compile=0
        fi
-    fi
+   fi
 fi
 
 #