1#!/bin/sh 2# Convenience script for regenerating all aclocal.m4, config.h.in, Makefile.in, 3# configure files with new versions of autoconf or automake. 4# 5# This script requires autoconf-2.60..2.61 and automake-1.10 in the PATH. 6# It also requires either 7# - the GNULIB_TOOL environment variable pointing to the gnulib-tool script 8# in a gnulib checkout, or 9# - the cvs program in the PATH and an internet connection. 10 11# Copyright (C) 2003-2006 Free Software Foundation, Inc. 12# 13# This program is free software; you can redistribute it and/or modify 14# it under the terms of the GNU General Public License as published by 15# the Free Software Foundation; either version 2, or (at your option) 16# any later version. 17# 18# This program is distributed in the hope that it will be useful, 19# but WITHOUT ANY WARRANTY; without even the implied warranty of 20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21# GNU General Public License for more details. 22# 23# You should have received a copy of the GNU General Public License 24# along with this program; if not, write to the Free Software Foundation, 25# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 27# Usage: ./autogen.sh [--quick] 28 29if test "x$1" = "x--quick"; then 30 quick=true 31else 32 quick=false 33fi 34 35if test -z "$GNULIB_TOOL"; then 36 # Check out gnulib in a subdirectory 'gnulib'. 37 GNULIB_CVS_ROOT=':pserver:anonymous@cvs.savannah.gnu.org:/sources/gnulib' 38 GNULIB_CVS_REPOSITORY='gnulib' 39 if test -d gnulib; then 40 (cd gnulib && cvs update -d -P) 41 else 42 cvs -d "$GNULIB_CVS_ROOT" checkout $GNULIB_CVS_REPOSITORY 43 fi 44 # Now it should contain a gnulib-tool. 45 if test -f gnulib/gnulib-tool; then 46 GNULIB_TOOL=`pwd`/gnulib/gnulib-tool 47 else 48 echo "** warning: gnulib-tool not found" 1>&2 49 fi 50fi 51# Skip the gnulib-tool step if gnulib-tool was not found. 52if test -n "$GNULIB_TOOL"; then 53 # In gettext-runtime: 54 GNULIB_MODULES_FOR_SRC=' 55 atexit 56 basename 57 closeout 58 error 59 exit 60 getopt 61 gettext-h 62 memmove 63 progname 64 propername 65 relocatable 66 relocwrapper 67 stdbool 68 strtoul 69 unlocked-io 70 xalloc 71 ' 72 GNULIB_MODULES_OTHER=' 73 gettext-runtime-misc 74 csharpcomp-script 75 java 76 javacomp-script 77 ' 78 $GNULIB_TOOL --dir=gettext-runtime --lib=libgrt --source-base=gnulib-lib --m4-base=gnulib-m4 --no-libtool --local-dir=gnulib-local \ 79 --import $GNULIB_MODULES_FOR_SRC $GNULIB_MODULES_OTHER 80 # In gettext-tools: 81 GNULIB_MODULES_FOR_SRC=' 82 alloca-opt 83 atexit 84 backupfile 85 basename 86 binary-io 87 bison-i18n 88 byteswap 89 c-ctype 90 c-strcase 91 c-strcasestr 92 c-strstr 93 clean-temp 94 closeout 95 copy-file 96 csharpcomp 97 csharpexec 98 error 99 error-progname 100 execute 101 exit 102 findprog 103 fnmatch-posix 104 fstrcmp 105 full-write 106 fwriteerror 107 gcd 108 getline 109 getopt 110 gettext-h 111 hash 112 iconv 113 javacomp 114 javaexec 115 linebreak 116 localcharset 117 lock 118 memmove 119 memset 120 minmax 121 obstack 122 pathname 123 pipe 124 progname 125 propername 126 relocatable 127 relocwrapper 128 sh-quote 129 stdbool 130 stpcpy 131 stpncpy 132 strcspn 133 xstriconv 134 strpbrk 135 strtol 136 strtoul 137 ucs4-utf8 138 unistd 139 unlocked-io 140 utf8-ucs4 141 utf16-ucs4 142 vasprintf 143 wait-process 144 xalloc 145 xallocsa 146 xerror 147 xsetenv 148 xstriconv 149 xvasprintf 150 ' 151 # Not yet used. Add some files to gettext-tools-misc instead. 152 GNULIB_MODULES_FOR_LIBGREP=' 153 error 154 exitfail 155 gettext-h 156 hard-locale 157 obstack 158 regex 159 stdbool 160 xalloc 161 ' 162 GNULIB_MODULES_OTHER=' 163 gettext-tools-misc 164 gcj 165 java 166 ' 167 $GNULIB_TOOL --dir=gettext-tools --lib=libgettextlib --source-base=gnulib-lib --m4-base=gnulib-m4 --libtool --local-dir=gnulib-local \ 168 --import $GNULIB_MODULES_FOR_SRC $GNULIB_MODULES_OTHER 169 # In gettext-tools/libgettextpo: 170 # This is a subset of the GNULIB_MODULES_FOR_SRC. 171 GNULIB_MODULES_FOR_LIBGETTEXTPO=' 172 basename 173 c-ctype 174 c-strcase 175 c-strstr 176 error 177 error-progname 178 exit 179 fstrcmp 180 fwriteerror 181 gcd 182 getline 183 gettext-h 184 hash 185 iconv 186 linebreak 187 minmax 188 pathname 189 progname 190 stdbool 191 ucs4-utf8 192 unlocked-io 193 utf8-ucs4 194 utf16-ucs4 195 vasprintf 196 xalloc 197 xallocsa 198 xerror 199 xstriconv 200 xvasprintf 201 ' 202 GNULIB_MODULES_OTHER=' 203 gettext-tools-libgettextpo-misc 204 ' 205 $GNULIB_TOOL --dir=gettext-tools --source-base=libgettextpo --m4-base=libgettextpo/gnulib-m4 --macro-prefix=gtpo --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local \ 206 --import $GNULIB_MODULES_FOR_LIBGETTEXTPO $GNULIB_MODULES_OTHER 207fi 208 209(cd autoconf-lib-link 210 aclocal -I m4 -I ../m4 211 autoconf 212 automake 213) 214 215(cd gettext-runtime 216 aclocal -I m4 -I ../autoconf-lib-link/m4 -I ../m4 -I gnulib-m4 217 autoconf 218 autoheader && touch config.h.in 219 automake 220) 221 222(cd gettext-runtime/libasprintf 223 aclocal -I ../../m4 -I ../m4 224 autoconf 225 autoheader && touch config.h.in 226 automake 227) 228 229cp -p gettext-runtime/ABOUT-NLS gettext-tools/ABOUT-NLS 230 231(cd gettext-tools 232 aclocal -I m4 -I ../gettext-runtime/m4 -I ../autoconf-lib-link/m4 -I ../m4 -I gnulib-m4 -I libgettextpo/gnulib-m4 233 autoconf 234 autoheader && touch config.h.in 235 automake 236) 237 238(cd gettext-tools/examples 239 aclocal -I ../../gettext-runtime/m4 -I ../../m4 240 autoconf 241 automake 242 # Rebuilding the examples PO files is only rarely needed. 243 if ! $quick; then 244 ./configure && (cd po && make update-po) && make distclean 245 fi 246) 247 248aclocal 249autoconf 250automake 251 252cp -p autoconf-lib-link/config.rpath build-aux/config.rpath 253