This is the mail archive of the automake-prs@sources.redhat.com mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

automake/243: AM_OUTPUT_DEPENDENCY_COMMANDS doesn't handle Makefile:Makefile.in:tail.mk in AC_OUTPUT



>Number:         243
>Category:       automake
>Synopsis:       AM_OUTPUT_DEPENDENCY_COMMANDS doesn't handle Makefile:Makefile.in:tail.mk in AC_OUTPUT
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tromey
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 05 15:01:04 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jolien
>Release:        1.5
>Organization:
>Environment:

>Description:
If configure.in has something like
AC_OUTPUT( Makefile:Makefile.in:tail.mk )
then config.status cannot parse the Makefile to build the dependency
files in the .deps directory.  This is because the AM_OUTPUT_DEPENDENCY_COMMANDS macro cannot cope with
the colon in the CONFIG_FILES variable.
>How-To-Repeat:

>Fix:
I fixed the problem by re-defining AM_OUTPUT_DEPENDENCY_COMMANDS
in my acinclude.m4 as follows:

AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
AC_OUTPUT_COMMANDS([
test x"$AMDEP_TRUE" != x"" ||
for mf in $CONFIG_FILES; do
  case "$mf" in
  *:*) mf=`echo "$mf"|sed 's%:.*%%'` ;;
  esac
  case "$mf" in
  Makefile) dirpart=.;;
  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
  *) continue;;
  esac
  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
  # Extract the definition of DEP_FILES from the Makefile without
  # running `make'.
  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
  test -z "$DEPDIR" && continue
  # When using ansi2knr, U may be empty or an underscore; expand it
  U=`sed -n -e '/^U = / s///p' < "$mf"`
  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
  # We invoke sed twice because it is the simplest approach to
  # changing $(DEPDIR) to its actual value in the expansion.
  for file in `sed -n -e '
    /^DEP_FILES = .*\\\\$/ {
      s/^DEP_FILES = //
      :loop
        s/\\\\$//
        p
        n
        /\\\\$/ b loop
      p
    }
    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
    # Make sure the directory exists.
    test -f "$dirpart/$file" && continue
    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
    # echo "creating $dirpart/$file"
    echo '# dummy' > "$dirpart/$file"
  done
done
], [AMDEP_TRUE="$AMDEP_TRUE"
ac_aux_dir="$ac_aux_dir"])])

The only change is the first case statement, which gets rid of everything
after the first colon.

I don't know if this is the correct fix, and I'm worried that it will break when
a new release of automake comes out.  Is there a better fix?
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]