Commit e3d65389 authored by Yang Tse's avatar Yang Tse
Browse files

Depending on the libtool and automake versions being used config.guess gets

installed in the subdirectory at different stages. With some versions it is
installed when libtoolize finishes, but with others it is not installed
until automake has finished.

So we can not attempt to use config.guess until the very last buildconf stage.
parent 027cb376
Loading
Loading
Loading
Loading
+57 −52
Original line number Diff line number Diff line
@@ -302,13 +302,50 @@ done
echo "buildconf: running libtoolize"
$libtoolize --copy --automake --force || die "The libtoolize command failed"

if test "1" = "0"; then
if test ! -f m4/curl-functions.m4; then
  echo "buildconf: cURL m4 macros not found"
  exit 1
fi

if test ! -f ./config.guess; then
  echo "buildconf: config.guess not found"
echo "buildconf: running aclocal"
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "The aclocal command line failed"

if test -n "$PERL"; then
  echo "buildconf: running aclocal hack to convert all mv to mv -f"
  $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
else
  echo "buildconf: perl not found"
  exit 1
fi

echo "buildconf: running autoheader"
${AUTOHEADER:-autoheader} || die "The autoheader command failed"

echo "buildconf: cp lib/config.h.in src/config.h.in"
cp lib/config.h.in src/config.h.in

echo "buildconf: running autoconf"
${AUTOCONF:-autoconf}     || die "The autoconf command failed"

if test -d ares; then
  cd ares
  echo "buildconf: running in ares"
  ./buildconf
  cd ..
fi

echo "buildconf: running automake"
${AUTOMAKE:-automake} -a -c  || die "The automake command failed"

#--------------------------------------------------------------------------
# Depending on the libtool and automake versions being used, config.guess
# might not be installed in the subdirectory until automake has finished.
# So we can not attempt to use it until this very last buildconf stage.
#

if test ! -f ./config.guess; then
  echo "buildconf: config.guess not found"
else
  buildhost=`./config.guess 2>/dev/null|head -n 1`
  case $buildhost in
    *-*-hpux*)
@@ -318,7 +355,6 @@ case $buildhost in
      need_lt_check="yes"
      ;;
  esac

  if test ! -z "$need_lt_check"; then
    lt_major="$major"
    lt_minor="$minor"
@@ -348,46 +384,15 @@ if test ! -z "$need_lt_check"; then
      need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch"
      echo "buildconf: libtool version $lt_pversion found."
      echo "            $buildhost requires libtool $need_lt_version or newer."
      rm -f configure
      exit 1
    fi
  fi

fi

if test ! -f m4/curl-functions.m4; then
  echo "buildconf: cURL m4 macros not found"
  exit 1
fi

echo "buildconf: running aclocal"
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "The aclocal command line failed"

if test -n "$PERL"; then
  echo "buildconf: running aclocal hack to convert all mv to mv -f"
  $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
else
  echo "buildconf: perl not found"
  exit 1
fi

echo "buildconf: running autoheader"
${AUTOHEADER:-autoheader} || die "The autoheader command failed"

echo "buildconf: cp lib/config.h.in src/config.h.in"
cp lib/config.h.in src/config.h.in

echo "buildconf: running autoconf"
${AUTOCONF:-autoconf}     || die "The autoconf command failed"

if test -d ares; then
  cd ares
  echo "buildconf: running in ares"
  ./buildconf
  cd ..
fi

echo "buildconf: running automake"
${AUTOMAKE:-automake} -a -c  || die "The automake command failed"
#--------------------------------------------------------------------------
# Finished succesfully.
#

echo "buildconf: OK"
exit 0