1 dnl Copyright (C) 2007-2016 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, or (at your option) any later version.
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
23 dnl @synopsis AC_C_DEPEND_FLAG
24 dnl define C_DEPEND_FLAG
25 dnl define CXX_DEPEND_FLAG
27 dnl @author Marc Tajchman
29 AC_DEFUN([AC_DEPEND_FLAG],[
30 AC_MSG_CHECKING([which flag for dependency information generation])
33 echo "conftest.o: conftest.c" > conftest.verif
34 echo "int main() { return 0; }" > conftest.c
38 irix5.* | irix6.* | osf4.* | osf5.* | linux* )
41 # porting on intel processor 64 bits
42 expr "$host_os" : 'linux' >/dev/null && ( test ! x"$host_cpu" = x"x86_64" && test ! x"$host_cpu" = x"ia64" ) && linux64="false"
43 if test ! x"$linux64" = "xfalse" ; then
44 echo "$as_me:$LINENO: checking for 64bits integers size in F77/F90" >&5
45 echo $ECHO_N "checking for 64bits integers size in F77/F90... $ECHO_C" >&6
46 # Check whether --enable-int64 or --disable-int64 was given.
47 if test "${enable_int64+set}" = set; then
48 enableval="$enable_int64"
51 case "X-$enable_int64" in
53 echo "$as_me:$LINENO: result: \"disabled\"" >&5
54 echo "${ECHO_T}\"disabled\"" >&6
58 echo "$as_me:$LINENO: result: \"enabled\"" >&5
59 echo "${ECHO_T}\"enabled\"" >&6
72 # porting on intel processor 64 bits: if 64 bits processor, by default compilation in 64 bits
73 if test x"$linux64" = x"true"; then \
74 MACHINE="PCLINUX64${SUFFIXES}";
75 CFLAGS=" -D_OCC64 ${CXXFLAGS}";
76 CXXFLAGS=" -D_OCC64 ${CXXFLAGS}";\
89 MACHINE="IRIX64${SUFFIXES}"
90 host_os_novers=irix5.x
93 MACHINE="IRIX64${SUFFIXES}"
94 host_os_novers=irix6.x
97 MACHINE="OSF1${SUFFIXES}"
101 MACHINE="OSF1${SUFFIXES}"
102 host_os_novers=osf5.x
106 host_os_novers=solaris2.x
113 host_os_novers=$host_os
117 dnl Evolution portage sur CCRT/osf system
120 dnl sur CCRT/osf pas d'equivalent de l'option -MG de gcc avec compilo natif
121 dnl on utilise donc gnu pour generer les dependances.
131 DEPCXXFLAGS="\${CXXFLAGS}"
133 dnl MACHINE="PCLINUX"
137 for ac_C_DEPEND_FLAG in -xM -MM -M ; do
139 rm -f conftest.d conftest.err
140 ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
141 if test -f conftest.u ; then
142 mv conftest.u conftest.d
146 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
147 if test ! -s conftest ; then
148 C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
153 dnl use gcc option -MG : asume unknown file will be construct later
154 rm -f conftest.d conftest.err
155 ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
156 if test -f conftest.u ; then
157 mv conftest.u conftest.d
160 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
161 if test ! -s conftest ; then
162 C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
166 if test "x${C_DEPEND_FLAG}" = "x" ; then
167 echo "cannot determine flag (C language)"
171 printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
174 echo "conftest.o: conftest.cxx" > conftest.verif
175 echo "int main() { return 0; }" > conftest.cxx
178 for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
180 rm -f conftest.d conftest.err
181 ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
182 if test -f conftest.u ; then
183 mv conftest.u conftest.d
187 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
188 if test ! -s conftest ; then
189 CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
194 dnl use g++ option -MG : asume unknown file will be construct later
195 rm -f conftest.d conftest.err
196 ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
197 if test -f conftest.u ; then
198 mv conftest.u conftest.d
201 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
202 if test ! -s conftest ; then
203 CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
208 if test "x${CXX_DEPEND_FLAG}" = "x" ; then
209 echo "cannot determine flag (C++ language)"
213 printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
216 AC_MSG_RESULT([ ... done])
220 AC_SUBST(DEPCXXFLAGS)
221 AC_SUBST(C_DEPEND_FLAG)
222 AC_SUBST(CXX_DEPEND_FLAG)