1 dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 dnl @synopsis AC_C_DEPEND_FLAG
23 dnl define C_DEPEND_FLAG
24 dnl define CXX_DEPEND_FLAG
26 dnl @author Marc Tajchman
28 AC_DEFUN([AC_DEPEND_FLAG],[
29 AC_MSG_CHECKING([which flag for dependency information generation])
32 echo "conftest.o: conftest.c" > conftest.verif
33 echo "int main() { return 0; }" > conftest.c
37 irix5.* | irix6.* | osf4.* | osf5.* | linux* )
40 # porting on intel processor 64 bits
41 expr "$host_os" : 'linux' >/dev/null && ( test ! x"$host_cpu" = x"x86_64" && test ! x"$host_cpu" = x"ia64" ) && linux64="false"
42 if test ! x"$linux64" = "xfalse" ; then
43 echo "$as_me:$LINENO: checking for 64bits integers size in F77/F90" >&5
44 echo $ECHO_N "checking for 64bits integers size in F77/F90... $ECHO_C" >&6
45 # Check whether --enable-int64 or --disable-int64 was given.
46 if test "${enable_int64+set}" = set; then
47 enableval="$enable_int64"
50 case "X-$enable_int64" in
52 echo "$as_me:$LINENO: result: \"disabled\"" >&5
53 echo "${ECHO_T}\"disabled\"" >&6
57 echo "$as_me:$LINENO: result: \"enabled\"" >&5
58 echo "${ECHO_T}\"enabled\"" >&6
71 # porting on intel processor 64 bits: if 64 bits processor, by default compilation in 64 bits
72 if test x"$linux64" = x"true"; then \
73 MACHINE="PCLINUX64${SUFFIXES}";
74 CFLAGS=" -D_OCC64 ${CXXFLAGS}";
75 CXXFLAGS=" -D_OCC64 ${CXXFLAGS}";\
88 MACHINE="IRIX64${SUFFIXES}"
89 host_os_novers=irix5.x
92 MACHINE="IRIX64${SUFFIXES}"
93 host_os_novers=irix6.x
96 MACHINE="OSF1${SUFFIXES}"
100 MACHINE="OSF1${SUFFIXES}"
101 host_os_novers=osf5.x
105 host_os_novers=solaris2.x
112 host_os_novers=$host_os
116 dnl Evolution portage sur CCRT/osf system
119 dnl sur CCRT/osf pas d'equivalent de l'option -MG de gcc avec compilo natif
120 dnl on utilise donc gnu pour generer les dependances.
130 DEPCXXFLAGS="\${CXXFLAGS}"
132 dnl MACHINE="PCLINUX"
136 for ac_C_DEPEND_FLAG in -xM -MM -M ; do
138 rm -f conftest.d conftest.err
139 ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
140 if test -f conftest.u ; then
141 mv conftest.u conftest.d
145 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
146 if test ! -s conftest ; then
147 C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
152 dnl use gcc option -MG : asume unknown file will be construct later
153 rm -f conftest.d conftest.err
154 ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
155 if test -f conftest.u ; then
156 mv conftest.u conftest.d
159 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
160 if test ! -s conftest ; then
161 C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
165 if test "x${C_DEPEND_FLAG}" = "x" ; then
166 echo "cannot determine flag (C language)"
170 printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
173 echo "conftest.o: conftest.cxx" > conftest.verif
174 echo "int main() { return 0; }" > conftest.cxx
177 for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
179 rm -f conftest.d conftest.err
180 ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
181 if test -f conftest.u ; then
182 mv conftest.u conftest.d
186 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
187 if test ! -s conftest ; then
188 CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
193 dnl use g++ option -MG : asume unknown file will be construct later
194 rm -f conftest.d conftest.err
195 ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
196 if test -f conftest.u ; then
197 mv conftest.u conftest.d
200 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
201 if test ! -s conftest ; then
202 CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
207 if test "x${CXX_DEPEND_FLAG}" = "x" ; then
208 echo "cannot determine flag (C++ language)"
212 printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
215 AC_MSG_RESULT([ ... done])
219 AC_SUBST(DEPCXXFLAGS)
220 AC_SUBST(C_DEPEND_FLAG)
221 AC_SUBST(CXX_DEPEND_FLAG)