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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
|
dnl Process this file with autoconf to produce a configure script.
dnl Copyright (c) 2003 Morgan Stanley Dean Witter and Co. All rights reserved.
dnl See .../src/LICENSE for terms of distribution.
AC_INIT(src/dap/BcdPack.c)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(aplus-fsf,4.22)
AM_MAINTAINER_MODE
AC_PREREQ([2.50])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_PROG_INSTALL
dnl Checks for libraries.
LIBS="$LIBS -lm"
AC_CHECK_LIB( dl, main, LIBS="-ldl $LIBS")
AC_CHECK_LIB( nsl, main, LIBS="-lnsl $LIBS")
AC_CHECK_LIB( pthread, main, LIBS="-lpthread $LIBS")
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VFORK
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd gethostname gettimeofday getwd mktime putenv regcomp select sigaction socket strcspn strdup strerror strstr strtod strtol strtoul)
dnl Future replacement for nsl/socket
dnl AC_SEARCH_LIBS(gethostbyname, nsl)
dnl AC_CHECK_FUNC(socket, , [
dnl AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket", [
dnl AC_CHECK_LIB(nsl, socket, LIBS="$LIBS -lsocket -lnsl", , -lsocket)
dnl ], "$LIBS")
dnl ])
dnl Checks for X headers and libs.
AC_PATH_X([X11], [X11/Xlib.h], [XOpenDisplay(NULL)])
if test "x$no_x" = "x"; then
X_INCLUDES="-I$x_includes"
X_LIBS="-L$x_libraries -lX11"
else
X_INCLUDES=""
X_LIBS=""
fi
AC_SUBST(X_INCLUDES)
AC_SUBST(X_LIBS)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h fp_class.h ieeefp.h math.h float.h)
dnl Checks for standard C++ headers
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS(new iostream iomanip fstream sstream iosfwd)
AC_LANG_POP(C++)
dnl Additional m4 macros
dnl test for socklen_t
AC_DEFUN(AC_TYPE_SOCKLEN_T,
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t len = 42; return len;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)
])
if test $ac_cv_type_socklen_t = yes; then
AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t])
fi
])
dnl test for SVR4 defines
AC_DEFUN(AC_DEFINE_SVR4,
[AC_CACHE_CHECK([for SVR4 defines], ac_cv_define_svr4,
[
AC_TRY_COMPILE(
[],
[
#if defined(_SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4) || defined(_SVR4) || defined(__SVR4)
return 1;
#else
foobar
#endif
],
ac_cv_define_svr4=yes,
ac_cv_define_svr4=no)
])
if test $ac_cv_define_svr4 = yes; then
AC_DEFINE(HAVE_SVR4, 1, [Whether is SVR4])
fi
])
dnl HP-UX 11.00 does not have finite but does have isfinite as a macro
AC_CHECK_FUNCS(fpclassify, ,
[AC_MSG_CHECKING(for fpclassify with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; fpclassify(f)],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FPCLASSIFY), AC_MSG_RESULT(no))])
AC_CHECK_FUNCS(finite, ,
[AC_CHECK_FUNCS(isfinite, ,
[AC_MSG_CHECKING(for isfinite with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISFINITE), AC_MSG_RESULT(no))])])
AC_CHECK_FUNCS(isinf, ,
[AC_MSG_CHECKING(for isinf with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISINF), AC_MSG_RESULT(no))])
dnl determine how to get IEEE math working
dnl AC_IEEE(MESSAGE, set rd_cv_ieee_[var] variable, INCLUDES,
dnl FUNCTION-BODY, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
AC_DEFUN(AC_IEEE,
AC_MSG_CHECKING([if IEEE math works $1])
AC_CACHE_VAL([rd_cv_ieee_$2],
[AC_TRY_RUN([$3
#if HAVE_MATH_H
# include <math.h>
#endif
#if HAVE_FLOAT_H
# include <float.h>
#endif
#if HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#if HAVE_FP_CLASS_H
# include <fp_class.h>
#endif
/* Solaris */
#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
# define HAVE_ISINF 1
# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
#endif
/* Digital UNIX */
#if (! defined(HAVE_ISINF) && defined(HAVE_FP_CLASS) && defined(HAVE_FP_CLASS_H))
# define HAVE_ISINF 1
# define isinf(a) (fp_class(a) == FP_NEG_INF || fp_class(a) == FP_POS_INF)
#endif
/* AIX */
#if (! defined(HAVE_ISINF) && defined(HAVE_CLASS))
# define HAVE_ISINF 1
# define isinf(a) (class(a) == FP_MINUS_INF || class(a) == FP_PLUS_INF)
#endif
#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_PLUS_INF) && defined(FP_MINUS_INF))
# define HAVE_ISINF 1
# define isinf(a) (fpclassify(a) == FP_MINUS_INF || fpclassify(a) == FP_PLUS_INF)
#endif
#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASSIFY) && defined(FP_INFINITE))
# define HAVE_ISINF 1
# define isinf(a) (fpclassify(a) == FP_INFINITE)
#endif
/* IRIX */
#if (! defined(isinf) && defined(HAVE_FINITE))
# define HAVE_ISINF 1
# define isinf(a) (!finite(a))
#endif
#include <stdio.h>
int main(void){
double nan,inf,c,zero;
$4;
/* some math to see if we get a floating point exception */
zero=sin(0.0); /* don't let the compiler optimize us away */
nan=0.0/zero; /* especially here */
inf=1.0/zero; /* and here. I want to know if it can do the magic */
/* at run time without sig fpe */
c = inf + nan;
c = inf / nan;
if (! isnan(nan)) {printf ("not isnan(NaN) ... "); return 1;}
if (nan == nan) {printf ("nan == nan ... "); return 1;}
if (! isinf(inf)) {printf ("not isinf(oo) ... "); return 1;}
if (! isinf(-inf)) {printf ("not isinf(-oo) ... "); return 1;}
if (! inf > 0) {printf ("not inf > 0 ... "); return 1;}
if (! -inf < 0) {printf ("not -inf < 0 ... "); return 1;}
return 0;
}],
rd_cv_ieee_$2=yes,
rd_cv_ieee_$2=no,
:)])
dnl these we run regardles is cached or not
if test x${rd_cv_ieee_$2} = "xyes"; then
AC_MSG_RESULT(yes)
$5
else
AC_MSG_RESULT(no)
$6
fi
)
_cxxflags=${CXXFLAGS}
_cflags=${CFLAGS}
AC_IEEE([out of the box], works, , , ,
[CXXFLAGS="$_cxxflags -ieee" CFLAGS="$_cflags -ieee"
AC_IEEE([with the -ieee switch], switch, , , ,
[CXXFLAGS="$_cxxflags -qfloat=nofold" CFLAGS="$_cflags -qfloat=nofold"
AC_IEEE([with the -qfloat=nofold switch], nofold, , , ,
[CXXFLAGS="$_cxxflags -w -qflttrap=enable:zerodivide" CFLAGS="$_cflags -w -qflttrap=enable:zerodivide"
AC_IEEE([with the -w -qflttrap=enable:zerodivide], flttrap, , , ,
[CXXFLAGS="$_cxxflags -mieee" CFLAGS="$_cflags -mieee"
AC_IEEE([with the -mieee switch], mswitch, , , ,
[CXXFLAGS="$_cxxflags -q float=rndsngl" CFLAGS="$_cflags -q float=rndsngl"
AC_IEEE([with the -q float=rndsngl switch], qswitch, , , ,
[CXXFLAGS="$_cxxflags -OPT:IEEE_comparisons=ON" CFLAGS="$_cflags -OPT:IEEE_comparisons=ON"
AC_IEEE([with the -OPT:IEEE_comparisons=ON switch], ieeecmpswitch, , , ,
[CXXFLAGS=$_cxxflags CFLAGS=$_cflags
AC_IEEE([with fpsetmask(0)], mask,
[#include <floatingpoint.h>], [fpsetmask(0)], ,
[AC_IEEE([with signal(SIGFPE,SIG_IGN)], sigfpe,
[#include <signal.h>], [signal(SIGFPE,SIG_IGN)], ,
AC_MSG_ERROR([
Your Compiler does not do propper IEEE math ... Please find out how to
make IEEE math work with your compiler and let me know (oetiker@ee.ethz.ch).
Check config.log to see what went wrong ...
]))])])])])])])])])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
AC_TYPE_UID_T
AC_TYPE_SOCKLEN_T
AC_DEFINE_SVR4
AC_OUTPUT(\
Makefile \
config/Makefile \
src/Makefile \
src/IPC/Makefile \
src/cxs/Makefile \
src/cxb/Makefile \
src/AplusGUI/Makefile \
src/cxsys/Makefile \
src/cxc/Makefile \
src/esf/Makefile \
src/a/Makefile \
src/app-defaults/Makefile \
src/dap/Makefile \
src/MSGUI/Makefile \
src/MSIPC/Makefile \
src/MSTypes/Makefile \
src/main/Makefile \
src/lisp.0/Makefile \
src/fonts/Makefile \
src/fonts/TrueType/Makefile \
src/fonts/X11/Makefile \
src/fonts/X11/bdf/Makefile \
src/fonts/X11/pcf/Makefile \
src/html/Makefile \
src/html/tutorials/Makefile \
src/html/tutorials/graphs/Makefile \
src/html/tutorials/s.tutorials/Makefile \
src/contrib/Makefile \
src/scripts/Makefile \
src/tutorials/Makefile \
src/tutorials/graphs/Makefile \
src/tutorials/s.tutorials/Makefile \
src/lisp.1/Makefile )
|