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}
9 : ${LIBTOOLIZE=libtoolize}
14 config_aux_dir
=$ltdldir/config
15 config_macro_dir
=$ltdldir/m4
18 # List dependencies here too; we don't extract them, otherwise dependent
19 # modules could end up being imported to src/ *and* gnu/!
20 src_modules
='getopt version-etc-fsf version-etc'
25 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
26 # is ksh but when the shell is invoked as "sh" and the current value of
27 # the _XPG environment variable is not equal to 1 (one), the special
28 # positional parameter $0, within a function call, is the name of the
32 # The name of this program:
33 progname
=`echo "$progpath" | $SED "$basename"`
36 # Echo program name prefixed message.
39 echo $progname: ${1+"$@"}
43 # Echo program name prefixed message to standard error.
46 echo $progname: ${1+"$@"} >&2
50 ## ---------------------------- ##
51 ## Find the gnulib module tree. ##
52 ## ---------------------------- ##
55 /* ) gnulibdir
=$GNULIB_TOOL ;; # absolute
56 */* ) gnulibdir
=`pwd`/$GNULIB_TOOL ;; # relative
57 * ) gnulibdir
=`which "$GNULIB_TOOL"` ;; # PATH search
61 while test -h "$gnulibdir"; do
63 # Resolve symbolic link.
64 sedexpr1
='s, -> ,#%%#,'
65 sedexpr2
='s,^.*#%%#\(.*\)$,\1,p'
66 linkval
=`LC_ALL=C ls -l "$gnulibdir" | $SED "$sedexpr1" | $SED -n "$sedexpr2"`
67 test -n "$linkval" ||
break
70 /* ) gnulibdir
="$linkval" ;;
71 * ) gnulibdir
=`echo "$gnulibdir" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
76 gnulibdir
=`echo "$gnulibdir" | $SED "$dirname"`
79 ## ---------------------- ##
80 ## Import Gnulib modules. ##
81 ## ---------------------- ##
83 func_echo
"running: ${GNULIB_TOOL} --import"
84 ${GNULIB_TOOL} --import
86 func_echo
"patching include directories in gnulib regex module"
87 mv $config_macro_dir/regex.
m4 $config_macro_dir/regex-m4.old
88 sed 's,lib/regex.c,gnu/regex.c,g' $config_macro_dir/regex-m4.old
> $config_macro_dir/regex.
m4 && \
89 $RM $config_macro_dir/regex-m4.old
91 func_echo
"hiding gnulib jm_\* macros"
92 cat >> $config_macro_dir/gnulib.
m4 <<\EOF
93 AC_DEFUN
([gl_AC_HEADER_INTTYPES_H
], [jm_AC_HEADER_INTTYPES_H
])
94 AC_DEFUN
([gl_AC_HEADER_STDINT_H
], [jm_AC_HEADER_STDINT_H
])
95 AC_DEFUN
([gl_AC_TYPE_UINTMAX_T
], [jm_AC_TYPE_UINTMAX_T
])
99 ## --------------------------------- ##
100 ## Copy additional src only modules. ##
101 ## --------------------------------- ##
103 func_echo
"fetching modules for src directory"
105 for file in `${GNULIB_TOOL} --extract-filelist $src_modules`; do
107 dest
=`echo $file | $SED "$basename"`
109 lib
/*) dest
=src
/$dest ;;
110 m
4/*) dest
=$config_macro_dir/$dest ;;
111 *) func_echo
"Unknown file: $file"
116 # Be sure to show all copying errors before bailing out
117 if test -f $gnulibdir/$file; then
118 func_echo
"copying file \`$dest'"
119 cp $gnulibdir/$file $dest
121 func_error
"$gnulibdir/$file does not exist"
132 func_echo
"running: $LIBTOOLIZE --ltdl=\"$ltdldir\" --force --copy"
133 $LIBTOOLIZE --ltdl="$ltdldir" --force --copy
140 func_echo
"running: $AUTORECONF --force --verbose --install"
141 $AUTORECONF --force --verbose --install
149 func_echo
"generating testsuite"
151 $AWK -f .
/generate.
awk ..
/doc
/m4.texinfo
> generated.
at