buildconf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # The logic for finding the right libtoolize is taken from libcurl's buildconf
  3. #--------------------------------------------------------------------------
  4. # findtool works as 'which' but we use a different name to make it more
  5. # obvious we aren't using 'which'! ;-)
  6. #
  7. findtool(){
  8. file="$1"
  9. old_IFS=$IFS; IFS=':'
  10. for path in $PATH
  11. do
  12. IFS=$old_IFS
  13. # echo "checks for $file in $path" >&2
  14. if test -f "$path/$file"; then
  15. echo "$path/$file"
  16. return
  17. fi
  18. done
  19. IFS=$old_IFS
  20. }
  21. # this approach that tries 'glibtool' first is some kind of work-around for
  22. # some BSD-systems I believe that use to provide the GNU libtool named
  23. # glibtool, with 'libtool' being something completely different.
  24. libtool=`findtool glibtool 2>/dev/null`
  25. if test ! -x "$libtool"; then
  26. libtool=`findtool ${LIBTOOL:-libtool}`
  27. fi
  28. if test -z "$LIBTOOLIZE"; then
  29. # set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found
  30. # $libtool is already the full path
  31. libtoolize="${libtool}ize"
  32. else
  33. libtoolize=`findtool $LIBTOOLIZE`
  34. fi
  35. ${libtoolize} --copy --automake --force
  36. ${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
  37. ${AUTOHEADER:-autoheader}
  38. ${AUTOCONF:-autoconf}
  39. ${AUTOMAKE:-automake} --add-missing