From 6c94ed0508c933c48bc76ed409f48699eb92a575 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 17 Mar 2005 12:04:13 +0000 Subject: [PATCH] Fix on previous integration, that was associated with CCRT_Port_V220. The regression was caused by customisation of compilation between PCLINUX and OSF1 platforms for KERNEL/MEDWrapper library. By the fix we define corresponded C++ preprocessor variable (MACHINE) at configuration step of KERNEL module in SALOMEconfig.h header file. So, every client of KERNEL module will automaticaly be customizing by including of this header file. --- salome_adm/unix/SALOMEconfig.h.in | 8 ++++ .../unix/config_files/ac_cxx_depend_flag.m4 | 3 ++ salome_adm/unix/config_files/check_med2.m4 | 38 +++++-------------- src/MEDWrapper/Base/MED_Common.hxx | 2 + src/MEDWrapper/Base/Makefile.in | 2 +- src/MEDWrapper/V2_1/Makefile.in | 2 +- 6 files changed, 25 insertions(+), 30 deletions(-) diff --git a/salome_adm/unix/SALOMEconfig.h.in b/salome_adm/unix/SALOMEconfig.h.in index e79eb7ae8..c1be35bd0 100644 --- a/salome_adm/unix/SALOMEconfig.h.in +++ b/salome_adm/unix/SALOMEconfig.h.in @@ -19,9 +19,17 @@ See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org ------------------------------------------------------------------------------------*/ +#ifndef SALOME_CONFIG_H +#define SALOME_CONFIG_H + #define DEBUG #define QUOTE(x) #x #define CORBA_CLIENT_HEADER(x) QUOTE(x@IDL_CLN_H@) #define CORBA_SERVER_HEADER(x) QUOTE(x@IDL_SRV_H@) +#ifndef @MACHINE@ + #define @MACHINE@ +#endif + +#endif diff --git a/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 b/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 index 9e3d4ecc9..ee49cd8a3 100644 --- a/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 +++ b/salome_adm/unix/config_files/ac_cxx_depend_flag.m4 @@ -44,12 +44,14 @@ dnl on utilise donc gnu pour generer les dependances. DEPCXX=g++ DEPCXXFLAGS="-Wno-deprecated" DIFFFLAGS="-w" + MACHINE="OSF1" ;; *) DEPCC=${CC-cc} DEPCXX=${CXX-c++} DEPCXXFLAGS="\${CXXFLAGS}" DIFFFLAGS="-b -B" + MACHINE="PCLINUX" ;; esac C_DEPEND_FLAG= @@ -137,5 +139,6 @@ dnl use g++ option -MG : asume unknown file will be construct later AC_SUBST(DEPCXXFLAGS) AC_SUBST(C_DEPEND_FLAG) AC_SUBST(CXX_DEPEND_FLAG) + AC_SUBST(MACHINE) ]) ]) diff --git a/salome_adm/unix/config_files/check_med2.m4 b/salome_adm/unix/config_files/check_med2.m4 index 6e8192b44..3b8fd9f8d 100644 --- a/salome_adm/unix/config_files/check_med2.m4 +++ b/salome_adm/unix/config_files/check_med2.m4 @@ -24,6 +24,7 @@ AC_DEFUN([CHECK_MED2],[ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([CHECK_HDF5])dnl +AC_REQUIRE([AC_DEPEND_FLAG])dnl AC_CHECKING(for MED2) @@ -41,57 +42,38 @@ MED2_INCLUDES="" MED2_LIBS="" MED2_MT_LIBS="" -med2_ok=no +LOCAL_INCLUDES="" +LOCAL_LIBS="" -LOCAL_INCLUDES="$HDF5_INCLUDES" -LOCAL_LIBS="-lmed $HDF5_LIBS" +med2_ok=no +dnl check, if there is MED library if test -z $MED2HOME then AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory) else - LOCAL_INCLUDES="$LOCAL_INCLUDES -I$MED2HOME/include" - LOCAL_LIBS="-L$MED2HOME/lib $LOCAL_LIBS" + LOCAL_INCLUDES="$HDF5_INCLUDES -I$MED2HOME/include" + LOCAL_LIBS="-L$MED2HOME/lib -lmed $HDF5_LIBS" fi dnl check med2 header - CPPFLAGS_old="$CPPFLAGS" -dnl we must test system : linux = -DPCLINUX -dnl we must test system : Alpha-OSF = -DOSF1 -case $host_os in - linux*) - CPPFLAGS="$CPPFLAGS -DPCLINUX $LOCAL_INCLUDES" - ;; - osf*) - CPPFLAGS="$CPPFLAGS -DOSF1 $LOCAL_INCLUDES" - ;; -esac +CPPFLAGS="$CPPFLAGS -D$MACHINE $LOCAL_INCLUDES" AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no) CPPFLAGS="$CPPFLAGS_old" +dnl check med2 library if test "x$med2_ok" = "xyes" then - -dnl check med2 library - LIBS_old="$LIBS" LIBS="$LIBS $LOCAL_LIBS" AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no) LIBS="$LIBS_old" - fi if test "x$med2_ok" = "xyes" then -case $host_os in - linux*) - MED2_INCLUDES="-DPCLINUX $LOCAL_INCLUDES" - ;; - osf*) - MED2_INCLUDES="-DOSF1 $LOCAL_INCLUDES" - ;; -esac + MED2_INCLUDES="-D$MACHINE $LOCAL_INCLUDES" MED2_LIBS="$LOCAL_LIBS" MED2_MT_LIBS="$LOCAL_LIBS" fi diff --git a/src/MEDWrapper/Base/MED_Common.hxx b/src/MEDWrapper/Base/MED_Common.hxx index ed46935b7..a4d5af9f3 100644 --- a/src/MEDWrapper/Base/MED_Common.hxx +++ b/src/MEDWrapper/Base/MED_Common.hxx @@ -42,6 +42,8 @@ extern "C"{ #include +#include "SALOMEconfig.h" + namespace MED{ enum EVersion {eVUnknown = -1, eV2_1, eV2_2}; diff --git a/src/MEDWrapper/Base/Makefile.in b/src/MEDWrapper/Base/Makefile.in index 91a72d437..ae80425cb 100644 --- a/src/MEDWrapper/Base/Makefile.in +++ b/src/MEDWrapper/Base/Makefile.in @@ -54,7 +54,7 @@ LIB_SRC = \ BIN = BIN_SRC = -CPPFLAGS+= $(MED2_INCLUDES) $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) +CPPFLAGS+= $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) LDFLAGS+= diff --git a/src/MEDWrapper/V2_1/Makefile.in b/src/MEDWrapper/V2_1/Makefile.in index 5a1d3cc80..778b27267 100644 --- a/src/MEDWrapper/V2_1/Makefile.in +++ b/src/MEDWrapper/V2_1/Makefile.in @@ -161,7 +161,7 @@ EXPORT_HEADERS = \ BIN = mdump_V2_1 test1_V2_1 BIN_SRC = -CPPFLAGS+= $(MED2_INCLUDES) $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) +CPPFLAGS+= -D@MACHINE@ $(BOOST_CPPFLAGS) $(HDF5_INCLUDES) LDFLAGS+= $(HDF5_LIBS) -lMEDWrapperBase -- 2.39.2