comparison man/internals/internals.texi @ 2647:89e2f8e3f660

[xemacs-hg @ 2005-03-10 11:44:17 by malcolmp] Autoconf 2.5 documentation updates.
author malcolmp
date Thu, 10 Mar 2005 11:44:22 +0000
parents a4040d921acc
children 5d63eacf17f1
comparison
equal deleted inserted replaced
2646:5e4893b16f7c 2647:89e2f8e3f660
4157 @node The Build Configuration System, Rules When Writing New C Code, The Modules of XEmacs, Top 4157 @node The Build Configuration System, Rules When Writing New C Code, The Modules of XEmacs, Top
4158 @chapter The Build Configuration System 4158 @chapter The Build Configuration System
4159 @cindex build configuration 4159 @cindex build configuration
4160 @cindex configuration, build 4160 @cindex configuration, build
4161 4161
4162 @strong{Please write this node!} @c #### 4162 XEmacs makes extensive use of the external features provided by the
4163 4163 system it is running on. Determining which features are present and
4164 This node should describe XEmacs-specific techniques and idioms in the 4164 where they are located is the responsibility of the build configuration
4165 configuration system. A particular example is the set of @samp{XE_} 4165 system.
4166 macros in @file{configure.in} and @file{configure.ac}.
4167 4166
4168 @menu 4167 @menu
4169 * The version.sh Script:: 4168 * The version.sh Script::
4170 * Adding Configurable Features:: 4169 * Adding Configurable Features::
4171 * The configure Script:: 4170 * The configure Script::
4269 @section Adding Configurable Features 4268 @section Adding Configurable Features
4270 @cindex adding configurable features 4269 @cindex adding configurable features
4271 @cindex configurable features, adding 4270 @cindex configurable features, adding
4272 @cindex features, adding configurable 4271 @cindex features, adding configurable
4273 4272
4274 Adding a configurable feature requires at least adding an option to the 4273 Adding a configurable feature requires at the very least adding an
4275 @file{configure} script and a macro definition to @file{src/config.h.in} 4274 option to the @file{configure} script and a macro definition to
4276 (@pxref{The configure Script}), and often changes to Makefile precursors 4275 @file{src/config.h.in} (@pxref{The configure Script}), and often changes
4277 (@pxref{The Makefile Precursors}). 4276 to Makefile precursors (@pxref{The Makefile Precursors}).
4278 4277
4278 Be prepared for the feature to be absent (even if you think that is
4279 always present for a particular OS release) and work with
4280 @code{--with-site-prefixes} to handle libraries and headers that are in
4281 unusual locations. There is no end to the strange ways in which systems
4282 can be configured and XEmacs is expected to cope with anything thrown at
4283 it.
4279 4284
4280 4285
4281 @node The configure Script, The Makefile Precursors, Adding Configurable Features, The Build Configuration System 4286 @node The configure Script, The Makefile Precursors, Adding Configurable Features, The Build Configuration System
4282 @section The configure Script 4287 @section The configure Script
4283 @cindex configure script 4288 @cindex configure script
4284 @cindex scripts, configure 4289 @cindex scripts, configure
4285 4290
4286 At the heart of the XEmacs build configuration system is the 4291 At the heart of the XEmacs build configuration system is the
4287 @file{configure} script. This beast is maintained using the Autoconf 4292 @file{configure} script. This beast is maintained using the Autoconf
4288 system, which is a truly terrifying monstrosity based on a fundamentally 4293 system, which is a truly terrifying monstrosity based on a fundamentally
4289 flawed programming model (extensive use of macros), with an 4294 flawed programming model (extensive use of macros), with an unpleasant
4290 implementation about which I've never heard a nice word (GNU @file{m4}), 4295 implementation (GNU @file{m4}), used to string together a large set of
4291 used to string together a large set of @emph{ad hoc} tests, to implement 4296 @emph{ad hoc} tests, to implement a configuration language with
4292 a configuration language with conventions that are unimportant in simple 4297 conventions that are unimportant in simple cases and counterintuitive
4293 cases and counterintuitive when things get complicated. If that doesn't 4298 when things get complicated. If that doesn't scare you off, Welcome! I
4294 scare you off, Welcome! I think you're ready to become a configure 4299 think you're ready to become a configure hacker! (But be prepared for
4295 hacker! (But be prepared for things to go downhill from here.) 4300 things to go downhill from here.)
4301
4302 Unless you plan to develop autoconf macros, much of this complexity can
4303 be removed by following the following rule:
4304
4305 @quotation
4306 Always quote (ie surround with @samp{[]}) every argument to every
4307 macro. This includes macros that appear in the argument list of other
4308 macros.
4309 @end quotation
4310
4311 If this rule is followed and the macro produces incorrect results then
4312 the macro is buggy.
4296 4313
4297 @file{configure} is, of course, is written in POSIX shell language, and 4314 @file{configure} is, of course, is written in POSIX shell language, and
4298 autogenerated from a precursor (see? the first step was a doozy!) 4315 autogenerated from a precursor. As of March 2005 on the mainline the
4299 Currently that precursor is called @file{configure.ac}, but in the 4316 precursor is called @file{configure.ac} and it is built using
4300 previous generation it was called @file{configure.in}. As of February 4317 @code{autoconf} 2.59. Prior to that, and with XEmacs 21.4 and earlier
4301 2005, @file{configure.ac} is used in the development mainline, but 4318 it was called @file{configure.in} and build using @code{autoconf} 2.13.
4302 because the semantics of many predefined macros changed drastically 4319 @code{autoconf} 2.5X is not completely backward compatible with
4303 between @file{autoconf} 2.13 and @file{autoconf} 2.50 (why not ``3.0''? 4320 @code{autoconf} 2.13 so the XEmacs Project chose to stick with the devil
4304 you got me), the XEmacs Project chose to stick with the devil it knew 4321 it knew for the stable line of XEmacs 21.4 releases.
4305 for the stable line of XEmacs 21.4 releases. 4322
4306 4323 One reason for worrying about the level of compatibility is the fact
4307 One reason for worrying about the semantic changes is the fact that 4324 that XEmacs uses a lot of homebrew code, including @file{m4} macros, to
4308 XEmacs uses a lot of homebrew code, including @file{m4} macros, to
4309 implement special features in its @file{configure} script. Here are 4325 implement special features in its @file{configure} script. Here are
4310 some of the important features: 4326 some of the important features:
4311 4327
4312 @itemize 4328 @itemize
4313 @item 4329 @item
4324 provided for performing common operations: 4340 provided for performing common operations:
4325 4341
4326 @c #### @var{}-ize the formal parameters of these functions? 4342 @c #### @var{}-ize the formal parameters of these functions?
4327 @table @code 4343 @table @code
4328 @item USAGE_ERROR(string) 4344 @item USAGE_ERROR(string)
4329 prints a usage error and dies 4345 Prints a usage error and dies.
4330 4346
4331 @item PRINT_VAR(var var ...) 4347 @item PRINT_VAR(var var ...)
4332 prints values of shell variables 4348 Prints the name and value of the list of shell variables.
4333 4349
4334 @item XE_ADD_OBJS(foo.o ...) 4350 @item XE_ADD_OBJS(foo.o)
4335 @strong{#### Please document me!} 4351 Appends the argument to the variable @code{extra_objs}. This variable
4352 goes to make up part of the link command line. If the command line
4353 argument @code{--verbose} is supplied a message is printed out.
4336 4354
4337 @item XE_APPEND(value, varname) 4355 @item XE_APPEND(value, varname)
4338 @strong{#### Please document me!} 4356 Append the value (separated by a space) to the shell variable
4357 @var{varname}. @var{varname} should not be prefixed with a @samp{$}.
4358 If the command line argument @code{--verbose} is supplied a message is
4359 printed out.
4339 4360
4340 @item XE_PREPEND(value, varname) 4361 @item XE_PREPEND(value, varname)
4341 @strong{#### Please document me!} 4362 Prepend the value (separated by a space) to the shell variable
4363 @var{varname}. @var{varname} should not be prefixed with a @samp{$}.
4364 If the command line argument @code{--verbose} is supplied a message is
4365 printed out.
4342 4366
4343 @item XE_DIE(message) 4367 @item XE_DIE(message)
4344 used for situations that can't lead to a successful build, such as 4368 Used for situations that can't lead to a successful build, such as
4345 missing include files or conflicts between requested features. 4369 missing include files or conflicts between requested features.
4346 4370
4347 @item XE_CHECK_FEATURE_DEPENDENCY(feature1, feature2) 4371 @item XE_CHECK_FEATURE_DEPENDENCY(feature1, feature2)
4348 @strong{#### Please document me!} 4372 @code{--with-@var{feature1}} requires that @code{--with-@var{feature2}}
4373 be also set and will die if the latter is not specified.
4349 4374
4350 @item XE_STRIP_4TH_COMPONENT(var) 4375 @item XE_STRIP_4TH_COMPONENT(var)
4351 @strong{#### Please document me!} 4376 Converts the four part system name (eg @code{i986-pc-linux-gnu}) in
4377 @var{var} to a three part names (eg @code{i986-pc-linux}).
4352 4378
4353 @item CANONICALIZE_PATH(varname) 4379 @item CANONICALIZE_PATH(varname)
4354 @strong{#### Please document me!} 4380 Strips automount brokenness from the path in @var{varname}.
4355 4381
4356 @item XE_PROTECT_LINKER_FLAGS(shell_var) 4382 @item XE_PROTECT_LINKER_FLAGS(shell_var)
4357 @strong{#### Please document me!} 4383 Wrap the command line arguments in @var{shell_var} with suitable
4384 incantations to ensure that the compiler front end passes them to the
4385 linker. Currently the magic is added only for gcc.
4358 4386
4359 @item COLON_TO_SPACE(path) 4387 @item COLON_TO_SPACE(path)
4360 Allow use of either @samp{:} or spaces for lists of directories. 4388 Converts a colon separated list of paths into a space separated list of paths.
4361 4389
4362 @item XE_ADD_RUNPATH_DIR(directory) 4390 @item XE_ADD_RUNPATH_DIR(directory)
4363 @strong{#### Please document me!} 4391 Internal function used by @code{XE_COMPUTE_RUNPATH}.
4364 4392
4365 @item XE_COMPUTE_RUNPATH() 4393 @item XE_COMPUTE_RUNPATH()
4366 @strong{#### Please document me!} 4394 Calculate the appropriate dynamic library run path for XEmacs and the
4395 value to the shell variable @code{ld_switch_run}.
4367 4396
4368 @item XE_SPACE(var, words) 4397 @item XE_SPACE(var, words)
4369 @strong{#### Please document me!} 4398 Append to @code{var} a space separated list of @code{words}.
4370 4399
4371 @item XE_SHLIB_STUFF 4400 @item XE_SHLIB_STUFF
4372 See @file{aclocal.m4}. 4401 Generate the appropriate shared library support black magic. This is
4402 implemented in the file @file{aclocal.m4}.
4373 @end table 4403 @end table
4374 4404
4375 @heading XEmacs keyword option support 4405 @heading XEmacs keyword option support
4376 4406
4377 A @dfn{keyword} option is one that accepts one of a number of 4407 A @dfn{keyword} option is one that accepts one of a number of
4378 pre-defined values (if support for sets of values is needed, see 4408 pre-defined values (if support for sets of values is needed, x1see
4379 ``complex options'' below). For example, 4409 ``complex options'' below). For example,
4380 @samp{--with-mail-locking=flock}. 4410 @samp{--with-mail-locking=flock}.
4381 4411
4382 Keyword options use expanded forms of @samp{AC_ARG_[WITH|ENABLE]} called 4412 Keyword options are defined with expanded forms of
4383 @samp{XE_KEYWORD_ARG_[WITH|ENABLE]}, both taking 5 parameters. The 4413 @samp{AC_ARG_[WITH|ENABLE]} called @samp{XE_KEYWORD_ARG_[WITH|ENABLE]},
4384 first 4 parameters of these macros are the same as original macros with 4414 both taking 5 parameters. The first 4 parameters of these macros are
4385 the exception that all four parameters are @strong{required}. The 4415 the same as original macros with the exception that all four parameters
4386 @var{action-if-true} code is run after the argument list has been 4416 are @strong{required}. The @var{action-if-true} code is run after the
4387 parsed. 4417 argument list has been parsed.
4388 4418
4389 The 5th parameter is a list of supported keywords. The whole list must 4419 The 5th parameter is a list of supported keywords. The whole list must
4390 be quoted but the individual keywords should not. 4420 be quoted but the individual keywords should not. Here is how the
4421 @samp{mail-locking} flag is defined:
4422
4423 @example
4424 XE_KEYWORD_ARG_WITH([mail-locking],
4425 AC_HELP_STRING([--with-mail-locking],[Specify the locking to be
4426 used by movemail to prevent concurrent updates
4427 of mail spool files. Valid types are `lockf',
4428 `flock', `dot', `locking' or `mmdf'.]),
4429 [],
4430 [],
4431 [lockf,flock,file,locking,mmdf,pop])
4432 @end example
4433
4434 (Note that the help string will be reformatted by @file{autoconf} so
4435 that all whitespace is first compressed to a single space, then folded
4436 to appear in the right-hand column as above. Thus the help string may
4437 appear differently when @code{./configure --help} is invoked.)
4391 4438
4392 If the option value is a not a valid keyword then an error message is 4439 If the option value is a not a valid keyword then an error message is
4393 generated, otherwise the value is left untouched. 4440 generated, otherwise the value is left untouched.
4394 4441
4395 This support is implemented via the following @file{GNU m4} macros. 4442 This support is implemented via the following @file{GNU m4} macros.
4396 Macros labelled @dfn{internal} are not expected to be used by 4443 Macros labeled @dfn{internal} are not expected to be used by
4397 @file{configure.ac} programmers; they are part of the implementation of 4444 @file{configure.ac} programmers; they are part of the implementation of
4398 higher-level features. 4445 higher-level features.
4399 4446
4400 @table @code 4447 @table @code
4401 @item XE_KEYWORD_ARG_WITH(package, help-string, action-if-true, action-if-false, [keyword1, keyword2, ....]) 4448 @item XE_KEYWORD_ARG_WITH(package, help-string, action-if-true, action-if-false, [keyword1, keyword2, ....])
4402 Expanded version of @samp{AC_ARG_WITH} for keyword options. All the 4449 Expanded version of @code{AC_ARG_WITH} for keyword options. All the
4403 parameters are required. The last argument is a comma-separated list of 4450 parameters are required. The last argument is a comma-separated list of
4404 supported keywords, @file{m4}-quoted with @samp{[]}. 4451 supported keywords, @file{m4}-quoted with @samp{[]}.
4405 4452
4406 @item XE_KEYWORD_ARG_ENABLE(feature, help-string, action-if-true, action-if-false, [keyword1, keyword2, ....]) 4453 @item XE_KEYWORD_ARG_ENABLE(feature, help-string, action-if-true, action-if-false, [keyword1, keyword2, ....])
4407 Expanded version of @samp{AC_ARG_ENABLE} for keyword options. All the 4454 Expanded version of @code{AC_ARG_ENABLE} for keyword options. All the
4408 parameters are required. The last argument is a comma-separated list of 4455 parameters are required. The last argument is a comma-separated list of
4409 supported keywords, @file{m4}-quoted with @samp{[]}. 4456 supported keywords, @file{m4}-quoted with @samp{[]}.
4410 4457
4411 @item XE_PARSE_KEYWORD_OPTION(prefix, cmdline-flag) 4458 @item XE_PARSE_KEYWORD_OPTION(prefix, cmdline-flag)
4412 Internal macro to parse the option values. If an undeclared option is 4459 Internal macro to parse the option values. If an undeclared option is
4413 found then an error is generated. 4460 found then an error is generated.
4414 4461
4415 @item XE_KEYWORD(keyword) 4462 @item XE_KEYWORD(keyword)
4416 Internal macro to declare an option value. 4463 Internal macro to convert the keyword list into the various forms needed
4464 by @code{XE_PARSE_KEYWORD_OPTION}.
4417 4465
4418 @end table 4466 @end table
4419 4467
4420 @heading XEmacs complex option support 4468 @heading XEmacs complex option support
4421 4469
4422 A @dfn{complex option} is one that takes a number of related values, as 4470 A @dfn{complex option} is one that takes a number of related values, as
4423 a set. For example, we might use "--with-xft=all,nomenubars" for 4471 a set. For example, we might use @code{--with-sound=native,nas} to play
4424 compatibility with XFontSet i18n of menubars. (The example is 4472 sounds using the native libraries and via NAS.
4425 contrived, Xft looks much better than XFS.) Processing such an option 4473
4426 requires a number of auxiliary variables. 4474 Complex options are defined with expanded forms of
4427 4475 @samp{AC_ARG_[WITH|ENABLE]} called @samp{XE_COMPLEX_ARG_[WITH|ENABLE]},
4428 Complex options use expanded forms of @samp{AC_ARG_[WITH|ENABLE]} called 4476 both taking 5 parameters. The first 4 parameters of these macros are
4429 @samp{XE_COMPLEX_ARG_[WITH|ENABLE]}, both taking 5 parameters. The 4477 the same as original macros with the exception that all four parameters
4430 first 4 parameters of these macros are the same as original macros with 4478 are @strong{required}. The @var{action-if-true} code is run after the
4431 the exception that all four parameters are @strong{required}. The 4479 argument list has been parsed.
4432 @var{action-if-true} code is run after the argument list has been 4480
4433 parsed. 4481 The 5th parameter is a list of @code{XE_COMPLEX_OPTION} macro calls that
4434
4435 The 5th parameter is a list of @samp{XE_COMPLEX_OPTION} macro calls that
4436 define the valid components and their default values. The list must be 4482 define the valid components and their default values. The list must be
4437 quoted but the individual macro calls should not. Here is how the 4483 quoted but the individual macro calls should not. Here is how the
4438 @samp{sound} flag is defined: 4484 @samp{sound} flag is defined:
4439 4485
4440 @example 4486 @example
4452 [XE_COMPLEX_OPTION([native],[""]), 4498 [XE_COMPLEX_OPTION([native],[""]),
4453 XE_COMPLEX_OPTION([nas],[""]), 4499 XE_COMPLEX_OPTION([nas],[""]),
4454 XE_COMPLEX_OPTION([esd],[no])]) 4500 XE_COMPLEX_OPTION([esd],[no])])
4455 @end example 4501 @end example
4456 4502
4457 (Note that the help string will be reformatted by @file{autoconf} so
4458 that all whitespace is first compressed to a single space, then folded
4459 to appear in the right-hand column as above. Thus the help string may
4460 appear differently when @code{./configure --help} is invoked.)
4461
4462 @c #### verify for INSTALL and xemacs Texinfo. 4503 @c #### verify for INSTALL and xemacs Texinfo.
4463 Each component is interpreted as a separate feature to be enabled or 4504 Each option is interpreted as a separate feature to be enabled or
4464 disabled. As usual, the distinction between ``with'' and ``enable'' is 4505 disabled. As usual, the distinction between ``with'' and ``enable'' is
4465 that ``with'' features require specific support from the system, usually 4506 that ``with'' features require specific support from the system, usually
4466 one or more optional libraries, and ``enable'' features are supported 4507 one or more optional libraries, and ``enable'' features are supported
4467 entirely by code in XEmacs, but the user might want to switch it off for 4508 entirely by code in XEmacs, but the user might want to switch it off for
4468 some reason. Option values are stored in the variables 4509 some reason. Option values are stored in the variables
4469 @samp{with_@var{package}_@var{component}} or 4510 @code{with_@var{package}_@var{component}} or
4470 @samp{enable_@var{feature}_@var{component}} (@i{e.g.} 4511 @code{enable_@var{feature}_@var{component}} (@i{e.g.}
4471 @samp{with_xft_menubars}). 4512 @code{enable_sound_native}).
4472 4513
4473 The user of @file{configure} specifies the configuration by providing a 4514 The user of @code{configure} specifies the configuration by providing a
4474 list of components. The special components @samp{all} and @samp{none} 4515 list of components. The special components @samp{all} and @samp{none}
4475 may occur first in the list, setting the defaults for all components to 4516 may occur first in the list, setting the defaults for all components to
4476 @samp{yes} or @samp{no} respectively. 4517 @samp{yes} or @samp{no} respectively.
4477 4518
4478 In @file{configure.ac}, default values of option values may be 4519 In @file{configure.ac}, default values of option values may be
4480 occur if there is a configuration problems (such as a missing library) 4521 occur if there is a configuration problems (such as a missing library)
4481 or @samp{no} which means that the option must not be used. The default 4522 or @samp{no} which means that the option must not be used. The default
4482 value can also be the null string @samp{""}, usually meaning that 4523 value can also be the null string @samp{""}, usually meaning that
4483 @file{configure} will attempt to find support for the feature on the 4524 @file{configure} will attempt to find support for the feature on the
4484 system, and will enable the configuration if it is available. Sometimes 4525 system, and will enable the configuration if it is available. Sometimes
4485 the null string means that @file{configure}'s default is 4526 the null string means that @code{configure}'s default is
4486 system-dependent. (This usage is not consistent, and depends on the 4527 system-dependent. (This usage is not consistent, and depends on the
4487 implementation of the feature detector rather than the argument parser.) 4528 implementation of the feature detector rather than the argument parser.)
4488 Users cannot specify the null string for an individual component from 4529 Users cannot specify the null string for an individual component from
4489 the command line. 4530 the command line.
4490 4531
4492 exemplified by sound: there are alternative protocols (native, ESD, NAS) 4533 exemplified by sound: there are alternative protocols (native, ESD, NAS)
4493 and each is supported by a corresponding library. The other is a single 4534 and each is supported by a corresponding library. The other is a single
4494 library which may or may not be supported by multiple components of 4535 library which may or may not be supported by multiple components of
4495 XEmacs, as exemplified by Xft. This latter usage may be more common 4536 XEmacs, as exemplified by Xft. This latter usage may be more common
4496 during development of a feature. Perhaps specialized APIs should be 4537 during development of a feature. Perhaps specialized APIs should be
4497 provided, see comment on @samp{XE_COMPLEX_OPTION_HELP_STRING} below. 4538 provided, see comment on @code{XE_COMPLEX_OPTION_HELP_STRING} below.
4498 4539
4499 @table @code 4540 @table @code
4500 @item XE_COMPLEX_OPTION(option, yesno) 4541 @item XE_COMPLEX_OPTION(option, yesno)
4501 Declare a complex option and its default value. The value @strong{must} 4542 Declare a complex option and its default value. The value @strong{must}
4502 be either @samp{yes} or @samp{no} or the null string @samp{""}. The 4543 be either @samp{yes} or @samp{no} or the null string @samp{""}. The
4511 This was originally written for the Xft option, and doesn't read so well 4552 This was originally written for the Xft option, and doesn't read so well
4512 for options based on alternative libraries like sound. Hackers beware: 4553 for options based on alternative libraries like sound. Hackers beware:
4513 the API may be enhanced to deal with this in the future. 4554 the API may be enhanced to deal with this in the future.
4514 4555
4515 @item XE_COMPLEX_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE, [XE_COMPLEX_OPTION(a,yes), ....]) 4556 @item XE_COMPLEX_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE, [XE_COMPLEX_OPTION(a,yes), ....])
4516 Extended version of @samp{AC_ARG_WITH} for complex options. All the 4557 Extended version of @code{AC_ARG_WITH} for complex options. All the
4517 parameters are required. 4558 parameters are required.
4518 4559
4519 @item XE_COMPLEX_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE, [XE_COMPLEX_OPTION(a,yes), ....]) 4560 @item XE_COMPLEX_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE, [XE_COMPLEX_OPTION(a,yes), ....])
4520 Expanded version of @samp{AC_ARG_ENABLE} for complex options. All the 4561 Expanded version of @code{AC_ARG_ENABLE} for complex options. All the
4521 parameters are required. 4562 parameters are required.
4522 4563
4523 @item XE_EXPAND_COMPLEX_OPTION(prefix, component, yesno) 4564 @item XE_EXPAND_COMPLEX_OPTION(prefix, component, yesno)
4524 Internal macro create the option's shell variable containing the default 4565 Internal macro create the option's shell variable containing the default
4525 value and to note the values in an option list. 4566 value and to note the values in an option list.
4546 @node The Makefile Precursors, , The configure Script, The Build Configuration System 4587 @node The Makefile Precursors, , The configure Script, The Build Configuration System
4547 @section The Makefile Precursors 4588 @section The Makefile Precursors
4548 @cindex Makefile precursors 4589 @cindex Makefile precursors
4549 @cindex precursors, Makefile 4590 @cindex precursors, Makefile
4550 4591
4551 @strong{Please write this node!} @c #### 4592 As with other @code{autoconf} based programs, XEmacs's Makefiles are not
4552 4593 written, they are generated. The @code{configure} program uses Makefile
4553 As in other programs using a @file{configure} program, XEmacs's 4594 precursors, or templates, to generate the actual Makefiles. Unlike
4554 Makefiles are not written, they are generated. The @file{configure} 4595 other programs this is a multistage process. The developer changes the
4555 program uses Makefile precursors, or templates, to generate the actual 4596 file @file{Makefile.in.in}, then @code{configure} first generates an
4556 Makefiles. In fact, it is a multistage process. The developer changes
4557 the file @file{Makefile.in.in}, then @file{configure} first generates an
4558 intermediate file @file{Makefile.in}, and finally produces a portable 4597 intermediate file @file{Makefile.in}, and finally produces a portable
4559 Makefile called @file{Makefile}, and a Makefile optimized for @file{GNU 4598 Makefile called @file{Makefile}, and a Makefile optimized for @code{GNU
4560 make} called @file{GNUmakefile}. 4599 make} called @file{GNUmakefile}.
4561 4600
4562 This node describes XEmacs-specific techniques and idioms used in the 4601 @file{Makefile.in.in} is run through the C preprocessor as part of this
4563 @file{Makefile.in.in} files. 4602 process. This means that common files can be included and conditional
4564 4603 construction of the Makefile can occur. When @file{GNUmakefile} is
4565 4604 being produced @code{USE_GNU_MAKE} is defined.
4605
4606 Comments in @file{Makefile.in.in} must start with @samp{##} to avoid
4607 confusing the preprocessor.
4566 4608
4567 @node Rules When Writing New C Code, Regression Testing XEmacs, The Build Configuration System, Top 4609 @node Rules When Writing New C Code, Regression Testing XEmacs, The Build Configuration System, Top
4568 @chapter Rules When Writing New C Code 4610 @chapter Rules When Writing New C Code
4569 @cindex writing new C code, rules when 4611 @cindex writing new C code, rules when
4570 @cindex C code, rules when writing new 4612 @cindex C code, rules when writing new