1 dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 dnl @synopsis AC_C_DEPEND_FLAG
24 dnl define C_DEPEND_FLAG
25 dnl define CXX_DEPEND_FLAG
28 dnl @author Marc Tajchman
30 AC_DEFUN(AC_DEPEND_FLAG,
31 [AC_CACHE_CHECK(which flag for dependency information generation,
35 echo "conftest.o: conftest.c" > conftest.verif
36 echo "int main() { return 0; }" > conftest.c
38 dnl Evolution portage sur CCRT/osf system
41 dnl sur CCRT/osf pas d'equivalent de l'option -MG de gcc avec compilo natif
42 dnl on utilise donc gnu pour generer les dependances.
45 DEPCXXFLAGS="-Wno-deprecated"
52 DEPCXXFLAGS="\${CXXFLAGS}"
58 for ac_C_DEPEND_FLAG in -xM -MM -M ; do
60 rm -f conftest.d conftest.err
61 ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
62 if test -f conftest.u ; then
63 mv conftest.u conftest.d
67 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
68 if test ! -s conftest ; then
69 C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
74 dnl use gcc option -MG : asume unknown file will be construct later
75 rm -f conftest.d conftest.err
76 ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
77 if test -f conftest.u ; then
78 mv conftest.u conftest.d
81 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
82 if test ! -s conftest ; then
83 C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
87 if test "x${C_DEPEND_FLAG}" = "x" ; then
88 echo "cannot determine flag (C language)"
92 printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
95 echo "conftest.o: conftest.cxx" > conftest.verif
96 echo "int main() { return 0; }" > conftest.cxx
99 for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
101 rm -f conftest.d conftest.err
102 ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
103 if test -f conftest.u ; then
104 mv conftest.u conftest.d
108 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
109 if test ! -s conftest ; then
110 CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
115 dnl use g++ option -MG : asume unknown file will be construct later
116 rm -f conftest.d conftest.err
117 ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
118 if test -f conftest.u ; then
119 mv conftest.u conftest.d
122 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
123 if test ! -s conftest ; then
124 CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
129 if test "x${CXX_DEPEND_FLAG}" = "x" ; then
130 echo "cannot determine flag (C++ language)"
134 printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
139 AC_SUBST(DEPCXXFLAGS)
140 AC_SUBST(C_DEPEND_FLAG)
141 AC_SUBST(CXX_DEPEND_FLAG)