* doc/autoconf.texi: Expand section on DOS issues.

Add link to the `doschk' package.  Fix minor typo.
Clean up white spaces.
This commit is contained in:
Akim Demaille 2001-03-13 12:34:49 +00:00
parent 8490bcc359
commit 7862e20827
2 changed files with 139 additions and 110 deletions

View File

@ -1,3 +1,9 @@
2001-03-13 Tim Van Holder <tim.van.holder@pandora.be>
* doc/autoconf.texi: Expand section on DOS issues.
Add link to the `doschk' package. Fix minor typo.
Clean up white spaces.
2001-03-13 Steven G. Johnson <stevenj@alum.mit.edu>
* aclang.m4 (AC_PROG_F77_C_O): define F77_NO_MINUS_C_MINUS_O

View File

@ -35,17 +35,17 @@
@dircategory Individual utilities
@direntry
* autoscan: (autoconf)autoscan Invocation.
Semi-automatic @file{configure.ac} writing
Semi-automatic @file{configure.ac} writing
* ifnames: (autoconf)ifnames Invocation.
Listing the conditionals in source code
Listing the conditionals in source code
* autoconf: (autoconf)autoconf Invocation.
How to create configuration scripts
How to create configuration scripts
* autoreconf: (autoconf)autoreconf Invocation.
Remaking multiple @code{configure} scripts
Remaking multiple @code{configure} scripts
* configure: (autoconf)configure Invocation.
Configuring a package
Configuring a package
* config.status: (autoconf)config.status Invocation.
Recreating a configuration
Recreating a configuration
@end direntry
@ifinfo
@ -568,9 +568,9 @@ your source files --> [autoscan*] --> [configure.scan] --> configure.ac
@group
configure.ac --.
| .------> autoconf* -----> configure
| .------> autoconf* -----> configure
[aclocal.m4] --+---+
| `-----> [autoheader*] --> [config.h.in]
| `-----> [autoheader*] --> [config.h.in]
[acsite.m4] ---'
@end group
@ -581,11 +581,11 @@ Makefile.in -------------------------------> Makefile.in
Files used in configuring a software package:
@example
@group
.-------------> [config.cache]
.-------------> [config.cache]
configure* ------------+-------------> config.log
|
|
[config.h.in] -. v .-> [config.h] -.
+--> config.status* -+ +--> make*
+--> config.status* -+ +--> make*
Makefile.in ---' `-> Makefile ---'
@end group
@end example
@ -693,8 +693,8 @@ For instance:
@example
AC_CHECK_HEADER([stdio.h],
[AC_DEFINE([HAVE_STDIO_H])],
[AC_MSG_ERROR([Sorry, can't do anything for you])])
[AC_DEFINE([HAVE_STDIO_H])],
[AC_MSG_ERROR([Sorry, can't do anything for you])])
@end example
@noindent
@ -702,8 +702,8 @@ is perfectly quoted. You may safely simplify quotation to
@example
AC_CHECK_HEADER(stdio.h,
[AC_DEFINE(HAVE_STDIO_H)],
[AC_MSG_ERROR([Sorry, can't do anything for you])])
[AC_DEFINE(HAVE_STDIO_H)],
[AC_MSG_ERROR([Sorry, can't do anything for you])])
@end example
@noindent
@ -714,8 +714,8 @@ The following example is wrong and dangerous, as it is underquoted:
@example
AC_CHECK_HEADER(stdio.h,
AC_DEFINE(HAVE_STDIO_H),
AC_MSG_ERROR([Sorry, can't do anything for you]))
AC_DEFINE(HAVE_STDIO_H),
AC_MSG_ERROR([Sorry, can't do anything for you]))
@end example
You may have to use text that also resembles a macro call. In this
@ -1637,7 +1637,7 @@ colon-separated list of input files. Examples:
@example
AC_CONFIG_FILES(Makefile:boiler/top.mk:boiler/bot.mk
lib/Makefile:boiler/lib.mk)
lib/Makefile:boiler/lib.mk)
@end example
@noindent
@ -1939,10 +1939,10 @@ Makefile snippet:
@example
.sh:
rm -f $@@ $@@.tmp
sed 's,@@datadir\@@,$(pkgdatadir),g' $< >$@@.tmp
chmod +x $@@.tmp
mv $@@.tmp $@@
rm -f $@@ $@@.tmp
sed 's,@@datadir\@@,$(pkgdatadir),g' $< >$@@.tmp
chmod +x $@@.tmp
mv $@@.tmp $@@
@end example
Three things are noteworthy:
@ -2003,7 +2003,7 @@ files by prefixing them with @samp{$(srcdir)/}. For example:
@example
time.info: time.texinfo
$(MAKEINFO) $(srcdir)/time.texinfo
$(MAKEINFO) $(srcdir)/time.texinfo
@end example
@node Automatic Remaking, , Build Directories, Makefile Substitutions
@ -2032,23 +2032,23 @@ command like @code{echo} as a workaround.
@example
@group
$(srcdir)/configure: configure.ac aclocal.m4
cd $(srcdir) && autoconf
cd $(srcdir) && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
$(srcdir)/config.h.in: stamp-h.in
$(srcdir)/stamp-h.in: configure.ac aclocal.m4
cd $(srcdir) && autoheader
echo timestamp > $(srcdir)/stamp-h.in
cd $(srcdir) && autoheader
echo timestamp > $(srcdir)/stamp-h.in
config.h: stamp-h
stamp-h: config.h.in config.status
./config.status
./config.status
Makefile: Makefile.in config.status
./config.status
./config.status
config.status: configure
./config.status --recheck
./config.status --recheck
@end group
@end example
@ -2325,10 +2325,10 @@ For instance:
@example
AH_TEMPLATE([CRAY_STACKSEG_END],
[Define to one of _getb67, GETB67, getb67
for Cray-2 and Cray-YMP systems. This
function is required for alloca.c support
on those systems.])
[Define to one of _getb67, GETB67, getb67
for Cray-2 and Cray-YMP systems. This
function is required for alloca.c support
on those systems.])
@end example
@noindent
@ -2380,8 +2380,8 @@ Here is an unrealistic example:
@example
fubar=42
AC_CONFIG_COMMANDS(fubar,
[echo this is extra $fubar, and so on.],
[fubar=$fubar])
[echo this is extra $fubar, and so on.],
[fubar=$fubar])
@end example
Here is a better one:
@ -2433,7 +2433,7 @@ For example, this call:
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
object.h:config/$obj_format.h)
object.h:config/$obj_format.h)
@end example
@noindent
@ -3926,8 +3926,8 @@ If no @var{includes} are specified, the default includes are used
@example
AC_CHECK_MEMBER(struct passwd.pw_gecos,,
[AC_MSG_ERROR([We need `passwd.pw_gecos'!])],
[#include <pwd.h>])
[AC_MSG_ERROR([We need `passwd.pw_gecos'!])],
[#include <pwd.h>])
@end example
You can use this macro for sub members:
@ -5280,14 +5280,21 @@ or @samp{;}) when it starts up.
File names need extra care as well. While @sc{dos}-based environments
that are Unixy enough to run @command{autoconf} (such as DJGPP) will
usually be able to handle long file names properly, there are still
limitations that can seriously break packages:
limitations that can seriously break packages. Several of these issues can
be easily detected by
@uref{ftp://ftp.gnu.org/gnu/non-gnu/doschk/doschk-1.1.tar.gz, the doschk
package}.
A short overview follows; problems are marked with @sc{sfn}/@sc{lfn} to
indicate where they apply: @sc{sfn} means the issues are only relevant to
plain @sc{dos}, not to @sc{dos} boxes under Windows, while @sc{lfn}
identifies problems that exist even under Windows.
@table @asis
@item No multiple dots
@sc{dos} cannot handle multiple dots in filenames. This is an
especially important thing to remember when building a portable
configure script, as @command{autoconf} uses a .in suffix for template
files.
@item No multiple dots (@sc{sfn})
@sc{dos} cannot handle multiple dots in filenames. This is an especially
important thing to remember when building a portable configure script,
as @command{autoconf} uses a .in suffix for template files.
This is perfectly OK on Unices:
@ -5308,20 +5315,36 @@ AC_CONFIG_FILES([source.c:source.cin foo.bar:foobar.in])
AC_OUTPUT
@end example
@item Case insensitivity
@item No leading dot (@sc{sfn})
@sc{dos} cannot handle filenames that start with a dot. This is an especially
important thing to remember when building a portable configure script,
as @command{autoconf} uses a .in suffix for template files.
@item Case insensitivity (@sc{lfn})
@sc{dos} is case insensitive, so you cannot, for example, have both a
file called @samp{INSTALL} and a directory called @samp{install}. This
also affects @command{make}; if there's a file called @samp{INSTALL} in
the directory, @command{make install} will do nothing (unless the
@samp{install} target is marked as PHONY).
@item The 8+3 limit
@item The 8+3 limit (@sc{sfn})
Because the @sc{dos} file system only stores the first 8 characters of
the filename and the first 3 of the extension, those must be unique.
That means that @samp{foobar-part1.c}, @samp{foobar-part2.c} and
@samp{foobar-prettybird.c} all resolve to the same filename
(@samp{FOOBAR-P.C}). The same goes for @samp{foo.bar} and
@samp{foo.bartender}.
Note: This is not usually a problem under Windows, as it uses numeric
tails in the short version of filenames to make them unique. However,
a registry setting can turn this behaviour off. While this makes it
possible to share file trees containing long file names between @sc{sfn}
and @sc{lfn} environments, it also means the above problem also applies.
@item Illegal characters
Some characters are illegal in @sc{dos} filenames, and should therefore
be avoided. In a @sc{lfn} environment, these are '/', '\', '?', '*', ':',
'<', '>', '|' and '"'. In a @sc{sfn} environment, other characters are
also illegal. These include '+', ',', '[' and ']'.
@end table
@node Shell Substitutions, Assignments, File System Conventions, Portable Shell
@ -6154,11 +6177,11 @@ Don't leave white spaces before the parentheses in user functions calls,
@example
$ gawk 'function die () @{ print "Aaaaarg!" @}
BEGIN @{ die () @}'
BEGIN @{ die () @}'
gawk: cmd. line:2: BEGIN @{ die () @}
gawk: cmd. line:2: ^ parse error
$ gawk 'function die () @{ print "Aaaaarg!" @}
BEGIN @{ die() @}'
BEGIN @{ die() @}'
Aaaaarg!
@end example
@ -6234,7 +6257,7 @@ emulate, e.g.:
@example
dir=`expr "x$file" : 'x\(.*\)/[^/]*' \|
'.' : '.'
'.' : '.'
@end example
@noindent
@ -6411,7 +6434,7 @@ program. This feature also works with nonexistent files like in the
Unix spec. So @samp{ln -s file link} will generate @file{link.exe},
which will attempt to call @file{file.exe} if run. But this feature only
works for executables, so @samp{cp -p} is used instead for these
systems. DJGPP version 2.04 and later have full symlink support.
systems. DJGPP versions 2.04 and later have full symlink support.
@item @command{mv}
@ -6580,16 +6603,16 @@ fstype=no
# The order of these tests is important.
AC_TRY_CPP([#include <sys/statvfs.h>
#include <sys/fstyp.h>],
[AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4])
[AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4])
if test $fstype = no; then
AC_TRY_CPP([#include <sys/statfs.h>
#include <sys/fstyp.h>],
[AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3])
[AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3])
fi
if test $fstype = no; then
AC_TRY_CPP([#include <sys/statfs.h>
#include <sys/vmount.h>],
[AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])
[AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX])
fi
# (more cases omitted here)
AC_MSG_RESULT([$fstype])
@ -6874,7 +6897,7 @@ AC_DEFUN([AC_SHELL_TRUE],
true && ac_cv_shell_true_works=yes
if test $ac_cv_shell_true_works = yes; then
AC_DEFINE([TRUE_WORKS], 1
[Define if `true(1)' works properly.])
[Define if `true(1)' works properly.])
fi[]dnl
])])
@end group
@ -6893,7 +6916,7 @@ AC_DEFUN([AC_SHELL_TRUE],
true && ac_cv_shell_true_works=yes])
if test $ac_cv_shell_true_works = yes; then
AC_DEFINE([TRUE_WORKS], 1
[Define if `true(1)' works properly.])
[Define if `true(1)' works properly.])
fi[]dnl
])
@end group
@ -7573,9 +7596,9 @@ AC_TRY_LINK(
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif],
[atoi (*tzname);],
[ac_cv_var_tzname=yes],
[ac_cv_var_tzname=no])
[atoi (*tzname);],
[ac_cv_var_tzname=yes],
[ac_cv_var_tzname=no])
@end example
@noindent
@ -7609,9 +7632,9 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif]],
[atoi (*tzname);])],
[ac_cv_var_tzname=yes],
[ac_cv_var_tzname=no])
[atoi (*tzname);])],
[ac_cv_var_tzname=yes],
[ac_cv_var_tzname=no])
@end example
@c FIXME: Quadrigraphs and hopeless cases.
@ -7909,8 +7932,8 @@ write
@example
AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
[ac_cv_emxos2=yes],
[ac_cv_emxos2=no])])
[ac_cv_emxos2=yes],
[ac_cv_emxos2=no])])
@end example
@noindent
@ -7918,11 +7941,11 @@ or even
@example
AC_CACHE_CHECK([for EMX OS/2 environment],
[ac_cv_emxos2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[return __EMX__;])],
[ac_cv_emxos2=yes],
[ac_cv_emxos2=no])])
[ac_cv_emxos2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[return __EMX__;])],
[ac_cv_emxos2=yes],
[ac_cv_emxos2=no])])
@end example
When using @code{AC_TRY_RUN} or any macro that cannot work when
@ -8045,8 +8068,8 @@ and the new way:
define([_AC_EMXOS2],
[AC_CACHE_CHECK([for EMX OS/2 environment], [ac_cv_emxos2],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return __EMX__;])],
[ac_cv_emxos2=yes],
[ac_cv_emxos2=no])])
[ac_cv_emxos2=yes],
[ac_cv_emxos2=no])])
test "$ac_cv_emxos2" = yes && EMXOS2=yes[]dnl
])# _AC_EMXOS2
@end example
@ -8246,7 +8269,7 @@ cases together, like in this fragment:
@example
case "$target" in
i386-*-mach* | i386-*-gnu*)
obj_format=aout emulation=mach bfd_gas=yes ;;
obj_format=aout emulation=mach bfd_gas=yes ;;
i960-*-bout) obj_format=bout ;;
esac
@end example
@ -8256,7 +8279,7 @@ and in @file{configure.ac}, use:
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
object.h:config/$obj_format.h)
object.h:config/$obj_format.h)
@end example
You can also use the host system type to find cross-compilation tools.
@ -8450,11 +8473,11 @@ Options}). The following example will make this clearer.
@example
AC_DEFUN(TEST_MACRO,
[AC_ARG_WITH(foo,
AC_HELP_STRING([--with-foo],
[use foo (default is NO)]),
ac_cv_use_foo=$withval, ac_cv_use_foo=no),
AC_HELP_STRING([--with-foo],
[use foo (default is NO)]),
ac_cv_use_foo=$withval, ac_cv_use_foo=no),
AC_CACHE_CHECK(whether to use foo,
ac_cv_use_foo, ac_cv_use_foo=no)])
ac_cv_use_foo, ac_cv_use_foo=no)])
@end example
Please note that the call to @code{AC_HELP_STRING} is @strong{unquoted}.
@ -8473,8 +8496,8 @@ arguments, as shown in the following example.
@example
AC_DEFUN(MY_ARG_WITH,
[AC_ARG_WITH([$1],
AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
ac_cv_use_$1=$withval, ac_cv_use_$1=no),
AC_HELP_STRING([--with-$1], [use $1 (default is $2)]),
ac_cv_use_$1=$withval, ac_cv_use_$1=no),
AC_CACHE_CHECK(whether to use $1, ac_cv_use_$1, ac_cv_use_$1=$2)])
@end example
@end defmac
@ -8590,11 +8613,11 @@ Here is how to use the variable @code{program_transform_name} in a
@example
transform = @@program_transform_name@@
install: all
$(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog | \
sed '$(transform)'`
$(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog | \
sed '$(transform)'`
uninstall:
rm -f $(bindir)/`echo myprog | sed '$(transform)'`
rm -f $(bindir)/`echo myprog | sed '$(transform)'`
@end example
@noindent
@ -8603,15 +8626,15 @@ If you have more than one program to install, you can do it in a loop:
@example
PROGRAMS = cp ls rm
install:
for p in $(PROGRAMS); do \
$(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | \
sed '$(transform)'`; \
done
for p in $(PROGRAMS); do \
$(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | \
sed '$(transform)'`; \
done
uninstall:
for p in $(PROGRAMS); do \
rm -f $(bindir)/`echo $$p | sed '$(transform)'`; \
done
for p in $(PROGRAMS); do \
rm -f $(bindir)/`echo $$p | sed '$(transform)'`; \
done
@end example
Whether to do the transformations on documentation files (Texinfo or
@ -8838,11 +8861,11 @@ that rule:
@group
config.h: stamp-h
stamp-h: config.h.in config.status
./config.status config.h
echo > stamp-h
./config.status config.h
echo > stamp-h
Makefile: Makefile.in config.status
./config.status Makefile
./config.status Makefile
@end group
@end example
@ -8913,13 +8936,13 @@ would be:
@group
config.h: stamp-h
stamp-h: config.h.in config.status
CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_FILES= \
CONFIG_HEADERS=config.h ./config.status
echo > stamp-h
CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_FILES= \
CONFIG_HEADERS=config.h ./config.status
echo > stamp-h
Makefile: Makefile.in config.status
CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_HEADERS= \
CONFIG_FILES=Makefile ./config.status
CONFIG_COMMANDS= CONFIG_LINKS= CONFIG_HEADERS= \
CONFIG_FILES=Makefile ./config.status
@end group
@end example
@ -8965,12 +8988,12 @@ package for distribution were:
@example
@group
configure.ac --. .------> autoconf* -----> configure
+---+
+---+
[aclocal.m4] --+ `---.
[acsite.m4] ---' |
+--> [autoheader*] -> [config.h.in]
+--> [autoheader*] -> [config.h.in]
[acconfig.h] ----. |
+-----'
+-----'
[config.h.top] --+
[config.h.bot] --'
@end group
@ -9105,9 +9128,9 @@ This macro is equivalent to:
@example
AC_CHECK_TYPE([@var{type}],
[AC_DEFINE([@var{type}], [@var{default}],
[Define to `@var{default}' if <sys/types.h>
does not define.])])
[AC_DEFINE([@var{type}], [@var{default}],
[Define to `@var{default}' if <sys/types.h>
does not define.])])
@end example
In order to keep backward compatibility, the two versions of
@ -9179,7 +9202,7 @@ means to check the nature of the host is using
AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
case $host_os in
*cygwin* ) CYGWIN=yes;;
* ) CYGWIN=no;;
* ) CYGWIN=no;;
esac
@end example
@ -9387,7 +9410,7 @@ version of:
@example
AC_LINK_FILES(config/$machine.h config/$obj_format.h,
host.h object.h)
host.h object.h)
@end example
@noindent
@ -9395,7 +9418,7 @@ is:
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
object.h:config/$obj_format.h)
object.h:config/$obj_format.h)
@end example
@end defmac
@ -9499,7 +9522,7 @@ interface is equivalent to:
@group
AC_CONFIG_FILES(@var{file}@dots{})
AC_CONFIG_COMMANDS([default],
@var{extra-cmds}, @var{init-cmds})
@var{extra-cmds}, @var{init-cmds})
AC_OUTPUT
@end group
@end example
@ -9517,9 +9540,9 @@ Here is an unrealistic example:
@example
fubar=27
AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.],
fubar=$fubar)
fubar=$fubar)
AC_OUTPUT_COMMANDS([echo this is another, extra, bit],
[echo init bit])
[echo init bit])
@end example
Aside from the fact that @code{AC_CONFIG_COMMANDS} requires an
@ -9766,8 +9789,8 @@ AC_EGREP_CPP(yes,
[#if defined M_XENIX && !defined M_UNIX
yes
#endif],
[AC_MSG_RESULT([yes]); XENIX=yes],
[AC_MSG_RESULT([no]); XENIX=])
[AC_MSG_RESULT([yes]); XENIX=yes],
[AC_MSG_RESULT([no]); XENIX=])
@end example
@end defmac