Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
[m4/ericb.git] / README
blob2e0dbf124cd2bb24c4ef614211a14b761da66021
1 GNU `m4' is an implementation of the traditional Unix macro
2 processor.  It is mostly SVR4 compatible, although it has some
3 extensions (for example, handling more than 9 positional parameters
4 to macros).  `m4' also has builtin functions for including files,
5 running shell commands, doing arithmetic, etc.  Autoconf needs GNU
6 `m4' for generating `configure' scripts, but not for running them.
8 GNU `m4' has been originally written by RenĂ© Seindal, from Denmark.
10 GNU `m4' has a web site at http://www.seindal.dk/rene/gnu/.
12 If GNU `m4' is meant to serve GNU `autoconf', beware that `m4'
13 should be fully installed *prior to* configuring `autoconf' itself.
15 In the subdirectories `tests' and `examples' you will find various m4
16 files, ranging from trivial test files to rather advanced macros.  If
17 you intend to use m4 seriously, you might find useful material down
18 there.
20 See file `COPYING' for copying conditions.
21 See file `INSTALL' for compilation and installation instructions.
22 See file `ABOUT-NLS' for how to customize this program to your language.
23 See file `NEWS' for a list of major changes in the current release.
24 See file `AUTHORS' for the names of maintainers.
25 See file `THANKS' for a list of contributors.
27 By using `./configure --with-gmp, you get multiple precision integral
28 and rational arithmetic using mpeval.  The implementation depends on the
29 GNU gmp v2 library.
31 By using `./configure --with-modules=`foo bar baz', you get an m4 with only
32 the named modules preloaded.  The default modules (preloaded if you do not
33 use this option) are sufficient to do the job of GNU m4-1.4.  Additional
34 modules may be desirable, or necessary if libltdl does not support your
35 host architecture.  The implementation uses libltdl interface, details of
36 which are in the libtool manual.  See file `modules/README' for a more
37 detailed description.
39 By using `./configure --with-dmalloc', GNU m4 is linked with Gray
40 Watson's dmalloc package.  It is a debugging option for finding memory
41 management problems.  Gray Watson's dmalloc package is available at
42 ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz.
44 GNU M4 uses GNU Libtool in order to build shared libraries on a
45 variety of systems.  While this is very nice for making usable
46 binaries, it can be a pain when trying to debug a program. For that
47 reason, compilation of shared libraries can be turned off by
48 specifying the `--disable-shared' option to `configure'.
50 When compiling on cygwin (b20.1 at least), the cygwin getopt build
51 doesn't handle optional arguments properly.  The best way to get around
52 this is to force the build to use the included getopt files like this,
53 `ac_cv_func_getopt_long=no ./configure`.
55 Send bug reports, comments or ideas to `bug-m4@gnu.org'.  A bug report
56 is an adequate description of the problem: your input, what you
57 expected, what you got, and why this is wrong.  Diffs are welcome, but
58 they only describe a solution, from which the problem might be uneasy to
59 infer.  Don't forget all relevant information about your operating
60 system, compiler, libraries, ...
64 ## ------- ##
65 ## Patches ##
66 ## ------- ##
68 If you wish to run bootstrap, the released versions of autoconf and automake
69 are missing some functionality we need.  You will need to patch automake-1.9.5
70 and autoconf-2.59 according to the patches below:
72 --- automake-1.9.5/automake.in.orig     2005-02-12 10:06:56.000000000 +0000
73 +++ automake-1.9.5/automake.in  2005-04-20 14:08:05.000000000 +0100
74 @@ -142,6 +142,7 @@
75  use Automake::RuleDef;
76  use Automake::Wrap 'makefile_wrap';
77  use File::Basename;
78 +use File::Spec;
79  use Carp;
81  ## ----------- ##
82 @@ -333,6 +334,10 @@
83  # in Makefiles.
84  my $am_config_aux_dir = '';
86 +# Directory to search for AC_LIBSOURCE file, as set by AC_CONFIG_LIBOBJ_DIR
87 +# in configure.ac.
88 +my $config_libobj_dir = '';
90  # Whether AM_GNU_GETTEXT has been seen in configure.ac.
91  my $seen_gettext = 0;
92  # Whether AM_GNU_GETTEXT([external]) is used.
93 @@ -2067,7 +2072,7 @@
95        if ($iter =~ /\.h$/)
96         {
97 -         require_file_with_macro ($cond, $var, FOREIGN, $iter);
98 +         require_libobj_with_macro ($cond, $var, FOREIGN, $iter);
99         }
100        elsif ($iter ne 'alloca.c')
101         {
102 @@ -2079,7 +2084,7 @@
103           my $bs = var ('BUILT_SOURCES');
104           if (! $bs || ! grep (/$rewrite/, $bs->value_as_list_recursive))
105             {
106 -             require_file_with_macro ($cond, $var, FOREIGN, $iter);
107 +             require_libobj_with_macro ($cond, $var, FOREIGN, $iter);
108             }
109         }
110      }
111 @@ -2092,7 +2097,7 @@
112    $lt ||= '';
113    $var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA');
114    $dep_files{'$(DEPDIR)/alloca.P' . $myobjext} = 1;
115 -  require_file_with_macro ($cond, $var, FOREIGN, 'alloca.c');
116 +  require_libobj_with_macro ($cond, $var, FOREIGN, 'alloca.c');
117    &saw_extension ('c');
120 @@ -4636,6 +4641,7 @@
121                 AC_CONFIG_AUX_DIR => 1,
122                 AC_CONFIG_FILES => 1,
123                 AC_CONFIG_HEADERS => 1,
124 +               AC_CONFIG_LIBOBJ_DIR => 1,
125                 AC_CONFIG_LINKS => 1,
126                 AC_INIT => 0,
127                 AC_LIBSOURCE => 1,
128 @@ -4731,6 +4737,12 @@
129               push @config_headers, $spec;
130             }
131         }
132 +      elsif ($macro eq 'AC_CONFIG_LIBOBJ_DIR')
133 +       {
134 +         $config_libobj_dir = $args[1];
135 +         $relative_dir = '.';
136 +         check_directory ($config_libobj_dir, $where);
137 +       }
138        elsif ($macro eq 'AC_CONFIG_LINKS')
139         {
140           foreach my $spec (split (' ', $args[1]))
141 @@ -5761,6 +5773,15 @@
142      use constant IN_COMMENT => 2;
143      my $prev_state = IN_RULE_DEF;
145 +    # Calculate the relative path from this Makefile to LIBOBJDIR.
146 +    my $am_libobj_dir = '';
147 +    unless ($config_libobj_dir eq '')
148 +      {
149 +       my $dir = File::Spec->abs2rel ($config_libobj_dir, $relative_dir);
150 +       $am_libobj_dir = "$dir/" unless $dir eq '';
151 +      }
152 +    &define_variable ('LIBOBJDIR', "$am_libobj_dir", INTERNAL);
154      while ($_ = $am_file->getline)
155      {
156          $where->set ("$amfile:$.");
157 @@ -6975,6 +6996,22 @@
158      require_file ($macro->rdef ($cond)->location, $mystrict, @files);
161 +# &require_libobj_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
162 +# -------------------------------------------------------------
163 +sub require_libobj_with_macro ($$$@)
165 +    my ($cond, $macro, $mystrict, @files) = @_;
166 +    $macro = rvar ($macro) unless ref $macro;
167 +    if ($config_libobj_dir eq '')
168 +      {
169 +       require_file ($macro->rdef ($cond)->location, $mystrict, @files);
170 +      }
171 +    else
172 +      {
173 +       require_file_internal ($macro->rdef ($cond)->location, $mystrict,
174 +                              $config_libobj_dir, @files);
175 +      }
178  # &require_conf_file ($WHERE, $MYSTRICT, @FILES)
179  # ----------------------------------------------
180 --- autoconf-2.59/lib/autoconf/general.m4.orig  2003-10-27 11:10:56.000000000 +0000
181 +++ autoconf-2.59/lib/autoconf/general.m4       2005-04-25 17:56:48.000000000 +0100
182 @@ -2435,7 +2435,7 @@
184  # _AC_LIBOBJS_NORMALIZE
185  # ---------------------
186 -# Clean up LIBOBJS abd LTLIBOBJS so that they work with 1. ac_objext,
187 +# Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext,
188  # 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three.
189  # Used with AC_CONFIG_COMMANDS_PRE.
190  AC_DEFUN([_AC_LIBOBJS_NORMALIZE],
191 @@ -2445,9 +2445,10 @@
192    # 1. Remove the extension, and $U if already installed.
193    ac_i=`echo "$ac_i" |
194          sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
195 -  # 2. Add them.
196 -  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
197 -  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
198 +  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
199 +  #    will be set to the directory where LIBOBJS objects are built.
200 +  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
201 +  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
202  done
203  AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
204  AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])