1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(twkalc/kcalc.h)
dnl where to find stuff needed by 'configure'
AC_CONFIG_AUX_DIR(admin)
dnl set this package name and version
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
AC_CANONICAL_SYSTEM
dnl create config.h
AM_CONFIG_HEADER(config.h)
dnl set language for tests: C
AC_LANG_C
dnl Checks for C, C++, make, install and other needed programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_INSTALL
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
dnl Checks for header files.
AC_ARG_PROGRAM
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(Tw/Tw.h)
if test "$ac_cv_header_Tw_Tw_h" = "no"; then
AC_MSG_ERROR([your system is missing Tw/Tw.h header!
Check, if you installed the libTw header files correctly.])
fi
AC_CHECK_HEADERS(Tw/Tw++.h)
if test "$ac_cv_header_Tw_Twpp_h" = "no"; then
AC_MSG_ERROR([your system is missing Tw/Tw++.h header!
Check, if you installed the libTw header files correctly.])
fi
dnl Checks for libraries.
AC_CHECK_LIB(Tw, Tw_Open)
if test "$ac_cv_lib_Tw_Tw_Open" = "no"; then
AC_MSG_ERROR([your system fails linking a small libTw application!
Check, if your compiler is installed correctly and if you have used the
same compiler to compile libTw as you did use now])
fi
AC_CHECK_LIB(m, sqrt)
AC_CHECK_LIB(m, isinf, [
AC_DEFINE_UNQUOTED(HAVE_FUNC_ISINF)
])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl do not check for `const' and `inline', they are standard in C++
dnl AC_C_CONST
dnl AC_C_INLINE
AC_DEFUN(AC_my_C_LONG_DOUBLE,
[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
[AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main() {
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
long double foo = 1.0;
char buffer[10];
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
int result = (sizeof(long double) < sizeof(double));
/* the following is needed for a broken printf in glibc2 */
if (!result) {
foo = foo * 3;
sprintf(buffer,"%0.0Lf",foo);
result = strcmp(buffer, "3");
/* and now something mean ;-) */
foo = fabsl(foo);
}
exit(result); }],
ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
])
if test $ac_cv_c_long_double = yes; then
AC_DEFINE(HAVE_LONG_DOUBLE)
fi
])
AC_my_C_LONG_DOUBLE
AC_DEFUN(AC_my_C_BOOL,
[
AC_MSG_CHECKING([for bool])
AC_CACHE_VAL(ac_cv_have_bool,
[
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([],
[bool aBool = true;],
[ac_cv_have_bool="yes"],
[ac_cv_have_bool="no"])
]) dnl end AC_CHECK_VAL
AC_MSG_RESULT($ac_cv_have_bool)
if test "$ac_cv_have_bool" = "yes"; then
AC_DEFINE(HAVE_BOOL)
fi
])
AC_my_C_BOOL
dnl output files
topdir=`pwd`
AC_SUBST(topdir)
AC_OUTPUT(Makefile admin/Makefile twkalc/Makefile)
|