autogen.sh 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. # Convenience script for regenerating all autogeneratable files that are
  3. # omitted from the version control repository. In particular, this script
  4. # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
  5. # with new versions of autoconf or automake.
  6. #
  7. # This script requires autoconf-2.63 and automake-1.11 in the PATH.
  8. # It also requires either
  9. # - the GNULIB_TOOL environment variable pointing to the gnulib-tool script
  10. # in a gnulib checkout, or
  11. # - the git program in the PATH and an internet connection.
  12. # It also requires
  13. # - the gperf program.
  14. # Copyright (C) 2003-2009 Free Software Foundation, Inc.
  15. #
  16. # This program is free software: you can redistribute it and/or modify
  17. # it under the terms of the GNU General Public License as published by
  18. # the Free Software Foundation; either version 3 of the License, or
  19. # (at your option) any later version.
  20. #
  21. # This program is distributed in the hope that it will be useful,
  22. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. # GNU General Public License for more details.
  25. #
  26. # You should have received a copy of the GNU General Public License
  27. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  28. # Usage: ./autogen.sh [--skip-gnulib]
  29. #
  30. # Usage from a CVS checkout: ./autogen.sh
  31. # This uses an up-to-date gnulib checkout.
  32. #
  33. # Usage from a released tarball: ./autogen.sh --skip-gnulib
  34. # This does not use a gnulib checkout.
  35. skip_gnulib=false
  36. while :; do
  37. case "$1" in
  38. --skip-gnulib) skip_gnulib=true; shift;;
  39. *) break ;;
  40. esac
  41. done
  42. if test $skip_gnulib = false; then
  43. if test -z "$GNULIB_TOOL"; then
  44. # Check out gnulib in a subdirectory 'gnulib'.
  45. if test -d gnulib; then
  46. (cd gnulib && git pull)
  47. else
  48. git clone git://git.savannah.gnu.org/gnulib.git
  49. fi
  50. # Now it should contain a gnulib-tool.
  51. if test -f gnulib/gnulib-tool; then
  52. GNULIB_TOOL=`pwd`/gnulib/gnulib-tool
  53. else
  54. echo "** warning: gnulib-tool not found" 1>&2
  55. fi
  56. fi
  57. # Skip the gnulib-tool step if gnulib-tool was not found.
  58. if test -n "$GNULIB_TOOL"; then
  59. if test -f srcm4/gnulib-cache.m4; then
  60. mv -f srcm4/gnulib-cache.m4 srcm4/gnulib-cache.m4~
  61. fi
  62. if test -f srclib/Makefile.gnulib; then
  63. mv -f srclib/Makefile.gnulib srclib/Makefile.gnulib~
  64. fi
  65. make -f Makefile.devel srclib/Makefile.gnulib GNULIB_TOOL="$GNULIB_TOOL"
  66. fi
  67. fi
  68. rm -f configure config.h.in include/iconv.h.build.in
  69. rm -f lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h
  70. rm -f lib/aliases_aix.h lib/aliases_aix_sysaix.h
  71. rm -f lib/aliases_osf1.h lib/aliases_osf1_sysosf1.h
  72. rm -f lib/aliases_dos.h
  73. rm -f lib/aliases_extra.h
  74. rm -f lib/flags.h
  75. rm -f lib/translit.h
  76. rm -f man/iconv.1.html man/iconv.3.html man/iconv_close.3.html man/iconv_open.3.html
  77. make -f Makefile.devel
  78. (cd libcharset
  79. ./autogen.sh
  80. )