Permalink
Browse files

snapshot of project "my-autoconf", label t19970906

  • Loading branch information...
1 parent cfc3ea1 commit 169d729a45f2d1cda090478aed1fe4d1d044019d @ThomasDickey committed Sep 7, 1997
@@ -0,0 +1,9 @@
+dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56
+dnl ------------
+dnl Conditionally generate script according to whether we're using the release
+dnl version of autoconf, or a patched version (using the ternary component as
+dnl the patch-version).
+define(CF_AC_PREREQ,
+[CF_PREREQ_COMPARE(
+AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl
@@ -0,0 +1,21 @@
+dnl Construct the list of include-options for the C programs in the Ada95
+dnl binding.
+AC_DEFUN([CF_ADA_INCLUDE_DIRS],
+[
+ACPPFLAGS="$ACPPFLAGS -I. -I../../include"
+if test "$srcdir" != "."; then
+ ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include"
+fi
+if test -z "$GCC"; then
+ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
+elif test "$includedir" != "/usr/include"; then
+ if test "$includedir" = '${prefix}/include' ; then
+ if test $prefix != /usr ; then
+ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
+ fi
+ else
+ ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
+ fi
+fi
+AC_SUBST(ACPPFLAGS)
+])dnl
@@ -0,0 +1,43 @@
+dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
+dnl in the sharutils 4.2 distribution.
+AC_DEFUN([CF_ANSI_CC_CHECK],
+[
+AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(cf_cv_ansi_cc,[
+cf_cv_ansi_cc=no
+cf_save_CFLAGS="$CFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX -Aa -D_HPUX_SOURCE
+# SVR4 -Xc
+# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
+for cf_arg in "-DCC_HAS_PROTOS" "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
+do
+ CFLAGS="$cf_save_CFLAGS $cf_arg"
+ AC_TRY_COMPILE(
+[
+#ifndef CC_HAS_PROTOS
+#if !defined(__STDC__) || __STDC__ != 1
+choke me
+#endif
+#endif
+],[
+ int test (int i, double x);
+ struct s1 {int (*f) (int a);};
+ struct s2 {int (*f) (double a);};],
+ [cf_cv_ansi_cc="$cf_arg"; break])
+done
+CFLAGS="$cf_save_CFLAGS"
+])
+AC_MSG_RESULT($cf_cv_ansi_cc)
+
+if test "$cf_cv_ansi_cc" != "no"; then
+if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
+ CFLAGS="$CFLAGS $cf_cv_ansi_cc"
+else
+ AC_DEFINE(CC_HAS_PROTOS)
+fi
+fi
+])dnl
@@ -0,0 +1,17 @@
+dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
+dnl ---------------
+dnl For programs that must use an ANSI compiler, obtain compiler options that
+dnl will make it recognize prototypes. We'll do preprocessor checks in other
+dnl macros, since tools such as unproto can fake prototypes, but only part of
+dnl the preprocessor.
+AC_DEFUN([CF_ANSI_CC_REQD],
+[AC_REQUIRE([CF_ANSI_CC_CHECK])
+if test "$cf_cv_ansi_cc" = "no"; then
+ AC_ERROR(
+[Your compiler does not appear to recognize prototypes.
+You have the following choices:
+ a. adjust your compiler options
+ b. get an up-to-date compiler
+ c. use a wrapper such as unproto])
+fi
+])dnl
View
@@ -0,0 +1,23 @@
+dnl Test if we should use ANSI-style prototype for qsort's compare-function
+AC_DEFUN([CF_ANSI_QSORT],
+[
+AC_MSG_CHECKING([for standard qsort])
+AC_CACHE_VAL(cf_cv_ansi_qsort,[
+ AC_TRY_COMPILE([
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+ int compare(const void *a, const void *b)
+ { return (*(int *)a - *(int *)b); } ],
+ [ extern long *vector;
+ qsort(vector, 1, 1, compare); ],
+ [cf_cv_ansi_qsort=yes],
+ [cf_cv_ansi_qsort=no])
+])
+AC_MSG_RESULT($cf_cv_ansi_qsort)
+if test $cf_cv_ansi_qsort = yes; then
+ AC_DEFINE(ANSI_QSORT,1)
+else
+ AC_DEFINE(ANSI_QSORT,0)
+fi
+])dnl
View
@@ -0,0 +1,19 @@
+dnl Test if 'bool' is a builtin type in the configured C++ compiler. Some
+dnl older compilers (e.g., gcc 2.5.8) don't support 'bool' directly; gcc
+dnl 2.6.3 does, in anticipation of the ANSI C++ standard.
+dnl
+dnl Treat the configuration-variable specially here, since we're directly
+dnl substituting its value (i.e., 1/0).
+AC_DEFUN([CF_BOOL_DECL],
+[
+AC_MSG_CHECKING([for builtin c++ bool type])
+AC_CACHE_VAL(cf_cv_builtin_bool,[
+ AC_TRY_COMPILE([],[bool x = false],
+ [cf_cv_builtin_bool=1],
+ [cf_cv_builtin_bool=0])
+ ])
+if test $cf_cv_builtin_bool = 1
+then AC_MSG_RESULT(yes)
+else AC_MSG_RESULT(no)
+fi
+])dnl
View
@@ -0,0 +1,38 @@
+dnl Test for the size of 'bool' in the configured C++ compiler (e.g., a type).
+dnl Don't bother looking for bool.h, since it's been deprecated.
+AC_DEFUN([CF_BOOL_SIZE],
+[
+AC_MSG_CHECKING([for size of c++ bool])
+AC_CACHE_VAL(cf_cv_type_of_bool,[
+ rm -f cf_test.out
+ AC_TRY_RUN([
+#include <stdlib.h>
+#include <stdio.h>
+#if HAVE_BUILTIN_H
+#include <builtin.h>
+#endif
+main()
+{
+ FILE *fp = fopen("cf_test.out", "w");
+ if (fp != 0) {
+ bool x = false;
+ if (sizeof(x) == sizeof(int)) fputs("int", fp);
+ else if (sizeof(x) == sizeof(char)) fputs("char", fp);
+ else if (sizeof(x) == sizeof(short))fputs("short",fp);
+ else if (sizeof(x) == sizeof(long)) fputs("long", fp);
+ fclose(fp);
+ }
+ exit(0);
+}
+ ],
+ [cf_cv_type_of_bool=`cat cf_test.out`],
+ [cf_cv_type_of_bool=unknown],
+ [cf_cv_type_of_bool=unknown])
+ ])
+ rm -f cf_test.out
+AC_MSG_RESULT($cf_cv_type_of_bool)
+if test $cf_cv_type_of_bool = unknown ; then
+ AC_MSG_WARN(Assuming unsigned for type of bool)
+ cf_cv_type_of_bool=unsigned
+fi
+])dnl
@@ -0,0 +1,49 @@
+dnl Determine the default configuration into which we'll install ncurses. This
+dnl can be overridden by the user's command-line options. There's two items to
+dnl look for:
+dnl 1. the prefix (e.g., /usr)
+dnl 2. the header files (e.g., /usr/include/ncurses)
+dnl We'll look for a previous installation of ncurses and use the same defaults.
+dnl
+dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and
+dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's
+dnl programs from a vendor's.
+AC_DEFUN([CF_CFG_DEFAULTS],
+[
+AC_MSG_CHECKING(for prefix)
+if test "x$prefix" = "xNONE" ; then
+ case "$cf_cv_systype" in
+ # non-vendor systems don't have a conflict
+ OpenBSD|NetBSD|FreeBSD|Linux) prefix=/usr
+ ;;
+ *) prefix=$ac_default_prefix
+ ;;
+ esac
+fi
+AC_MSG_RESULT($prefix)
+if test "x$prefix" = "xNONE" ; then
+AC_MSG_CHECKING(for default include-directory)
+test -n "$verbose" && echo 1>&6
+for cf_symbol in \
+ $includedir \
+ $includedir/ncurses \
+ $prefix/include \
+ $prefix/include/ncurses \
+ /usr/local/include \
+ /usr/local/include/ncurses \
+ /usr/include \
+ /usr/include/ncurses
+do
+ cf_dir=`eval echo $cf_symbol`
+ if test -f $cf_dir/curses.h ; then
+ if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
+ includedir="$cf_symbol"
+ test -n "$verbose" && echo $ac_n " found " 1>&6
+ break
+ fi
+ fi
+ test -n "$verbose" && echo " tested $cf_dir" 1>&6
+done
+AC_MSG_RESULT($includedir)
+fi
+])dnl
@@ -0,0 +1,18 @@
+dnl SVr4 curses should have term.h as well (where it puts the definitions of
+dnl the low-level interface). This may not be true in old/broken implementations,
+dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
+dnl running with Solaris 2.5.1).
+AC_DEFUN([CF_CURSES_TERM_H],
+[
+AC_MSG_CHECKING([for term.h])
+AC_CACHE_VAL(cf_cv_have_term_h,[
+ AC_TRY_COMPILE([
+#include <curses.h>
+#include <term.h>],
+ [WINDOW *x],
+ [cf_cv_have_term_h=yes],
+ [cf_cv_have_term_h=no])
+ ])
+AC_MSG_RESULT($cf_cv_have_term_h)
+test $cf_cv_have_term_h = yes && AC_DEFINE(HAVE_TERM_H)
+])dnl
@@ -0,0 +1,23 @@
+dnl CF_CXX_LIBRARY version: 2 updated: 1997/09/06 23:41:28
+dnl --------------
+dnl If we're trying to use g++, test if libg++ is installed (a rather common
+dnl problem :-). If we have the compiler but no library, we'll be able to
+dnl configure, but won't be able to build the c++ demo program.
+AC_DEFUN([CF_CXX_LIBRARY],
+[
+cf_cxx_library=unknown
+if test $ac_cv_prog_gxx = yes; then
+ AC_MSG_CHECKING([for libg++])
+ cf_save="$LIBS"
+ LIBS="$LIBS -lg++ -lm"
+ AC_TRY_LINK([
+#include <builtin.h>
+ ],
+ [float foo=abs(1.0)],
+ [cf_cxx_library=yes
+ CXXLIBS="$CXXLIBS -lg++ -lm"],
+ [cf_cxx_library=no])
+ LIBS="$cf_save"
+ AC_MSG_RESULT($cf_cxx_library)
+fi
+])dnl
@@ -0,0 +1,14 @@
+AC_DEFUN([CF_DIRS_TO_MAKE],
+[
+DIRS_TO_MAKE="lib"
+for cf_item in $cf_list_models
+do
+ CF_OBJ_SUBDIR($cf_item,cf_subdir)
+ DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir"
+done
+for cf_dir in $DIRS_TO_MAKE
+do
+ test ! -d $cf_dir && mkdir $cf_dir
+done
+AC_SUBST(DIRS_TO_MAKE)
+])dnl
View
@@ -1,4 +1,4 @@
-dnl
+dnl Check if 'errno' is declared in <errno.h>
AC_DEFUN([CF_ERRNO],
[
AC_MSG_CHECKING([for errno external decl])
@@ -46,7 +46,7 @@ EOF
changequote([,])dnl
for cf_attribute in scanf printf unused noreturn
do
- CF_UPPER($cf_attribute,CF_ATTRIBUTE)
+ CF_UPPER(CF_ATTRIBUTE,$cf_attribute)
cf_directive="__attribute__(($cf_attribute))"
echo "checking for gcc $cf_directive" 1>&AC_FD_CC
case $cf_attribute in
@@ -29,7 +29,6 @@ EOF
Wmissing-prototypes \
Wnested-externs \
Wpointer-arith \
- Wwrite-strings \
Wshadow \
Wstrict-prototypes
do
@@ -43,4 +42,5 @@ EOF
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"
fi
+AC_SUBST(EXTRA_CFLAGS)
])dnl
@@ -0,0 +1,16 @@
+dnl Verify Version of GNAT.
+AC_DEFUN([CF_GNAT_VERSION],
+[
+changequote(<<, >>)dnl
+cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
+ sed -e 's/[^0-9 \.]//g' | $AWK '{print $<<1>>;}'`
+case $cf_cv_gnat_version in
+ 3.0[5-9]|3.[1-9]*|[4-9].*)
+ ac_cv_prog_gnat_correct=yes
+ ;;
+ *) echo Unsupported GNAT version $cf_cv_gnat_version. Disabling Ada95 binding.
+ ac_cv_prog_gnat_correct=no
+ ;;
+esac
+changequote([, ])dnl
+])
@@ -0,0 +1,23 @@
+dnl Construct the list of include-options according to whether we're building
+dnl in the source directory or using '--srcdir=DIR' option. If we're building
+dnl with gcc, don't append the includedir if it happens to be /usr/include,
+dnl since that usually breaks gcc's shadow-includes.
+AC_DEFUN([CF_INCLUDE_DIRS],
+[
+CPPFLAGS="$CPPFLAGS -I. -I../include"
+if test "$srcdir" != "."; then
+ CPPFLAGS="$CPPFLAGS -I\$(srcdir)/../include"
+fi
+if test -z "$GCC"; then
+ CPPFLAGS="$CPPFLAGS -I\$(includedir)"
+elif test "$includedir" != "/usr/include"; then
+ if test "$includedir" = '${prefix}/include' ; then
+ if test $prefix != /usr ; then
+ CPPFLAGS="$CPPFLAGS -I\$(includedir)"
+ fi
+ else
+ CPPFLAGS="$CPPFLAGS -I\$(includedir)"
+ fi
+fi
+AC_SUBST(CPPFLAGS)
+])dnl
View
@@ -0,0 +1,34 @@
+dnl Note: must follow AC_FUNC_SETPGRP, but cannot use AC_REQUIRE, since that
+dnl messes up the messages...
+AC_DEFUN([CF_KILLPG],
+[
+AC_MSG_CHECKING([if killpg is needed])
+AC_CACHE_VAL(cf_cv_need_killpg,[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <signal.h>
+RETSIGTYPE
+handler(s)
+ int s;
+{
+ exit(0);
+}
+
+main()
+{
+#ifdef SETPGRP_VOID
+ (void) setpgrp();
+#else
+ (void) setpgrp(0,0);
+#endif
+ (void) signal(SIGINT, handler);
+ (void) kill(-getpid(), SIGINT);
+ exit(1);
+}],
+ [cf_cv_need_killpg=no],
+ [cf_cv_need_killpg=yes],
+ [cf_cv_need_killpg=unknown]
+)])
+AC_MSG_RESULT($cf_cv_need_killpg)
+test $cf_cv_need_killpg = yes && AC_DEFINE(HAVE_KILLPG)
+])dnl
Oops, something went wrong.

0 comments on commit 169d729

Please sign in to comment.