3 # helps bootstrapping M4, when checked out from CVS
4 # requires GNU Gettext and bleeding edge GNU Autoconf, Automake & Libtool
6 : ${AUTORECONF=autoreconf}
8 : ${GNULIB_TOOL=gnulib-tool}
16 config_aux_dir
=$ltdldir/config
17 config_macro_dir
=$ltdldir/m4
20 # List dependencies here too; we don't extract them, otherwise dependent
21 # modules could end up being imported to src/ *and* gnu/!
22 src_modules
='getopt version-etc-fsf version-etc'
27 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
28 # is ksh but when the shell is invoked as "sh" and the current value of
29 # the _XPG environment variable is not equal to 1 (one), the special
30 # positional parameter $0, within a function call, is the name of the
34 # The name of this program:
35 progname
=`echo "$progpath" | $SED "$basename"`
38 # Echo program name prefixed message.
41 echo $progname: ${1+"$@"}
45 # Echo program name prefixed message to standard error.
48 echo $progname: ${1+"$@"} >&2
52 ## ------------------------------ ##
53 ## Fetch translations. ##
54 ## (taken from GNU tar bootstrap) ##
55 ## ------------------------------ ##
57 TP_URL
="http://www.iro.umontreal.ca/translation/maint/m4/"
66 func_echo
"getting translation for $1..."
67 $WGET -r --cache=off
$TP_URL/$POFILE
69 func_echo
"getting translations into po..."
71 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
72 $WGET -nv -nd -r -l 1 -A .po
--cache=off
$TP_URL &&
73 rm -f index.html index.html.
[0-9]*
74 ls *.po |
sed 's/\.po$//' > LINGUAS
81 only
) func_update_po
; exit 0 ;;
82 yes) func_update_po
;;
83 *) func_update_po
$DOWNLOAD_PO ;;
86 ## ---------------------------- ##
87 ## Find the gnulib module tree. ##
88 ## ---------------------------- ##
91 /* ) gnulibdir
=$GNULIB_TOOL ;; # absolute
92 */* ) gnulibdir
=`pwd`/$GNULIB_TOOL ;; # relative
93 * ) gnulibdir
=`which "$GNULIB_TOOL"` ;; # PATH search
97 while test -h "$gnulibdir"; do
99 # Resolve symbolic link.
100 sedexpr1
='s, -> ,#%%#,'
101 sedexpr2
='s,^.*#%%#\(.*\)$,\1,p'
102 linkval
=`LC_ALL=C ls -l "$gnulibdir" | $SED "$sedexpr1" | $SED -n "$sedexpr2"`
103 test -n "$linkval" ||
break
106 /* ) gnulibdir
="$linkval" ;;
107 * ) gnulibdir
=`echo "$gnulibdir" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
112 gnulibdir
=`echo "$gnulibdir" | $SED "$dirname"`
115 ## ---------------------- ##
116 ## Import Gnulib modules. ##
117 ## ---------------------- ##
119 func_echo
"running: ${GNULIB_TOOL} --update"
120 ${GNULIB_TOOL} --update
122 func_echo
"patching include directories in gnulib regex module"
123 mv $config_macro_dir/regex.
m4 $config_macro_dir/regex-m4.old
124 sed 's,lib/regex.c,gnu/regex.c,g' $config_macro_dir/regex-m4.old
> $config_macro_dir/regex.
m4 && \
125 $RM $config_macro_dir/regex-m4.old
127 func_echo
"hiding gnulib jm_\* macros"
128 cat >> $config_macro_dir/gnulib.
m4 <<\EOF
129 AC_DEFUN
([gl_AC_HEADER_INTTYPES_H
], [jm_AC_HEADER_INTTYPES_H
])
130 AC_DEFUN
([gl_AC_HEADER_STDINT_H
], [jm_AC_HEADER_STDINT_H
])
131 AC_DEFUN
([gl_AC_TYPE_UINTMAX_T
], [jm_AC_TYPE_UINTMAX_T
])
135 ## --------------------------------- ##
136 ## Copy additional src only modules. ##
137 ## --------------------------------- ##
139 func_echo
"fetching modules for src directory"
141 for file in `${GNULIB_TOOL} --extract-filelist $src_modules`; do
143 dest
=`echo $file | $SED "$basename"`
145 lib
/*) dest
=src
/$dest ;;
146 m
4/*) dest
=$config_macro_dir/$dest ;;
147 *) func_echo
"Unknown file: $file"
152 # Be sure to show all copying errors before bailing out
153 if test -f $gnulibdir/$file; then
154 func_echo
"copying file \`$dest'"
155 cp $gnulibdir/$file $dest
157 func_error
"$gnulibdir/$file does not exist"
168 func_echo
"running: $AUTORECONF --force --verbose --install --no-recursive"
169 $AUTORECONF --force --verbose --install --no-recursive
177 func_echo
"generating testsuite"
179 $AWK -f .
/generate.
awk ..
/doc
/m4.texinfo
> generated.
at
182 if test x
"$DOWNLOAD_PO" != xno
; then
183 func_echo
"If your pofiles are uptodate, you can rerun bootstrap"
184 func_echo
"as \`DOWNLOAD_PO=no $progname' to avoid redownloading."