]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
whitespace frobbing
authorDavid MacKenzie <djm@djmnet.org>
Fri, 26 Aug 1994 02:47:25 +0000 (02:47 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Fri, 26 Aug 1994 02:47:25 +0000 (02:47 +0000)
acspecific.m4
autoconf.texi
doc/autoconf.texi
lib/autoconf/specific.m4

index dba47d44ce6f8eb27e099a3e59629b7af750a136..887da666daf19427b4ec9b4cf1b546b4b824455a 100644 (file)
@@ -472,25 +472,27 @@ AC_CACHE_VAL(ac_cv_header_stat_broken,
 [AC_EGREP_CPP([You lose], [#include <sys/types.h>
 #include <sys/stat.h>
 #ifdef S_ISBLK
-#if S_ISBLK (S_IFDIR)
+# if S_ISBLK (S_IFDIR)
 You lose.
-#endif
-#ifdef S_IFCHR
-#if S_ISBLK (S_IFCHR)
+# endif
+# ifdef S_IFCHR
+#  if S_ISBLK (S_IFCHR)
 You lose.
+#  endif
+# endif
 #endif
-#endif /* S_IFCHR */
-#endif /* S_ISBLK */
+
 #ifdef S_ISLNK
-#if S_ISLNK (S_IFREG)
+# if S_ISLNK (S_IFREG)
 You lose.
+# endif
 #endif
-#endif /* S_ISLNK */
+
 #ifdef S_ISSOCK
-#if S_ISSOCK (S_IFREG)
+# if S_ISSOCK (S_IFREG)
 You lose.
+# endif
 #endif
-#endif /* S_ISSOCK */
 ], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])dnl
 AC_MSG_RESULT($ac_cv_header_stat_broken)
 if test $ac_cv_header_stat_broken = yes; then
@@ -604,36 +606,40 @@ AC_CACHE_VAL(ac_cv_func_mmap,
 #include <sys/mman.h>
 
 #ifdef BSD
-#ifndef BSD4_1
-#define HAVE_GETPAGESIZE
-#endif
+# ifndef BSD4_1
+#  define HAVE_GETPAGESIZE
+# endif
 #endif
+
 #ifndef HAVE_GETPAGESIZE
-#include <sys/param.h>
-#ifdef EXEC_PAGESIZE
-#define getpagesize() EXEC_PAGESIZE
-#else
-#ifdef NBPG
-#define getpagesize() NBPG * CLSIZE
-#ifndef CLSIZE
-#define CLSIZE 1
-#endif /* no CLSIZE */
-#else /* no NBPG */
-#ifdef NBPC
-#define getpagesize() NBPC
-#else /* no NBPC */
-#define getpagesize() PAGESIZE /* SVR4 */
-#endif /* no NBPC */
-#endif /* no NBPG */
-#endif /* no EXEC_PAGESIZE */
-#endif /* not HAVE_GETPAGESIZE */
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+#  define getpagesize() EXEC_PAGESIZE
+# else
+#  ifdef NBPG
+#   define getpagesize() NBPG * CLSIZE
+#   ifndef CLSIZE
+#    define CLSIZE 1
+#   endif
+#  else
+#   ifdef NBPC
+#    define getpagesize() NBPC
+#   else
+#    define getpagesize() PAGESIZE /* SVR4 */
+#   endif
+#  endif
+# endif
+#endif
 
 #ifdef __osf__
-#define valloc malloc
+# define valloc malloc
 #endif
 
-extern char *valloc();
-extern char *malloc();
+#ifdef __cplusplus
+extern "C" { char *valloc(int), *malloc(int); }
+#else
+char *valloc(), *malloc();
+#endif
 
 int
 main()
@@ -845,20 +851,21 @@ fi
 
 AC_MSG_CHECKING([for alloca])
 AC_CACHE_VAL(ac_cv_func_alloca,
-[AC_TRY_LINK([#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#if HAVE_ALLOCA_H
-#include <alloca.h>
+[AC_TRY_LINK([
+#ifdef __GNUC__
+# define alloca __builtin_alloca
 #else
-#ifdef _AIX
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+#  ifdef _AIX
  #pragma alloca
-#else
-#ifndef alloca /* predefined by HP cc +Olibcalls */
+#  else
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
-#endif
-#endif
-#endif
+#   endif
+#  endif
+# endif
 #endif
 ], [char *p = (char *) alloca(1);],
   ac_cv_func_alloca=yes, ac_cv_func_alloca=no)])dnl
index 09d7878918a89761ffa9d835b16a4ebe13e4110c..6b5392a89192531f4889de706b43cacd5c91fe99 100644 (file)
@@ -1858,10 +1858,12 @@ is not changed.  Calls @code{AC_SUBST} for @var{variable}.
 This macro is equivalent to calling @code{AC_CHECK_LIB} with a
 @var{function} argument of @code{main}.  In addition, @var{library} can
 be written as any of @samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}.  In
-all of those cases, the compiler is passed @samp{-lfoo}.  This macro is
-considered obsolete, because some linkers (e.g., Apollo's) do not fail
-when asked to link with a nonexistent library if there are no unresolved
-sybols.
+all of those cases, the compiler is passed @samp{-lfoo}.  However,
+@var{library} can not be a shell variable; it must be a constant.
+
+This macro is considered obsolete, because some linkers (e.g., Apollo's)
+do not fail when asked to link with a nonexistent library if there are
+no unresolved sybols.
 @end defmac
 
 @defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@@ -2080,7 +2082,8 @@ the option which looks like this:
 @noindent
 @var{help-string} may be more than one line long, if more detail is
 needed.  Just make sure the columns line up in @samp{configure --help}.
-Avoid tabs in the help string.
+Avoid tabs in the help string.  You'll need to enclose it in @samp{[}
+and @samp{]} in order to produce the leading spaces.
 
 The name @var{feature} should consist only of alphanumeric characters
 and dashes.  The @var{feature} indicates an optional user-level
@@ -2117,7 +2120,8 @@ the option which looks like this:
 @noindent
 @var{help-string} may be more than one line long, if more detail is
 needed.  Just make sure the columns line up in @samp{configure --help}.
-Avoid tabs in the help string.
+Avoid tabs in the help string.  You'll need to enclose it in @samp{[}
+and @samp{]} in order to produce the leading spaces.
 
 The name @var{package} should consist only of alphanumeric characters
 and dashes.  The @var{package} indicates another software package that
@@ -2976,6 +2980,18 @@ foo(i) int i;
 #endif
 @end example
 
+Functions that test programs declare should also be conditionalized for
+C++, which requires @samp{extern "C"} prototypes.  Make sure to not
+include any header files containing clashing prototypes.
+
+@example
+#ifdef __cplusplus
+extern "C" char *malloc(int);
+#else
+char *malloc();
+#endif
+@end example
+
 Test programs can use @code{#if} or @code{#ifdef} to check the values of
 preprocessor macros defined by tests that have already run.  For
 example, if you call @code{AC_HEADER_STDC}, then later on in
index 09d7878918a89761ffa9d835b16a4ebe13e4110c..6b5392a89192531f4889de706b43cacd5c91fe99 100644 (file)
@@ -1858,10 +1858,12 @@ is not changed.  Calls @code{AC_SUBST} for @var{variable}.
 This macro is equivalent to calling @code{AC_CHECK_LIB} with a
 @var{function} argument of @code{main}.  In addition, @var{library} can
 be written as any of @samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}.  In
-all of those cases, the compiler is passed @samp{-lfoo}.  This macro is
-considered obsolete, because some linkers (e.g., Apollo's) do not fail
-when asked to link with a nonexistent library if there are no unresolved
-sybols.
+all of those cases, the compiler is passed @samp{-lfoo}.  However,
+@var{library} can not be a shell variable; it must be a constant.
+
+This macro is considered obsolete, because some linkers (e.g., Apollo's)
+do not fail when asked to link with a nonexistent library if there are
+no unresolved sybols.
 @end defmac
 
 @defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@@ -2080,7 +2082,8 @@ the option which looks like this:
 @noindent
 @var{help-string} may be more than one line long, if more detail is
 needed.  Just make sure the columns line up in @samp{configure --help}.
-Avoid tabs in the help string.
+Avoid tabs in the help string.  You'll need to enclose it in @samp{[}
+and @samp{]} in order to produce the leading spaces.
 
 The name @var{feature} should consist only of alphanumeric characters
 and dashes.  The @var{feature} indicates an optional user-level
@@ -2117,7 +2120,8 @@ the option which looks like this:
 @noindent
 @var{help-string} may be more than one line long, if more detail is
 needed.  Just make sure the columns line up in @samp{configure --help}.
-Avoid tabs in the help string.
+Avoid tabs in the help string.  You'll need to enclose it in @samp{[}
+and @samp{]} in order to produce the leading spaces.
 
 The name @var{package} should consist only of alphanumeric characters
 and dashes.  The @var{package} indicates another software package that
@@ -2976,6 +2980,18 @@ foo(i) int i;
 #endif
 @end example
 
+Functions that test programs declare should also be conditionalized for
+C++, which requires @samp{extern "C"} prototypes.  Make sure to not
+include any header files containing clashing prototypes.
+
+@example
+#ifdef __cplusplus
+extern "C" char *malloc(int);
+#else
+char *malloc();
+#endif
+@end example
+
 Test programs can use @code{#if} or @code{#ifdef} to check the values of
 preprocessor macros defined by tests that have already run.  For
 example, if you call @code{AC_HEADER_STDC}, then later on in
index dba47d44ce6f8eb27e099a3e59629b7af750a136..887da666daf19427b4ec9b4cf1b546b4b824455a 100644 (file)
@@ -472,25 +472,27 @@ AC_CACHE_VAL(ac_cv_header_stat_broken,
 [AC_EGREP_CPP([You lose], [#include <sys/types.h>
 #include <sys/stat.h>
 #ifdef S_ISBLK
-#if S_ISBLK (S_IFDIR)
+# if S_ISBLK (S_IFDIR)
 You lose.
-#endif
-#ifdef S_IFCHR
-#if S_ISBLK (S_IFCHR)
+# endif
+# ifdef S_IFCHR
+#  if S_ISBLK (S_IFCHR)
 You lose.
+#  endif
+# endif
 #endif
-#endif /* S_IFCHR */
-#endif /* S_ISBLK */
+
 #ifdef S_ISLNK
-#if S_ISLNK (S_IFREG)
+# if S_ISLNK (S_IFREG)
 You lose.
+# endif
 #endif
-#endif /* S_ISLNK */
+
 #ifdef S_ISSOCK
-#if S_ISSOCK (S_IFREG)
+# if S_ISSOCK (S_IFREG)
 You lose.
+# endif
 #endif
-#endif /* S_ISSOCK */
 ], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])dnl
 AC_MSG_RESULT($ac_cv_header_stat_broken)
 if test $ac_cv_header_stat_broken = yes; then
@@ -604,36 +606,40 @@ AC_CACHE_VAL(ac_cv_func_mmap,
 #include <sys/mman.h>
 
 #ifdef BSD
-#ifndef BSD4_1
-#define HAVE_GETPAGESIZE
-#endif
+# ifndef BSD4_1
+#  define HAVE_GETPAGESIZE
+# endif
 #endif
+
 #ifndef HAVE_GETPAGESIZE
-#include <sys/param.h>
-#ifdef EXEC_PAGESIZE
-#define getpagesize() EXEC_PAGESIZE
-#else
-#ifdef NBPG
-#define getpagesize() NBPG * CLSIZE
-#ifndef CLSIZE
-#define CLSIZE 1
-#endif /* no CLSIZE */
-#else /* no NBPG */
-#ifdef NBPC
-#define getpagesize() NBPC
-#else /* no NBPC */
-#define getpagesize() PAGESIZE /* SVR4 */
-#endif /* no NBPC */
-#endif /* no NBPG */
-#endif /* no EXEC_PAGESIZE */
-#endif /* not HAVE_GETPAGESIZE */
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+#  define getpagesize() EXEC_PAGESIZE
+# else
+#  ifdef NBPG
+#   define getpagesize() NBPG * CLSIZE
+#   ifndef CLSIZE
+#    define CLSIZE 1
+#   endif
+#  else
+#   ifdef NBPC
+#    define getpagesize() NBPC
+#   else
+#    define getpagesize() PAGESIZE /* SVR4 */
+#   endif
+#  endif
+# endif
+#endif
 
 #ifdef __osf__
-#define valloc malloc
+# define valloc malloc
 #endif
 
-extern char *valloc();
-extern char *malloc();
+#ifdef __cplusplus
+extern "C" { char *valloc(int), *malloc(int); }
+#else
+char *valloc(), *malloc();
+#endif
 
 int
 main()
@@ -845,20 +851,21 @@ fi
 
 AC_MSG_CHECKING([for alloca])
 AC_CACHE_VAL(ac_cv_func_alloca,
-[AC_TRY_LINK([#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#if HAVE_ALLOCA_H
-#include <alloca.h>
+[AC_TRY_LINK([
+#ifdef __GNUC__
+# define alloca __builtin_alloca
 #else
-#ifdef _AIX
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+#  ifdef _AIX
  #pragma alloca
-#else
-#ifndef alloca /* predefined by HP cc +Olibcalls */
+#  else
+#   ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
-#endif
-#endif
-#endif
+#   endif
+#  endif
+# endif
 #endif
 ], [char *p = (char *) alloca(1);],
   ac_cv_func_alloca=yes, ac_cv_func_alloca=no)])dnl