]> SALOME platform Git repositories - modules/kernel.git/blob - salome_adm/unix/config_files/check_mico.m4
Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/kernel.git] / salome_adm / unix / config_files / check_mico.m4
1 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 dnl 
4 dnl  This library is free software; you can redistribute it and/or 
5 dnl  modify it under the terms of the GNU Lesser General Public 
6 dnl  License as published by the Free Software Foundation; either 
7 dnl  version 2.1 of the License. 
8 dnl 
9 dnl  This library is distributed in the hope that it will be useful, 
10 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 dnl  Lesser General Public License for more details. 
13 dnl 
14 dnl  You should have received a copy of the GNU Lesser General Public 
15 dnl  License along with this library; if not, write to the Free Software 
16 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 dnl 
18 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 dnl
20 dnl
21 dnl
22
23 AC_DEFUN([CHECK_MICO],[
24 AC_REQUIRE([AC_PROG_CC])dnl
25 AC_REQUIRE([AC_PROG_CXX])dnl
26 AC_REQUIRE([AC_PROG_CPP])dnl
27 AC_REQUIRE([AC_PROG_CXXCPP])dnl
28
29 AC_CHECKING(for mico)
30 mico_ok=yes
31
32 AC_LANG_SAVE
33 AC_LANG_CPLUSPLUS
34
35 AC_PATH_PROG(MICOD, micod)
36 if test "x$MICOD" = "x"
37 then
38   mico_ok=no
39   AC_MSG_RESULT(mico binaries not in PATH variable)
40 else
41   mico_ok=yes
42 fi
43
44 if  test "x$mico_ok" = "xyes"
45 then
46   AC_SUBST(MICO_IDL)
47
48   MICO_BIN=`echo ${MICOD} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
49   MICO_LIB=`echo ${MICO_BIN} | sed -e "s,bin,lib,"`
50   MICO_ROOT=`echo ${MICO_BIN}  | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
51   AC_SUBST(MICO_ROOT)
52
53   MICO_IDL=${MICO_BIN}/idl
54   AC_SUBST(MICO_IDL)
55
56   MICO_INCLUDES="-I$MICO_ROOT/include"
57   AC_SUBST(MICO_INCLUDES)
58
59   MICO_VERSION=`sed -n -e 's/.define *MICO_VERSION *\"\([[^\"]]*\)\"/\1/p' $MICO_ROOT/include/mico/version.h`
60   AC_SUBST(MICO_VERSION)
61   AC_MSG_RESULT(using mico version $MICO_VERSION)
62
63   MICO_CXXFLAGS="-ftemplate-depth-42 -fpermissive"
64   AC_SUBST(MICO_CXXFLAGS)
65
66   CXXFLAGS_old=$CXXFLAGS
67   CXXFLAGS="$CXXFLAGS $MICO_CXXFLAGS $MICO_INCLUDES"
68
69   AC_MSG_CHECKING(include of CORBA.h)
70   AC_TRY_COMPILE(
71 #include "CORBA.h"
72 , ,mico_ok=yes ,mico_ok=no)
73
74   if  test "x$mico_ok" = "xno"
75   then
76     AC_MSG_RESULT(CORBA.h not found in mico installation)
77   else
78     AC_MSG_RESULT(yes)
79   fi
80
81   CXXFLAGS=$CXXFLAGS_old
82
83 fi
84
85 if test "x$mico_ok" = "xyes" 
86 then
87   MICO_LDFLAGS="-L$MICO_LIB"
88
89   LIBS_old=$LIBS
90   MICO_LIBS="$MICO_LDFLAGS -lmico$MICO_VERSION -ldl"
91   AC_SUBST(MICO_LIBS)
92
93   LIBS="$MICO_LIBS $LIBS"
94   CXXFLAGS_old=$CXXFLAGS
95   CXXFLAGS="$CXXFLAGS $MICO_CXXFLAGS $MICO_INCLUDES"
96
97   AC_MSG_CHECKING(whether we can link with mico)
98   AC_TRY_LINK(
99 #include "CORBA.h"
100 ,CORBA::ORB_var orb,
101     mico_ok=yes,mico_ok=no)
102
103   if test "x$mico_ok" = "xno" 
104   then
105     AC_MSG_RESULT(mico library linking failed)
106     mico_ok=no
107   else
108     AC_MSG_RESULT(yes)
109   fi
110
111   CXXFLAGS=$CXXFLAGS_old
112   LIBS=$LIBS_old
113 fi
114
115
116 if test "x$mico_ok" = "xyes" 
117 then
118
119   MICO_IDLCXXFLAGS="-bcxx -I$MICO_ROOT/idl"
120   AC_SUBST(MICO_IDLCXXFLAGS)
121   AC_SUBST(MICO_IDLPYFLAGS)
122
123   MICO_IDL_CLN_H=.hh
124   MICO_IDL_CLN_CXX=SK.cc
125   MICO_IDL_CLN_OBJ=SK.o 
126   AC_SUBST(MICO_IDL_CLN_H)
127   AC_SUBST(MICO_IDL_CLN_CXX)
128   AC_SUBST(MICO_IDL_CLN_OBJ)
129
130   MICO_IDL_SRV_H=.hh
131   MICO_IDL_SRV_CXX=SK.cc
132   MICO_IDL_SRV_OBJ=SK.o
133   AC_SUBST(MICO_IDL_SRV_H)
134   AC_SUBST(MICO_IDL_SRV_CXX)
135   AC_SUBST(MICO_IDL_SRV_OBJ)
136
137   MICO_IDL_TIE_H=
138   MICO_IDL_TIE_CXX=
139   AC_SUBST(MICO_IDL_TIE_H)
140   AC_SUBST(MICO_IDL_TIE_CXX)
141   
142   AC_DEFINE(MICO)
143
144   CORBA_HAVE_POA=1
145   AC_DEFINE(CORBA_HAVE_POA)
146
147 fi
148
149 AC_LANG_RESTORE
150
151 AC_MSG_RESULT(for mico: $mico_ok)
152
153 ])dnl
154 dnl