Edit

kc3-lang/automake/m4/depend.m4

Branch :

  • Show log

    Commit

  • Author : Tom Tromey
    Date : 2000-08-26 20:20:50
    Hash : eb91e2d1
    Message : * m4/depend.m4 (depcpp): Use `-o conftest.o'. Fix for PR automake/74. From js pendry.

  • m4/depend.m4
  • # See how the compiler implements dependency checking.
    # Usage:
    # AM_DEPENDENCIES(NAME)
    # NAME is "CC", "CXX" or "OBJC".
    
    # We try a few techniques and use that to set a single cache variable.
    
    AC_DEFUN([AM_DEPENDENCIES],[
    AC_REQUIRE([AM_SET_DEPDIR])
    AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
    ifelse([$1],CC,[
    AC_REQUIRE([AC_PROG_CC])
    AC_REQUIRE([AC_PROG_CPP])
    depcc="$CC"
    depcpp="$CPP"],[$1],CXX,[
    AC_REQUIRE([AC_PROG_CXX])
    AC_REQUIRE([AC_PROG_CXXCPP])
    depcc="$CXX"
    depcpp="$CXXCPP"],[$1],OBJC,[
    am_cv_OBJC_dependencies_compiler_type=gcc],[
    AC_REQUIRE([AC_PROG_][$1])
    depcc="$[$1]"
    depcpp=""])
    AC_MSG_CHECKING([dependency style of $depcc])
    AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
    if test -z "$AMDEP"; then
      echo '#include "conftest.h"' > conftest.c
      echo 'int i;' > conftest.h
    
      am_cv_[$1]_dependencies_compiler_type=none
      for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
        case "$depmode" in
        nosideeffect)
          # after this tag, mechanisms are not by side-effect, so they'll
          # only be used when explicitly requested
          if test "x$enable_dependency_tracking" = xyes; then
    	continue
          else
    	break
          fi
          ;;
        none) break ;;
        esac
        # We check with `-c' and `-o' for the sake of the "dashmstdout"
        # mode.  It turns out that the SunPro C++ compiler does not properly
        # handle `-M -o', and we need to detect this.
        if depmode="$depmode" \
           source=conftest.c object=conftest.o \
           depfile=conftest.Po tmpdepfile=conftest.TPo \
           $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o 2>/dev/null &&
           grep conftest.h conftest.Po > /dev/null 2>&1; then
          am_cv_[$1]_dependencies_compiler_type="$depmode"
          break
        fi
      done
    
      rm -f conftest.*
    else
      am_cv_[$1]_dependencies_compiler_type=none
    fi
    ])
    AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
    [$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
    AC_SUBST([$1]DEPMODE)
    ])
    
    # Choose a directory name for dependency files.
    # This macro is AC_REQUIREd in AM_DEPENDENCIES
    
    AC_DEFUN([AM_SET_DEPDIR],[
    if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
      DEPDIR=.deps
    else
      DEPDIR=_deps
    fi
    AC_SUBST(DEPDIR)
    ])
    
    AC_DEFUN([AM_DEP_TRACK],[
    AC_ARG_ENABLE(dependency-tracking,
    [  --disable-dependency-tracking Speeds up one-time builds
      --enable-dependency-tracking  Do not reject slow dependency extractors])
    if test "x$enable_dependency_tracking" = xno; then
      AMDEP="#"
    else
      am_depcomp="$ac_aux_dir/depcomp"
      if test ! -f "$am_depcomp"; then
        AMDEP="#"
      else
        AMDEP=
      fi
    fi
    AC_SUBST(AMDEP)
    if test -z "$AMDEP"; then
      AMDEPBACKSLASH='\'
    else
      AMDEPBACKSLASH=
    fi
    pushdef([subst], defn([AC_SUBST]))
    subst(AMDEPBACKSLASH)
    popdef([subst])
    ])