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"
51 DEPCXXFLAGS="\${CXXFLAGS}"
56 for ac_C_DEPEND_FLAG in -xM -MM -M ; do
58 rm -f conftest.d conftest.err
59 ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
60 if test -f conftest.u ; then
61 mv conftest.u conftest.d
65 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
66 if test ! -s conftest ; then
67 C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
72 dnl use gcc option -MG : asume unknown file will be construct later
73 rm -f conftest.d conftest.err
74 ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
75 if test -f conftest.u ; then
76 mv conftest.u conftest.d
79 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
80 if test ! -s conftest ; then
81 C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
85 if test "x${C_DEPEND_FLAG}" = "x" ; then
86 echo "cannot determine flag (C language)"
90 printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
93 echo "conftest.o: conftest.cxx" > conftest.verif
94 echo "int main() { return 0; }" > conftest.cxx
97 for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
99 rm -f conftest.d conftest.err
100 ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
101 if test -f conftest.u ; then
102 mv conftest.u conftest.d
106 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
107 if test ! -s conftest ; then
108 CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
113 dnl use g++ option -MG : asume unknown file will be construct later
114 rm -f conftest.d conftest.err
115 ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
116 if test -f conftest.u ; then
117 mv conftest.u conftest.d
120 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
121 if test ! -s conftest ; then
122 CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
127 if test "x${CXX_DEPEND_FLAG}" = "x" ; then
128 echo "cannot determine flag (C++ language)"
132 printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
137 AC_SUBST(DEPCXXFLAGS)
138 AC_SUBST(C_DEPEND_FLAG)
139 AC_SUBST(CXX_DEPEND_FLAG)