buildconf.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #! /bin/sh
  2. #
  3. # Find libtoolize
  4. #
  5. libtoolize=`conftools/PrintPath glibtoolize libtoolize libtoolize15 libtoolize14`
  6. if [ "x$libtoolize" = "x" ]; then
  7. echo "libtoolize not found in path"
  8. exit 1
  9. fi
  10. #
  11. # Create the libtool helper files
  12. #
  13. # Note: we copy (rather than link) the files.
  14. #
  15. # Note: This bundled version of expat will not always replace the
  16. # files since we have a special config.guess/config.sub that we
  17. # want to ensure is used.
  18. echo "Copying libtool helper files ..."
  19. # Remove any m4 cache and libtool files so one can switch between
  20. # autoconf and libtool versions by simply rerunning the buildconf script.
  21. #
  22. (cd conftools ; rm -f ltconfig ltmain.sh)
  23. rm -rf aclocal.m4 libtool.m4 ltsugar.m4 autom4te*.cache
  24. $libtoolize --copy --automake
  25. #
  26. # find libtool.m4
  27. #
  28. if [ ! -f libtool.m4 ]; then
  29. ltpath=`dirname $libtoolize`
  30. ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
  31. if [ -f $ltfile ]; then
  32. echo "libtool.m4 found at $ltfile"
  33. cp $ltfile libtool.m4
  34. else
  35. echo "libtool.m4 not found - aborting!"
  36. exit 1
  37. fi
  38. fi
  39. #
  40. # Build aclocal.m4 from libtool's m4 files
  41. #
  42. echo "dnl THIS FILE IS AUTOMATICALLY GENERATED BY buildconf.sh" > aclocal.m4
  43. echo "dnl edits here will be lost" >> aclocal.m4
  44. for m4file in libtool.m4 ltsugar.m4 ltoptions.m4 ltversion.m4 lt~obsolete.m4
  45. do
  46. if [ -f $m4file ]; then
  47. echo "Incorporating $m4file into aclocal.m4 ..."
  48. cat $m4file >> aclocal.m4
  49. rm -f $m4file
  50. fi
  51. done
  52. cross_compile_warning="warning: AC_TRY_RUN called without default to allow cross compiling"
  53. #
  54. # Generate the autoconf header template (config.h.in) and ./configure
  55. #
  56. echo "Creating config.h.in ..."
  57. ${AUTOHEADER:-autoheader} 2>&1 | grep -v "$cross_compile_warning"
  58. echo "Creating configure ..."
  59. ${ACLOCAL:-aclocal}
  60. ### do some work to toss config.cache?
  61. ${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning"
  62. # Remove autoconf caches
  63. rm -rf autom4te*.cache
  64. exit 0