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 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
|
# Process this file with autoconf to produce a configure script.
#
# Initialize autoconf stuff.
#
AC_INIT(Maude, 2.6, [maude-bugs@maude.cs.uiuc.edu])
#
# Allow directory names that look like macros.
#
m4_pattern_allow([AU_Persistent])
m4_pattern_allow([AU_Theory])
#
# Figure out system we are building for and set $host shell variable.
#
AC_CANONICAL_HOST
#
# Initialize automake stuff.
#
AM_INIT_AUTOMAKE(Maude, 2.6)
#
# Cause defines to be put in a header file rather than passed as
# compiler flags.
#
AC_CONFIG_HEADER(config.h)
#
# If the user set CFLAGS or CXXFLAGS we leave them alone.
# Otherwise we set them to -g -Wall to stop AC_PROG_CC and
# AC_PROG_CXX from setting them.
#
USER_SET_CFLAGS=yes
if (test -z "$CFLAGS") then
USER_SET_CFLAGS=no
CFLAGS="-g -Wall"
fi
USER_SET_CXXFLAGS=yes
if (test -z "$CXXFLAGS") then
USER_SET_CXXFLAGS=no
CXXFLAGS="-g -Wall"
fi
#
# *** PROGRAMS ***
#
AC_PROG_CC
AC_PROG_CXX
if (test "$GXX" = yes) then
AC_MSG_CHECKING([g++ compiler version])
GXX_VERSION=`$CXX -dumpversion`
AC_MSG_RESULT($GXX_VERSION)
fi
AC_PROG_RANLIB
if (test -z "$BISON") then
BISON="bison"
fi
AC_SUBST(BISON)
if (test -z "$FLEX") then
FLEX="flex"
fi
AC_SUBST(FLEX)
#
# *** LIBRARIES ***
#
#
# Figure out what libraries need to be linked in to use sockets.
#
AC_CHECK_LIB(nsl, inet_addr)
AC_CHECK_LIB(socket, socket)
#
# Check if user set particular Buddy library to use and if
# not set default.
#
if (test -z "$BUDDY_LIB") then
BUDDY_LIB="-lbdd"
fi
AC_SUBST(BUDDY_LIB)
#
# Check to see if we should use Tecla for command line editing.
#
AC_ARG_WITH(tecla,
AC_HELP_STRING([--with-tecla],
[use Tecla command line editing library [default=yes]]),
[WITH_TECLA=$withval],
[WITH_TECLA=yes])
if (test $WITH_TECLA = yes) then
#
# Check if user set particular Tecla libraries to use and if
# not set defaults.
#
AC_DEFINE([USE_TECLA], [], [use Tecla command line editing library])
if (test -z "$TECLA_LIBS") then
TECLA_LIBS="-ltecla -lcurses"
fi
else
TECLA_LIBS=""
fi
AC_SUBST(TECLA_LIBS)
#
# Check to see if we should use libsigsegv to handle segmentation faults.
#
AC_ARG_WITH(libsigsegv,
AC_HELP_STRING([--with-libsigsegv],
[use libsigsegv to handle segmentation faults [default=yes]]),
[WITH_LIBSIGSEGV=$withval],
[WITH_LIBSIGSEGV=yes])
if (test $WITH_LIBSIGSEGV = yes) then
#
# Check if user set particular libsigsegv to use and if
# not set default.
#
AC_DEFINE([USE_LIBSIGSEGV], [], [use libsigsegv to handle segmentation faults])
if (test -z "$LIBSIGSEGV_LIB") then
LIBSIGSEGV_LIB="-lsigsegv"
fi
else
LIBSIGSEGV_LIB=""
fi
AC_SUBST(LIBSIGSEGV_LIB)
#
# Check if user set particular GMP libraries to use and if
# not set defaults.
#
if (test -z "$GMP_LIBS") then
GMP_LIBS="-lgmpxx -lgmp"
fi
AC_SUBST(GMP_LIBS)
#
# *** HEADERS ***
#
AC_LANG(C++)
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(math.h)
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(sys/termios.h)
AC_CHECK_HEADERS(stddef.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(ctype.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(ostream)
AC_CHECK_HEADERS(ostream.h)
#
# *** SIZES ***
#
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(void *)
#
# Check to see if we are debugging.
# If we are not debugging, assume we are optimizing.
#
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[no optimization, runtime checks, dump routines [default=no]]),
[DEBUGGING=$enableval],
[DEBUGGING=no])
if (test "$DEBUGGING" = yes) then
AC_DEFINE([DUMP], [], [include dump code])
else
AC_DEFINE([NO_ASSERT], [], [don't do runtime checks])
AC_DEFINE([LOCAL_INLINES], [], [inline and discard selected local functions])
#
# Set compiler optimization flags if user didn't set CXXFLAGS.
#
if (test "$GXX" = yes) then
OFLAGS="-O2 -fomit-frame-pointer -fforce-addr"
case $GXX_VERSION in
3.*)
OFLAGS="$OFLAGS -finline-limit=10000"
;;
4.*)
OFLAGS="$OFLAGS -finline-limit=10000"
;;
esac
else
OFLAGS="-O"
fi
if (test $USER_SET_CFLAGS = no) then
CFLAGS="$CFLAGS $OFLAGS"
fi
if (test $USER_SET_CXXFLAGS = no) then
CXXFLAGS="$CXXFLAGS $OFLAGS"
fi
#
# Performance tweaks for known hosts.
#
TWEAKFLAGS=""
case $host in
sparc-*)
#
# We assume the v8 instruction set as a baseline in order to
# have multiplication and division instructions (gcc defaults
# to v7 which does not) but schedule for a more recent v9
# implementation.
#
TWEAKFLAGS="-march=v8 -mtune=ultrasparc"
;;
*-darwin*)
#
# Changing the stack boundary causes problems on x86 Macs.
#
;;
#
# For the Intel x86 family we select the smallest stack alignment
# in order to trade speed for memory on deeply recursive calls.
# The Pentium Pro and later have conditional move instructions,
# which out-perform various bit twiddling tricks, but gcc will
# only use them if given -march=i686.
#
i386-*)
TWEAKFLAGS="-march=i386 -mpreferred-stack-boundary=2"
;;
i486-*)
TWEAKFLAGS="-march=i486 -mpreferred-stack-boundary=2"
;;
i586-*)
TWEAKFLAGS="-march=i586 -mpreferred-stack-boundary=2"
;;
i686-*)
TWEAKFLAGS="-march=i686 -mpreferred-stack-boundary=2"
if (test $USER_SET_CXXFLAGS = no) then
AC_DEFINE([HAVE_CMOV], [], [have conditional move instruction])
fi
;;
#
# The x86-64 supports conditional moves and gcc will use
# them without being given additional flags. Smallest legal
# stack alignment is 4.
#
x86_64-*)
TWEAKFLAGS="-mpreferred-stack-boundary=4"
AC_DEFINE([HAVE_CMOV], [], [have conditional move instruction])
;;
#
# The DEC Alpha supports conditional moves and gcc will use
# them without being given additional flags.
#
alpha*)
AC_DEFINE([HAVE_CMOV], [], [have conditional move instruction])
;;
esac
if (test $USER_SET_CFLAGS = no) && (test $GCC = yes) then
CFLAGS="$CFLAGS $TWEAKFLAGS"
fi
if (test $USER_SET_CXXFLAGS = no) && (test $GXX = yes) then
CXXFLAGS="$CXXFLAGS $TWEAKFLAGS"
fi
fi
#
# Check to see if we should use Doug Lea's malloc().
#
AC_ARG_WITH(dlmalloc,
AC_HELP_STRING([--with-dlmalloc],
[use Doug Lea's malloc() [default=yes]]),
[WITH_DLMALLOC=$withval],
[WITH_DLMALLOC=yes])
#
# Fixes for known hosts.
#
FIXFLAGS=""
case $host in
#
# Needed to handle +/- infinity and underflow without
# causing a SIGFPE.
#
alpha*)
FIXFLAGS="-mieee"
;;
#
# gcc on x86-64 on linux doesn't seem to be able to link an
# external malloc with conflicting with the one defined in
# lib64/libc.a
#
x86_64-*-linux-*)
WITH_DLMALLOC=no
;;
#
# Doug Lea's malloc() is unstable on Darwin - presumably because
# of brk()/sbrk() issues.
#
*-darwin*)
AC_DEFINE([DARWIN], [], [enable Darwin specific fixes])
WITH_DLMALLOC=no
;;
esac
if (test $USER_SET_CFLAGS = no) && (test $GCC = yes) then
CFLAGS="$CFLAGS $FIXFLAGS"
fi
if (test $USER_SET_CXXFLAGS = no) && (test $GXX = yes) then
CXXFLAGS="$CXXFLAGS $FIXFLAGS"
fi
#
# Needed defines.
#
AC_DEFINE([SCP], [], [use MSCP10 calling conventions])
AC_DEFINE([BUBBLES], [], [support bubbles when parsing])
#
# Check to see if we should build the compiler.
#
AC_ARG_ENABLE(compiler,
AC_HELP_STRING([--enable-compiler],
[build the experimental integrated compiler [default=no]]),
[COMPILER=$enableval],
[COMPILER=no])
if (test "$COMPILER" = yes) then
AC_DEFINE([COMPILER], [], [build the experimental integrated compiler])
AC_DEFINE([ANNOTATED], [], [annotate comiler output])
fi
#
# Check to see if we should support MOS oracles.
#
AC_ARG_ENABLE(mos,
AC_HELP_STRING([--enable-mos],
[support MOS oracles (DO NOT USE!) [default=no]]),
[MOS=$enableval],
[MOS=no])
if (test "$MOS" = yes) then
AC_DEFINE([MOS], [], [support MOS oracles])
fi
#
# Conditional compilation and linking.
#
AM_CONDITIONAL(USE_DLMALLOC, test $WITH_DLMALLOC = yes)
AM_CONDITIONAL(BUILD_COMPILER, test $COMPILER = yes)
AC_CONFIG_FILES([Makefile
src/Makefile
src/3rdParty/Makefile
src/Utility/Makefile
src/Temporal/Makefile
src/Interface/Makefile
src/Core/Makefile
src/Variable/Makefile
src/NA_Theory/Makefile
src/ACU_Persistent/Makefile
src/ACU_Theory/Makefile
src/AU_Persistent/Makefile
src/AU_Theory/Makefile
src/CUI_Theory/Makefile
src/S_Theory/Makefile
src/FreeTheory/Makefile
src/Higher/Makefile
src/BuiltIn/Makefile
src/IO_Stuff/Makefile
src/ObjectSystem/Makefile
src/Meta/Makefile
src/FullCompiler/Makefile
src/MSCP10/Makefile
src/StrategyLanguage/Makefile
src/Mixfix/Makefile
src/Main/Makefile
tests/Makefile
tests/BuiltIn/Makefile
tests/Meta/Makefile
tests/Misc/Makefile
tests/ResolvedBugs/Makefile
])
AC_OUTPUT
|