2000-02-07 19:54:29 +08:00
|
|
|
# -*- autoconf -*-
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
2000-02-08 21:25:49 +08:00
|
|
|
Semantics.
|
2000-02-07 19:54:29 +08:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2000-02-08 01:28:43 +08:00
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_TRY_LINK_FUNC
|
|
|
|
# ----------------
|
2000-09-20 02:08:38 +08:00
|
|
|
AT_CHECK_MACRO(AC_TRY_LINK_FUNC,
|
2000-10-27 22:15:28 +08:00
|
|
|
[AC_TRY_LINK_FUNC(exit,,
|
|
|
|
[AC_MSG_ERROR([cannot find `exit'])])
|
2000-03-25 17:06:24 +08:00
|
|
|
AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
|
2000-10-27 22:15:28 +08:00
|
|
|
[AC_MSG_ERROR([found a nonexistent function])])])
|
2000-03-25 17:06:24 +08:00
|
|
|
|
|
|
|
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 21:09:05 +08:00
|
|
|
|
|
|
|
## -------------------------------- ##
|
|
|
|
## Members of the AC_CHECK family. ##
|
|
|
|
## -------------------------------- ##
|
|
|
|
|
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_LIB
|
|
|
|
# ------------
|
|
|
|
# Well, I can't imagine a system where `cos' is neither in libc, nor
|
|
|
|
# in libm. Nor can I imagine a lib more likely to exists than libm.
|
2000-04-11 20:07:45 +08:00
|
|
|
# But there are systems without libm, on which we don't want to have
|
2000-03-25 17:06:24 +08:00
|
|
|
# this test fail, so exit successfully if `cos' is in libc.
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_LIB],
|
2000-11-02 03:57:54 +08:00
|
|
|
[AC_TRY_LINK_FUNC(cos, [AS_EXIT(0)])
|
2000-10-27 22:15:28 +08:00
|
|
|
AC_CHECK_LIB(m, cos,,
|
|
|
|
[AC_MSG_ERROR([cannot find `cos'])])])
|
2000-03-25 17:06:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
# AC_CHECK_DECLS
|
|
|
|
# --------------
|
|
|
|
# Check that it performs the correct actions:
|
|
|
|
# Must define NEED_NO_DECL, but not NEED_YES_DECL.
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_DECLS],
|
2000-05-11 00:16:31 +08:00
|
|
|
[[AC_CHECK_DECLS([yes, no],,,
|
|
|
|
[int yes = 1;])]],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AT_CHECK_DEFINES(
|
2000-02-15 17:33:59 +08:00
|
|
|
[#define HAVE_DECL_NO 0
|
|
|
|
#define HAVE_DECL_YES 1
|
2000-02-08 01:28:43 +08:00
|
|
|
])])
|
|
|
|
|
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_FUNCS
|
|
|
|
# --------------
|
|
|
|
# Check that it performs the correct actions:
|
|
|
|
# Must define HAVE_EXIT, but not HAVE_AUTOCONF_TIXE
|
2000-11-03 19:59:39 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_FUNCS],
|
|
|
|
[AC_CHECK_FUNCS(exit autoconf_tixe)],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_AUTOCONF_TIXE */
|
|
|
|
#define HAVE_EXIT 1
|
|
|
|
])])
|
|
|
|
|
|
|
|
|
|
|
|
# AC_HAVE_FUNCS
|
|
|
|
# -------------
|
|
|
|
# This macro is an obsolete version of AC_CHECK_FUNCS. Running this
|
|
|
|
# test allows to check that AU_ALIAS'ed macros work properly.
|
|
|
|
AT_CHECK_MACRO([AC_HAVE_FUNCS],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AC_CHECK_FUNCS(exit autoconf_tixe)],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_AUTOCONF_TIXE */
|
|
|
|
#define HAVE_EXIT 1
|
|
|
|
])])
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_HEADERS
|
|
|
|
# ----------------
|
|
|
|
# Check that it performs the correct actions:
|
|
|
|
# Must define HAVE_STDIO_H, but not HAVE_AUTOCONF_IO_H.
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_HEADERS],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AC_CHECK_HEADERS(stdio.h autoconf_io.h)],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_AUTOCONF_IO_H */
|
|
|
|
#define HAVE_STDIO_H 1
|
|
|
|
])])
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_MEMBERS
|
|
|
|
# ----------------
|
|
|
|
# Check that it performs the correct actions.
|
2000-04-11 20:07:45 +08:00
|
|
|
# Must define HAVE_STRUCT_YES_S_YES, but not HAVE_STRUCT_YES_S_NO.
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_MEMBERS],
|
2000-05-11 00:16:31 +08:00
|
|
|
[[AC_CHECK_MEMBERS([struct yes_s.yes, struct yes_s.no],,,
|
|
|
|
[struct yes_s { int yes ;} ;])]],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AT_CHECK_DEFINES(
|
2000-04-11 20:07:45 +08:00
|
|
|
[/* #undef HAVE_STRUCT_YES_S_NO */
|
|
|
|
#define HAVE_STRUCT_YES_S_YES 1
|
2000-02-07 19:54:29 +08:00
|
|
|
])])
|
|
|
|
|
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_SIZEOF
|
2000-04-11 20:07:45 +08:00
|
|
|
# ---------------
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_SIZEOF],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AC_CHECK_SIZEOF(char)
|
|
|
|
AC_CHECK_SIZEOF(charchar,,
|
|
|
|
[#include <stdio.h>
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char a;
|
|
|
|
char b;
|
2000-05-26 19:33:54 +08:00
|
|
|
} charchar;])
|
|
|
|
AC_CHECK_SIZEOF(charcharchar)
|
|
|
|
|
|
|
|
# Exercize the code used when cross-compiling
|
|
|
|
cross_compiling=yes
|
|
|
|
AC_CHECK_SIZEOF(unsigned char)
|
|
|
|
AC_CHECK_SIZEOF(ucharchar,,
|
|
|
|
[#include <stdio.h>
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned char a;
|
|
|
|
unsigned char b;
|
|
|
|
} ucharchar;])
|
|
|
|
AC_CHECK_SIZEOF(ucharcharchar)],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[#define SIZEOF_CHAR 1
|
|
|
|
#define SIZEOF_CHARCHAR 2
|
2000-05-26 19:33:54 +08:00
|
|
|
#define SIZEOF_CHARCHARCHAR 0
|
|
|
|
#define SIZEOF_UCHARCHAR 2
|
|
|
|
#define SIZEOF_UCHARCHARCHAR 0
|
|
|
|
#define SIZEOF_UNSIGNED_CHAR 1
|
2000-02-07 19:54:29 +08:00
|
|
|
])])
|
|
|
|
|
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_TYPES
|
|
|
|
# --------------
|
|
|
|
# Check that it performs the correct actions.
|
2000-04-11 20:07:45 +08:00
|
|
|
# Must define HAVE_STRUCT_YES_S, HAVE_INT, but not HAVE_STRUCT_NO_S.
|
|
|
|
# `int' and `struct yes_s' are both checked to test both the compiler
|
2000-03-25 17:06:24 +08:00
|
|
|
# builtin types, and defined types.
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_TYPES],
|
2000-05-11 00:16:31 +08:00
|
|
|
[[AC_CHECK_TYPES([int, struct yes_s, struct no_s],,,
|
|
|
|
[struct yes_s { int yes ;} ;])]],
|
2000-02-08 01:28:43 +08:00
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[#define HAVE_INT 1
|
2000-04-11 20:07:45 +08:00
|
|
|
/* #undef HAVE_STRUCT_NO_S */
|
|
|
|
#define HAVE_STRUCT_YES_S 1
|
2000-02-07 19:54:29 +08:00
|
|
|
])])
|
2000-02-10 17:40:55 +08:00
|
|
|
|
|
|
|
|
2000-04-11 20:07:45 +08:00
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_TYPES
|
|
|
|
# --------------
|
|
|
|
# Check that we properly dispatch properly to the old implementation
|
|
|
|
# or to the new one.
|
2000-02-10 18:24:10 +08:00
|
|
|
AT_SETUP([AC_CHECK_TYPES])
|
|
|
|
|
|
|
|
AT_DATA(configure.in,
|
|
|
|
[[AC_INIT
|
Get rid of the m4 name spaces.
* libm4.m4 (m4_changequote, m4_define, m4_defn, m4_dnl, m4_indir,
m4_popdef, m4_pushdef, m4_undefine, m4_namespace_push,
m4_namespace_pop, m4_namespace_register, m4_namespace_define,
m4_disable, m4_enable): Removed.
All dependencies adjusted.
* libm4.m4: Remove all the name space initialization.
* acgeneral.m4: Adjust.
(AU_DEFINE): Redefine as `AC_DEFUN'.
* autoupdate.m4: Adjust.
* tests/tools.m4: Temporarily disable the `autoupdate' test.
2000-05-11 21:28:47 +08:00
|
|
|
define([_AC_CHECK_TYPE_NEW], [NEW])
|
|
|
|
define([_AC_CHECK_TYPE_OLD], [OLD])
|
2000-02-10 18:24:10 +08:00
|
|
|
#(cut-from-here
|
|
|
|
AC_CHECK_TYPE(ptrdiff_t)
|
|
|
|
AC_CHECK_TYPE(ptrdiff_t, int)
|
|
|
|
AC_CHECK_TYPE(quad, long long)
|
|
|
|
AC_CHECK_TYPE(table_42, [int[42]])
|
2000-03-25 17:06:24 +08:00
|
|
|
# Nice machine!
|
2000-02-10 18:24:10 +08:00
|
|
|
AC_CHECK_TYPE(uint8_t, uint65536_t)
|
|
|
|
AC_CHECK_TYPE(a,b,c,d)
|
|
|
|
#to-here)
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
2000-07-19 17:03:53 +08:00
|
|
|
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0,,
|
2000-02-10 18:24:10 +08:00
|
|
|
[configure.in:10: warning: AC_CHECK_TYPE: assuming `uint65536_t' is not a type
|
|
|
|
])
|
2000-02-17 17:38:08 +08:00
|
|
|
AT_CHECK([[sed -e '/^#(cut-from-here/,/^#to-here)/!d' -e '/^#/d' configure]],
|
2000-02-10 18:24:10 +08:00
|
|
|
0,
|
|
|
|
[NEW
|
|
|
|
OLD
|
|
|
|
OLD
|
|
|
|
OLD
|
|
|
|
NEW
|
|
|
|
NEW
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CLEANUP(autoconf.err)
|
|
|
|
|
|
|
|
|
2000-02-10 17:40:55 +08:00
|
|
|
|
2000-03-25 17:06:24 +08:00
|
|
|
# AC_CHECK_FILES
|
|
|
|
# --------------
|
|
|
|
# FIXME: To really test HAVE_AC_EXISTS2 and HAVE_AC_MISSING2 we need to
|
|
|
|
# open AH_TEMPLATE to `configure.in', which is not yet the case.
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_FILES],
|
2000-02-10 17:40:55 +08:00
|
|
|
[touch ac-exists1 ac-exists2
|
|
|
|
ac_exists2=ac-exists2
|
|
|
|
ac_missing2=ac-missing2
|
|
|
|
AC_CHECK_FILES(ac-exists1 ac-missing1 $ac_exists2 $ac_missing2)
|
|
|
|
rm ac-exists1 ac-exists2],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[#define HAVE_AC_EXISTS1 1
|
|
|
|
/* #undef HAVE_AC_MISSING1 */
|
|
|
|
])])
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-03-21 20:22:27 +08:00
|
|
|
## ------------------------------ ##
|
|
|
|
## AC_CHECK_PROG & AC_PATH_PROG. ##
|
|
|
|
## ------------------------------ ##
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
|
2000-10-27 22:15:28 +08:00
|
|
|
# AT_CHECK_PROGS_PREPARE
|
|
|
|
# ----------------------
|
2000-03-03 22:15:41 +08:00
|
|
|
# Create a sub directory `path' with 6 subdirs which all 7 contain
|
|
|
|
# an executable `tool'. `6' contains a `better' tool.
|
2000-11-29 18:11:38 +08:00
|
|
|
m4_define([AT_CHECK_PROGS_PREPARE],
|
2000-10-27 22:15:28 +08:00
|
|
|
[mkdir path
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
cat >path/tool <<\EOF
|
|
|
|
#! /bin/sh
|
|
|
|
exit 0
|
|
|
|
EOF
|
|
|
|
chmod +x path/tool
|
|
|
|
|
|
|
|
for i in 1 2 3 4 5 6
|
|
|
|
do
|
|
|
|
mkdir path/$i
|
|
|
|
cp path/tool path/$i
|
|
|
|
done
|
2000-10-27 22:15:28 +08:00
|
|
|
cp path/tool path/6/better])
|
2000-03-03 22:15:41 +08:00
|
|
|
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
# -------------------------------- #
|
|
|
|
# AC_CHECK_PROG & AC_CHECK_PROGS. #
|
|
|
|
# -------------------------------- #
|
|
|
|
|
2000-11-29 18:11:38 +08:00
|
|
|
AT_SETUP([AC_CHECK_PROG & AC_CHECK_PROGS])
|
2000-10-27 22:15:28 +08:00
|
|
|
|
|
|
|
AT_CHECK_PROGS_PREPARE
|
|
|
|
|
2000-03-03 22:15:41 +08:00
|
|
|
AT_DATA(configure.in,
|
|
|
|
[[AC_INIT
|
2000-03-21 20:22:27 +08:00
|
|
|
pwd=`pwd`
|
|
|
|
path=`echo "1:2:3:4:5:6" | sed -e 's,\([[0-9]]\),'"$pwd"'/path/\1,g'`
|
2000-10-27 22:15:28 +08:00
|
|
|
fail=false
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
AC_CHECK_PROG(TOOL1, tool, found, not-found, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL1" = found || fail=:
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
# Yes, the semantics of this macro is weird.
|
|
|
|
AC_CHECK_PROG(TOOL2, tool,, not-found, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL2" = not-found || fail=:
|
2000-03-03 22:15:41 +08:00
|
|
|
|
2000-03-21 20:22:27 +08:00
|
|
|
AC_CHECK_PROG(TOOL3, tool, tool, not-found, $path, $pwd/path/1/tool)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL3" = $pwd/path/2/tool || fail=:
|
2000-03-03 22:15:41 +08:00
|
|
|
|
2000-03-21 20:22:27 +08:00
|
|
|
AC_CHECK_PROG(TOOL4, better, better, not-found, $path, $pwd/path/1/tool)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL4" = better || fail=:
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
# When a tool is not found, and no value is given for not-found,
|
|
|
|
# the variable is left empty.
|
|
|
|
AC_CHECK_PROGS(TOOL5, missing,, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test -z "$TOOL5" || fail=:
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
AC_CHECK_PROGS(TOOL6, missing tool better,, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL6" = tool || fail=:
|
2000-03-03 22:15:41 +08:00
|
|
|
|
|
|
|
# no AC_OUTPUT, we don't need config.status.
|
2000-10-27 22:15:28 +08:00
|
|
|
$fail &&
|
|
|
|
AC_MSG_ERROR([[CHECK_PROG failed]])
|
2000-11-02 03:57:54 +08:00
|
|
|
AS_EXIT(0)
|
2000-03-03 22:15:41 +08:00
|
|
|
]])
|
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
2000-03-03 22:15:41 +08:00
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CLEANUP(path)
|
2000-10-27 22:15:28 +08:00
|
|
|
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
# ------------------------------ #
|
|
|
|
# AC_PATH_PROG & AC_PATH_PROGS. #
|
|
|
|
# ------------------------------ #
|
|
|
|
|
2000-10-27 22:15:28 +08:00
|
|
|
AT_SETUP(AC_PATH_PROG & AC_PATH_PROGS)
|
|
|
|
|
|
|
|
AT_CHECK_PROGS_PREPARE
|
|
|
|
|
2000-03-21 20:22:27 +08:00
|
|
|
AT_DATA(configure.in,
|
|
|
|
[[AC_INIT
|
|
|
|
pwd=`pwd`
|
|
|
|
path=`echo "1:2:3:4:5:6" | sed -e 's,\([[0-9]]\),'"$pwd"'/path/\1,g'`
|
2000-10-27 22:15:28 +08:00
|
|
|
fail=false
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
AC_PATH_PROG(TOOL1, tool, not-found, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL1" = $pwd/path/1/tool || fail=:
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
AC_PATH_PROG(TOOL2, better, not-found, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL2" = $pwd/path/6/better || fail=:
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
# When a tool is not found, and no value is given for not-found,
|
|
|
|
# the variable is left empty.
|
|
|
|
AC_PATH_PROGS(TOOL3, missing,, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test -z "$TOOL3" || fail=:
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
AC_PATH_PROGS(TOOL4, missing tool better,, $path)
|
2000-10-27 22:15:28 +08:00
|
|
|
test "$TOOL4" = $pwd/path/1/tool || fail=:
|
2000-03-21 20:22:27 +08:00
|
|
|
|
|
|
|
# no AC_OUTPUT, we don't need config.status.
|
2000-10-27 22:15:28 +08:00
|
|
|
$fail &&
|
|
|
|
AC_MSG_ERROR([[PATH_PROG failed]])
|
2000-11-02 03:57:54 +08:00
|
|
|
AS_EXIT(0)
|
2000-03-21 20:22:27 +08:00
|
|
|
]])
|
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
2000-03-21 20:22:27 +08:00
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CLEANUP(path)
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 21:09:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------- ##
|
|
|
|
## Specific macros. ##
|
|
|
|
## ----------------- ##
|
|
|
|
|
|
|
|
|
2000-05-22 16:38:44 +08:00
|
|
|
# C compiler
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 21:09:05 +08:00
|
|
|
# ----------
|
|
|
|
# GCC supports `const', `volatile', and `inline'.
|
2000-09-20 02:08:38 +08:00
|
|
|
AT_CHECK_MACRO(C keywords,
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 21:09:05 +08:00
|
|
|
[[AC_PROG_CC
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_VOLATILE
|
|
|
|
case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in
|
2000-10-27 22:15:28 +08:00
|
|
|
yes,*no*)
|
|
|
|
AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);;
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 21:09:05 +08:00
|
|
|
esac]])
|
2000-06-26 18:20:36 +08:00
|
|
|
|
|
|
|
|
2000-09-19 18:37:57 +08:00
|
|
|
## ------------- ##
|
|
|
|
## AC_PROG_CPP. ##
|
|
|
|
## ------------- ##
|
|
|
|
|
|
|
|
|
|
|
|
# It's Ok for strict preprocessors to produce warnings.
|
|
|
|
|
|
|
|
AT_SETUP([AC_PROG_CPP with warnings])
|
|
|
|
|
|
|
|
AT_DATA([mycpp],
|
|
|
|
[[#! /bin/sh
|
|
|
|
echo noise >&2
|
2000-09-26 04:12:01 +08:00
|
|
|
exec ${1+"$@"}
|
2000-09-19 18:37:57 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
chmod +x mycpp
|
|
|
|
|
|
|
|
_AT_CHECK_AC_MACRO(
|
|
|
|
[AC_PROG_CPP
|
|
|
|
# If the preprocessor is not strict, just ignore
|
2000-10-27 22:15:28 +08:00
|
|
|
test "x$ac_c_preproc_warn_flag" = xyes &&
|
|
|
|
AC_MSG_ERROR([preprocessor has no warning option], 77)
|
2000-09-19 18:37:57 +08:00
|
|
|
CPP="./mycpp $CPP"
|
|
|
|
AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
|
|
|
|
|
|
|
|
AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_AUTOCONF_IO_H */
|
|
|
|
#define HAVE_STDIO_H 1
|
|
|
|
])
|
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CLEANUP()dnl
|
2000-09-19 18:37:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
# Non-strict preprocessors work if they produce no warnings.
|
|
|
|
|
|
|
|
AT_SETUP([AC_PROG_CPP without warnings])
|
|
|
|
|
|
|
|
AT_DATA([mycpp],
|
|
|
|
[[#! /bin/sh
|
|
|
|
/lib/cpp ${1+"$@"}
|
|
|
|
exit 0
|
|
|
|
]])
|
|
|
|
|
|
|
|
chmod +x mycpp
|
|
|
|
|
|
|
|
_AT_CHECK_AC_MACRO(
|
|
|
|
[# Ignore if /lib/cpp doesn't work
|
2000-10-27 22:15:28 +08:00
|
|
|
/lib/cpp </dev/null >/dev/null 2>&1 ||
|
|
|
|
AC_MSG_ERROR([preprocessor doesn't work], 77)
|
2000-09-19 18:37:57 +08:00
|
|
|
CPP=./mycpp
|
|
|
|
AC_PROG_CPP
|
2000-10-27 22:15:28 +08:00
|
|
|
test "x$ac_c_preproc_warn_flag" != xyes &&
|
|
|
|
AC_MSG_ERROR([failed to detect preprocessor warning option])
|
2000-09-19 18:37:57 +08:00
|
|
|
AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
|
|
|
|
|
|
|
|
AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_AUTOCONF_IO_H */
|
|
|
|
#define HAVE_STDIO_H 1
|
|
|
|
])
|
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CLEANUP()dnl
|