package compiler and linker metadata toolkit https://www.pkgconf.org/

autogen.sh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #! /bin/sh
  2. TOP_DIR=$(dirname $0)
  3. LAST_DIR=$PWD
  4. if test ! -f $TOP_DIR/configure.ac ; then
  5. echo "You must execute this script from the top level directory."
  6. exit 1
  7. fi
  8. AUTOCONF=${AUTOCONF:-autoconf}
  9. ACLOCAL=${ACLOCAL:-aclocal}
  10. AUTOHEADER=${AUTOHEADER:-autoheader}
  11. AUTOMAKE=${AUTOMAKE:-automake}
  12. LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
  13. dump_help_screen ()
  14. {
  15. echo "Usage: $0 [options]"
  16. echo
  17. echo "options:"
  18. echo " -n skip CVS changelog creation"
  19. echo " -h,--help show this help screen"
  20. echo
  21. exit 0
  22. }
  23. parse_options ()
  24. {
  25. while test "$1" != "" ; do
  26. case $1 in
  27. -h|--help)
  28. dump_help_screen
  29. ;;
  30. -n)
  31. SKIP_CVS_CHANGELOG=yes
  32. ;;
  33. *)
  34. echo Invalid argument - $1
  35. dump_help_screen
  36. ;;
  37. esac
  38. shift
  39. done
  40. }
  41. run_or_die ()
  42. {
  43. COMMAND=$1
  44. # check for empty commands
  45. if test -z "$COMMAND" ; then
  46. echo "*warning* no command specified"
  47. return 1
  48. fi
  49. shift;
  50. OPTIONS="$@"
  51. # print a message
  52. echo -n "*info* running $COMMAND"
  53. if test -n "$OPTIONS" ; then
  54. echo " ($OPTIONS)"
  55. else
  56. echo
  57. fi
  58. # run or die
  59. $COMMAND $OPTIONS ; RESULT=$?
  60. if test $RESULT -ne 0 ; then
  61. echo "*error* $COMMAND failed. (exit code = $RESULT)"
  62. exit 1
  63. fi
  64. return 0
  65. }
  66. parse_options "$@"
  67. cd $TOP_DIR
  68. run_or_die $ACLOCAL
  69. run_or_die $AUTOHEADER
  70. run_or_die $AUTOCONF
  71. run_or_die $LIBTOOLIZE --install
  72. run_or_die $AUTOMAKE --add-missing