Skip to content

Commit 169d729

Browse files
committed
snapshot of project "my-autoconf", label t19970906
1 parent cfc3ea1 commit 169d729

40 files changed

+1541
-5
lines changed

AcSplit/CF_AC_PREREQ

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56
2+
dnl ------------
3+
dnl Conditionally generate script according to whether we're using the release
4+
dnl version of autoconf, or a patched version (using the ternary component as
5+
dnl the patch-version).
6+
define(CF_AC_PREREQ,
7+
[CF_PREREQ_COMPARE(
8+
AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
9+
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl

AcSplit/CF_ADA_INCLUDE_DIRS

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
dnl Construct the list of include-options for the C programs in the Ada95
2+
dnl binding.
3+
AC_DEFUN([CF_ADA_INCLUDE_DIRS],
4+
[
5+
ACPPFLAGS="$ACPPFLAGS -I. -I../../include"
6+
if test "$srcdir" != "."; then
7+
ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include"
8+
fi
9+
if test -z "$GCC"; then
10+
ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
11+
elif test "$includedir" != "/usr/include"; then
12+
if test "$includedir" = '${prefix}/include' ; then
13+
if test $prefix != /usr ; then
14+
ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
15+
fi
16+
else
17+
ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
18+
fi
19+
fi
20+
AC_SUBST(ACPPFLAGS)
21+
])dnl

AcSplit/CF_ANSI_CC_CHECK

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
2+
dnl in the sharutils 4.2 distribution.
3+
AC_DEFUN([CF_ANSI_CC_CHECK],
4+
[
5+
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
6+
AC_CACHE_VAL(cf_cv_ansi_cc,[
7+
cf_cv_ansi_cc=no
8+
cf_save_CFLAGS="$CFLAGS"
9+
# Don't try gcc -ansi; that turns off useful extensions and
10+
# breaks some systems' header files.
11+
# AIX -qlanglvl=ansi
12+
# Ultrix and OSF/1 -std1
13+
# HP-UX -Aa -D_HPUX_SOURCE
14+
# SVR4 -Xc
15+
# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
16+
for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
17+
do
18+
CFLAGS="$cf_save_CFLAGS $cf_arg"
19+
AC_TRY_COMPILE(
20+
[
21+
#ifndef CC_HAS_PROTOS
22+
#if !defined(__STDC__) || __STDC__ != 1
23+
choke me
24+
#endif
25+
#endif
26+
],[
27+
int test (int i, double x);
28+
struct s1 {int (*f) (int a);};
29+
struct s2 {int (*f) (double a);};],
30+
[cf_cv_ansi_cc="$cf_arg"; break])
31+
done
32+
CFLAGS="$cf_save_CFLAGS"
33+
])
34+
AC_MSG_RESULT($cf_cv_ansi_cc)
35+
36+
if test "$cf_cv_ansi_cc" != "no"; then
37+
if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
38+
CFLAGS="$CFLAGS $cf_cv_ansi_cc"
39+
else
40+
AC_DEFINE(CC_HAS_PROTOS)
41+
fi
42+
fi
43+
])dnl

AcSplit/CF_ANSI_CC_REQD

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
2+
dnl ---------------
3+
dnl For programs that must use an ANSI compiler, obtain compiler options that
4+
dnl will make it recognize prototypes. We'll do preprocessor checks in other
5+
dnl macros, since tools such as unproto can fake prototypes, but only part of
6+
dnl the preprocessor.
7+
AC_DEFUN([CF_ANSI_CC_REQD],
8+
[AC_REQUIRE([CF_ANSI_CC_CHECK])
9+
if test "$cf_cv_ansi_cc" = "no"; then
10+
AC_ERROR(
11+
[Your compiler does not appear to recognize prototypes.
12+
You have the following choices:
13+
a. adjust your compiler options
14+
b. get an up-to-date compiler
15+
c. use a wrapper such as unproto])
16+
fi
17+
])dnl

AcSplit/CF_ANSI_QSORT

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dnl Test if we should use ANSI-style prototype for qsort's compare-function
2+
AC_DEFUN([CF_ANSI_QSORT],
3+
[
4+
AC_MSG_CHECKING([for standard qsort])
5+
AC_CACHE_VAL(cf_cv_ansi_qsort,[
6+
AC_TRY_COMPILE([
7+
#if HAVE_STDLIB_H
8+
#include <stdlib.h>
9+
#endif
10+
int compare(const void *a, const void *b)
11+
{ return (*(int *)a - *(int *)b); } ],
12+
[ extern long *vector;
13+
qsort(vector, 1, 1, compare); ],
14+
[cf_cv_ansi_qsort=yes],
15+
[cf_cv_ansi_qsort=no])
16+
])
17+
AC_MSG_RESULT($cf_cv_ansi_qsort)
18+
if test $cf_cv_ansi_qsort = yes; then
19+
AC_DEFINE(ANSI_QSORT,1)
20+
else
21+
AC_DEFINE(ANSI_QSORT,0)
22+
fi
23+
])dnl

AcSplit/CF_BOOL_DECL

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some
2+
dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc
3+
dnl 2.6.3 does, in anticipation of the ANSI C++ standard.
4+
dnl
5+
dnl Treat the configuration-variable specially here, since we're directly
6+
dnl substituting its value (i.e., 1/0).
7+
AC_DEFUN([CF_BOOL_DECL],
8+
[
9+
AC_MSG_CHECKING([for builtin c++ bool type])
10+
AC_CACHE_VAL(cf_cv_builtin_bool,[
11+
AC_TRY_COMPILE([],[bool x = false],
12+
[cf_cv_builtin_bool=1],
13+
[cf_cv_builtin_bool=0])
14+
])
15+
if test $cf_cv_builtin_bool = 1
16+
then AC_MSG_RESULT(yes)
17+
else AC_MSG_RESULT(no)
18+
fi
19+
])dnl

AcSplit/CF_BOOL_SIZE

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type).
2+
dnl Don't bother looking for bool.h, since it's been deprecated.
3+
AC_DEFUN([CF_BOOL_SIZE],
4+
[
5+
AC_MSG_CHECKING([for size of c++ bool])
6+
AC_CACHE_VAL(cf_cv_type_of_bool,[
7+
rm -f cf_test.out
8+
AC_TRY_RUN([
9+
#include <stdlib.h>
10+
#include <stdio.h>
11+
#if HAVE_BUILTIN_H
12+
#include <builtin.h>
13+
#endif
14+
main()
15+
{
16+
FILE *fp = fopen("cf_test.out", "w");
17+
if (fp != 0) {
18+
bool x = false;
19+
if (sizeof(x) == sizeof(int)) fputs("int", fp);
20+
else if (sizeof(x) == sizeof(char)) fputs("char", fp);
21+
else if (sizeof(x) == sizeof(short))fputs("short",fp);
22+
else if (sizeof(x) == sizeof(long)) fputs("long", fp);
23+
fclose(fp);
24+
}
25+
exit(0);
26+
}
27+
],
28+
[cf_cv_type_of_bool=`cat cf_test.out`],
29+
[cf_cv_type_of_bool=unknown],
30+
[cf_cv_type_of_bool=unknown])
31+
])
32+
rm -f cf_test.out
33+
AC_MSG_RESULT($cf_cv_type_of_bool)
34+
if test $cf_cv_type_of_bool = unknown ; then
35+
AC_MSG_WARN(Assuming unsigned for type of bool)
36+
cf_cv_type_of_bool=unsigned
37+
fi
38+
])dnl

AcSplit/CF_CFG_DEFAULTS

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
dnl Determine the default configuration into which we'll install ncurses. This
2+
dnl can be overridden by the user's command-line options. There's two items to
3+
dnl look for:
4+
dnl 1. the prefix (e.g., /usr)
5+
dnl 2. the header files (e.g., /usr/include/ncurses)
6+
dnl We'll look for a previous installation of ncurses and use the same defaults.
7+
dnl
8+
dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and
9+
dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's
10+
dnl programs from a vendor's.
11+
AC_DEFUN([CF_CFG_DEFAULTS],
12+
[
13+
AC_MSG_CHECKING(for prefix)
14+
if test "x$prefix" = "xNONE" ; then
15+
case "$cf_cv_systype" in
16+
# non-vendor systems don't have a conflict
17+
OpenBSD|NetBSD|FreeBSD|Linux) prefix=/usr
18+
;;
19+
*) prefix=$ac_default_prefix
20+
;;
21+
esac
22+
fi
23+
AC_MSG_RESULT($prefix)
24+
if test "x$prefix" = "xNONE" ; then
25+
AC_MSG_CHECKING(for default include-directory)
26+
test -n "$verbose" && echo 1>&6
27+
for cf_symbol in \
28+
$includedir \
29+
$includedir/ncurses \
30+
$prefix/include \
31+
$prefix/include/ncurses \
32+
/usr/local/include \
33+
/usr/local/include/ncurses \
34+
/usr/include \
35+
/usr/include/ncurses
36+
do
37+
cf_dir=`eval echo $cf_symbol`
38+
if test -f $cf_dir/curses.h ; then
39+
if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
40+
includedir="$cf_symbol"
41+
test -n "$verbose" && echo $ac_n " found " 1>&6
42+
break
43+
fi
44+
fi
45+
test -n "$verbose" && echo " tested $cf_dir" 1>&6
46+
done
47+
AC_MSG_RESULT($includedir)
48+
fi
49+
])dnl

AcSplit/CF_CURSES_TERM_H

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dnl SVr4 curses should have term.h as well (where it puts the definitions of
2+
dnl the low-level interface). This may not be true in old/broken implementations,
3+
dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
4+
dnl running with Solaris 2.5.1).
5+
AC_DEFUN([CF_CURSES_TERM_H],
6+
[
7+
AC_MSG_CHECKING([for term.h])
8+
AC_CACHE_VAL(cf_cv_have_term_h,[
9+
AC_TRY_COMPILE([
10+
#include <curses.h>
11+
#include <term.h>],
12+
[WINDOW *x],
13+
[cf_cv_have_term_h=yes],
14+
[cf_cv_have_term_h=no])
15+
])
16+
AC_MSG_RESULT($cf_cv_have_term_h)
17+
test $cf_cv_have_term_h = yes && AC_DEFINE(HAVE_TERM_H)
18+
])dnl

AcSplit/CF_CXX_LIBRARY

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dnl CF_CXX_LIBRARY version: 2 updated: 1997/09/06 23:41:28
2+
dnl --------------
3+
dnl If we're trying to use g++, test if libg++ is installed (a rather common
4+
dnl problem :-). If we have the compiler but no library, we'll be able to
5+
dnl configure, but won't be able to build the c++ demo program.
6+
AC_DEFUN([CF_CXX_LIBRARY],
7+
[
8+
cf_cxx_library=unknown
9+
if test $ac_cv_prog_gxx = yes; then
10+
AC_MSG_CHECKING([for libg++])
11+
cf_save="$LIBS"
12+
LIBS="$LIBS -lg++ -lm"
13+
AC_TRY_LINK([
14+
#include <builtin.h>
15+
],
16+
[float foo=abs(1.0)],
17+
[cf_cxx_library=yes
18+
CXXLIBS="$CXXLIBS -lg++ -lm"],
19+
[cf_cxx_library=no])
20+
LIBS="$cf_save"
21+
AC_MSG_RESULT($cf_cxx_library)
22+
fi
23+
])dnl

0 commit comments

Comments
 (0)