# ------------------------- parse hxx file and generate code ---------------------------------------
#
echo -e "\n-> Extract public functions\n"
- cat ${hxx_file} | awk -f ${gene_dir}/parse1.awk > ${CLASS_NAME}_public_functions
+ cat ${hxx_file} | awk -f ${gene_dir}/parse01.awk | awk -f ${gene_dir}/parse1.awk > ${CLASS_NAME}_public_functions
cat ${CLASS_NAME}_public_functions
if [ ! -s ${CLASS_NAME}_public_functions ]
then
if [ $res == 1 ]
then
echo -e "###\n#------ ${CLASS_NAME}-Src ------" >> ${ENVIRON_FILE}
- echo -e "setenv ${CLASS_NAME}_BASE ${INSTALL_DIR}\n" >> ${ENVIRON_FILE}
+ echo -e "setenv ${CLASS_NAME}_BASE ${INSTALL_DIR}" >> ${ENVIRON_FILE}
echo -e "setenv ${CLASS_NAME}_SRC_DIR \${${CLASS_NAME}_BASE}/${CLASS_NAME}_SRC\n" >> ${ENVIRON_FILE}
fi
if [ $res == 1 ]
then
echo -e "###\n#------ ${CLASS_NAME}-Bin ------" >> ${ENVIRON_FILE}
- echo -e "setenv ${CLASS_NAME}_ROOT_DIR \${${CLASS_NAME}_BASE}/${CLASS_NAME}_INSTALL\n" >> ${ENVIRON_FILE}
+ echo -e "setenv ${CLASS_NAME}_ROOT_DIR \${${CLASS_NAME}_BASE}/${CLASS_NAME}_INSTALL" >> ${ENVIRON_FILE}
echo -e "setenv ${CLASS_NAME}_CPP_ROOT ${CPP_ROOT_DIR}" >> ${ENVIRON_FILE}
echo -e "setenv LD_LIBRARY_PATH \${${CLASS_NAME}_CPP_ROOT}${lib_dir#${CPP_ROOT_DIR}}:\${LD_LIBRARY_PATH}" >> ${ENVIRON_FILE}
fi
if [ $res == 1 ]
then
echo -e "###\n#------ ${CLASS_NAME}-Src ------" >> ${ENVIRON_FILE}
- echo -e "export ${CLASS_NAME}_BASE=${INSTALL_DIR}\n" >> ${ENVIRON_FILE}
+ echo -e "export ${CLASS_NAME}_BASE=${INSTALL_DIR}" >> ${ENVIRON_FILE}
echo -e "export ${CLASS_NAME}_SRC_DIR=\${${CLASS_NAME}_BASE}/${CLASS_NAME}_SRC\n" >> ${ENVIRON_FILE}
fi
if [ $res == 1 ]
then
echo -e "###\n#------ ${CLASS_NAME}-Bin ------" >> ${ENVIRON_FILE}
- echo -e "export ${CLASS_NAME}_ROOT_DIR=\${${CLASS_NAME}_BASE}/${CLASS_NAME}_INSTALL\n" >> ${ENVIRON_FILE}
+ echo -e "export ${CLASS_NAME}_ROOT_DIR=\${${CLASS_NAME}_BASE}/${CLASS_NAME}_INSTALL" >> ${ENVIRON_FILE}
echo -e "export ${CLASS_NAME}_CPP_ROOT=${CPP_ROOT_DIR}" >> ${ENVIRON_FILE}
echo -e "export LD_LIBRARY_PATH=\${${CLASS_NAME}_CPP_ROOT}${lib_dir#${CPP_ROOT_DIR}}:\${LD_LIBRARY_PATH}" \
>> ${ENVIRON_FILE}
fi
\rm -rf ${NEW_COMPONENT_ROOT_DIR}/* ${NEW_COMPONENT_BUILD_DIR}/*
- source ${ENVIRON_FILE}
+# source ${ENVIRON_FILE}
echo
echo -e "\n-> Build Configure"
cd ${NEW_COMPONENT_SRC_DIR}
csh) SHELL_EXT=csh;;
sh) SHELL_EXT=sh;;
esac
- if [ "${SHELL_EXT}" == "csh" ]
- then
- # source csh environment and retrieve it in bash father shell
- cp ${ENVIRON_FILE} __tmp__env.csh
- cat >>__tmp__env.csh<<-EOF
-setenv | awk -F= '{print "export " \$1 "=\"" \$2 "\""}' >__tmp__env.sh
-EOF
- csh __tmp__env.csh
- . __tmp__env.sh
- rm -f __tmp__env.csh
- rm -f __tmp__env.sh
- else
- source ${ENVIRON_FILE}
- fi
+fi
+
+if [ ${KERNEL_ROOT_DIR} ] && [ -d ${KERNEL_ROOT_DIR} ] && [ ${OMNIORBDIR} ] && [ -d ${OMNIORBDIR} ]
+then
+ # if KERNEL_ROOT_DIR ans OMNIORBDIR are defined, we consider that environment is set
+ echo -e "\n Environment already set"
else
- echo -e "\nSorry - Cannot compile : Environment file shoud be set up for compiling!\n"
- do_compile=0
+ # 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 [ $do_compile -eq 1 ]
+ then
+ echo -e "\n Warning - Cannot compile : Environment shoud be set up for compiling!\n"
+ do_compile=0
+ fi
+ fi
fi
+
#
if [ ${HXX2SALOME_ROOT_DIR} ] && [ -d ${HXX2SALOME_ROOT_DIR} ]
then
gene_dir=${HXX2SALOME_ROOT_DIR}
else
- if [ ! -f parse1.awk -o ! -f parse2.awk ]
- then
- echo -e "\nError : Variable HXX2SALOME_ROOT_DIR shoud be set, or hxx2salome should be launched localy"
- usage
- else
- gene_dir=`pwd` # case where hxx2salome was launched from HXX2SALOME directory
- fi
+ gene_dir=`pwd` # case where hxx2salome was launched from HXX2SALOME directory
+fi
+echo " hxx2salome directory : $gene_dir"
+if [ ! -f ${gene_dir}/parse1.awk -o ! -f ${gene_dir}/parse2.awk ] # check if script are found
+then
+ echo -e "\nError : Variable HXX2SALOME_ROOT_DIR shoud be set, or hxx2salome should be launched localy from bin directory"
+ usage
fi
#
# get class name
# ---------------------- Modification of Salome environment file -------------------------------------------
#
update_environment
-export `echo ${SOURCE_NAME}`_ROOT_DIR=${NEW_COMPONENT_ROOT_DIR} # to avoid resource env for compiling and launching salome
+export `echo ${CLASS_NAME}`_ROOT_DIR=${NEW_COMPONENT_ROOT_DIR} # to avoid resource env for compiling and launching salome
+export `echo ${CLASS_NAME}`_CPP_ROOT=${CPP_ROOT_DIR} # idem
#
# ---------------------- Copy the generated source from temp dir -------------------------------------------
#