1 dnl Copyright (C) 2006-2012 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
20 dnl @synopsis AC_C_DEPEND_FLAG
21 dnl define C_DEPEND_FLAG
22 dnl define CXX_DEPEND_FLAG
24 dnl @author Marc Tajchman
26 AC_DEFUN(AC_DEPEND_FLAG,
27 [AC_CACHE_CHECK(which flag for dependency information generation,
31 echo "conftest.o: conftest.c" > conftest.verif
32 echo "int main() { return 0; }" > conftest.c
34 dnl Evolution portage sur CCRT/osf system
37 dnl sur CCRT/osf pas d'equivalent de l'option -MG de gcc avec compilo natif
38 dnl on utilise donc gnu pour generer les dependances.
41 DEPCXXFLAGS="-Wno-deprecated"
48 DEPCXXFLAGS="\${CXXFLAGS}"
54 for ac_C_DEPEND_FLAG in -xM -MM -M ; do
56 rm -f conftest.d conftest.err
57 ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
58 if test -f conftest.u ; then
59 mv conftest.u conftest.d
63 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
64 if test ! -s conftest ; then
65 C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
70 dnl use gcc option -MG : asume unknown file will be construct later
71 rm -f conftest.d conftest.err
72 ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
73 if test -f conftest.u ; then
74 mv conftest.u conftest.d
77 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
78 if test ! -s conftest ; then
79 C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
83 if test "x${C_DEPEND_FLAG}" = "x" ; then
84 echo "cannot determine flag (C language)"
88 printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
91 echo "conftest.o: conftest.cxx" > conftest.verif
92 echo "int main() { return 0; }" > conftest.cxx
95 for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
97 rm -f conftest.d conftest.err
98 ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
99 if test -f conftest.u ; then
100 mv conftest.u conftest.d
104 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
105 if test ! -s conftest ; then
106 CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
111 dnl use g++ option -MG : asume unknown file will be construct later
112 rm -f conftest.d conftest.err
113 ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
114 if test -f conftest.u ; then
115 mv conftest.u conftest.d
118 diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
119 if test ! -s conftest ; then
120 CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
125 if test "x${CXX_DEPEND_FLAG}" = "x" ; then
126 echo "cannot determine flag (C++ language)"
130 printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
135 AC_SUBST(DEPCXXFLAGS)
136 AC_SUBST(C_DEPEND_FLAG)
137 AC_SUBST(CXX_DEPEND_FLAG)