1 dnl Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License.
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 dnl Lesser General Public License for more details.
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 dnl @synopsis AC_C_DEPEND_FLAG
20 dnl define C_DEPEND_FLAG
21 dnl define CXX_DEPEND_FLAG
23 dnl @author Marc Tajchman
25 AC_DEFUN(AC_DEPEND_FLAG,
26 [AC_CACHE_CHECK(which flag for dependency information generation,
30 echo "conftest.o: conftest.c" > conftest.verif
31 echo "int main() { return 0; }" > conftest.c
33 dnl Evolution portage sur CCRT/osf system
36 dnl sur CCRT/osf pas d'equivalent de l'option -MG de gcc avec compilo natif
37 dnl on utilise donc gnu pour generer les dependances.
40 DEPCXXFLAGS="-Wno-deprecated"
47 DEPCXXFLAGS="\${CXXFLAGS}"
53 for ac_C_DEPEND_FLAG in -xM -MM -M ; do
55 rm -f conftest.d conftest.err
56 ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
57 if test -f conftest.u ; then
58 mv conftest.u conftest.d
62 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
63 if test ! -s conftest ; then
64 C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
69 dnl use gcc option -MG : asume unknown file will be construct later
70 rm -f conftest.d conftest.err
71 ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
72 if test -f conftest.u ; then
73 mv conftest.u conftest.d
76 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
77 if test ! -s conftest ; then
78 C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
82 if test "x${C_DEPEND_FLAG}" = "x" ; then
83 echo "cannot determine flag (C language)"
87 printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
90 echo "conftest.o: conftest.cxx" > conftest.verif
91 echo "int main() { return 0; }" > conftest.cxx
94 for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
96 rm -f conftest.d conftest.err
97 ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
98 if test -f conftest.u ; then
99 mv conftest.u conftest.d
103 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
104 if test ! -s conftest ; then
105 CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
110 dnl use g++ option -MG : asume unknown file will be construct later
111 rm -f conftest.d conftest.err
112 ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
113 if test -f conftest.u ; then
114 mv conftest.u conftest.d
117 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
118 if test ! -s conftest ; then
119 CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
124 if test "x${CXX_DEPEND_FLAG}" = "x" ; then
125 echo "cannot determine flag (C++ language)"
129 printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
134 AC_SUBST(DEPCXXFLAGS)
135 AC_SUBST(C_DEPEND_FLAG)
136 AC_SUBST(CXX_DEPEND_FLAG)