/[autoconf]/autoconf/doc/autoconf.texi
ViewVC logotype

Diff of /autoconf/doc/autoconf.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.764 by stevengj, Wed Oct 8 20:06:21 2003 UTC revision 1.765 by eggert, Sat Oct 11 06:52:08 2003 UTC
# Line 216  published by the Free Software Foundatio Line 216  published by the Free Software Foundatio
216  @dircategory Individual utilities  @dircategory Individual utilities
217  @direntry  @direntry
218  * autoscan: (autoconf)autoscan Invocation.  * autoscan: (autoconf)autoscan Invocation.
219                                  Semi-automatic @file{configure.ac} writing                                  Semi-automatic @file{configure.ac} writing
220  * ifnames: (autoconf)ifnames Invocation.        Listing conditionals in source.  * ifnames: (autoconf)ifnames Invocation.        Listing conditionals in source.
221  * autoconf: (autoconf)autoconf Invocation.  * autoconf: (autoconf)autoconf Invocation.
222                                  How to create configuration scripts                                  How to create configuration scripts
223  * autoreconf: (autoconf)autoreconf Invocation.  * autoreconf: (autoconf)autoreconf Invocation.
224                                  Remaking multiple @command{configure} scripts                                  Remaking multiple @command{configure} scripts
225  * autoheader: (autoconf)autoheader Invocation.  * autoheader: (autoconf)autoheader Invocation.
226                                  How to create configuration templates                                  How to create configuration templates
227  * autom4te: (autoconf)autom4te Invocation.  * autom4te: (autoconf)autom4te Invocation.
228                                  The Autoconf executables backbone                                  The Autoconf executables backbone
229  * configure: (autoconf)configure Invocation.    Configuring a package.  * configure: (autoconf)configure Invocation.    Configuring a package.
230  * autoupdate: (autoconf)autoupdate Invocation.  * autoupdate: (autoconf)autoupdate Invocation.
231                                  Automatic update of @file{configure.ac}                                  Automatic update of @file{configure.ac}
232  * config.status: (autoconf)config.status Invocation. Recreating configurations.  * config.status: (autoconf)config.status Invocation. Recreating configurations.
233  * testsuite: (autoconf)testsuite Invocation.    Running an Autotest test suite.  * testsuite: (autoconf)testsuite Invocation.    Running an Autotest test suite.
234  @end direntry  @end direntry
# Line 878  your source files --> [autoscan*] --> [c Line 878  your source files --> [autoscan*] --> [c
878    
879  @group  @group
880  configure.ac --.  configure.ac --.
881                 |   .------> autoconf* -----> configure                 |   .------> autoconf* -----> configure
882  [aclocal.m4] --+---+  [aclocal.m4] --+---+
883                 |   `-----> [autoheader*] --> [config.h.in]                 |   `-----> [autoheader*] --> [config.h.in]
884  [acsite.m4] ---'  [acsite.m4] ---'
885  @end group  @end group
886    
# Line 891  Makefile.in ---------------------------- Line 891  Makefile.in ----------------------------
891  Files used in configuring a software package:  Files used in configuring a software package:
892  @example  @example
893  @group  @group
894                         .-------------> [config.cache]                         .-------------> [config.cache]
895  configure* ------------+-------------> config.log  configure* ------------+-------------> config.log
896                         |                         |
897  [config.h.in] -.       v            .-> [config.h] -.  [config.h.in] -.       v            .-> [config.h] -.
898                 +--> config.status* -+               +--> make*                 +--> config.status* -+               +--> make*
899  Makefile.in ---'                    `-> Makefile ---'  Makefile.in ---'                    `-> Makefile ---'
900  @end group  @end group
901  @end example  @end example
# Line 1005  For instance: Line 1005  For instance:
1005    
1006  @example  @example
1007  AC_CHECK_HEADER([stdio.h],  AC_CHECK_HEADER([stdio.h],
1008                  [AC_DEFINE([HAVE_STDIO_H])],                  [AC_DEFINE([HAVE_STDIO_H])],
1009                  [AC_MSG_ERROR([Sorry, can't do anything for you])])                  [AC_MSG_ERROR([Sorry, can't do anything for you])])
1010  @end example  @end example
1011    
1012  @noindent  @noindent
# Line 1014  is quoted properly.  You may safely simp Line 1014  is quoted properly.  You may safely simp
1014    
1015  @example  @example
1016  AC_CHECK_HEADER(stdio.h,  AC_CHECK_HEADER(stdio.h,
1017                  [AC_DEFINE(HAVE_STDIO_H)],                  [AC_DEFINE(HAVE_STDIO_H)],
1018                  [AC_MSG_ERROR([Sorry, can't do anything for you])])                  [AC_MSG_ERROR([Sorry, can't do anything for you])])
1019  @end example  @end example
1020    
1021  @noindent  @noindent
# Line 1026  The following example is wrong and dange Line 1026  The following example is wrong and dange
1026    
1027  @example  @example
1028  AC_CHECK_HEADER(stdio.h,  AC_CHECK_HEADER(stdio.h,
1029                  AC_DEFINE(HAVE_STDIO_H),                  AC_DEFINE(HAVE_STDIO_H),
1030                  AC_MSG_ERROR([Sorry, can't do anything for you]))                  AC_MSG_ERROR([Sorry, can't do anything for you]))
1031  @end example  @end example
1032    
1033  In other cases, you may have to use text that also resembles a macro  In other cases, you may have to use text that also resembles a macro
# Line 2010  colon-separated list of input files.  Ex Line 2010  colon-separated list of input files.  Ex
2010    
2011  @example  @example
2012  AC_CONFIG_FILES([Makefile:boiler/top.mk:boiler/bot.mk]  AC_CONFIG_FILES([Makefile:boiler/top.mk:boiler/bot.mk]
2013                  [lib/Makefile:boiler/lib.mk])                  [lib/Makefile:boiler/lib.mk])
2014  @end example  @end example
2015    
2016  @noindent  @noindent
# Line 2357  Makefile snippet similar to: Line 2357  Makefile snippet similar to:
2357  @example  @example
2358  @group  @group
2359  edit = sed \  edit = sed \
2360          -e 's,@@datadir\@@,$(pkgdatadir),g' \          -e 's,@@datadir\@@,$(pkgdatadir),g' \
2361          -e 's,@@prefix\@@,$(prefix),g'          -e 's,@@prefix\@@,$(prefix),g'
2362  @end group  @end group
2363    
2364  @group  @group
2365  autoconf: Makefile $(srcdir)/autoconf.in  autoconf: Makefile $(srcdir)/autoconf.in
2366          rm -f autoconf autoconf.tmp          rm -f autoconf autoconf.tmp
2367          $(edit) $(srcdir)/autoconf.in >autoconf.tmp          $(edit) $(srcdir)/autoconf.in >autoconf.tmp
2368          chmod +x autoconf.tmp          chmod +x autoconf.tmp
2369          mv autoconf.tmp autoconf          mv autoconf.tmp autoconf
2370  @end group  @end group
2371    
2372  @group  @group
2373  autoheader: Makefile $(srcdir)/autoheader.in  autoheader: Makefile $(srcdir)/autoheader.in
2374          rm -f autoheader autoheader.tmp          rm -f autoheader autoheader.tmp
2375          $(edit) $(srcdir)/autoconf.in >autoheader.tmp          $(edit) $(srcdir)/autoconf.in >autoheader.tmp
2376          chmod +x autoheader.tmp          chmod +x autoheader.tmp
2377          mv autoheader.tmp autoheader          mv autoheader.tmp autoheader
2378  @end group  @end group
2379  @end example  @end example
2380    
# Line 2407  as: Line 2407  as:
2407  autoconf autoheader: Makefile  autoconf autoheader: Makefile
2408  @group  @group
2409  .in:  .in:
2410          rm -f $@@ $@@.tmp          rm -f $@@ $@@.tmp
2411          $(edit) $< >$@@.tmp          $(edit) $< >$@@.tmp
2412          chmod +x $@@.tmp          chmod +x $@@.tmp
2413          mv $@@.tmp $@@          mv $@@.tmp $@@
2414  @end group  @end group
2415  @end example  @end example
2416    
# Line 2462  files by prefixing them with @samp{$(src Line 2462  files by prefixing them with @samp{$(src
2462    
2463  @example  @example
2464  time.info: time.texinfo  time.info: time.texinfo
2465          $(MAKEINFO) $(srcdir)/time.texinfo          $(MAKEINFO) $(srcdir)/time.texinfo
2466  @end example  @end example
2467    
2468  @node Automatic Remaking  @node Automatic Remaking
# Line 2491  conflicts etc.). Line 2491  conflicts etc.).
2491  @example  @example
2492  @group  @group
2493  $(srcdir)/configure: configure.ac aclocal.m4  $(srcdir)/configure: configure.ac aclocal.m4
2494          cd $(srcdir) && autoconf          cd $(srcdir) && autoconf
2495    
2496  # autoheader might not change config.h.in, so touch a stamp file.  # autoheader might not change config.h.in, so touch a stamp file.
2497  $(srcdir)/config.h.in: stamp-h.in  $(srcdir)/config.h.in: stamp-h.in
2498  $(srcdir)/stamp-h.in: configure.ac aclocal.m4  $(srcdir)/stamp-h.in: configure.ac aclocal.m4
2499          cd $(srcdir) && autoheader          cd $(srcdir) && autoheader
2500          echo timestamp > $(srcdir)/stamp-h.in          echo timestamp > $(srcdir)/stamp-h.in
2501    
2502  config.h: stamp-h  config.h: stamp-h
2503  stamp-h: config.h.in config.status  stamp-h: config.h.in config.status
2504          ./config.status          ./config.status
2505    
2506  Makefile: Makefile.in config.status  Makefile: Makefile.in config.status
2507          ./config.status          ./config.status
2508    
2509  config.status: configure  config.status: configure
2510          ./config.status --recheck          ./config.status --recheck
2511  @end group  @end group
2512  @end example  @end example
2513    
# Line 2783  For example: Line 2783  For example:
2783    
2784  @example  @example
2785  AH_TEMPLATE([CRAY_STACKSEG_END],  AH_TEMPLATE([CRAY_STACKSEG_END],
2786              [Define to one of _getb67, GETB67, getb67              [Define to one of _getb67, GETB67, getb67
2787               for Cray-2 and Cray-YMP systems.  This               for Cray-2 and Cray-YMP systems.  This
2788               function is required for alloca.c support               function is required for alloca.c support
2789               on those systems.])               on those systems.])
2790  @end example  @end example
2791    
2792  @noindent  @noindent
# Line 2837  Here is an unrealistic example: Line 2837  Here is an unrealistic example:
2837  @example  @example
2838  fubar=42  fubar=42
2839  AC_CONFIG_COMMANDS([fubar],  AC_CONFIG_COMMANDS([fubar],
2840                     [echo this is extra $fubar, and so on.],                     [echo this is extra $fubar, and so on.],
2841                     [fubar=$fubar])                     [fubar=$fubar])
2842  @end example  @end example
2843    
2844  Here is a better one:  Here is a better one:
# Line 2882  For example, this call: Line 2882  For example, this call:
2882    
2883  @example  @example
2884  AC_CONFIG_LINKS(host.h:config/$machine.h  AC_CONFIG_LINKS(host.h:config/$machine.h
2885                  object.h:config/$obj_format.h)                  object.h:config/$obj_format.h)
2886  @end example  @end example
2887    
2888  @noindent  @noindent
# Line 3351  instead, like this: Line 3351  instead, like this:
3351    
3352  @example  @example
3353  AC_PATH_PROG([INETD], [inetd], [/usr/libexec/inetd],  AC_PATH_PROG([INETD], [inetd], [/usr/libexec/inetd],
3354               [$PATH:/usr/libexec:/usr/sbin:/usr/etc:etc])               [$PATH:/usr/libexec:/usr/sbin:/usr/etc:etc])
3355  @end example  @end example
3356    
3357  You are strongly encouraged to declare the @var{variable} passed to  You are strongly encouraged to declare the @var{variable} passed to
# Line 4959  If no @var{includes} are specified, the Line 4959  If no @var{includes} are specified, the
4959    
4960  @example  @example
4961  AC_CHECK_MEMBER(struct passwd.pw_gecos,,  AC_CHECK_MEMBER(struct passwd.pw_gecos,,
4962                  [AC_MSG_ERROR([We need `passwd.pw_gecos'!])],                  [AC_MSG_ERROR([We need `passwd.pw_gecos'!])],
4963                  [#include <pwd.h>])                  [#include <pwd.h>])
4964  @end example  @end example
4965    
4966  You can use this macro for sub-members:  You can use this macro for sub-members:
# Line 6357  AC_INIT(Autoconf Documentation, @value{V Line 6357  AC_INIT(Autoconf Documentation, @value{V
6357  AC_DEFINE([HELLO_WORLD], ["Hello, World\n"])  AC_DEFINE([HELLO_WORLD], ["Hello, World\n"])
6358  AC_LANG_CONFTEST(  AC_LANG_CONFTEST(
6359  [AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],  [AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],
6360                   [[fputs (hw, stdout);]])])                   [[fputs (hw, stdout);]])])
6361  gcc -E -dD conftest.c -o -  gcc -E -dD conftest.c -o -
6362  @end example  @end example
6363    
# Line 6449  AC_INIT(Autoconf Documentation, @value{V Line 6449  AC_INIT(Autoconf Documentation, @value{V
6449  AC_DEFINE([HELLO_WORLD], ["Hello, World\n"])  AC_DEFINE([HELLO_WORLD], ["Hello, World\n"])
6450  AC_PREPROC_IFELSE(  AC_PREPROC_IFELSE(
6451     [AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],     [AC_LANG_PROGRAM([[const char hw[] = "Hello, World\n";]],
6452                      [[fputs (hw, stdout);]])],                      [[fputs (hw, stdout);]])],
6453     [AC_MSG_RESULT([OK])],     [AC_MSG_RESULT([OK])],
6454     [AC_MSG_FAILURE([unexpected preprocessor failure])])     [AC_MSG_FAILURE([unexpected preprocessor failure])])
6455  @end example  @end example
# Line 6697  fstype=no Line 6697  fstype=no
6697  # The order of these tests is important.  # The order of these tests is important.
6698  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statvfs.h>  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statvfs.h>
6699  #include <sys/fstyp.h>]])],  #include <sys/fstyp.h>]])],
6700                    [AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4])                    [AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4])
6701  if test $fstype = no; then  if test $fstype = no; then
6702    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statfs.h>    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statfs.h>
6703  #include <sys/fstyp.h>]])],  #include <sys/fstyp.h>]])],
6704                    [AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3])                    [AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3])
6705  fi  fi
6706  if test $fstype = no; then  if test $fstype = no; then
6707    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statfs.h>    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/statfs.h>
6708  #include <sys/vmount.h>]])]),  #include <sys/vmount.h>]])]),
6709                    [AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])                    [AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])
6710  fi  fi
6711  # (more cases omitted here)  # (more cases omitted here)
6712  AC_MSG_RESULT([$fstype])  AC_MSG_RESULT([$fstype])
# Line 7003  instance, the following macro is broken: Line 7003  instance, the following macro is broken:
7003  @group  @group
7004  AC_DEFUN([AC_SHELL_TRUE],  AC_DEFUN([AC_SHELL_TRUE],
7005  [AC_CACHE_CHECK([whether true(1) works], [ac_cv_shell_true_works],  [AC_CACHE_CHECK([whether true(1) works], [ac_cv_shell_true_works],
7006                  [ac_cv_shell_true_works=no                  [ac_cv_shell_true_works=no
7007                   true && ac_cv_shell_true_works=yes                   true && ac_cv_shell_true_works=yes
7008                   if test $ac_cv_shell_true_works = yes; then                   if test $ac_cv_shell_true_works = yes; then
7009                     AC_DEFINE([TRUE_WORKS], 1                     AC_DEFINE([TRUE_WORKS], 1
7010                               [Define if `true(1)' works properly.])                               [Define if `true(1)' works properly.])
7011                   fi])                   fi])
7012  ])  ])
7013  @end group  @end group
7014  @end example  @end example
# Line 7022  is: Line 7022  is:
7022  @group  @group
7023  AC_DEFUN([AC_SHELL_TRUE],  AC_DEFUN([AC_SHELL_TRUE],
7024  [AC_CACHE_CHECK([whether true(1) works], [ac_cv_shell_true_works],  [AC_CACHE_CHECK([whether true(1) works], [ac_cv_shell_true_works],
7025                  [ac_cv_shell_true_works=no                  [ac_cv_shell_true_works=no
7026                   true && ac_cv_shell_true_works=yes])                   true && ac_cv_shell_true_works=yes])
7027   if test $ac_cv_shell_true_works = yes; then   if test $ac_cv_shell_true_works = yes; then
7028     AC_DEFINE([TRUE_WORKS], 1     AC_DEFINE([TRUE_WORKS], 1
7029               [Define if `true(1)' works properly.])               [Define if `true(1)' works properly.])
7030   fi   fi
7031  ])  ])
7032  @end group  @end group
# Line 7736  AC_TRY_LINK( Line 7736  AC_TRY_LINK(
7736  #ifndef tzname /* For SGI.  */  #ifndef tzname /* For SGI.  */
7737  extern char *tzname[]; /* RS6000 and others reject char **tzname.  */  extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
7738  #endif],  #endif],
7739              [atoi (*tzname);],              [atoi (*tzname);],
7740              [ac_cv_var_tzname=yes],              [ac_cv_var_tzname=yes],
7741              [ac_cv_var_tzname=no])              [ac_cv_var_tzname=no])
7742  @end example  @end example
7743    
7744  @noindent  @noindent
# Line 7772  AC_LINK_IFELSE([AC_LANG_PROGRAM( Line 7772  AC_LINK_IFELSE([AC_LANG_PROGRAM(
7772  #ifndef tzname /* For SGI.  */  #ifndef tzname /* For SGI.  */
7773  extern char *tzname[]; /* RS6000 and others reject char **tzname.  */  extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
7774  #endif]],  #endif]],
7775                                  [atoi (*tzname);])],                                  [atoi (*tzname);])],
7776                 [ac_cv_var_tzname=yes],                 [ac_cv_var_tzname=yes],
7777                 [ac_cv_var_tzname=no])                 [ac_cv_var_tzname=no])
7778  @end example  @end example
7779    
7780  @xref{Quadrigraphs}, for what to do if you run into a hopeless case  @xref{Quadrigraphs}, for what to do if you run into a hopeless case
# Line 8831  write Line 8831  write
8831  @example  @example
8832  AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],  AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],
8833  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
8834                     [ac_cv_emxos2=yes],                     [ac_cv_emxos2=yes],
8835                     [ac_cv_emxos2=no])])                     [ac_cv_emxos2=no])])
8836  @end example  @end example
8837    
8838  @noindent  @noindent
# Line 8840  or even Line 8840  or even
8840    
8841  @example  @example
8842  AC_CACHE_CHECK([for EMX OS/2 environment],  AC_CACHE_CHECK([for EMX OS/2 environment],
8843                 [ac_cv_emxos2],                 [ac_cv_emxos2],
8844                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],                 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
8845                                                     [return __EMX__;])],                                                     [return __EMX__;])],
8846                                    [ac_cv_emxos2=yes],                                    [ac_cv_emxos2=yes],
8847                                    [ac_cv_emxos2=no])])                                    [ac_cv_emxos2=no])])
8848  @end example  @end example
8849    
8850  When using @code{AC_RUN_IFELSE} or any macro that cannot work when  When using @code{AC_RUN_IFELSE} or any macro that cannot work when
# Line 8967  and the new way: Line 8967  and the new way:
8967  m4_define([_AC_EMXOS2],  m4_define([_AC_EMXOS2],
8968  [AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],  [AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],
8969  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
8970                     [ac_cv_emxos2=yes],                     [ac_cv_emxos2=yes],
8971                     [ac_cv_emxos2=no])])                     [ac_cv_emxos2=no])])
8972  test "$ac_cv_emxos2" = yes && EMXOS2=yes[]dnl  test "$ac_cv_emxos2" = yes && EMXOS2=yes[]dnl
8973  ])# _AC_EMXOS2  ])# _AC_EMXOS2
8974  @end example  @end example
# Line 10564  Don't leave white spaces before the pare Line 10564  Don't leave white spaces before the pare
10564    
10565  @example  @example
10566  $ @kbd{gawk 'function die () @{ print "Aaaaarg!"  @}  $ @kbd{gawk 'function die () @{ print "Aaaaarg!"  @}
10567          BEGIN @{ die () @}'}          BEGIN @{ die () @}'}
10568  gawk: cmd. line:2:         BEGIN @{ die () @}  gawk: cmd. line:2:         BEGIN @{ die () @}
10569  gawk: cmd. line:2:                      ^ parse error  gawk: cmd. line:2:                      ^ parse error
10570  $ @kbd{gawk 'function die () @{ print "Aaaaarg!"  @}  $ @kbd{gawk 'function die () @{ print "Aaaaarg!"  @}
10571          BEGIN @{ die() @}'}          BEGIN @{ die() @}'}
10572  Aaaaarg!  Aaaaarg!
10573  @end example  @end example
10574    
# Line 11248  FOO = one \ Line 11248  FOO = one \
11248  BAR = two  BAR = two
11249    
11250  test:  test:
11251          : FOO is "$(FOO)"          : FOO is "$(FOO)"
11252          : BAR is "$(BAR)"          : BAR is "$(BAR)"
11253  @end example  @end example
11254    
11255  @noindent  @noindent
# Line 11269  and continue until an unescaped newline Line 11269  and continue until an unescaped newline
11269        baz        baz
11270    
11271  all:  all:
11272          @@echo ok          @@echo ok
11273  % @kbd{make}   # GNU make  % @kbd{make}   # GNU make
11274  ok  ok
11275  @end example  @end example
# Line 11307  will not pass the substitution along to Line 11307  will not pass the substitution along to
11307  % @kbd{cat Makefile}  % @kbd{cat Makefile}
11308  foo = foo  foo = foo
11309  one:  one:
11310          @@echo $(foo)          @@echo $(foo)
11311          $(MAKE) two          $(MAKE) two
11312  two:  two:
11313          @@echo $(foo)          @@echo $(foo)
11314  % @kbd{make foo=bar}            # GNU make 3.79.1  % @kbd{make foo=bar}            # GNU make 3.79.1
11315  bar  bar
11316  make two  make two
# Line 11355  manually, from your @file{Makefile}: Line 11355  manually, from your @file{Makefile}:
11355  @example  @example
11356  foo = foo  foo = foo
11357  one:  one:
11358          @@echo $(foo)          @@echo $(foo)
11359          $(MAKE) foo=$(foo) two          $(MAKE) foo=$(foo) two
11360  two:  two:
11361          @@echo $(foo)          @@echo $(foo)
11362  @end example  @end example
11363    
11364  You need to foresee all macros that a user might want to override if  You need to foresee all macros that a user might want to override if
# Line 11396  protect @code{SHELL}, since it doesn't u Line 11396  protect @code{SHELL}, since it doesn't u
11396  SHELL = /bin/sh  SHELL = /bin/sh
11397  FOO = foo  FOO = foo
11398  all:  all:
11399          @@echo $(SHELL)          @@echo $(SHELL)
11400          @@echo $(FOO)          @@echo $(FOO)
11401  % @kbd{env SHELL=/bin/tcsh FOO=bar make -e}   # OSF1 V4.0 Make  % @kbd{env SHELL=/bin/tcsh FOO=bar make -e}   # OSF1 V4.0 Make
11402  /bin/tcsh  /bin/tcsh
11403  bar  bar
# Line 11419  The @command{make} from Tru64 Unix V5.1 Line 11419  The @command{make} from Tru64 Unix V5.1
11419    
11420  @example  @example
11421  all:  all:
11422          # foo          # foo
11423  @end example  @end example
11424    
11425  @item The @file{obj/} subdirectory.  @item The @file{obj/} subdirectory.
# Line 11436  current directory will not be read. Line 11436  current directory will not be read.
11436  @example  @example
11437  % @kbd{cat Makefile}  % @kbd{cat Makefile}
11438  all:  all:
11439          echo Hello          echo Hello
11440  % @kbd{cat obj/Makefile}  % @kbd{cat obj/Makefile}
11441  all:  all:
11442          echo World          echo World
11443  % @kbd{make}      # GNU make  % @kbd{make}      # GNU make
11444  echo Hello  echo Hello
11445  Hello  Hello
# Line 11458  implementations always succeed. Line 11458  implementations always succeed.
11458  @example  @example
11459  % @kbd{cat Makefile}  % @kbd{cat Makefile}
11460  all:  all:
11461          false          false
11462  % @kbd{make -k; echo exit status: $?}    # GNU make  % @kbd{make -k; echo exit status: $?}    # GNU make
11463  false  false
11464  make: *** [all] Error 1  make: *** [all] Error 1
# Line 11508  whole thing manually.  For instance, usi Line 11508  whole thing manually.  For instance, usi
11508  @example  @example
11509  VPATH = ../src  VPATH = ../src
11510  foo.o: foo.c  foo.o: foo.c
11511          cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o          cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o
11512  @end example  @end example
11513    
11514  @item Automatic rule rewriting  @item Automatic rule rewriting
# Line 11524  For instance Line 11524  For instance
11524  @example  @example
11525  VPATH = ../src  VPATH = ../src
11526  foo.o: foo.c  foo.o: foo.c
11527          cc -c foo.c -o foo.o          cc -c foo.c -o foo.o
11528  @end example  @end example
11529    
11530  @noindent  @noindent
# Line 11537  rely on this, and we have to search @cod Line 11537  rely on this, and we have to search @cod
11537  @example  @example
11538  VPATH = ../src  VPATH = ../src
11539  foo.o: foo.c  foo.o: foo.c
11540          cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o          cc -c `test -f foo.c || echo ../src/`foo.c -o foo.o
11541  @end example  @end example
11542    
11543  @noindent  @noindent
# Line 11564  in the rule.  For instance these three r Line 11564  in the rule.  For instance these three r
11564  @example  @example
11565  VPATH = ../src  VPATH = ../src
11566  foo.o: foo.c  foo.o: foo.c
11567          cc -c `test -f ./foo.c || echo ../src/`foo.c -o foo.o          cc -c `test -f ./foo.c || echo ../src/`foo.c -o foo.o
11568  foo2.o: foo2.c  foo2.o: foo2.c
11569          cc -c `test -f 'foo2.c' || echo ../src/`foo2.c -o foo2.o          cc -c `test -f 'foo2.c' || echo ../src/`foo2.c -o foo2.o
11570  foo3.o: foo3.c  foo3.o: foo3.c
11571          cc -c `test -f "foo3.c" || echo ../src/`foo3.c -o foo3.o          cc -c `test -f "foo3.c" || echo ../src/`foo3.c -o foo3.o
11572  @end example  @end example
11573    
11574  Things get worse when your prerequisites are in a macro.  Things get worse when your prerequisites are in a macro.
# Line 11577  Things get worse when your prerequisites Line 11577  Things get worse when your prerequisites
11577  VPATH = ../src  VPATH = ../src
11578  HEADERS = foo.h foo2.h foo3.h  HEADERS = foo.h foo2.h foo3.h
11579  install-HEADERS: $(HEADERS)  install-HEADERS: $(HEADERS)
11580          for i in $(HEADERS); do \          for i in $(HEADERS); do \
11581            $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \            $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
11582              $(DESTDIR)$(includedir)/$$i; \              $(DESTDIR)$(includedir)/$$i; \
11583          done          done
11584  @end example  @end example
11585    
11586  The above @code{install-HEADERS} rule is not SunOS-proof because @code{for  The above @code{install-HEADERS} rule is not SunOS-proof because @code{for
# Line 11619  Trying to quote @code{$(HEADERS)} in som Line 11619  Trying to quote @code{$(HEADERS)} in som
11619    
11620  @example  @example
11621  install-HEADERS: $(HEADERS)  install-HEADERS: $(HEADERS)
11622          headers='$(HEADERS)'; for i in $$headers; do \          headers='$(HEADERS)'; for i in $$headers; do \
11623            $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \            $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
11624              $(DESTDIR)$(includedir)/$$i; \              $(DESTDIR)$(includedir)/$$i; \
11625          done          done
11626  @end example  @end example
11627    
11628  Indeed, @code{headers='$(HEADERS)'} expands to @code{headers='foo.h  Indeed, @code{headers='$(HEADERS)'} expands to @code{headers='foo.h
# Line 11636  One workaround is to strip this unwanted Line 11636  One workaround is to strip this unwanted
11636  VPATH = ../src  VPATH = ../src
11637  HEADERS = foo.h foo2.h foo3.h  HEADERS = foo.h foo2.h foo3.h
11638  install-HEADERS: $(HEADERS)  install-HEADERS: $(HEADERS)
11639          headers='$(HEADERS)'; for i in $$headers; do \          headers='$(HEADERS)'; for i in $$headers; do \
11640            i=`expr "$$i" : '../src/\(.*\)'`;            i=`expr "$$i" : '../src/\(.*\)'`;
11641            $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \            $(INSTALL) -m 644 `test -f $$i || echo ../src/`$$i \
11642              $(DESTDIR)$(includedir)/$$i; \              $(DESTDIR)$(includedir)/$$i; \
11643          done          done
11644  @end example  @end example
11645    
11646  Automake does something similar.  Automake does something similar.
# Line 11670  search as presented before. Line 11670  search as presented before.
11670  @example  @example
11671  VPATH = ..  VPATH = ..
11672  all : foo/bar  all : foo/bar
11673          command `test -d foo/bar || echo ../`foo/bar          command `test -d foo/bar || echo ../`foo/bar
11674  @end example  @end example
11675    
11676  The above @command{command} will be run on the empty @file{foo/bar}  The above @command{command} will be run on the empty @file{foo/bar}
# Line 11712  update existing files in the source dire Line 11712  update existing files in the source dire
11712  VPATH = ..  VPATH = ..
11713  all: foo.x bar.x  all: foo.x bar.x
11714  foo.x bar.x: newer.x  foo.x bar.x: newer.x
11715          @@echo Building $@@          @@echo Building $@@
11716  % @kbd{touch ../bar.x}  % @kbd{touch ../bar.x}
11717  % @kbd{touch ../newer.x}  % @kbd{touch ../newer.x}
11718  % @kbd{make}        # GNU make  % @kbd{make}        # GNU make
# Line 11759  the @code{bar.x: newer.x} rule. Line 11759  the @code{bar.x: newer.x} rule.
11759  VPATH = ..  VPATH = ..
11760  all: bar.y  all: bar.y
11761  bar.x: newer.x  bar.x: newer.x
11762          @@echo Building $@@          @@echo Building $@@
11763  .SUFFIXES: .x .y  .SUFFIXES: .x .y
11764  .x.y:  .x.y:
11765          cp $< $@@          cp $< $@@
11766  % @kbd{touch ../bar.x}  % @kbd{touch ../bar.x}
11767  % @kbd{touch ../newer.x}  % @kbd{touch ../newer.x}
11768  % @kbd{make}        # GNU make  % @kbd{make}        # GNU make
# Line 11798  all: bar.y Line 11798  all: bar.y
11798  bar.x: newer.x  bar.x: newer.x
11799  .SUFFIXES: .x .y  .SUFFIXES: .x .y
11800  .x.y:  .x.y:
11801          cp $< $@@          cp $< $@@
11802  % @kbd{touch ../bar.x}  % @kbd{touch ../bar.x}
11803  % @kbd{touch ../newer.x}  % @kbd{touch ../newer.x}
11804  % @kbd{make}        # GNU make  % @kbd{make}        # GNU make
# Line 11842  $ @kbd{cat Makefile} Line 11842  $ @kbd{cat Makefile}
11842  .SUFFIXES: .in  .SUFFIXES: .in
11843  foo: foo.in  foo: foo.in
11844  .in:  .in:
11845          cp $< $@          cp $< $@
11846  $ @kbd{touch foo.in}  $ @kbd{touch foo.in}
11847  $ @kbd{make}  $ @kbd{make}
11848  $ @kbd{ls}  $ @kbd{ls}
# Line 11865  Note it works without the @samp{foo: foo Line 11865  Note it works without the @samp{foo: foo
11865  $ @kbd{cat Makefile}  $ @kbd{cat Makefile}
11866  .SUFFIXES: .in  .SUFFIXES: .in
11867  .in:  .in:
11868          cp $< $@          cp $< $@
11869  $ @kbd{make foo}  $ @kbd{make foo}
11870  cp foo.in foo  cp foo.in foo
11871  @end example  @end example
# Line 11878  $ @kbd{cat Makefile} Line 11878  $ @kbd{cat Makefile}
11878  foo.out: foo.in  foo.out: foo.in
11879  .SUFFIXES: .in .out  .SUFFIXES: .in .out
11880  .in.out:  .in.out:
11881          cp $< $@          cp $< $@
11882  $ @kbd{make}  $ @kbd{make}
11883  cp foo.in foo.out  cp foo.in foo.out
11884  @end example  @end example
# Line 11902  Tools}).  Hence you should be wary of ru Line 11902  Tools}).  Hence you should be wary of ru
11902    
11903  @example  @example
11904  dest: src  dest: src
11905          cp -p src dest          cp -p src dest
11906  @end example  @end example
11907    
11908  as @file{dest} will often appear to be older than @file{src} after the  as @file{dest} will often appear to be older than @file{src} after the
# Line 11912  problem, you can use a timestamp file, e Line 11912  problem, you can use a timestamp file, e
11912    
11913  @example  @example
11914  dest-stamp: src  dest-stamp: src
11915          cp -p src dest          cp -p src dest
11916          date >dest-stamp          date >dest-stamp
11917  @end example  @end example
11918    
11919  @end table  @end table
# Line 12095  cases together, like in this fragment: Line 12095  cases together, like in this fragment:
12095  @example  @example
12096  case $target in  case $target in
12097  i386-*-mach* | i386-*-gnu*)  i386-*-mach* | i386-*-gnu*)
12098               obj_format=aout emulation=mach bfd_gas=yes ;;               obj_format=aout emulation=mach bfd_gas=yes ;;
12099  i960-*-bout) obj_format=bout ;;  i960-*-bout) obj_format=bout ;;
12100  esac  esac
12101  @end example  @end example
# Line 12105  and later in @file{configure.ac}, use: Line 12105  and later in @file{configure.ac}, use:
12105    
12106  @example  @example
12107  AC_CONFIG_LINKS(host.h:config/$machine.h  AC_CONFIG_LINKS(host.h:config/$machine.h
12108                  object.h:config/$obj_format.h)                  object.h:config/$obj_format.h)
12109  @end example  @end example
12110    
12111  Note that the above example uses @code{$target} because it's taken from  Note that the above example uses @code{$target} because it's taken from
# Line 12327  Options}).  The following example will m Line 12327  Options}).  The following example will m
12327  @example  @example
12328  AC_DEFUN([TEST_MACRO],  AC_DEFUN([TEST_MACRO],
12329  [AC_ARG_WITH([foo],  [AC_ARG_WITH([foo],
12330               AS_HELP_STRING([--with-foo],               AS_HELP_STRING([--with-foo],
12331                              [use foo (default is NO)]),                              [use foo (default is NO)]),
12332               [ac_cv_use_foo=$withval], [ac_cv_use_foo=no])               [ac_cv_use_foo=$withval], [ac_cv_use_foo=no])
12333  AC_CACHE_CHECK([whether to use foo],  AC_CACHE_CHECK([whether to use foo],
12334                 [ac_cv_use_foo], [ac_cv_use_foo=no])])                 [ac_cv_use_foo], [ac_cv_use_foo=no])])
12335  @end example  @end example
12336    
12337  Please note that the call to @code{AS_HELP_STRING} is @strong{unquoted}.  Please note that the call to @code{AS_HELP_STRING} is @strong{unquoted}.
# Line 12350  arguments, as shown in the following exa Line 12350  arguments, as shown in the following exa
12350  @example  @example
12351  AC_DEFUN(MY_ARG_WITH,  AC_DEFUN(MY_ARG_WITH,
12352  [AC_ARG_WITH([$1],  [AC_ARG_WITH([$1],
12353               AS_HELP_STRING([--with-$1], [use $1 (default is $2)]),               AS_HELP_STRING([--with-$1], [use $1 (default is $2)]),
12354               ac_cv_use_$1=$withval, ac_cv_use_$1=no),               ac_cv_use_$1=$withval, ac_cv_use_$1=no),
12355  AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)])  AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)])
12356  @end example  @end example
12357  @end defmac  @end defmac
# Line 12469  Here is how to use the variable @code{pr Line 12469  Here is how to use the variable @code{pr
12469  PROGRAMS = cp ls rm  PROGRAMS = cp ls rm
12470  transform = @@program_transform_name@@  transform = @@program_transform_name@@
12471  install:  install:
12472          for p in $(PROGRAMS); do \          for p in $(PROGRAMS); do \
12473            $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | \            $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | \
12474                                                sed '$(transform)'`; \                                                sed '$(transform)'`; \
12475          done          done
12476    
12477  uninstall:  uninstall:
12478          for p in $(PROGRAMS); do \          for p in $(PROGRAMS); do \
12479            rm -f $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; \            rm -f $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; \
12480          done          done
12481  @end example  @end example
12482    
12483  It is guaranteed that @code{program_transform_name} is never empty, and  It is guaranteed that @code{program_transform_name} is never empty, and
# Line 12721  that rule: Line 12721  that rule:
12721  @group  @group
12722  config.h: stamp-h  config.h: stamp-h
12723  stamp-h: config.h.in config.status  stamp-h: config.h.in config.status
12724          ./config.status config.h          ./config.status config.h
12725          echo > stamp-h          echo > stamp-h
12726    
12727  Makefile: Makefile.in config.status  Makefile: Makefile.in config.status
12728          ./config.status Makefile          ./config.status Makefile
12729  @end group  @end group
12730  @end example  @end example
12731    
# Line 12798  would be: Line 12798  would be:
12798  @group  @group
12799  config.h: stamp-h  config.h: stamp-h
12800  stamp-h: config.h.in config.status  stamp-h: config.h.in config.status
12801          CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_FILES= \          CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_FILES= \
12802            CONFIG_HEADERS=config.h ./config.status            CONFIG_HEADERS=config.h ./config.status
12803          echo > stamp-h          echo > stamp-h
12804    
12805  Makefile: Makefile.in config.status  Makefile: Makefile.in config.status
12806          CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_HEADERS= \          CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_HEADERS= \
12807            CONFIG_FILES=Makefile ./config.status            CONFIG_FILES=Makefile ./config.status
12808  @end group  @end group
12809  @end example  @end example
12810    
# Line 12850  package for distribution were: Line 12850  package for distribution were:
12850  @example  @example
12851  @group  @group
12852  configure.ac --.   .------> autoconf* -----> configure  configure.ac --.   .------> autoconf* -----> configure
12853                 +---+                 +---+
12854  [aclocal.m4] --+   `---.  [aclocal.m4] --+   `---.
12855  [acsite.m4] ---'       |  [acsite.m4] ---'       |
12856                         +--> [autoheader*] -> [config.h.in]                         +--> [autoheader*] -> [config.h.in]
12857  [acconfig.h] ----.     |  [acconfig.h] ----.     |
12858                   +-----'                   +-----'
12859  [config.h.top] --+  [config.h.top] --+
12860  [config.h.bot] --'  [config.h.bot] --'
12861  @end group  @end group
# Line 12984  This macro is equivalent to: Line 12984  This macro is equivalent to:
12984    
12985  @example  @example
12986  AC_CHECK_TYPE([@var{type}],,  AC_CHECK_TYPE([@var{type}],,
12987                [AC_DEFINE_UNQUOTED([@var{type}], [@var{default}],                [AC_DEFINE_UNQUOTED([@var{type}], [@var{default}],
12988                                    [Define to `@var{default}' if                                    [Define to `@var{default}' if
12989                                     <sys/types.h> does not define.])])                                     <sys/types.h> does not define.])])
12990  @end example  @end example
12991    
12992  In order to keep backward compatibility, the two versions of  In order to keep backward compatibility, the two versions of
# Line 13061  means to check the nature of the host is Line 13061  means to check the nature of the host is
13061  AC_REQUIRE([AC_CANONICAL_HOST])[]dnl  AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
13062  case $host_os in  case $host_os in
13063    *cygwin* ) CYGWIN=yes;;    *cygwin* ) CYGWIN=yes;;
13064           * ) CYGWIN=no;;           * ) CYGWIN=no;;
13065  esac  esac
13066  @end example  @end example
13067    
# Line 13302  version of: Line 13302  version of:
13302    
13303  @example  @example
13304  AC_LINK_FILES(config/$machine.h config/$obj_format.h,  AC_LINK_FILES(config/$machine.h config/$obj_format.h,
13305                host.h            object.h)                host.h            object.h)
13306  @end example  @end example
13307    
13308  @noindent  @noindent
# Line 13310  is: Line 13310  is:
13310    
13311  @example  @example
13312  AC_CONFIG_LINKS(host.h:config/$machine.h  AC_CONFIG_LINKS(host.h:config/$machine.h
13313                  object.h:config/$obj_format.h)                  object.h:config/$obj_format.h)
13314  @end example  @end example
13315  @end defmac  @end defmac
13316    
# Line 13414  interface is equivalent to: Line 13414  interface is equivalent to:
13414  @group  @group
13415  AC_CONFIG_FILES(@var{file}@dots{})  AC_CONFIG_FILES(@var{file}@dots{})
13416  AC_CONFIG_COMMANDS([default],  AC_CONFIG_COMMANDS([default],
13417                     @var{extra-cmds}, @var{init-cmds})                     @var{extra-cmds}, @var{init-cmds})
13418  AC_OUTPUT  AC_OUTPUT
13419  @end group  @end group
13420  @end example  @end example
# Line 13432  Here is an unrealistic example: Line 13432  Here is an unrealistic example:
13432  @example  @example
13433  fubar=27  fubar=27
13434  AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.],  AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.],
13435                     [fubar=$fubar])                     [fubar=$fubar])
13436  AC_OUTPUT_COMMANDS([echo this is another, extra, bit],  AC_OUTPUT_COMMANDS([echo this is another, extra, bit],
13437                     [echo init bit])                     [echo init bit])
13438  @end example  @end example
13439    
13440  Aside from the fact that @code{AC_CONFIG_COMMANDS} requires an  Aside from the fact that @code{AC_CONFIG_COMMANDS} requires an
# Line 13765  AC_EGREP_CPP(yes, Line 13765  AC_EGREP_CPP(yes,
13765  [#if defined M_XENIX && !defined M_UNIX  [#if defined M_XENIX && !defined M_UNIX
13766    yes    yes
13767  #endif],  #endif],
13768               [AC_MSG_RESULT([yes]); XENIX=yes],               [AC_MSG_RESULT([yes]); XENIX=yes],
13769               [AC_MSG_RESULT([no]); XENIX=])               [AC_MSG_RESULT([no]); XENIX=])
13770  @end example  @end example
13771  @end defmac  @end defmac
13772    
# Line 14030  too! Line 14030  too!
14030  @example  @example
14031  AC_INIT  AC_INIT
14032  AC_CHECK_HEADERS(foo.h,,  AC_CHECK_HEADERS(foo.h,,
14033                   [AC_MSG_ERROR([cannot find foo.h, bailing out])])                   [AC_MSG_ERROR([cannot find foo.h, bailing out])])
14034  AC_OUTPUT  AC_OUTPUT
14035  @end example  @end example
14036    
# Line 14291  Yet another reason why assigning @code{L Line 14291  Yet another reason why assigning @code{L
14291  # This is necessary so that .o files in LIBOBJS are also built via  # This is necessary so that .o files in LIBOBJS are also built via
14292  # the ANSI2KNR-filtering rules.  # the ANSI2KNR-filtering rules.
14293  LIB@@&t@@OBJS=`echo "$LIB@@&t@@OBJS" |  LIB@@&t@@OBJS=`echo "$LIB@@&t@@OBJS" |
14294               sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`               sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
14295  LTLIBOBJS=`echo "$LIB@@&t@@OBJS" |  LTLIBOBJS=`echo "$LIB@@&t@@OBJS" |
14296             sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`             sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
14297  AC_SUBST(LTLIBOBJS)  AC_SUBST(LTLIBOBJS)
14298  @end example  @end example
14299    
# Line 14366  AC_COMPILE_IFELSE([AC_LANG_PROGRAM( Line 14366  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
14366  # error _AIX not defined  # error _AIX not defined
14367  #endif  #endif
14368  ]])],  ]])],
14369                     [is_aix=yes],                     [is_aix=yes],
14370                     [is_aix=no])                     [is_aix=no])
14371  @end group  @end group
14372  @end example  @end example
14373    
# Line 14524  subfile-n.at ->' Line 14524  subfile-n.at ->'
14524  Files used in configuring a software package:  Files used in configuring a software package:
14525    
14526  @example  @example
14527                                       .--> atconfig                                       .--> atconfig
14528                                      /                                      /
14529  [atlocal.in] -->  config.status* --<  [atlocal.in] -->  config.status* --<
14530                                      \                                      \
14531                                       `--> [atlocal]                                       `--> [atlocal]
14532  @end example  @end example
14533    
14534  @noindent  @noindent
# Line 14536  Files created during the test suite exec Line 14536  Files created during the test suite exec
14536    
14537  @example  @example
14538  atconfig -->.                    .--> testsuite.log  atconfig -->.                    .--> testsuite.log
14539               \                  /               \                  /
14540                >-- testsuite* --<                >-- testsuite* --<
14541               /                  \               /                  \
14542  [atlocal] ->'                    `--> [testsuite.dir]  [atlocal] ->'                    `--> [testsuite.dir]
14543  @end example  @end example
14544    
# Line 14826  suggest the following Makefile excerpt: Line 14826  suggest the following Makefile excerpt:
14826    
14827  @smallexample  @smallexample
14828  $(srcdir)/package.m4: $(top_srcdir)/configure.ac  $(srcdir)/package.m4: $(top_srcdir)/configure.ac
14829          @{                                      \          @{                                      \
14830            echo '# Signature of the current package.'; \            echo '# Signature of the current package.'; \
14831            echo 'm4_define([AT_PACKAGE_NAME],      [@@PACKAGE_NAME@@])'; \            echo 'm4_define([AT_PACKAGE_NAME],      [@@PACKAGE_NAME@@])'; \
14832            echo 'm4_define([AT_PACKAGE_TARNAME],   [@@PACKAGE_TARNAME@@])'; \            echo 'm4_define([AT_PACKAGE_TARNAME],   [@@PACKAGE_TARNAME@@])'; \
14833            echo 'm4_define([AT_PACKAGE_VERSION],   [@@PACKAGE_VERSION@@])'; \            echo 'm4_define([AT_PACKAGE_VERSION],   [@@PACKAGE_VERSION@@])'; \
14834            echo 'm4_define([AT_PACKAGE_STRING],    [@@PACKAGE_STRING@@])'; \            echo 'm4_define([AT_PACKAGE_STRING],    [@@PACKAGE_STRING@@])'; \
14835            echo 'm4_define([AT_PACKAGE_BUGREPORT], [@@PACKAGE_BUGREPORT@@])'; \            echo 'm4_define([AT_PACKAGE_BUGREPORT], [@@PACKAGE_BUGREPORT@@])'; \
14836          @} >$(srcdir)/package.m4          @} >$(srcdir)/package.m4
14837  @end smallexample  @end smallexample
14838    
14839  @noindent  @noindent
# Line 14869  check} with a validation suite. Line 14869  check} with a validation suite.
14869  EXTRA_DIST = testsuite.at testsuite  EXTRA_DIST = testsuite.at testsuite
14870  TESTSUITE = $(srcdir)/testsuite  TESTSUITE = $(srcdir)/testsuite
14871  check-local: atconfig atlocal $(TESTSUITE)  check-local: atconfig atlocal $(TESTSUITE)
14872          $(SHELL) $(TESTSUITE)          $(SHELL) $(TESTSUITE)
14873    
14874  AUTOTEST = $(AUTOM4TE) --language=autotest  AUTOTEST = $(AUTOM4TE) --language=autotest
14875  $(TESTSUITE): $(srcdir)/testsuite.at  $(TESTSUITE): $(srcdir)/testsuite.at
14876          $(AUTOTEST) -I $(srcdir) $@@.at -o $@@.tmp          $(AUTOTEST) -I $(srcdir) $@@.at -o $@@.tmp
14877          mv $@@.tmp $@@          mv $@@.tmp $@@
14878  @end example  @end example
14879    
14880  You might want to list explicitly the dependencies, i.e., the list of  You might want to list explicitly the dependencies, i.e., the list of
# Line 14887  following: Line 14887  following:
14887  subdir = tests  subdir = tests
14888    
14889  atconfig: $(top_builddir)/config.status  atconfig: $(top_builddir)/config.status
14890          cd $(top_builddir) && \          cd $(top_builddir) && \
14891             $(SHELL) ./config.status $(subdir)/$@@             $(SHELL) ./config.status $(subdir)/$@@
14892    
14893  atlocal: $(srcdir)/atlocal.in $(top_builddir)/config.status  atlocal: $(srcdir)/atlocal.in $(top_builddir)/config.status
14894          cd $(top_builddir) && \          cd $(top_builddir) && \
14895             $(SHELL) ./config.status $(subdir)/$@@             $(SHELL) ./config.status $(subdir)/$@@
14896  @end example  @end example
14897    
14898  @noindent  @noindent
# Line 15101  similar.  If I use Line 15101  similar.  If I use
15101    
15102  @example  @example
15103  AC_DEFINE_UNQUOTED([DATADIR], [$datadir],  AC_DEFINE_UNQUOTED([DATADIR], [$datadir],
15104                     [Define to the read-only architecture-independent                     [Define to the read-only architecture-independent
15105                      data directory.])                      data directory.])
15106  @end example  @end example
15107    
15108  @noindent  @noindent
# Line 15137  or create a dedicated header file: Line 15137  or create a dedicated header file:
15137  @example  @example
15138  DISTCLEANFILES = datadir.h  DISTCLEANFILES = datadir.h
15139  datadir.h: Makefile  datadir.h: Makefile
15140          echo '#define DATADIR "$(datadir)"' >$@@          echo '#define DATADIR "$(datadir)"' >$@@
15141  @end example  @end example
15142    
15143  @item  @item

Legend:
Removed from v.1.764  
changed lines
  Added in v.1.765

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26