mona-1.4/0000777000414100000240000000000011045777453007320 500000000000000mona-1.4/README0000644000414100000240000000205410756503727010114 00000000000000MONA Version 1.4 Copyright (C) 1997-2008 BRICS. [The 'Mem/dlmalloc.*' are the memory management routines of Doug Lea (dl@cs.oswego.edu) and are not covered by the BRICS copyright.] Please read the file 'COPYING' before you use MONA. To compile and install, see the file 'INSTALL'. The 'MONA Version 1.4 User Manual' is available from the MONA homepage. Information about the Graphviz tool for visualization of DFAs can be found at http://www.research.att.com/sw/tools/graphviz/. A simple Emacs MONA mode is available in this package. See 'mona-mode.el' for further information. The directory 'Lib' contains libraries for using the external automaton format and some example applications. The directory 'Examples' contains the MONA programs shown in the manual and some example applications of the BDD, DFA and GTA packages using the internal representation. If you have any problems or questions about the source code, please send email to mona@brics.dk or visit the MONA homepage at http://www.brics.dk/mona Anders Moeller amoeller@brics.dk mona-1.4/configure.in0000644000414100000240000000651011045776576011554 00000000000000# Process this file with autoconf to produce a configure script. dnl ========== initialization ========== AC_INIT([mona], [1.4]) RELEASE=13 AC_CONFIG_AUX_DIR(config) AC_CONFIG_SRCDIR(Front/mona.cpp) AM_INIT_AUTOMAKE() AC_CONFIG_HEADERS([config.h]) AC_SUBST(VERSION) AC_SUBST(RELEASE) AC_DEFINE_UNQUOTED(RELEASE, "$RELEASE", Release number of package) AC_GNU_SOURCE dnl ========== checks for programs ========== AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_YACC AM_PROG_LEX dnl ========== special configure parameters ========== CFG= AC_ARG_ENABLE(debug, [ --enable-debug development mode], [ case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -g -ansi -pedantic" ;; no) CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac], [ CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG" ]) if test "x$GCC" = "xyes"; then if test -z "`echo "$CXXFLAGS" | grep "\-Wall" 2> /dev/null`" ; then CXXFLAGS="$CXXFLAGS -Wall" fi fi AC_ARG_ENABLE(profiling, [ --enable-profiling compile with profiling], [ case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -pg" ;; no) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;; esac]) AC_ARG_ENABLE(memdebug, [ --enable-memdebug enable debug info for dlmalloc], [ case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -DDEBUG" ;; no) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-memdebug) ;; esac]) AC_ARG_ENABLE(maxalloc, [ --enable-maxalloc measure max allocated memory], [ case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -DMAXALLOCATED" ;; no) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-maxalloc) ;; esac]) AC_ARG_ENABLE(malloc, [ --enable-malloc use built-in malloc instead of dlmalloc], [ case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -DUSE_MALLOC" ;; no) ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-malloc) ;; esac CFG="$CFG --enable-malloc=$enableval"]) AC_SUBST(CFG) dnl ========== checks for operating system ========== AC_MSG_CHECKING(Win32 compiler) have_win32_gcc=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[]])],[have_win32_gcc=yes],[]) AC_MSG_RESULT($have_win32_gcc) if test x$have_win32_gcc = xyes; then CXXFLAGS="$CXXFLAGS -DWIN32" fi CFLAGS=$CXXFLAGS AC_SUBST(CFLAGS) dnl ========== checks for header files ========== AC_HEADER_STDC AC_CHECK_HEADERS(stdlib.h string.h sys/time.h unistd.h ,,AC_MSG_ERROR(required header file not found)) dnl ========== checks for typedefs, structures, and compiler characteristics ========== AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T dnl ========== checks for library functions ========== AC_DEFUN([FUNCTION_MISSING], [AC_MSG_ERROR(required library function not found)]) AC_TYPE_SIGNAL if test "$ac_cv_type_signal" = "int"; then SIGRET=return 0 else SIGRET=return fi AC_DEFINE_UNQUOTED(SIGRET, $SIGRET, Signal handler successful return) AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_MMAP AC_CHECK_FUNCS(alarm memset mkdir,,FUNCTION_MISSING) dnl ========== output files ========== AC_CONFIG_FILES([mona.spec makefile config/makefile Mem/makefile BDD/makefile DFA/makefile GTA/makefile Front/makefile Lib/makefile Examples/makefile]) AC_OUTPUT mona-1.4/aclocal.m40000644000414100000240000100006011045777375011074 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR mona-1.4/mona-mode.el0000644000414100000240000000552610756504133011431 00000000000000;;; mona-mode.el -- Emacs MONA mode ;; Copyright (C) 1997-2008 BRICS. ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ;; USA. ;; Usage: ;; Insert the following into your .emacs file: ;; ;; (load "/mona-mode") ;; (global-font-lock-mode t) ;; ;; where is the name of the directory containing this file. ;; If font-lock is already enabled you don't need to insert the second line. (require 'font-lock) (defvar mona-mode-font-lock-keywords `( (,(regexp-opt '("all0" "all1" "all2" "ex0" "ex1" "ex2" "true" "false" "let0" "let1""let2" "pred" "macro" "assert" "inter" "sub" "union" "in" "notin" "var0" "var1" "var2" "linear" "tree" "universe" "root" "guide" "const" "defaultwhere1" "defaultwhere2" "empty" "m2l-str" "m2l-tree" "lastpos" "where" "max" "min" "include" "export" "prefix" "execute" "ws1s" "ws2s" "import" "in_state_space" "variant" "verify" "succ" "tree" "tree_root" "type" "const_tree" "well_formed_tree" "allpos" "sometype" "restrict") 'words) . font-lock-keyword-face)) "Regular expression to match Mona keywords") (defvar mona-mode-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?/ ". 14" table) (modify-syntax-entry ?* ". 23" table) (modify-syntax-entry ?# "<" table) (modify-syntax-entry ?\n ">" table) (modify-syntax-entry ?\f ">" table) (modify-syntax-entry ?' "w" table) (modify-syntax-entry ?_ "w" table) (modify-syntax-entry ?@ "w" table) (modify-syntax-entry ?$ "w" table) table) "Syntax table in use in mona-mode buffers.") (if (featurep 'xemacs) (put 'mona-mode 'font-lock-defaults '(mona-mode-font-lock-keywords nil nil nil backward-paragraph))) (defun mona-mode () "Major mode for editing MONA files" (interactive) (kill-all-local-variables) (setq mode-name "MONA") (setq major-mode 'mona-mode) (set-syntax-table mona-mode-syntax-table) (if (not (featurep 'xemacs)) (setq font-lock-defaults '(mona-mode-font-lock-keywords nil nil nil backward-paragraph))) (run-hooks 'mona-mode-hook)) (or (assoc "\\.mona$" auto-mode-alist) (setq auto-mode-alist (cons '("\\.mona$" . mona-mode) auto-mode-alist))) (provide 'mona-mode) mona-1.4/config.h0000644000414100000240000000576511045777444010667 00000000000000/* config.h. Generated by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `alarm' function. */ #define HAVE_ALARM 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkdir' function. */ #define HAVE_MKDIR 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Name of package */ #define PACKAGE "mona" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "mona" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "mona 1.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "mona" /* Define to the version of this package. */ #define PACKAGE_VERSION "1.4" /* Release number of package */ #define RELEASE "13" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void /* Signal handler successful return */ #define SIGRET return /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1.4" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to rpl_malloc if the replacement function should be used. */ /* #undef malloc */ /* Define to `unsigned' if does not define. */ /* #undef size_t */ mona-1.4/config.h.in0000644000414100000240000000545511045777445011271 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Release number of package */ #undef RELEASE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Signal handler successful return */ #undef SIGRET /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `unsigned' if does not define. */ #undef size_t mona-1.4/makefile.am0000644000414100000240000000132710764207701011322 00000000000000SUBDIRS = config Mem BDD DFA GTA Front Lib Examples EXTRA_DIST = mona.spec mona-mode.el mona.1 MAINTAINERCLEANFILES = configure stamp-h.in makefile makefile.in aclocal.m4 \ config.h.in config.log config.status config/missing configure.lineno man_MANS = mona.1 dist_data_DATA = mona-mode.el monadir = $(includedir)/mona mona_HEADERS = config.h tgz: dist mv -f mona-@VERSION@.tar.gz mona-@VERSION@-@RELEASE@.tar.gz rpm: tgz rpmbuild -ta mona-@VERSION@-@RELEASE@.tar.gz cp `rpm --eval %{_rpmdir}/%{_arch}`/mona-@VERSION@-@RELEASE@.`rpm --eval %{_arch}`.rpm \ `rpm --eval %{_srcrpmdir}`/mona-@VERSION@-@RELEASE@.src.rpm . lib: all $(MAKE) -C Lib $@ examples: all $(MAKE) -C Examples $@ .PHONY: rpm tgz lib examples mona-1.4/makefile.in0000644000414100000240000005601111045777402011336 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_data_DATA) \ $(mona_HEADERS) $(srcdir)/config.h.in $(srcdir)/makefile.am \ $(srcdir)/makefile.in $(srcdir)/mona.spec.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = mona.spec SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(datadir)" \ "$(DESTDIR)$(monadir)" NROFF = nroff MANS = $(man_MANS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dist_dataDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_data_DATA) monaHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(mona_HEADERS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = config Mem BDD DFA GTA Front Lib Examples EXTRA_DIST = mona.spec mona-mode.el mona.1 MAINTAINERCLEANFILES = configure stamp-h.in makefile makefile.in aclocal.m4 \ config.h.in config.log config.status config/missing configure.lineno man_MANS = mona.1 dist_data_DATA = mona-mode.el monadir = $(includedir)/mona mona_HEADERS = config.h all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mona.spec: $(top_builddir)/config.status $(srcdir)/mona.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-dist_dataDATA: $(dist_data_DATA) @$(NORMAL_INSTALL) test -z "$(datadir)" || $(mkdir_p) "$(DESTDIR)$(datadir)" @list='$(dist_data_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(datadir)/$$f'"; \ $(dist_dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(datadir)/$$f"; \ done uninstall-dist_dataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_data_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(datadir)/$$f'"; \ rm -f "$(DESTDIR)$(datadir)/$$f"; \ done install-monaHEADERS: $(mona_HEADERS) @$(NORMAL_INSTALL) test -z "$(monadir)" || $(mkdir_p) "$(DESTDIR)$(monadir)" @list='$(mona_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(monaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(monadir)/$$f'"; \ $(monaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(monadir)/$$f"; \ done uninstall-monaHEADERS: @$(NORMAL_UNINSTALL) @list='$(mona_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(monadir)/$$f'"; \ rm -f "$(DESTDIR)$(monadir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: makefile $(MANS) $(DATA) $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(datadir)" "$(DESTDIR)$(monadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dist_dataDATA install-man install-monaHEADERS install-exec-am: install-info: install-info-recursive install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_dataDATA uninstall-info-am uninstall-man \ uninstall-monaHEADERS uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_dataDATA install-exec install-exec-am \ install-info install-info-am install-man install-man1 \ install-monaHEADERS install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-dist_dataDATA \ uninstall-info-am uninstall-man uninstall-man1 \ uninstall-monaHEADERS tgz: dist mv -f mona-@VERSION@.tar.gz mona-@VERSION@-@RELEASE@.tar.gz rpm: tgz rpmbuild -ta mona-@VERSION@-@RELEASE@.tar.gz cp `rpm --eval %{_rpmdir}/%{_arch}`/mona-@VERSION@-@RELEASE@.`rpm --eval %{_arch}`.rpm \ `rpm --eval %{_srcrpmdir}`/mona-@VERSION@-@RELEASE@.src.rpm . lib: all $(MAKE) -C Lib $@ examples: all $(MAKE) -C Examples $@ .PHONY: rpm tgz lib examples # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/mona.spec.in0000644000414100000240000000224611037142004011426 00000000000000%define name mona %define version @VERSION@ %define release @RELEASE@ Summary: a decision procedure for the logics WS1S and WS2S Name: %{name} Version: %{version} Release: %{release} License: GPL Group: Development/Tools URL: http://www.brics.dk/mona Vendor: BRICS Source: http:/www.brics.dk/mona/download/%{name}-%{version}-%{release}.tar.gz BuildRoot: /tmp/%{name}-%{version} Packager: Anders Moeller %description MONA is a tool that translates formulas in the logics WS1S or WS2S into finite-state automata represented by BDDs. The formulas may express search patterns, temporal properties of reactive systems, parse tree constraints, etc. MONA also analyses the automaton resulting from the compilation, and determines whether the formula is valid and, if the formula is not valid, generates a counter-example. %prep %setup -q %build %configure @CFG@ make %install `rpm --eval '%makeinstall'`-strip %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README COPYING INSTALL %{_bindir}/mona %{_bindir}/dfa2dot %{_bindir}/gta2dot %{_mandir}/man1/* %{_datadir}/mona-mode.el %{_includedir}/mona/* %{_libdir}/*.so* %{_libdir}/*.a* %{_libdir}/*.la* mona-1.4/configure0000744000414100000240000261655711045777403011162 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for mona 1.4. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='mona' PACKAGE_TARNAME='mona' PACKAGE_VERSION='1.4' PACKAGE_STRING='mona 1.4' PACKAGE_BUGREPORT='' ac_unique_file="Front/mona.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar RELEASE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL YACC LEX LEXLIB LEX_OUTPUT_ROOT CFG LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures mona 1.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of mona 1.4:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug development mode --enable-profiling compile with profiling --enable-memdebug enable debug info for dlmalloc --enable-maxalloc measure max allocated memory --enable-malloc use built-in malloc instead of dlmalloc Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF mona configure 1.4 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by mona $as_me 1.4, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu RELEASE=13 ac_aux_dir= for ac_dir in config $srcdir/config; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='mona' VERSION='1.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" cat >>confdefs.h <<_ACEOF #define RELEASE "$RELEASE" _ACEOF cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # 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 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4241 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the mona lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5376:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6439: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6443: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6707: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6711: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6811: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6815: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 8280 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11620: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11624: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11724: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11728: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 12260 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13318: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13322: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13422: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13426: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 14871 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15649: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15653: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15917: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15921: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16021: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16025: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 17490 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi CFG= # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -g -ansi -pedantic" ;; no) CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG" ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5 echo "$as_me: error: bad value ${enableval} for --enable-debug" >&2;} { (exit 1); exit 1; }; } ;; esac else CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG" fi; if test "x$GCC" = "xyes"; then if test -z "`echo "$CXXFLAGS" | grep "\-Wall" 2> /dev/null`" ; then CXXFLAGS="$CXXFLAGS -Wall" fi fi # Check whether --enable-profiling or --disable-profiling was given. if test "${enable_profiling+set}" = set; then enableval="$enable_profiling" case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -pg" ;; no) ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-profiling" >&5 echo "$as_me: error: bad value ${enableval} for --enable-profiling" >&2;} { (exit 1); exit 1; }; } ;; esac fi; # Check whether --enable-memdebug or --disable-memdebug was given. if test "${enable_memdebug+set}" = set; then enableval="$enable_memdebug" case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -DDEBUG" ;; no) ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-memdebug" >&5 echo "$as_me: error: bad value ${enableval} for --enable-memdebug" >&2;} { (exit 1); exit 1; }; } ;; esac fi; # Check whether --enable-maxalloc or --disable-maxalloc was given. if test "${enable_maxalloc+set}" = set; then enableval="$enable_maxalloc" case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -DMAXALLOCATED" ;; no) ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-maxalloc" >&5 echo "$as_me: error: bad value ${enableval} for --enable-maxalloc" >&2;} { (exit 1); exit 1; }; } ;; esac fi; # Check whether --enable-malloc or --disable-malloc was given. if test "${enable_malloc+set}" = set; then enableval="$enable_malloc" case "${enableval}" in yes) CXXFLAGS="$CXXFLAGS -DUSE_MALLOC" ;; no) ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-malloc" >&5 echo "$as_me: error: bad value ${enableval} for --enable-malloc" >&2;} { (exit 1); exit 1; }; } ;; esac CFG="$CFG --enable-malloc=$enableval" fi; echo "$as_me:$LINENO: checking Win32 compiler" >&5 echo $ECHO_N "checking Win32 compiler... $ECHO_C" >&6 have_win32_gcc=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then have_win32_gcc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $have_win32_gcc" >&5 echo "${ECHO_T}$have_win32_gcc" >&6 if test x$have_win32_gcc = xyes; then CXXFLAGS="$CXXFLAGS -DWIN32" fi CFLAGS=$CXXFLAGS echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in stdlib.h string.h sys/time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the mona lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: required header file not found" >&5 echo "$as_me: error: required header file not found" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF if test "$ac_cv_type_signal" = "int"; then SIGRET=return 0 else SIGRET=return fi cat >>confdefs.h <<_ACEOF #define SIGRET $SIGRET _ACEOF for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the mona lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to the mona lists. ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap for ac_func in alarm memset mkdir do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: required library function not found" >&5 echo "$as_me: error: required library function not found" >&2;} { (exit 1); exit 1; }; } fi done ac_config_files="$ac_config_files mona.spec makefile config/makefile Mem/makefile BDD/makefile DFA/makefile GTA/makefile Front/makefile Lib/makefile Examples/makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by mona $as_me 1.4, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ mona config.status 1.4 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "mona.spec" ) CONFIG_FILES="$CONFIG_FILES mona.spec" ;; "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;; "config/makefile" ) CONFIG_FILES="$CONFIG_FILES config/makefile" ;; "Mem/makefile" ) CONFIG_FILES="$CONFIG_FILES Mem/makefile" ;; "BDD/makefile" ) CONFIG_FILES="$CONFIG_FILES BDD/makefile" ;; "DFA/makefile" ) CONFIG_FILES="$CONFIG_FILES DFA/makefile" ;; "GTA/makefile" ) CONFIG_FILES="$CONFIG_FILES GTA/makefile" ;; "Front/makefile" ) CONFIG_FILES="$CONFIG_FILES Front/makefile" ;; "Lib/makefile" ) CONFIG_FILES="$CONFIG_FILES Lib/makefile" ;; "Examples/makefile" ) CONFIG_FILES="$CONFIG_FILES Examples/makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@RELEASE@,$RELEASE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@SED@,$SED,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@YACC@,$YACC,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@CFG@,$CFG,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi mona-1.4/AUTHORS0000644000414100000240000000016410073170372010270 00000000000000Anders Moeller Nils Klarlund Jacob Elgaard Theis Rauhe Morten Biehl mona-1.4/COPYING0000644000414100000240000004307610073170372010264 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. mona-1.4/ChangeLog0000644000414100000240000000172611045776561011013 000000000000002008-08-05 (version 1.4-13) - fixed bug in basic automaton for x=y+1%z [Thanks to Stan Rosenberg!] 2008-07-15 (version 1.4-12) - updated RPM build script 2008-05-22 (version 1.4-11) - updated some static globals to make the BSD linker happy, e.g. for OS X [Thanks again to Jerry James!] 2008-03-07 (version 1.4-10) - updated more build scripts [Thanks again to Jerry James!] 2008-02-19 (version 1.4-9) - updated mona-mode.el and build scripts [Thanks to Jerry James!] 2007-03-06 (version 1.4-8) - tiny fix to make it compile with gcc 4 - now also compiles for 64-bit architectures - upgraded to newest dlmalloc 2004-07-05 (version 1.4-7) - fixed bug in formula reductions (double negation) 2004-06-28 (version 1.4-6) - fixed bug in the GTA SetMinus automaton construction 2003-03-23 (version 1.4-5) - now compiles with gcc 3.1.1 without warnings 2002-11-05 (version 1.4-4) - now using automake+autoconf - various minor compiler warnings fixed mona-1.4/INSTALL0000644000414100000240000000330010756503726010257 00000000000000Compiling and installing MONA ----------------------------- Files are installed in the following directories: $(bindir)/ - contains the 'mona' executable $(mandir)/ - contains the manual page for 'mona' $(datadir)/ - contains 'mona-mode.el' for Emacs This can be changed by passing appropriate arguments to 'configure' (see './configure --help'). To configure the same way as RPM does it, start by running config/rpm-config (arguments are passed on to 'configure') otherwise, run ./configure (with appropriate configuration switches) To compile and install, run make make install-strip (may require root permissions) If you run 'make' without 'make install-strip', you should manually run 'strip mona' to remove symbol table, etc., from the executable. To uninstall, run make uninstall (may require root permissions) Building binary RPMs -------------------- Configuration options (passed to './configure' or 'config/rpm-config') are also inserted in 'mona.spec'. This means that if you run make rpm you will get a binary RPM that is tailored for your system. Building the Lib and Examples programs -------------------------------------- To compile the programs in the Lib and Examples directories, run make lib make examples For developers -------------- Useful commands: config/init - run aclocal, autoheader, automake, and autoconf config/rpm-config - run configure with RPM configuration config/devel - run init and rpm-config with debug enabled make rpm - make tar.gz and source+binary RPMs make maintainer-clean - remove all files that can be auto-regenerated mona-1.4/NEWS0000644000414100000240000000563410073170372007726 00000000000000From v1.2 to v1.3 ----------------- * New features: o DFA and GTA package documentation and examples o in_state_space (in WS2S: to test state space) o execute (compiles without conjoining) o pconst (Presburger constants) o inherited-acceptance analysis (in WS2S: state analysis) o gta2dot for visualizing GTAs o C-style comments (/* .. */) * Bug fixes: o occasionally wrong free variables read by import o occasionally non-minimum counter-example o GTA bug (rare error occurring with huge GTAs) o recursion on restrictions was not implemented correctly * Source-code improvements: o interfaces to DFA and GTA packages simplified o all memory leaks removed o improved Emacs MONA mode o guide/universe construction rewritten o improved automaton file format o all timers now use CPU time o DAG code simplified * Minor changes: o unrestriction now explicit (-u option) o command-line usage now more intuitive o alphabet now consists of all globally declared variables o restr-feature removed (was confusing) o use ws1s, ws2s instead of linear, tree From v1.3 to v1.4 ----------------- * New features: o recursive types for WS2S - this feature allows GTA guides to be specified using a high-level notation, thereby making tree-mode easier to use and more efficient (- this extension of MONA makes the FIDO tool almost superfluous, so no more development will be made on FIDO) o formula reductions - before the translation into automata, some reduction techniques are applied, which often reduce translation time (experiments show 5-70% improvement!) o new M2L-Str emulation - now the skeleton is specified using a second-order variable instead of a first-order variable (for compatibility, the old technique is still available using the -m option) * Bug fixes: o root in WS2S had wrong encoding o all var1 globals are now asserted first-order even if not used o export and lastpos didn't work together o let had wrong scope o small bugs in GTA and DFA analysis fixed o the last memory leaks removed (this time we mean it :-) o occasionally wrong free variables at "where" o "include" didn't work properly * Source-code improvements: o better DAGification (typical 10% time improvement) o the notions of implicative and conjunctive automata (which became obsolete when restrictions were added) have been removed * Minor changes: o better Graphviz DAG dump o option -xw added: outputs resulting automaton in external format o progress information extended: current number of automata in memory is now shown mona-1.4/mona.spec0000644000414100000240000000222411045777443011041 00000000000000%define name mona %define version 1.4 %define release 13 Summary: a decision procedure for the logics WS1S and WS2S Name: %{name} Version: %{version} Release: %{release} License: GPL Group: Development/Tools URL: http://www.brics.dk/mona Vendor: BRICS Source: http:/www.brics.dk/mona/download/%{name}-%{version}-%{release}.tar.gz BuildRoot: /tmp/%{name}-%{version} Packager: Anders Moeller %description MONA is a tool that translates formulas in the logics WS1S or WS2S into finite-state automata represented by BDDs. The formulas may express search patterns, temporal properties of reactive systems, parse tree constraints, etc. MONA also analyses the automaton resulting from the compilation, and determines whether the formula is valid and, if the formula is not valid, generates a counter-example. %prep %setup -q %build %configure make %install `rpm --eval '%makeinstall'`-strip %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README COPYING INSTALL %{_bindir}/mona %{_bindir}/dfa2dot %{_bindir}/gta2dot %{_mandir}/man1/* %{_datadir}/mona-mode.el %{_includedir}/mona/* %{_libdir}/*.so* %{_libdir}/*.a* %{_libdir}/*.la* mona-1.4/mona.10000644000414100000240000000541210756504201010235 00000000000000.TH MONA 1 "FEBRUARY 2008" "" "BRICS tools" .SH NAME mona \- a decision procedure for the logics WS1S and WS2S .SH SYNOPSIS .B mona [ .I options ] .I mona-file .SH DESCRIPTION .B MONA is a tool that translates formulas in the logics WS1S or WS2S into finite-state automata represented by BDDs. The formulas may express search patterns, temporal properties of reactive systems, parse tree constraints, etc. MONA also analyses the automaton resulting from the compilation, and determines whether the formula is valid and, if the formula is not valid, generates a counter-example. The MONA project is a research project at the BRICS Research Center at University of Aarhus, Denmark. Full documentation, GPL source code, and related research papers are available from the MONA project home page at .B http://www.brics.dk/mona .SH OPTIONS .IP -w Output whole automaton. Default is to only output its size. .IP -n Don't analyze automaton. Default is to analyze for validity and unsatisfiability and to generate a satisfying example and counter-example. .IP -t Print elapsed time for each phase. If -s is also used, the time for each automaton operation is also printed. .IP -s Print statistics. Prints information for each automaton operation and a summary. .IP -i Print intermediate automata (implies -s). .IP -d Dump AST, symboltable, and code DAG. Useful for debugging. .IP -q Quiet, don't print progress. .IP -e Enable separate compilation. (See the MONALIB environment variable below.) .IP -oN Code optimization level N (0=none, 1=safe, 2=heuristic) (default 1). .IP -r Disable BDD index reordering, use order of declaration as index ordering. Default is to reorder BDD indices heuristically. .IP -f Force normal tree-mode output style. Only applicable for WSRT mode. .IP -m Alternative M2L-Str emulation (v1.3 style). .IP -h Enable inherited acceptance analysis. .IP -u Unrestrict output automata. Create conventional automata by converting "don't-care" states to "reject" states and minimizes. .IP -gw Output whole automaton in Graphviz format (implies -n -q). (Graphviz is available at http://www.research.att.com/sw/tools/graphviz/) .IP -gs Output satisfying example tree in Graphviz format (implies -q). .IP -gc Output counter-example tree in Graphviz format (implies -q). .IP -gd Dump code DAG in Graphviz format (implies -n -q). .IP -xw Output whole automaton in external format (implies -n -q). "External format" is the format used by dfalib and gtalib, see the source package. .SH ENVIRONMENT .IP MONALIB Defines the directory used for separate-compilation automata (default is current directory). .SH BUGS Please send bug reports to .SH AUTHORS Anders Moeller , Nils Klarlund, Jacob Elgaard, Theis Rauhe, and Morten Biehl. mona-1.4/config/0000777000414100000240000000000011045777447010570 500000000000000mona-1.4/config/makefile.am0000644000414100000240000000023610073170372012561 00000000000000MAINTAINERCLEANFILES = makefile.in makefile mkinstalldirs install-sh \ ltmain.sh ltconfig config.sub config.guess depcomp EXTRA_DIST = rpm-config init devel mona-1.4/config/makefile.in0000644000414100000240000002114011045777402012576 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config DIST_COMMON = $(srcdir)/makefile.am $(srcdir)/makefile.in compile \ config.guess config.sub depcomp install-sh ltmain.sh missing \ ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile mkinstalldirs install-sh \ ltmain.sh ltconfig config.sub config.guess depcomp EXTRA_DIST = rpm-config init devel all: all-am .SUFFIXES: $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu config/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/config/compile0000755000414100000240000000717310756617753012073 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mona-1.4/config/config.guess0000744000414100000240000012206511015335275013012 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown ## for Red Hat Linux if test -f /etc/redhat-release ; then VENDOR=redhat ; else VENDOR= ; fi # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-${VENDOR:-unknown}-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-${VENDOR:-unknown}-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-${VENDOR:-unknown}-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mona-1.4/config/config.sub0000744000414100000240000007305511015335275012461 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mona-1.4/config/depcomp0000744000414100000240000004224610756617753012070 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mona-1.4/config/install-sh0000744000414100000240000003160010756617753012507 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mona-1.4/config/ltmain.sh0000644000414100000240000060342610455371115012321 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. # for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` # done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: mona-1.4/config/missing0000744000414100000240000002557710756617753012122 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mona-1.4/config/ylwrap0000644000414100000240000001406110756617753011750 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2005-05-14.22 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) $prog "$input" ;; *) $prog "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: mona-1.4/config/rpm-config0000755000414100000240000000007510073170372012455 00000000000000#!/bin/sh set -x /bin/sh -c "`rpm --eval '%{configure}'` $*" mona-1.4/config/init0000755000414100000240000000017010573542404011357 00000000000000#!/bin/sh set -x rm -f config.cache aclocal autoheader libtoolize --copy --force automake --add-missing --copy autoconf mona-1.4/config/devel0000755000414100000240000000010110073170372011501 00000000000000#!/bin/sh set -x config/init config/rpm-config --enable-debug $* mona-1.4/Mem/0000777000414100000240000000000011045777447010041 500000000000000mona-1.4/Mem/dlmalloc.h0000644000414100000240000004555310756504270011717 00000000000000#ifndef USE_MALLOC /* Default header file for malloc-2.8.x, written by Doug Lea and released to the public domain, as explained at http://creativecommons.org/licenses/publicdomain. last update: Mon Aug 15 08:55:52 2005 Doug Lea (dl at gee) This header is for ANSI C/C++ only. You can set any of the following #defines before including: * If USE_DL_PREFIX is defined, it is assumed that malloc.c was also compiled with this option, so all routines have names starting with "dl". * If HAVE_USR_INCLUDE_MALLOC_H is defined, it is assumed that this file will be #included AFTER . This is needed only if your system defines a struct mallinfo that is incompatible with the standard one declared here. Otherwise, you can include this file INSTEAD of your system system . At least on ANSI, all declarations should be compatible with system versions * If MSPACES is defined, declarations for mspace versions are included. */ #ifndef MALLOC_280_H #define MALLOC_280_H #ifdef __cplusplus extern "C" { #endif #include /* for size_t */ #if !ONLY_MSPACES #ifndef USE_DL_PREFIX #define dlcalloc calloc #define dlfree free #define dlmalloc malloc #define dlmemalign memalign #define dlrealloc realloc #define dlvalloc valloc #define dlpvalloc pvalloc #define dlmallinfo mallinfo #define dlmallopt mallopt #define dlmalloc_trim malloc_trim #define dlmalloc_stats malloc_stats #define dlmalloc_usable_size malloc_usable_size #define dlmalloc_footprint malloc_footprint #define dlindependent_calloc independent_calloc #define dlindependent_comalloc independent_comalloc #endif /* USE_DL_PREFIX */ /* malloc(size_t n) Returns a pointer to a newly allocated chunk of at least n bytes, or null if no space is available, in which case errno is set to ENOMEM on ANSI C systems. If n is zero, malloc returns a minimum-sized chunk. (The minimum size is 16 bytes on most 32bit systems, and 32 bytes on 64bit systems.) Note that size_t is an unsigned type, so calls with arguments that would be negative if signed are interpreted as requests for huge amounts of space, which will often fail. The maximum supported value of n differs across systems, but is in all cases less than the maximum representable value of a size_t. */ void* dlmalloc(size_t); /* free(void* p) Releases the chunk of memory pointed to by p, that had been previously allocated using malloc or a related routine such as realloc. It has no effect if p is null. If p was not malloced or already freed, free(p) will by default cuase the current program to abort. */ void dlfree(void*); /* calloc(size_t n_elements, size_t element_size); Returns a pointer to n_elements * element_size bytes, with all locations set to zero. */ void* dlcalloc(size_t, size_t); /* realloc(void* p, size_t n) Returns a pointer to a chunk of size n that contains the same data as does chunk p up to the minimum of (n, p's size) bytes, or null if no space is available. The returned pointer may or may not be the same as p. The algorithm prefers extending p in most cases when possible, otherwise it employs the equivalent of a malloc-copy-free sequence. If p is null, realloc is equivalent to malloc. If space is not available, realloc returns null, errno is set (if on ANSI) and p is NOT freed. if n is for fewer bytes than already held by p, the newly unused space is lopped off and freed if possible. realloc with a size argument of zero (re)allocates a minimum-sized chunk. The old unix realloc convention of allowing the last-free'd chunk to be used as an argument to realloc is not supported. */ void* dlrealloc(void*, size_t); /* memalign(size_t alignment, size_t n); Returns a pointer to a newly allocated chunk of n bytes, aligned in accord with the alignment argument. The alignment argument should be a power of two. If the argument is not a power of two, the nearest greater power is used. 8-byte alignment is guaranteed by normal malloc calls, so don't bother calling memalign with an argument of 8 or less. Overreliance on memalign is a sure way to fragment space. */ void* dlmemalign(size_t, size_t); /* valloc(size_t n); Equivalent to memalign(pagesize, n), where pagesize is the page size of the system. If the pagesize is unknown, 4096 is used. */ void* dlvalloc(size_t); /* mallopt(int parameter_number, int parameter_value) Sets tunable parameters The format is to provide a (parameter-number, parameter-value) pair. mallopt then sets the corresponding parameter to the argument value if it can (i.e., so long as the value is meaningful), and returns 1 if successful else 0. SVID/XPG/ANSI defines four standard param numbers for mallopt, normally defined in malloc.h. None of these are use in this malloc, so setting them has no effect. But this malloc also supports other options in mallopt: Symbol param # default allowed param values M_TRIM_THRESHOLD -1 2*1024*1024 any (-1U disables trimming) M_GRANULARITY -2 page size any power of 2 >= page size M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) */ int dlmallopt(int, int); #define M_TRIM_THRESHOLD (-1) #define M_GRANULARITY (-2) #define M_MMAP_THRESHOLD (-3) /* malloc_footprint(); Returns the number of bytes obtained from the system. The total number of bytes allocated by malloc, realloc etc., is less than this value. Unlike mallinfo, this function returns only a precomputed result, so can be called frequently to monitor memory consumption. Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ size_t dlmalloc_footprint(); #if !NO_MALLINFO /* mallinfo() Returns (by copy) a struct containing various summary statistics: arena: current total non-mmapped bytes allocated from system ordblks: the number of free chunks smblks: always zero. hblks: current number of mmapped regions hblkhd: total bytes held in mmapped regions usmblks: the maximum total allocated space. This will be greater than current total if trimming has occurred. fsmblks: always zero uordblks: current total allocated space (normal or mmapped) fordblks: total free space keepcost: the maximum number of bytes that could ideally be released back to system via malloc_trim. ("ideally" means that it ignores page restrictions etc.) Because these fields are ints, but internal bookkeeping may be kept as longs, the reported values may wrap around zero and thus be inaccurate. */ #ifndef HAVE_USR_INCLUDE_MALLOC_H #ifndef _MALLOC_H #ifndef MALLINFO_FIELD_TYPE #define MALLINFO_FIELD_TYPE size_t #endif /* MALLINFO_FIELD_TYPE */ struct mallinfo { MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ MALLINFO_FIELD_TYPE smblks; /* always 0 */ MALLINFO_FIELD_TYPE hblks; /* always 0 */ MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ MALLINFO_FIELD_TYPE fordblks; /* total free space */ MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ }; #endif /* _MALLOC_H */ #endif /* HAVE_USR_INCLUDE_MALLOC_H */ struct mallinfo dlmallinfo(void); #endif /* NO_MALLINFO */ /* independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); independent_calloc is similar to calloc, but instead of returning a single cleared space, it returns an array of pointers to n_elements independent elements that can hold contents of size elem_size, each of which starts out cleared, and can be independently freed, realloc'ed etc. The elements are guaranteed to be adjacently allocated (this is not guaranteed to occur with multiple callocs or mallocs), which may also improve cache locality in some applications. The "chunks" argument is optional (i.e., may be null, which is probably the most typical usage). If it is null, the returned array is itself dynamically allocated and should also be freed when it is no longer needed. Otherwise, the chunks array must be of at least n_elements in length. It is filled in with the pointers to the chunks. In either case, independent_calloc returns this pointer array, or null if the allocation failed. If n_elements is zero and "chunks" is null, it returns a chunk representing an array with zero elements (which should be freed if not wanted). Each element must be individually freed when it is no longer needed. If you'd like to instead be able to free all at once, you should instead use regular calloc and assign pointers into this space to represent elements. (In this case though, you cannot independently free elements.) independent_calloc simplifies and speeds up implementations of many kinds of pools. It may also be useful when constructing large data structures that initially have a fixed number of fixed-sized nodes, but the number is not known at compile time, and some of the nodes may later need to be freed. For example: struct Node { int item; struct Node* next; }; struct Node* build_list() { struct Node** pool; int n = read_number_of_nodes_needed(); if (n <= 0) return 0; pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0); if (pool == 0) die(); // organize into a linked list... struct Node* first = pool[0]; for (i = 0; i < n-1; ++i) pool[i]->next = pool[i+1]; free(pool); // Can now free the array (or not, if it is needed later) return first; } */ void** dlindependent_calloc(size_t, size_t, void**); /* independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); independent_comalloc allocates, all at once, a set of n_elements chunks with sizes indicated in the "sizes" array. It returns an array of pointers to these elements, each of which can be independently freed, realloc'ed etc. The elements are guaranteed to be adjacently allocated (this is not guaranteed to occur with multiple callocs or mallocs), which may also improve cache locality in some applications. The "chunks" argument is optional (i.e., may be null). If it is null the returned array is itself dynamically allocated and should also be freed when it is no longer needed. Otherwise, the chunks array must be of at least n_elements in length. It is filled in with the pointers to the chunks. In either case, independent_comalloc returns this pointer array, or null if the allocation failed. If n_elements is zero and chunks is null, it returns a chunk representing an array with zero elements (which should be freed if not wanted). Each element must be individually freed when it is no longer needed. If you'd like to instead be able to free all at once, you should instead use a single regular malloc, and assign pointers at particular offsets in the aggregate space. (In this case though, you cannot independently free elements.) independent_comallac differs from independent_calloc in that each element may have a different size, and also that it does not automatically clear elements. independent_comalloc can be used to speed up allocation in cases where several structs or objects must always be allocated at the same time. For example: struct Head { ... } struct Foot { ... } void send_message(char* msg) { int msglen = strlen(msg); size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) }; void* chunks[3]; if (independent_comalloc(3, sizes, chunks) == 0) die(); struct Head* head = (struct Head*)(chunks[0]); char* body = (char*)(chunks[1]); struct Foot* foot = (struct Foot*)(chunks[2]); // ... } In general though, independent_comalloc is worth using only for larger values of n_elements. For small values, you probably won't detect enough difference from series of malloc calls to bother. Overuse of independent_comalloc can increase overall memory usage, since it cannot reuse existing noncontiguous small chunks that might be available for some of the elements. */ void** dlindependent_comalloc(size_t, size_t*, void**); /* pvalloc(size_t n); Equivalent to valloc(minimum-page-that-holds(n)), that is, round up n to nearest pagesize. */ void* dlpvalloc(size_t); /* malloc_trim(size_t pad); If possible, gives memory back to the system (via negative arguments to sbrk) if there is unused memory at the `high' end of the malloc pool or in unused MMAP segments. You can call this after freeing large blocks of memory to potentially reduce the system-level memory requirements of a program. However, it cannot guarantee to reduce memory. Under some allocation patterns, some large free blocks of memory will be locked between two used chunks, so they cannot be given back to the system. The `pad' argument to malloc_trim represents the amount of free trailing space to leave untrimmed. If this argument is zero, only the minimum amount of memory to maintain internal data structures will be left. Non-zero arguments can be supplied to maintain enough trailing space to service future expected allocations without having to re-obtain memory from the system. Malloc_trim returns 1 if it actually released any memory, else 0. */ int dlmalloc_trim(size_t); /* malloc_usable_size(void* p); Returns the number of bytes you can actually use in an allocated chunk, which may be more than you requested (although often not) due to alignment and minimum size constraints. You can use this many bytes without worrying about overwriting other allocated objects. This is not a particularly great programming practice. malloc_usable_size can be more useful in debugging and assertions, for example: p = malloc(n); assert(malloc_usable_size(p) >= 256); */ size_t dlmalloc_usable_size(void*); /* malloc_stats(); Prints on stderr the amount of space obtained from the system (both via sbrk and mmap), the maximum amount (which may be more than current if malloc_trim and/or munmap got called), and the current number of bytes allocated via malloc (or realloc, etc) but not yet freed. Note that this is the number of bytes allocated, not the number requested. It will be larger than the number requested because of alignment and bookkeeping overhead. Because it includes alignment wastage as being in use, this figure may be greater than zero even when no user-level chunks are allocated. The reported current and maximum system memory can be inaccurate if a program makes other calls to system memory allocation functions (normally sbrk) outside of malloc. malloc_stats prints only the most commonly interesting statistics. More information can be obtained by calling mallinfo. */ void dlmalloc_stats(); #endif /* !ONLY_MSPACES */ #if MSPACES /* mspace is an opaque type representing an independent region of space that supports mspace_malloc, etc. */ typedef void* mspace; /* create_mspace creates and returns a new independent space with the given initial capacity, or, if 0, the default granularity size. It returns null if there is no system memory available to create the space. If argument locked is non-zero, the space uses a separate lock to control access. The capacity of the space will grow dynamically as needed to service mspace_malloc requests. You can control the sizes of incremental increases of this space by compiling with a different DEFAULT_GRANULARITY or dynamically setting with mallopt(M_GRANULARITY, value). */ mspace create_mspace(size_t capacity, int locked); /* destroy_mspace destroys the given space, and attempts to return all of its memory back to the system, returning the total number of bytes freed. After destruction, the results of access to all memory used by the space become undefined. */ size_t destroy_mspace(mspace msp); /* create_mspace_with_base uses the memory supplied as the initial base of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this space is used for bookkeeping, so the capacity must be at least this large. (Otherwise 0 is returned.) When this initial space is exhausted, additional memory will be obtained from the system. Destroying this space will deallocate all additionally allocated space (if possible) but not the initial base. */ mspace create_mspace_with_base(void* base, size_t capacity, int locked); /* mspace_malloc behaves as malloc, but operates within the given space. */ void* mspace_malloc(mspace msp, size_t bytes); /* mspace_free behaves as free, but operates within the given space. If compiled with FOOTERS==1, mspace_free is not actually needed. free may be called instead of mspace_free because freed chunks from any space are handled by their originating spaces. */ void mspace_free(mspace msp, void* mem); /* mspace_realloc behaves as realloc, but operates within the given space. If compiled with FOOTERS==1, mspace_realloc is not actually needed. realloc may be called instead of mspace_realloc because realloced chunks from any space are handled by their originating spaces. */ void* mspace_realloc(mspace msp, void* mem, size_t newsize); /* mspace_calloc behaves as calloc, but operates within the given space. */ void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); /* mspace_memalign behaves as memalign, but operates within the given space. */ void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); /* mspace_independent_calloc behaves as independent_calloc, but operates within the given space. */ void** mspace_independent_calloc(mspace msp, size_t n_elements, size_t elem_size, void* chunks[]); /* mspace_independent_comalloc behaves as independent_comalloc, but operates within the given space. */ void** mspace_independent_comalloc(mspace msp, size_t n_elements, size_t sizes[], void* chunks[]); /* mspace_footprint() returns the number of bytes obtained from the system for this space. */ size_t mspace_footprint(mspace msp); #if !NO_MALLINFO /* mspace_mallinfo behaves as mallinfo, but reports properties of the given space. */ struct mallinfo mspace_mallinfo(mspace msp); #endif /* NO_MALLINFO */ /* mspace_malloc_stats behaves as malloc_stats, but reports properties of the given space. */ void mspace_malloc_stats(mspace msp); /* mspace_trim behaves as malloc_trim, but operates within the given space. */ int mspace_trim(mspace msp, size_t pad); /* An alias for mallopt. */ int mspace_mallopt(int, int); #endif /* MSPACES */ #ifdef __cplusplus }; /* end of extern "C" */ #endif #endif /* MALLOC_280_H */ #endif mona-1.4/Mem/gnuc.h0000644000414100000240000000311310756504270011046 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef _GNUC_H #define _GNUC_H #if (! defined __GNUC__) || (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __attribute__(x) # define __inline__ #endif #define GNUC_NORETURN __attribute__ ((__noreturn__)) #define GNUC_CONST __attribute__ ((__const__)) #define GNUC_FORMAT(a,s,f) __attribute__ ((__format__ (a, s, f))) #define GNUC_INLINE __inline__ #if (__GNUC__ > 2) || (__GNUC == 2 && __GNUC_MINOR >= 96) # define GNUC_PURE __attribute__ ((__pure__)) # define GNUC_MALLOC __attribute__ ((__malloc__)) #else # define GNUC_PURE # define GNUC_MALLOC #endif /* GNUC_NORETURN: function never returns GNUC_PURE: never writes to heap GNUC_CONST: never accesses heap GNUC_FORMAT: printf-like argument check GNUC_MALLOC: result is a fresh pointer GNUC_INLINE: inline function */ #endif mona-1.4/Mem/mem.h0000644000414100000240000000214610756504270010675 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __MEM_H #define __MEM_h #include #include "gnuc.h" extern int memlimit; #ifdef MAXALLOCATED extern int maxallocated; #endif void mem_error(); void *mem_alloc(size_t); void mem_free(void *); void *mem_resize(void *, size_t); void mem_copy(void *, void *, size_t); void mem_zero(void *, size_t); unsigned int mem_allocated(); #endif mona-1.4/Mem/makefile.am0000644000414100000240000000034310764207701012035 00000000000000MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonamem.la libmonamem_la_SOURCES = dlmalloc.c mem.c libmonamem_la_LDFLAGS = -version-info 1:4 monadir = $(includedir)/mona mona_HEADERS = dlmalloc.h gnuc.h mem.h mona-1.4/Mem/makefile.in0000644000414100000240000003606011045777402012056 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = Mem DIST_COMMON = $(mona_HEADERS) $(srcdir)/makefile.am \ $(srcdir)/makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libmonamem_la_LIBADD = am_libmonamem_la_OBJECTS = dlmalloc.lo mem.lo libmonamem_la_OBJECTS = $(am_libmonamem_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmonamem_la_SOURCES) DIST_SOURCES = $(libmonamem_la_SOURCES) monaHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(mona_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonamem.la libmonamem_la_SOURCES = dlmalloc.c mem.c libmonamem_la_LDFLAGS = -version-info 1:4 monadir = $(includedir)/mona mona_HEADERS = dlmalloc.h gnuc.h mem.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Mem/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Mem/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmonamem.la: $(libmonamem_la_OBJECTS) $(libmonamem_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libmonamem_la_LDFLAGS) $(libmonamem_la_OBJECTS) $(libmonamem_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlmalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-monaHEADERS: $(mona_HEADERS) @$(NORMAL_INSTALL) test -z "$(monadir)" || $(mkdir_p) "$(DESTDIR)$(monadir)" @list='$(mona_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(monaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(monadir)/$$f'"; \ $(monaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(monadir)/$$f"; \ done uninstall-monaHEADERS: @$(NORMAL_UNINSTALL) @list='$(mona_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(monadir)/$$f'"; \ rm -f "$(DESTDIR)$(monadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-monaHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-monaHEADERS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/Mem/dlmalloc.c0000644000414100000240000053757310764207551011723 00000000000000#ifdef USE_MALLOC int dl_dummy; #else #include "config.h" /* This is a version (aka dlmalloc) of malloc/free/realloc written by Doug Lea and released to the public domain, as explained at http://creativecommons.org/licenses/publicdomain. Send questions, comments, complaints, performance data, etc to dl@cs.oswego.edu * Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee) Note: There may be an updated version of this malloc obtainable at ftp://gee.cs.oswego.edu/pub/misc/malloc.c Check before installing! * Quickstart This library is all in one file to simplify the most common usage: ftp it, compile it (-O3), and link it into another program. All of the compile-time options default to reasonable values for use on most platforms. You might later want to step through various compile-time and dynamic tuning options. For convenience, an include file for code using this malloc is at: ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h You don't really need this .h file unless you call functions not defined in your system include files. The .h file contains only the excerpts from this file needed for using this malloc on ANSI C/C++ systems, so long as you haven't changed compile-time options about naming and tuning parameters. If you do, then you can create your own malloc.h that does include all settings by cutting at the point indicated below. Note that you may already by default be using a C library containing a malloc that is based on some version of this malloc (for example in linux). You might still want to use the one in this file to customize settings or to avoid overheads associated with library versions. * Vital statistics: Supported pointer/size_t representation: 4 or 8 bytes size_t MUST be an unsigned type of the same width as pointers. (If you are using an ancient system that declares size_t as a signed type, or need it to be a different width than pointers, you can use a previous release of this malloc (e.g. 2.7.2) supporting these.) Alignment: 8 bytes (default) This suffices for nearly all current machines and C compilers. However, you can define MALLOC_ALIGNMENT to be wider than this if necessary (up to 128bytes), at the expense of using more space. Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes) 8 or 16 bytes (if 8byte sizes) Each malloced chunk has a hidden word of overhead holding size and status information, and additional cross-check word if FOOTERS is defined. Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead) 8-byte ptrs: 32 bytes (including overhead) Even a request for zero bytes (i.e., malloc(0)) returns a pointer to something of the minimum allocatable size. The maximum overhead wastage (i.e., number of extra bytes allocated than were requested in malloc) is less than or equal to the minimum size, except for requests >= mmap_threshold that are serviced via mmap(), where the worst case wastage is about 32 bytes plus the remainder from a system page (the minimal mmap unit); typically 4096 or 8192 bytes. Security: static-safe; optionally more or less The "security" of malloc refers to the ability of malicious code to accentuate the effects of errors (for example, freeing space that is not currently malloc'ed or overwriting past the ends of chunks) in code that calls malloc. This malloc guarantees not to modify any memory locations below the base of heap, i.e., static variables, even in the presence of usage errors. The routines additionally detect most improper frees and reallocs. All this holds as long as the static bookkeeping for malloc itself is not corrupted by some other means. This is only one aspect of security -- these checks do not, and cannot, detect all possible programming errors. If FOOTERS is defined nonzero, then each allocated chunk carries an additional check word to verify that it was malloced from its space. These check words are the same within each execution of a program using malloc, but differ across executions, so externally crafted fake chunks cannot be freed. This improves security by rejecting frees/reallocs that could corrupt heap memory, in addition to the checks preventing writes to statics that are always on. This may further improve security at the expense of time and space overhead. (Note that FOOTERS may also be worth using with MSPACES.) By default detected errors cause the program to abort (calling "abort()"). You can override this to instead proceed past errors by defining PROCEED_ON_ERROR. In this case, a bad free has no effect, and a malloc that encounters a bad address caused by user overwrites will ignore the bad address by dropping pointers and indices to all known memory. This may be appropriate for programs that should continue if at all possible in the face of programming errors, although they may run out of memory because dropped memory is never reclaimed. If you don't like either of these options, you can define CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything else. And if if you are sure that your program using malloc has no errors or vulnerabilities, you can define INSECURE to 1, which might (or might not) provide a small performance improvement. Thread-safety: NOT thread-safe unless USE_LOCKS defined When USE_LOCKS is defined, each public call to malloc, free, etc is surrounded with either a pthread mutex or a win32 spinlock (depending on WIN32). This is not especially fast, and can be a major bottleneck. It is designed only to provide minimal protection in concurrent environments, and to provide a basis for extensions. If you are using malloc in a concurrent program, consider instead using ptmalloc, which is derived from a version of this malloc. (See http://www.malloc.de). System requirements: Any combination of MORECORE and/or MMAP/MUNMAP This malloc can use unix sbrk or any emulation (invoked using the CALL_MORECORE macro) and/or mmap/munmap or any emulation (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system memory. On most unix systems, it tends to work best if both MORECORE and MMAP are enabled. On Win32, it uses emulations based on VirtualAlloc. It also uses common C library functions like memset. Compliance: I believe it is compliant with the Single Unix Specification (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably others as well. * Overview of algorithms This is not the fastest, most space-conserving, most portable, or most tunable malloc ever written. However it is among the fastest while also being among the most space-conserving, portable and tunable. Consistent balance across these factors results in a good general-purpose allocator for malloc-intensive programs. In most ways, this malloc is a best-fit allocator. Generally, it chooses the best-fitting existing chunk for a request, with ties broken in approximately least-recently-used order. (This strategy normally maintains low fragmentation.) However, for requests less than 256bytes, it deviates from best-fit when there is not an exactly fitting available chunk by preferring to use space adjacent to that used for the previous small request, as well as by breaking ties in approximately most-recently-used order. (These enhance locality of series of small allocations.) And for very large requests (>= 256Kb by default), it relies on system memory mapping facilities, if supported. (This helps avoid carrying around and possibly fragmenting memory used only for large chunks.) All operations (except malloc_stats and mallinfo) have execution times that are bounded by a constant factor of the number of bits in a size_t, not counting any clearing in calloc or copying in realloc, or actions surrounding MORECORE and MMAP that have times proportional to the number of non-contiguous regions returned by system allocation routines, which is often just 1. The implementation is not very modular and seriously overuses macros. Perhaps someday all C compilers will do as good a job inlining modular code as can now be done by brute-force expansion, but now, enough of them seem not to. Some compilers issue a lot of warnings about code that is dead/unreachable only on some platforms, and also about intentional uses of negation on unsigned types. All known cases of each can be ignored. For a longer but out of date high-level description, see http://gee.cs.oswego.edu/dl/html/malloc.html * MSPACES If MSPACES is defined, then in addition to malloc, free, etc., this file also defines mspace_malloc, mspace_free, etc. These are versions of malloc routines that take an "mspace" argument obtained using create_mspace, to control all internal bookkeeping. If ONLY_MSPACES is defined, only these versions are compiled. So if you would like to use this allocator for only some allocations, and your system malloc for others, you can compile with ONLY_MSPACES and then do something like... static mspace mymspace = create_mspace(0,0); // for example #define mymalloc(bytes) mspace_malloc(mymspace, bytes) (Note: If you only need one instance of an mspace, you can instead use "USE_DL_PREFIX" to relabel the global malloc.) You can similarly create thread-local allocators by storing mspaces as thread-locals. For example: static __thread mspace tlms = 0; void* tlmalloc(size_t bytes) { if (tlms == 0) tlms = create_mspace(0, 0); return mspace_malloc(tlms, bytes); } void tlfree(void* mem) { mspace_free(tlms, mem); } Unless FOOTERS is defined, each mspace is completely independent. You cannot allocate from one and free to another (although conformance is only weakly checked, so usage errors are not always caught). If FOOTERS is defined, then each chunk carries around a tag indicating its originating mspace, and frees are directed to their originating spaces. ------------------------- Compile-time options --------------------------- Be careful in setting #define values for numerical constants of type size_t. On some systems, literal values are not automatically extended to size_t precision unless they are explicitly casted. WIN32 default: defined if _WIN32 defined Defining WIN32 sets up defaults for MS environment and compilers. Otherwise defaults are for unix. MALLOC_ALIGNMENT default: (size_t)8 Controls the minimum alignment for malloc'ed chunks. It must be a power of two and at least 8, even on machines for which smaller alignments would suffice. It may be defined as larger than this though. Note however that code and data structures are optimized for the case of 8-byte alignment. MSPACES default: 0 (false) If true, compile in support for independent allocation spaces. This is only supported if HAVE_MMAP is true. ONLY_MSPACES default: 0 (false) If true, only compile in mspace versions, not regular versions. USE_LOCKS default: 0 (false) Causes each call to each public routine to be surrounded with pthread or WIN32 mutex lock/unlock. (If set true, this can be overridden on a per-mspace basis for mspace versions.) FOOTERS default: 0 If true, provide extra checking and dispatching by placing information in the footers of allocated chunks. This adds space and time overhead. INSECURE default: 0 If true, omit checks for usage errors and heap space overwrites. USE_DL_PREFIX default: NOT defined Causes compiler to prefix all public routines with the string 'dl'. This can be useful when you only want to use this malloc in one part of a program, using your regular system malloc elsewhere. ABORT default: defined as abort() Defines how to abort on failed checks. On most systems, a failed check cannot die with an "assert" or even print an informative message, because the underlying print routines in turn call malloc, which will fail again. Generally, the best policy is to simply call abort(). It's not very useful to do more than this because many errors due to overwriting will show up as address faults (null, odd addresses etc) rather than malloc-triggered checks, so will also abort. Also, most compilers know that abort() does not return, so can better optimize code conditionally calling it. PROCEED_ON_ERROR default: defined as 0 (false) Controls whether detected bad addresses cause them to bypassed rather than aborting. If set, detected bad arguments to free and realloc are ignored. And all bookkeeping information is zeroed out upon a detected overwrite of freed heap space, thus losing the ability to ever return it from malloc again, but enabling the application to proceed. If PROCEED_ON_ERROR is defined, the static variable malloc_corruption_error_count is compiled in and can be examined to see if errors have occurred. This option generates slower code than the default abort policy. DEBUG default: NOT defined The DEBUG setting is mainly intended for people trying to modify this code or diagnose problems when porting to new platforms. However, it may also be able to better isolate user errors than just using runtime checks. The assertions in the check routines spell out in more detail the assumptions and invariants underlying the algorithms. The checking is fairly extensive, and will slow down execution noticeably. Calling malloc_stats or mallinfo with DEBUG set will attempt to check every non-mmapped allocated and free chunk in the course of computing the summaries. ABORT_ON_ASSERT_FAILURE default: defined as 1 (true) Debugging assertion failures can be nearly impossible if your version of the assert macro causes malloc to be called, which will lead to a cascade of further failures, blowing the runtime stack. ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(), which will usually make debugging easier. MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32 The action to take before "return 0" when malloc fails to be able to return memory because there is none available. HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES True if this system supports sbrk or an emulation of it. MORECORE default: sbrk The name of the sbrk-style system routine to call to obtain more memory. See below for guidance on writing custom MORECORE functions. The type of the argument to sbrk/MORECORE varies across systems. It cannot be size_t, because it supports negative arguments, so it is normally the signed type of the same width as size_t (sometimes declared as "intptr_t"). It doesn't much matter though. Internally, we only call it with arguments less than half the max value of a size_t, which should work across all reasonable possibilities, although sometimes generating compiler warnings. See near the end of this file for guidelines for creating a custom version of MORECORE. MORECORE_CONTIGUOUS default: 1 (true) If true, take advantage of fact that consecutive calls to MORECORE with positive arguments always return contiguous increasing addresses. This is true of unix sbrk. It does not hurt too much to set it true anyway, since malloc copes with non-contiguities. Setting it false when definitely non-contiguous saves time and possibly wasted space it would take to discover this though. MORECORE_CANNOT_TRIM default: NOT defined True if MORECORE cannot release space back to the system when given negative arguments. This is generally necessary only if you are using a hand-crafted MORECORE function that cannot handle negative arguments. HAVE_MMAP default: 1 (true) True if this system supports mmap or an emulation of it. If so, and HAVE_MORECORE is not true, MMAP is used for all system allocation. If set and HAVE_MORECORE is true as well, MMAP is primarily used to directly allocate very large blocks. It is also used as a backup strategy in cases where MORECORE fails to provide space from system. Note: A single call to MUNMAP is assumed to be able to unmap memory that may have be allocated using multiple calls to MMAP, so long as they are adjacent. HAVE_MREMAP default: 1 on linux, else 0 If true realloc() uses mremap() to re-allocate large blocks and extend or shrink allocation spaces. MMAP_CLEARS default: 1 on unix True if mmap clears memory so calloc doesn't need to. This is true for standard unix mmap using /dev/zero. USE_BUILTIN_FFS default: 0 (i.e., not used) Causes malloc to use the builtin ffs() function to compute indices. Some compilers may recognize and intrinsify ffs to be faster than the supplied C version. Also, the case of x86 using gcc is special-cased to an asm instruction, so is already as fast as it can be, and so this setting has no effect. (On most x86s, the asm version is only slightly faster than the C version.) malloc_getpagesize default: derive from system includes, or 4096. The system page size. To the extent possible, this malloc manages memory from the system in page-size units. This may be (and usually is) a function rather than a constant. This is ignored if WIN32, where page size is determined using getSystemInfo during initialization. USE_DEV_RANDOM default: 0 (i.e., not used) Causes malloc to use /dev/random to initialize secure magic seed for stamping footers. Otherwise, the current time is used. NO_MALLINFO default: 0 If defined, don't compile "mallinfo". This can be a simple way of dealing with mismatches between system declarations and those in this file. MALLINFO_FIELD_TYPE default: size_t The type of the fields in the mallinfo struct. This was originally defined as "int" in SVID etc, but is more usefully defined as size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set REALLOC_ZERO_BYTES_FREES default: not defined This should be set if a call to realloc with zero bytes should be the same as a call to free. Some people think it should. Otherwise, since this malloc returns a unique pointer for malloc(0), so does realloc(p, 0). LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H LACKS_STDLIB_H default: NOT defined unless on WIN32 Define these if your system does not have these header files. You might need to manually insert some of the declarations they provide. DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS, system_info.dwAllocationGranularity in WIN32, otherwise 64K. Also settable using mallopt(M_GRANULARITY, x) The unit for allocating and deallocating memory from the system. On most systems with contiguous MORECORE, there is no reason to make this more than a page. However, systems with MMAP tend to either require or encourage larger granularities. You can increase this value to prevent system allocation functions to be called so often, especially if they are slow. The value must be at least one page and must be a power of two. Setting to 0 causes initialization to either page size or win32 region size. (Note: In previous versions of malloc, the equivalent of this option was called "TOP_PAD") DEFAULT_TRIM_THRESHOLD default: 2MB Also settable using mallopt(M_TRIM_THRESHOLD, x) The maximum amount of unused top-most memory to keep before releasing via malloc_trim in free(). Automatic trimming is mainly useful in long-lived programs using contiguous MORECORE. Because trimming via sbrk can be slow on some systems, and can sometimes be wasteful (in cases where programs immediately afterward allocate more large chunks) the value should be high enough so that your overall system performance would improve by releasing this much memory. As a rough guide, you might set to a value close to the average size of a process (program) running on your system. Releasing this much memory would allow such a process to run in memory. Generally, it is worth tuning trim thresholds when a program undergoes phases where several large chunks are allocated and released in ways that can reuse each other's storage, perhaps mixed with phases where there are no such chunks at all. The trim value must be greater than page size to have any useful effect. To disable trimming completely, you can set to MAX_SIZE_T. Note that the trick some people use of mallocing a huge space and then freeing it at program startup, in an attempt to reserve system memory, doesn't have the intended effect under automatic trimming, since that memory will immediately be returned to the system. DEFAULT_MMAP_THRESHOLD default: 256K Also settable using mallopt(M_MMAP_THRESHOLD, x) The request size threshold for using MMAP to directly service a request. Requests of at least this size that cannot be allocated using already-existing space will be serviced via mmap. (If enough normal freed space already exists it is used instead.) Using mmap segregates relatively large chunks of memory so that they can be individually obtained and released from the host system. A request serviced through mmap is never reused by any other request (at least not directly; the system may just so happen to remap successive requests to the same locations). Segregating space in this way has the benefits that: Mmapped space can always be individually released back to the system, which helps keep the system level memory demands of a long-lived program low. Also, mapped memory doesn't become `locked' between other chunks, as can happen with normally allocated chunks, which means that even trimming via malloc_trim would not release them. However, it has the disadvantage that the space cannot be reclaimed, consolidated, and then used to service later requests, as happens with normal chunks. The advantages of mmap nearly always outweigh disadvantages for "large" chunks, but the value of "large" may vary across systems. The default is an empirically derived value that works well in most systems. You can disable mmap by setting to MAX_SIZE_T. */ #ifndef WIN32 #ifdef _WIN32 #define WIN32 1 #endif /* _WIN32 */ #endif /* WIN32 */ #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include #define HAVE_MMAP 1 #define HAVE_MORECORE 0 #define LACKS_UNISTD_H #define LACKS_SYS_PARAM_H #define LACKS_SYS_MMAN_H #define LACKS_STRING_H #define LACKS_STRINGS_H #define LACKS_SYS_TYPES_H #define LACKS_ERRNO_H #define MALLOC_FAILURE_ACTION #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ #endif /* WIN32 */ #if defined(DARWIN) || defined(_DARWIN) /* Mac OSX docs advise not to use sbrk; it seems better to use mmap */ #ifndef HAVE_MORECORE #define HAVE_MORECORE 0 #define HAVE_MMAP 1 #endif /* HAVE_MORECORE */ #endif /* DARWIN */ #ifndef LACKS_SYS_TYPES_H #include /* For size_t */ #endif /* LACKS_SYS_TYPES_H */ /* The maximum possible size_t value has all bits set */ #define MAX_SIZE_T (~(size_t)0) #ifndef ONLY_MSPACES #define ONLY_MSPACES 0 #endif /* ONLY_MSPACES */ #ifndef MSPACES #if ONLY_MSPACES #define MSPACES 1 #else /* ONLY_MSPACES */ #define MSPACES 0 #endif /* ONLY_MSPACES */ #endif /* MSPACES */ #ifndef MALLOC_ALIGNMENT #define MALLOC_ALIGNMENT ((size_t)8U) #endif /* MALLOC_ALIGNMENT */ #ifndef FOOTERS #define FOOTERS 0 #endif /* FOOTERS */ #ifndef ABORT #define ABORT abort() #endif /* ABORT */ #ifndef ABORT_ON_ASSERT_FAILURE #define ABORT_ON_ASSERT_FAILURE 1 #endif /* ABORT_ON_ASSERT_FAILURE */ #ifndef PROCEED_ON_ERROR #define PROCEED_ON_ERROR 0 #endif /* PROCEED_ON_ERROR */ #ifndef USE_LOCKS #define USE_LOCKS 0 #endif /* USE_LOCKS */ #ifndef INSECURE #define INSECURE 0 #endif /* INSECURE */ #ifndef HAVE_MMAP #define HAVE_MMAP 1 #endif /* HAVE_MMAP */ #ifndef MMAP_CLEARS #define MMAP_CLEARS 1 #endif /* MMAP_CLEARS */ #ifndef HAVE_MREMAP #ifdef linux #define HAVE_MREMAP 1 #else /* linux */ #define HAVE_MREMAP 0 #endif /* linux */ #endif /* HAVE_MREMAP */ #ifndef MALLOC_FAILURE_ACTION #define MALLOC_FAILURE_ACTION errno = ENOMEM; #endif /* MALLOC_FAILURE_ACTION */ #ifndef HAVE_MORECORE #if ONLY_MSPACES #define HAVE_MORECORE 0 #else /* ONLY_MSPACES */ #define HAVE_MORECORE 1 #endif /* ONLY_MSPACES */ #endif /* HAVE_MORECORE */ #if !HAVE_MORECORE #define MORECORE_CONTIGUOUS 0 #else /* !HAVE_MORECORE */ #ifndef MORECORE #define MORECORE sbrk #endif /* MORECORE */ #ifndef MORECORE_CONTIGUOUS #define MORECORE_CONTIGUOUS 1 #endif /* MORECORE_CONTIGUOUS */ #endif /* HAVE_MORECORE */ #ifndef DEFAULT_GRANULARITY #if MORECORE_CONTIGUOUS #define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ #else /* MORECORE_CONTIGUOUS */ #define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) #endif /* MORECORE_CONTIGUOUS */ #endif /* DEFAULT_GRANULARITY */ #ifndef DEFAULT_TRIM_THRESHOLD #ifndef MORECORE_CANNOT_TRIM #define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) #else /* MORECORE_CANNOT_TRIM */ #define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T #endif /* MORECORE_CANNOT_TRIM */ #endif /* DEFAULT_TRIM_THRESHOLD */ #ifndef DEFAULT_MMAP_THRESHOLD #if HAVE_MMAP #define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) #else /* HAVE_MMAP */ #define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T #endif /* HAVE_MMAP */ #endif /* DEFAULT_MMAP_THRESHOLD */ #ifndef USE_BUILTIN_FFS #define USE_BUILTIN_FFS 0 #endif /* USE_BUILTIN_FFS */ #ifndef USE_DEV_RANDOM #define USE_DEV_RANDOM 0 #endif /* USE_DEV_RANDOM */ #ifndef NO_MALLINFO #define NO_MALLINFO 0 #endif /* NO_MALLINFO */ #ifndef MALLINFO_FIELD_TYPE #define MALLINFO_FIELD_TYPE size_t #endif /* MALLINFO_FIELD_TYPE */ /* mallopt tuning options. SVID/XPG defines four standard parameter numbers for mallopt, normally defined in malloc.h. None of these are used in this malloc, so setting them has no effect. But this malloc does support the following options. */ #define M_TRIM_THRESHOLD (-1) #define M_GRANULARITY (-2) #define M_MMAP_THRESHOLD (-3) /* ------------------------ Mallinfo declarations ------------------------ */ #if !NO_MALLINFO /* This version of malloc supports the standard SVID/XPG mallinfo routine that returns a struct containing usage properties and statistics. It should work on any system that has a /usr/include/malloc.h defining struct mallinfo. The main declaration needed is the mallinfo struct that is returned (by-copy) by mallinfo(). The malloinfo struct contains a bunch of fields that are not even meaningful in this version of malloc. These fields are are instead filled by mallinfo() with other numbers that might be of interest. HAVE_USR_INCLUDE_MALLOC_H should be set if you have a /usr/include/malloc.h file that includes a declaration of struct mallinfo. If so, it is included; else a compliant version is declared below. These must be precisely the same for mallinfo() to work. The original SVID version of this struct, defined on most systems with mallinfo, declares all fields as ints. But some others define as unsigned long. If your system defines the fields using a type of different width than listed here, you MUST #include your system version and #define HAVE_USR_INCLUDE_MALLOC_H. */ /* #define HAVE_USR_INCLUDE_MALLOC_H */ #ifdef HAVE_USR_INCLUDE_MALLOC_H #include "/usr/include/malloc.h" #else /* HAVE_USR_INCLUDE_MALLOC_H */ struct mallinfo { MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ MALLINFO_FIELD_TYPE smblks; /* always 0 */ MALLINFO_FIELD_TYPE hblks; /* always 0 */ MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ MALLINFO_FIELD_TYPE fordblks; /* total free space */ MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ }; #endif /* HAVE_USR_INCLUDE_MALLOC_H */ #endif /* NO_MALLINFO */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if !ONLY_MSPACES /* ------------------- Declarations of public routines ------------------- */ #ifndef USE_DL_PREFIX #define dlcalloc calloc #define dlfree free #define dlmalloc malloc #define dlmemalign memalign #define dlrealloc realloc #define dlvalloc valloc #define dlpvalloc pvalloc #define dlmallinfo mallinfo #define dlmallopt mallopt #define dlmalloc_trim malloc_trim #define dlmalloc_stats malloc_stats #define dlmalloc_usable_size malloc_usable_size #define dlmalloc_footprint malloc_footprint #define dlmalloc_max_footprint malloc_max_footprint #define dlindependent_calloc independent_calloc #define dlindependent_comalloc independent_comalloc #endif /* USE_DL_PREFIX */ /* malloc(size_t n) Returns a pointer to a newly allocated chunk of at least n bytes, or null if no space is available, in which case errno is set to ENOMEM on ANSI C systems. If n is zero, malloc returns a minimum-sized chunk. (The minimum size is 16 bytes on most 32bit systems, and 32 bytes on 64bit systems.) Note that size_t is an unsigned type, so calls with arguments that would be negative if signed are interpreted as requests for huge amounts of space, which will often fail. The maximum supported value of n differs across systems, but is in all cases less than the maximum representable value of a size_t. */ void* dlmalloc(size_t); /* free(void* p) Releases the chunk of memory pointed to by p, that had been previously allocated using malloc or a related routine such as realloc. It has no effect if p is null. If p was not malloced or already freed, free(p) will by default cause the current program to abort. */ void dlfree(void*); /* calloc(size_t n_elements, size_t element_size); Returns a pointer to n_elements * element_size bytes, with all locations set to zero. */ void* dlcalloc(size_t, size_t); /* realloc(void* p, size_t n) Returns a pointer to a chunk of size n that contains the same data as does chunk p up to the minimum of (n, p's size) bytes, or null if no space is available. The returned pointer may or may not be the same as p. The algorithm prefers extending p in most cases when possible, otherwise it employs the equivalent of a malloc-copy-free sequence. If p is null, realloc is equivalent to malloc. If space is not available, realloc returns null, errno is set (if on ANSI) and p is NOT freed. if n is for fewer bytes than already held by p, the newly unused space is lopped off and freed if possible. realloc with a size argument of zero (re)allocates a minimum-sized chunk. The old unix realloc convention of allowing the last-free'd chunk to be used as an argument to realloc is not supported. */ void* dlrealloc(void*, size_t); /* memalign(size_t alignment, size_t n); Returns a pointer to a newly allocated chunk of n bytes, aligned in accord with the alignment argument. The alignment argument should be a power of two. If the argument is not a power of two, the nearest greater power is used. 8-byte alignment is guaranteed by normal malloc calls, so don't bother calling memalign with an argument of 8 or less. Overreliance on memalign is a sure way to fragment space. */ void* dlmemalign(size_t, size_t); /* valloc(size_t n); Equivalent to memalign(pagesize, n), where pagesize is the page size of the system. If the pagesize is unknown, 4096 is used. */ void* dlvalloc(size_t); /* mallopt(int parameter_number, int parameter_value) Sets tunable parameters The format is to provide a (parameter-number, parameter-value) pair. mallopt then sets the corresponding parameter to the argument value if it can (i.e., so long as the value is meaningful), and returns 1 if successful else 0. SVID/XPG/ANSI defines four standard param numbers for mallopt, normally defined in malloc.h. None of these are use in this malloc, so setting them has no effect. But this malloc also supports other options in mallopt. See below for details. Briefly, supported parameters are as follows (listed defaults are for "typical" configurations). Symbol param # default allowed param values M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables) M_GRANULARITY -2 page size any power of 2 >= page size M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) */ int dlmallopt(int, int); /* malloc_footprint(); Returns the number of bytes obtained from the system. The total number of bytes allocated by malloc, realloc etc., is less than this value. Unlike mallinfo, this function returns only a precomputed result, so can be called frequently to monitor memory consumption. Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ size_t dlmalloc_footprint(void); /* malloc_max_footprint(); Returns the maximum number of bytes obtained from the system. This value will be greater than current footprint if deallocated space has been reclaimed by the system. The peak number of bytes allocated by malloc, realloc etc., is less than this value. Unlike mallinfo, this function returns only a precomputed result, so can be called frequently to monitor memory consumption. Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ size_t dlmalloc_max_footprint(void); #if !NO_MALLINFO /* mallinfo() Returns (by copy) a struct containing various summary statistics: arena: current total non-mmapped bytes allocated from system ordblks: the number of free chunks smblks: always zero. hblks: current number of mmapped regions hblkhd: total bytes held in mmapped regions usmblks: the maximum total allocated space. This will be greater than current total if trimming has occurred. fsmblks: always zero uordblks: current total allocated space (normal or mmapped) fordblks: total free space keepcost: the maximum number of bytes that could ideally be released back to system via malloc_trim. ("ideally" means that it ignores page restrictions etc.) Because these fields are ints, but internal bookkeeping may be kept as longs, the reported values may wrap around zero and thus be inaccurate. */ struct mallinfo dlmallinfo(void); #endif /* NO_MALLINFO */ /* independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); independent_calloc is similar to calloc, but instead of returning a single cleared space, it returns an array of pointers to n_elements independent elements that can hold contents of size elem_size, each of which starts out cleared, and can be independently freed, realloc'ed etc. The elements are guaranteed to be adjacently allocated (this is not guaranteed to occur with multiple callocs or mallocs), which may also improve cache locality in some applications. The "chunks" argument is optional (i.e., may be null, which is probably the most typical usage). If it is null, the returned array is itself dynamically allocated and should also be freed when it is no longer needed. Otherwise, the chunks array must be of at least n_elements in length. It is filled in with the pointers to the chunks. In either case, independent_calloc returns this pointer array, or null if the allocation failed. If n_elements is zero and "chunks" is null, it returns a chunk representing an array with zero elements (which should be freed if not wanted). Each element must be individually freed when it is no longer needed. If you'd like to instead be able to free all at once, you should instead use regular calloc and assign pointers into this space to represent elements. (In this case though, you cannot independently free elements.) independent_calloc simplifies and speeds up implementations of many kinds of pools. It may also be useful when constructing large data structures that initially have a fixed number of fixed-sized nodes, but the number is not known at compile time, and some of the nodes may later need to be freed. For example: struct Node { int item; struct Node* next; }; struct Node* build_list() { struct Node** pool; int n = read_number_of_nodes_needed(); if (n <= 0) return 0; pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0); if (pool == 0) die(); // organize into a linked list... struct Node* first = pool[0]; for (i = 0; i < n-1; ++i) pool[i]->next = pool[i+1]; free(pool); // Can now free the array (or not, if it is needed later) return first; } */ void** dlindependent_calloc(size_t, size_t, void**); /* independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); independent_comalloc allocates, all at once, a set of n_elements chunks with sizes indicated in the "sizes" array. It returns an array of pointers to these elements, each of which can be independently freed, realloc'ed etc. The elements are guaranteed to be adjacently allocated (this is not guaranteed to occur with multiple callocs or mallocs), which may also improve cache locality in some applications. The "chunks" argument is optional (i.e., may be null). If it is null the returned array is itself dynamically allocated and should also be freed when it is no longer needed. Otherwise, the chunks array must be of at least n_elements in length. It is filled in with the pointers to the chunks. In either case, independent_comalloc returns this pointer array, or null if the allocation failed. If n_elements is zero and chunks is null, it returns a chunk representing an array with zero elements (which should be freed if not wanted). Each element must be individually freed when it is no longer needed. If you'd like to instead be able to free all at once, you should instead use a single regular malloc, and assign pointers at particular offsets in the aggregate space. (In this case though, you cannot independently free elements.) independent_comallac differs from independent_calloc in that each element may have a different size, and also that it does not automatically clear elements. independent_comalloc can be used to speed up allocation in cases where several structs or objects must always be allocated at the same time. For example: struct Head { ... } struct Foot { ... } void send_message(char* msg) { int msglen = strlen(msg); size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) }; void* chunks[3]; if (independent_comalloc(3, sizes, chunks) == 0) die(); struct Head* head = (struct Head*)(chunks[0]); char* body = (char*)(chunks[1]); struct Foot* foot = (struct Foot*)(chunks[2]); // ... } In general though, independent_comalloc is worth using only for larger values of n_elements. For small values, you probably won't detect enough difference from series of malloc calls to bother. Overuse of independent_comalloc can increase overall memory usage, since it cannot reuse existing noncontiguous small chunks that might be available for some of the elements. */ void** dlindependent_comalloc(size_t, size_t*, void**); /* pvalloc(size_t n); Equivalent to valloc(minimum-page-that-holds(n)), that is, round up n to nearest pagesize. */ void* dlpvalloc(size_t); /* malloc_trim(size_t pad); If possible, gives memory back to the system (via negative arguments to sbrk) if there is unused memory at the `high' end of the malloc pool or in unused MMAP segments. You can call this after freeing large blocks of memory to potentially reduce the system-level memory requirements of a program. However, it cannot guarantee to reduce memory. Under some allocation patterns, some large free blocks of memory will be locked between two used chunks, so they cannot be given back to the system. The `pad' argument to malloc_trim represents the amount of free trailing space to leave untrimmed. If this argument is zero, only the minimum amount of memory to maintain internal data structures will be left. Non-zero arguments can be supplied to maintain enough trailing space to service future expected allocations without having to re-obtain memory from the system. Malloc_trim returns 1 if it actually released any memory, else 0. */ int dlmalloc_trim(size_t); /* malloc_usable_size(void* p); Returns the number of bytes you can actually use in an allocated chunk, which may be more than you requested (although often not) due to alignment and minimum size constraints. You can use this many bytes without worrying about overwriting other allocated objects. This is not a particularly great programming practice. malloc_usable_size can be more useful in debugging and assertions, for example: p = malloc(n); assert(malloc_usable_size(p) >= 256); */ size_t dlmalloc_usable_size(void*); /* malloc_stats(); Prints on stderr the amount of space obtained from the system (both via sbrk and mmap), the maximum amount (which may be more than current if malloc_trim and/or munmap got called), and the current number of bytes allocated via malloc (or realloc, etc) but not yet freed. Note that this is the number of bytes allocated, not the number requested. It will be larger than the number requested because of alignment and bookkeeping overhead. Because it includes alignment wastage as being in use, this figure may be greater than zero even when no user-level chunks are allocated. The reported current and maximum system memory can be inaccurate if a program makes other calls to system memory allocation functions (normally sbrk) outside of malloc. malloc_stats prints only the most commonly interesting statistics. More information can be obtained by calling mallinfo. */ void dlmalloc_stats(void); #endif /* ONLY_MSPACES */ #if MSPACES /* mspace is an opaque type representing an independent region of space that supports mspace_malloc, etc. */ typedef void* mspace; /* create_mspace creates and returns a new independent space with the given initial capacity, or, if 0, the default granularity size. It returns null if there is no system memory available to create the space. If argument locked is non-zero, the space uses a separate lock to control access. The capacity of the space will grow dynamically as needed to service mspace_malloc requests. You can control the sizes of incremental increases of this space by compiling with a different DEFAULT_GRANULARITY or dynamically setting with mallopt(M_GRANULARITY, value). */ mspace create_mspace(size_t capacity, int locked); /* destroy_mspace destroys the given space, and attempts to return all of its memory back to the system, returning the total number of bytes freed. After destruction, the results of access to all memory used by the space become undefined. */ size_t destroy_mspace(mspace msp); /* create_mspace_with_base uses the memory supplied as the initial base of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this space is used for bookkeeping, so the capacity must be at least this large. (Otherwise 0 is returned.) When this initial space is exhausted, additional memory will be obtained from the system. Destroying this space will deallocate all additionally allocated space (if possible) but not the initial base. */ mspace create_mspace_with_base(void* base, size_t capacity, int locked); /* mspace_malloc behaves as malloc, but operates within the given space. */ void* mspace_malloc(mspace msp, size_t bytes); /* mspace_free behaves as free, but operates within the given space. If compiled with FOOTERS==1, mspace_free is not actually needed. free may be called instead of mspace_free because freed chunks from any space are handled by their originating spaces. */ void mspace_free(mspace msp, void* mem); /* mspace_realloc behaves as realloc, but operates within the given space. If compiled with FOOTERS==1, mspace_realloc is not actually needed. realloc may be called instead of mspace_realloc because realloced chunks from any space are handled by their originating spaces. */ void* mspace_realloc(mspace msp, void* mem, size_t newsize); /* mspace_calloc behaves as calloc, but operates within the given space. */ void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); /* mspace_memalign behaves as memalign, but operates within the given space. */ void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); /* mspace_independent_calloc behaves as independent_calloc, but operates within the given space. */ void** mspace_independent_calloc(mspace msp, size_t n_elements, size_t elem_size, void* chunks[]); /* mspace_independent_comalloc behaves as independent_comalloc, but operates within the given space. */ void** mspace_independent_comalloc(mspace msp, size_t n_elements, size_t sizes[], void* chunks[]); /* mspace_footprint() returns the number of bytes obtained from the system for this space. */ size_t mspace_footprint(mspace msp); /* mspace_max_footprint() returns the peak number of bytes obtained from the system for this space. */ size_t mspace_max_footprint(mspace msp); #if !NO_MALLINFO /* mspace_mallinfo behaves as mallinfo, but reports properties of the given space. */ struct mallinfo mspace_mallinfo(mspace msp); #endif /* NO_MALLINFO */ /* mspace_malloc_stats behaves as malloc_stats, but reports properties of the given space. */ void mspace_malloc_stats(mspace msp); /* mspace_trim behaves as malloc_trim, but operates within the given space. */ int mspace_trim(mspace msp, size_t pad); /* An alias for mallopt. */ int mspace_mallopt(int, int); #endif /* MSPACES */ #ifdef __cplusplus }; /* end of extern "C" */ #endif /* __cplusplus */ /* ======================================================================== To make a fully customizable malloc.h header file, cut everything above this line, put into file malloc.h, edit to suit, and #include it on the next line, as well as in programs that use this malloc. ======================================================================== */ /* #include "malloc.h" */ /*------------------------------ internal #includes ---------------------- */ #ifdef WIN32 #pragma warning( disable : 4146 ) /* no "unsigned" warnings */ #endif /* WIN32 */ #include /* for printing in malloc_stats */ #ifndef LACKS_ERRNO_H #include /* for MALLOC_FAILURE_ACTION */ #endif /* LACKS_ERRNO_H */ #if FOOTERS #include /* for magic initialization */ #endif /* FOOTERS */ #ifndef LACKS_STDLIB_H #include /* for abort() */ #endif /* LACKS_STDLIB_H */ #ifdef DEBUG #if ABORT_ON_ASSERT_FAILURE #define assert(x) if(!(x)) ABORT #else /* ABORT_ON_ASSERT_FAILURE */ #include #endif /* ABORT_ON_ASSERT_FAILURE */ #else /* DEBUG */ #define assert(x) #endif /* DEBUG */ #ifndef LACKS_STRING_H #include /* for memset etc */ #endif /* LACKS_STRING_H */ #if USE_BUILTIN_FFS #ifndef LACKS_STRINGS_H #include /* for ffs */ #endif /* LACKS_STRINGS_H */ #endif /* USE_BUILTIN_FFS */ #if HAVE_MMAP #ifndef LACKS_SYS_MMAN_H #include /* for mmap */ #endif /* LACKS_SYS_MMAN_H */ #ifndef LACKS_FCNTL_H #include #endif /* LACKS_FCNTL_H */ #endif /* HAVE_MMAP */ #if HAVE_MORECORE #ifndef LACKS_UNISTD_H #include /* for sbrk */ #else /* LACKS_UNISTD_H */ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) extern void* sbrk(ptrdiff_t); #endif /* FreeBSD etc */ #endif /* LACKS_UNISTD_H */ #endif /* HAVE_MMAP */ #ifndef WIN32 #ifndef malloc_getpagesize # ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ # ifndef _SC_PAGE_SIZE # define _SC_PAGE_SIZE _SC_PAGESIZE # endif # endif # ifdef _SC_PAGE_SIZE # define malloc_getpagesize sysconf(_SC_PAGE_SIZE) # else # if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) extern size_t getpagesize(); # define malloc_getpagesize getpagesize() # else # ifdef WIN32 /* use supplied emulation of getpagesize */ # define malloc_getpagesize getpagesize() # else # ifndef LACKS_SYS_PARAM_H # include # endif # ifdef EXEC_PAGESIZE # define malloc_getpagesize EXEC_PAGESIZE # else # ifdef NBPG # ifndef CLSIZE # define malloc_getpagesize NBPG # else # define malloc_getpagesize (NBPG * CLSIZE) # endif # else # ifdef NBPC # define malloc_getpagesize NBPC # else # ifdef PAGESIZE # define malloc_getpagesize PAGESIZE # else /* just guess */ # define malloc_getpagesize ((size_t)4096U) # endif # endif # endif # endif # endif # endif # endif #endif #endif /* ------------------- size_t and alignment properties -------------------- */ /* The byte and bit size of a size_t */ #define SIZE_T_SIZE (sizeof(size_t)) #define SIZE_T_BITSIZE (sizeof(size_t) << 3) /* Some constants coerced to size_t */ /* Annoying but necessary to avoid errors on some plaftorms */ #define SIZE_T_ZERO ((size_t)0) #define SIZE_T_ONE ((size_t)1) #define SIZE_T_TWO ((size_t)2) #define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) #define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) #define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) #define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) /* The bit mask value corresponding to MALLOC_ALIGNMENT */ #define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) /* True if address a has acceptable alignment */ #define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) /* the number of bytes to offset an address to align it */ #define align_offset(A)\ ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK)) /* -------------------------- MMAP preliminaries ------------------------- */ /* If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and checks to fail so compiler optimizer can delete code rather than using so many "#if"s. */ /* MORECORE and MMAP must return MFAIL on failure */ #define MFAIL ((void*)(MAX_SIZE_T)) #define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ #if !HAVE_MMAP #define IS_MMAPPED_BIT (SIZE_T_ZERO) #define USE_MMAP_BIT (SIZE_T_ZERO) #define CALL_MMAP(s) MFAIL #define CALL_MUNMAP(a, s) (-1) #define DIRECT_MMAP(s) MFAIL #else /* HAVE_MMAP */ #define IS_MMAPPED_BIT (SIZE_T_ONE) #define USE_MMAP_BIT (SIZE_T_ONE) #ifndef WIN32 #define CALL_MUNMAP(a, s) munmap((a), (s)) #define MMAP_PROT (PROT_READ|PROT_WRITE) #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) #define MAP_ANONYMOUS MAP_ANON #endif /* MAP_ANON */ #ifdef MAP_ANONYMOUS #define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS) #define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0) #else /* MAP_ANONYMOUS */ /* Nearly all versions of mmap support MAP_ANONYMOUS, so the following is unlikely to be needed, but is supplied just in case. */ #define MMAP_FLAGS (MAP_PRIVATE) static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ #define CALL_MMAP(s) ((dev_zero_fd < 0) ? \ (dev_zero_fd = open("/dev/zero", O_RDWR), \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) #endif /* MAP_ANONYMOUS */ #define DIRECT_MMAP(s) CALL_MMAP(s) #else /* WIN32 */ /* Win32 MMAP via VirtualAlloc */ static void* win32mmap(size_t size) { void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); return (ptr != 0)? ptr: MFAIL; } /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ static void* win32direct_mmap(size_t size) { void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, PAGE_READWRITE); return (ptr != 0)? ptr: MFAIL; } /* This function supports releasing coalesed segments */ static int win32munmap(void* ptr, size_t size) { MEMORY_BASIC_INFORMATION minfo; char* cptr = ptr; while (size) { if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) return -1; if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || minfo.State != MEM_COMMIT || minfo.RegionSize > size) return -1; if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) return -1; cptr += minfo.RegionSize; size -= minfo.RegionSize; } return 0; } #define CALL_MMAP(s) win32mmap(s) #define CALL_MUNMAP(a, s) win32munmap((a), (s)) #define DIRECT_MMAP(s) win32direct_mmap(s) #endif /* WIN32 */ #endif /* HAVE_MMAP */ #if HAVE_MMAP && HAVE_MREMAP #define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv)) #else /* HAVE_MMAP && HAVE_MREMAP */ #define CALL_MREMAP(addr, osz, nsz, mv) MFAIL #endif /* HAVE_MMAP && HAVE_MREMAP */ #if HAVE_MORECORE #define CALL_MORECORE(S) MORECORE(S) #else /* HAVE_MORECORE */ #define CALL_MORECORE(S) MFAIL #endif /* HAVE_MORECORE */ /* mstate bit set if continguous morecore disabled or failed */ #define USE_NONCONTIGUOUS_BIT (4U) /* segment bit set in create_mspace_with_base */ #define EXTERN_BIT (8U) /* --------------------------- Lock preliminaries ------------------------ */ #if USE_LOCKS /* When locks are defined, there are up to two global locks: * If HAVE_MORECORE, morecore_mutex protects sequences of calls to MORECORE. In many cases sys_alloc requires two calls, that should not be interleaved with calls by other threads. This does not protect against direct calls to MORECORE by other threads not using this lock, so there is still code to cope the best we can on interference. * magic_init_mutex ensures that mparams.magic and other unique mparams values are initialized only once. */ #ifndef WIN32 /* By default use posix locks */ #include #define MLOCK_T pthread_mutex_t #define INITIAL_LOCK(l) pthread_mutex_init(l, NULL) #define ACQUIRE_LOCK(l) pthread_mutex_lock(l) #define RELEASE_LOCK(l) pthread_mutex_unlock(l) #if HAVE_MORECORE static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER; #endif /* HAVE_MORECORE */ static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER; #else /* WIN32 */ /* Because lock-protected regions have bounded times, and there are no recursive lock calls, we can use simple spinlocks. */ #define MLOCK_T long static int win32_acquire_lock (MLOCK_T *sl) { for (;;) { #ifdef InterlockedCompareExchangePointer if (!InterlockedCompareExchange(sl, 1, 0)) return 0; #else /* Use older void* version */ if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0)) return 0; #endif /* InterlockedCompareExchangePointer */ Sleep (0); } } static void win32_release_lock (MLOCK_T *sl) { InterlockedExchange (sl, 0); } #define INITIAL_LOCK(l) *(l)=0 #define ACQUIRE_LOCK(l) win32_acquire_lock(l) #define RELEASE_LOCK(l) win32_release_lock(l) #if HAVE_MORECORE static MLOCK_T morecore_mutex; #endif /* HAVE_MORECORE */ static MLOCK_T magic_init_mutex; #endif /* WIN32 */ #define USE_LOCK_BIT (2U) #else /* USE_LOCKS */ #define USE_LOCK_BIT (0U) #define INITIAL_LOCK(l) #endif /* USE_LOCKS */ #if USE_LOCKS && HAVE_MORECORE #define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex); #define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex); #else /* USE_LOCKS && HAVE_MORECORE */ #define ACQUIRE_MORECORE_LOCK() #define RELEASE_MORECORE_LOCK() #endif /* USE_LOCKS && HAVE_MORECORE */ #if USE_LOCKS #define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex); #define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex); #else /* USE_LOCKS */ #define ACQUIRE_MAGIC_INIT_LOCK() #define RELEASE_MAGIC_INIT_LOCK() #endif /* USE_LOCKS */ /* ----------------------- Chunk representations ------------------------ */ /* (The following includes lightly edited explanations by Colin Plumb.) The malloc_chunk declaration below is misleading (but accurate and necessary). It declares a "view" into memory allowing access to necessary fields at known offsets from a given base. Chunks of memory are maintained using a `boundary tag' method as originally described by Knuth. (See the paper by Paul Wilson ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such techniques.) Sizes of free chunks are stored both in the front of each chunk and at the end. This makes consolidating fragmented chunks into bigger chunks fast. The head fields also hold bits representing whether chunks are free or in use. Here are some pictures to make it clearer. They are "exploded" to show that the state of a chunk can be thought of as extending from the high 31 bits of the head field of its header through the prev_foot and PINUSE_BIT bit of the following chunk header. A chunk that's in use looks like: chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of previous chunk (if P = 1) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| | Size of this chunk 1| +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- -+ | : +- size - sizeof(size_t) available payload bytes -+ : | chunk-> +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1| | Size of next chunk (may or may not be in use) | +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ And if it's free, it looks like this: chunk-> +- -+ | User payload (must be in use, or we would have merged!) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| | Size of this chunk 0| +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Prev pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : +- size - sizeof(struct chunk) unused bytes -+ : | chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of this chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| | Size of next chunk (must be in use, or we would have merged)| +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : +- User payload -+ : | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| +-+ Note that since we always merge adjacent free chunks, the chunks adjacent to a free chunk must be in use. Given a pointer to a chunk (which can be derived trivially from the payload pointer) we can, in O(1) time, find out whether the adjacent chunks are free, and if so, unlink them from the lists that they are on and merge them with the current chunk. Chunks always begin on even word boundaries, so the mem portion (which is returned to the user) is also on an even word boundary, and thus at least double-word aligned. The P (PINUSE_BIT) bit, stored in the unused low-order bit of the chunk size (which is always a multiple of two words), is an in-use bit for the *previous* chunk. If that bit is *clear*, then the word before the current chunk size contains the previous chunk size, and can be used to find the front of the previous chunk. The very first chunk allocated always has this bit set, preventing access to non-existent (or non-owned) memory. If pinuse is set for any given chunk, then you CANNOT determine the size of the previous chunk, and might even get a memory addressing fault when trying to do so. The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of the chunk size redundantly records whether the current chunk is inuse. This redundancy enables usage checks within free and realloc, and reduces indirection when freeing and consolidating chunks. Each freshly allocated chunk must have both cinuse and pinuse set. That is, each allocated chunk borders either a previously allocated and still in-use chunk, or the base of its memory arena. This is ensured by making all allocations from the the `lowest' part of any found chunk. Further, no free chunk physically borders another one, so each free chunk is known to be preceded and followed by either inuse chunks or the ends of memory. Note that the `foot' of the current chunk is actually represented as the prev_foot of the NEXT chunk. This makes it easier to deal with alignments etc but can be very confusing when trying to extend or adapt this code. The exceptions to all this are 1. The special chunk `top' is the top-most available chunk (i.e., the one bordering the end of available memory). It is treated specially. Top is never included in any bin, is used only if no other chunk is available, and is released back to the system if it is very large (see M_TRIM_THRESHOLD). In effect, the top chunk is treated as larger (and thus less well fitting) than any other available chunk. The top chunk doesn't update its trailing size field since there is no next contiguous chunk that would have to index off it. However, space is still allocated for it (TOP_FOOT_SIZE) to enable separation or merging when space is extended. 3. Chunks allocated via mmap, which have the lowest-order bit (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set PINUSE_BIT in their head fields. Because they are allocated one-by-one, each must carry its own prev_foot field, which is also used to hold the offset this chunk has within its mmapped region, which is needed to preserve alignment. Each mmapped chunk is trailed by the first two fields of a fake next-chunk for sake of usage checks. */ struct malloc_chunk { size_t prev_foot; /* Size of previous chunk (if free). */ size_t head; /* Size and inuse bits. */ struct malloc_chunk* fd; /* double links -- used only if free. */ struct malloc_chunk* bk; }; typedef struct malloc_chunk mchunk; typedef struct malloc_chunk* mchunkptr; typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ typedef unsigned int bindex_t; /* Described below */ typedef unsigned int binmap_t; /* Described below */ typedef unsigned int flag_t; /* The type of various bit flag sets */ /* ------------------- Chunks sizes and alignments ----------------------- */ #define MCHUNK_SIZE (sizeof(mchunk)) #if FOOTERS #define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) #else /* FOOTERS */ #define CHUNK_OVERHEAD (SIZE_T_SIZE) #endif /* FOOTERS */ /* MMapped chunks need a second word of overhead ... */ #define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) /* ... and additional padding for fake next-chunk at foot */ #define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) /* The smallest size we can malloc is an aligned minimal chunk */ #define MIN_CHUNK_SIZE\ ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) /* conversion from malloc headers to user pointers, and back */ #define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) #define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) /* chunk associated with aligned address A */ #define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) /* Bounds on request (not chunk) sizes. */ #define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) #define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) /* pad request bytes into a usable size */ #define pad_request(req) \ (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) /* pad request, checking for minimum (but not maximum) */ #define request2size(req) \ (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) /* ------------------ Operations on head and foot fields ----------------- */ /* The head field of a chunk is or'ed with PINUSE_BIT when previous adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in use. If the chunk was obtained with mmap, the prev_foot field has IS_MMAPPED_BIT set, otherwise holding the offset of the base of the mmapped region to the base of the chunk. */ #define PINUSE_BIT (SIZE_T_ONE) #define CINUSE_BIT (SIZE_T_TWO) #define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) /* Head value for fenceposts */ #define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) /* extraction of fields from head words */ #define cinuse(p) ((p)->head & CINUSE_BIT) #define pinuse(p) ((p)->head & PINUSE_BIT) #define chunksize(p) ((p)->head & ~(INUSE_BITS)) #define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) #define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT) /* Treat space at ptr +/- offset as a chunk */ #define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) #define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) /* Ptr to next or previous physical malloc_chunk. */ #define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS))) #define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) /* extract next chunk's pinuse bit */ #define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) /* Get/set size at footer */ #define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) #define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) /* Set size, pinuse bit, and foot */ #define set_size_and_pinuse_of_free_chunk(p, s)\ ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) /* Set size, pinuse bit, foot, and clear next pinuse */ #define set_free_with_pinuse(p, s, n)\ (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) #define is_mmapped(p)\ (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) /* Get the internal overhead associated with chunk p */ #define overhead_for(p)\ (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) /* Return true if malloced space is not necessarily cleared */ #if MMAP_CLEARS #define calloc_must_clear(p) (!is_mmapped(p)) #else /* MMAP_CLEARS */ #define calloc_must_clear(p) (1) #endif /* MMAP_CLEARS */ /* ---------------------- Overlaid data structures ----------------------- */ /* When chunks are not in use, they are treated as nodes of either lists or trees. "Small" chunks are stored in circular doubly-linked lists, and look like this: chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of previous chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `head:' | Size of chunk, in bytes |P| mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forward pointer to next chunk in list | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Back pointer to previous chunk in list | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unused space (may be 0 bytes long) . . . . | nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `foot:' | Size of chunk, in bytes | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Larger chunks are kept in a form of bitwise digital trees (aka tries) keyed on chunksizes. Because malloc_tree_chunks are only for free chunks greater than 256 bytes, their size doesn't impose any constraints on user chunk sizes. Each node looks like: chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of previous chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `head:' | Size of chunk, in bytes |P| mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forward pointer to next chunk of same size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Back pointer to previous chunk of same size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer to left child (child[0]) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer to right child (child[1]) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer to parent | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | bin index of this chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unused space . . | nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `foot:' | Size of chunk, in bytes | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Each tree holding treenodes is a tree of unique chunk sizes. Chunks of the same size are arranged in a circularly-linked list, with only the oldest chunk (the next to be used, in our FIFO ordering) actually in the tree. (Tree members are distinguished by a non-null parent pointer.) If a chunk with the same size an an existing node is inserted, it is linked off the existing node using pointers that work in the same way as fd/bk pointers of small chunks. Each tree contains a power of 2 sized range of chunk sizes (the smallest is 0x100 <= x < 0x180), which is is divided in half at each tree level, with the chunks in the smaller half of the range (0x100 <= x < 0x140 for the top nose) in the left subtree and the larger half (0x140 <= x < 0x180) in the right subtree. This is, of course, done by inspecting individual bits. Using these rules, each node's left subtree contains all smaller sizes than its right subtree. However, the node at the root of each subtree has no particular ordering relationship to either. (The dividing line between the subtree sizes is based on trie relation.) If we remove the last chunk of a given size from the interior of the tree, we need to replace it with a leaf node. The tree ordering rules permit a node to be replaced by any leaf below it. The smallest chunk in a tree (a common operation in a best-fit allocator) can be found by walking a path to the leftmost leaf in the tree. Unlike a usual binary tree, where we follow left child pointers until we reach a null, here we follow the right child pointer any time the left one is null, until we reach a leaf with both child pointers null. The smallest chunk in the tree will be somewhere along that path. The worst case number of steps to add, find, or remove a node is bounded by the number of bits differentiating chunks within bins. Under current bin calculations, this ranges from 6 up to 21 (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case is of course much better. */ struct malloc_tree_chunk { /* The first four fields must be compatible with malloc_chunk */ size_t prev_foot; size_t head; struct malloc_tree_chunk* fd; struct malloc_tree_chunk* bk; struct malloc_tree_chunk* child[2]; struct malloc_tree_chunk* parent; bindex_t index; }; typedef struct malloc_tree_chunk tchunk; typedef struct malloc_tree_chunk* tchunkptr; typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ /* A little helper macro for trees */ #define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) /* ----------------------------- Segments -------------------------------- */ /* Each malloc space may include non-contiguous segments, held in a list headed by an embedded malloc_segment record representing the top-most space. Segments also include flags holding properties of the space. Large chunks that are directly allocated by mmap are not included in this list. They are instead independently created and destroyed without otherwise keeping track of them. Segment management mainly comes into play for spaces allocated by MMAP. Any call to MMAP might or might not return memory that is adjacent to an existing segment. MORECORE normally contiguously extends the current space, so this space is almost always adjacent, which is simpler and faster to deal with. (This is why MORECORE is used preferentially to MMAP when both are available -- see sys_alloc.) When allocating using MMAP, we don't use any of the hinting mechanisms (inconsistently) supported in various implementations of unix mmap, or distinguish reserving from committing memory. Instead, we just ask for space, and exploit contiguity when we get it. It is probably possible to do better than this on some systems, but no general scheme seems to be significantly better. Management entails a simpler variant of the consolidation scheme used for chunks to reduce fragmentation -- new adjacent memory is normally prepended or appended to an existing segment. However, there are limitations compared to chunk consolidation that mostly reflect the fact that segment processing is relatively infrequent (occurring only when getting memory from system) and that we don't expect to have huge numbers of segments: * Segments are not indexed, so traversal requires linear scans. (It would be possible to index these, but is not worth the extra overhead and complexity for most programs on most platforms.) * New segments are only appended to old ones when holding top-most memory; if they cannot be prepended to others, they are held in different segments. Except for the top-most segment of an mstate, each segment record is kept at the tail of its segment. Segments are added by pushing segment records onto the list headed by &mstate.seg for the containing mstate. Segment flags control allocation/merge/deallocation policies: * If EXTERN_BIT set, then we did not allocate this segment, and so should not try to deallocate or merge with others. (This currently holds only for the initial segment passed into create_mspace_with_base.) * If IS_MMAPPED_BIT set, the segment may be merged with other surrounding mmapped segments and trimmed/de-allocated using munmap. * If neither bit is set, then the segment was obtained using MORECORE so can be merged with surrounding MORECORE'd segments and deallocated/trimmed using MORECORE with negative arguments. */ struct malloc_segment { char* base; /* base address */ size_t size; /* allocated size */ struct malloc_segment* next; /* ptr to next segment */ flag_t sflags; /* mmap and extern flag */ }; #define is_mmapped_segment(S) ((S)->sflags & IS_MMAPPED_BIT) #define is_extern_segment(S) ((S)->sflags & EXTERN_BIT) typedef struct malloc_segment msegment; typedef struct malloc_segment* msegmentptr; /* ---------------------------- malloc_state ----------------------------- */ /* A malloc_state holds all of the bookkeeping for a space. The main fields are: Top The topmost chunk of the currently active segment. Its size is cached in topsize. The actual size of topmost space is topsize+TOP_FOOT_SIZE, which includes space reserved for adding fenceposts and segment records if necessary when getting more space from the system. The size at which to autotrim top is cached from mparams in trim_check, except that it is disabled if an autotrim fails. Designated victim (dv) This is the preferred chunk for servicing small requests that don't have exact fits. It is normally the chunk split off most recently to service another small request. Its size is cached in dvsize. The link fields of this chunk are not maintained since it is not kept in a bin. SmallBins An array of bin headers for free chunks. These bins hold chunks with sizes less than MIN_LARGE_SIZE bytes. Each bin contains chunks of all the same size, spaced 8 bytes apart. To simplify use in double-linked lists, each bin header acts as a malloc_chunk pointing to the real first node, if it exists (else pointing to itself). This avoids special-casing for headers. But to avoid waste, we allocate only the fd/bk pointers of bins, and then use repositioning tricks to treat these as the fields of a chunk. TreeBins Treebins are pointers to the roots of trees holding a range of sizes. There are 2 equally spaced treebins for each power of two from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything larger. Bin maps There is one bit map for small bins ("smallmap") and one for treebins ("treemap). Each bin sets its bit when non-empty, and clears the bit when empty. Bit operations are then used to avoid bin-by-bin searching -- nearly all "search" is done without ever looking at bins that won't be selected. The bit maps conservatively use 32 bits per map word, even if on 64bit system. For a good description of some of the bit-based techniques used here, see Henry S. Warren Jr's book "Hacker's Delight" (and supplement at http://hackersdelight.org/). Many of these are intended to reduce the branchiness of paths through malloc etc, as well as to reduce the number of memory locations read or written. Segments A list of segments headed by an embedded malloc_segment record representing the initial space. Address check support The least_addr field is the least address ever obtained from MORECORE or MMAP. Attempted frees and reallocs of any address less than this are trapped (unless INSECURE is defined). Magic tag A cross-check field that should always hold same value as mparams.magic. Flags Bits recording whether to use MMAP, locks, or contiguous MORECORE Statistics Each space keeps track of current and maximum system memory obtained via MORECORE or MMAP. Locking If USE_LOCKS is defined, the "mutex" lock is acquired and released around every public call using this mspace. */ /* Bin types, widths and sizes */ #define NSMALLBINS (32U) #define NTREEBINS (32U) #define SMALLBIN_SHIFT (3U) #define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) #define TREEBIN_SHIFT (8U) #define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) #define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) #define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) struct malloc_state { binmap_t smallmap; binmap_t treemap; size_t dvsize; size_t topsize; char* least_addr; mchunkptr dv; mchunkptr top; size_t trim_check; size_t magic; mchunkptr smallbins[(NSMALLBINS+1)*2]; tbinptr treebins[NTREEBINS]; size_t footprint; size_t max_footprint; flag_t mflags; #if USE_LOCKS MLOCK_T mutex; /* locate lock among fields that rarely change */ #endif /* USE_LOCKS */ msegment seg; }; typedef struct malloc_state* mstate; /* ------------- Global malloc_state and malloc_params ------------------- */ /* malloc_params holds global properties, including those that can be dynamically set using mallopt. There is a single instance, mparams, initialized in init_mparams. */ struct malloc_params { size_t magic; size_t page_size; size_t granularity; size_t mmap_threshold; size_t trim_threshold; flag_t default_mflags; }; static struct malloc_params mparams; /* The global malloc_state used for all non-"mspace" calls */ static struct malloc_state _gm_; #define gm (&_gm_) #define is_global(M) ((M) == &_gm_) #define is_initialized(M) ((M)->top != 0) /* -------------------------- system alloc setup ------------------------- */ /* Operations on mflags */ #define use_lock(M) ((M)->mflags & USE_LOCK_BIT) #define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) #define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT) #define use_mmap(M) ((M)->mflags & USE_MMAP_BIT) #define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) #define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT) #define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) #define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) #define set_lock(M,L)\ ((M)->mflags = (L)?\ ((M)->mflags | USE_LOCK_BIT) :\ ((M)->mflags & ~USE_LOCK_BIT)) /* page-align a size */ #define page_align(S)\ (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE)) /* granularity-align a size */ #define granularity_align(S)\ (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE)) #define is_page_aligned(S)\ (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) #define is_granularity_aligned(S)\ (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) /* True if segment S holds address A */ #define segment_holds(S, A)\ ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) /* Return segment holding given address */ static msegmentptr segment_holding(mstate m, char* addr) { msegmentptr sp = &m->seg; for (;;) { if (addr >= sp->base && addr < sp->base + sp->size) return sp; if ((sp = sp->next) == 0) return 0; } } /* Return true if segment contains a segment link */ static int has_segment_link(mstate m, msegmentptr ss) { msegmentptr sp = &m->seg; for (;;) { if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size) return 1; if ((sp = sp->next) == 0) return 0; } } #ifndef MORECORE_CANNOT_TRIM #define should_trim(M,s) ((s) > (M)->trim_check) #else /* MORECORE_CANNOT_TRIM */ #define should_trim(M,s) (0) #endif /* MORECORE_CANNOT_TRIM */ /* TOP_FOOT_SIZE is padding at the end of a segment, including space that may be needed to place segment records and fenceposts when new noncontiguous segments are added. */ #define TOP_FOOT_SIZE\ (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) /* ------------------------------- Hooks -------------------------------- */ /* PREACTION should be defined to return 0 on success, and nonzero on failure. If you are not using locking, you can redefine these to do anything you like. */ #if USE_LOCKS /* Ensure locks are initialized */ #define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams()) #define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0) #define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); } #else /* USE_LOCKS */ #ifndef PREACTION #define PREACTION(M) (0) #endif /* PREACTION */ #ifndef POSTACTION #define POSTACTION(M) #endif /* POSTACTION */ #endif /* USE_LOCKS */ /* CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses. USAGE_ERROR_ACTION is triggered on detected bad frees and reallocs. The argument p is an address that might have triggered the fault. It is ignored by the two predefined actions, but might be useful in custom actions that try to help diagnose errors. */ #if PROCEED_ON_ERROR /* A count of the number of corruption errors causing resets */ int malloc_corruption_error_count; /* default corruption action */ static void reset_on_error(mstate m); #define CORRUPTION_ERROR_ACTION(m) reset_on_error(m) #define USAGE_ERROR_ACTION(m, p) #else /* PROCEED_ON_ERROR */ #ifndef CORRUPTION_ERROR_ACTION #define CORRUPTION_ERROR_ACTION(m) ABORT #endif /* CORRUPTION_ERROR_ACTION */ #ifndef USAGE_ERROR_ACTION #define USAGE_ERROR_ACTION(m,p) ABORT #endif /* USAGE_ERROR_ACTION */ #endif /* PROCEED_ON_ERROR */ /* -------------------------- Debugging setup ---------------------------- */ #if ! DEBUG #define check_free_chunk(M,P) #define check_inuse_chunk(M,P) #define check_malloced_chunk(M,P,N) #define check_mmapped_chunk(M,P) #define check_malloc_state(M) #define check_top_chunk(M,P) #else /* DEBUG */ #define check_free_chunk(M,P) do_check_free_chunk(M,P) #define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P) #define check_top_chunk(M,P) do_check_top_chunk(M,P) #define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N) #define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P) #define check_malloc_state(M) do_check_malloc_state(M) static void do_check_any_chunk(mstate m, mchunkptr p); static void do_check_top_chunk(mstate m, mchunkptr p); static void do_check_mmapped_chunk(mstate m, mchunkptr p); static void do_check_inuse_chunk(mstate m, mchunkptr p); static void do_check_free_chunk(mstate m, mchunkptr p); static void do_check_malloced_chunk(mstate m, void* mem, size_t s); static void do_check_tree(mstate m, tchunkptr t); static void do_check_treebin(mstate m, bindex_t i); static void do_check_smallbin(mstate m, bindex_t i); static void do_check_malloc_state(mstate m); static int bin_find(mstate m, mchunkptr x); static size_t traverse_and_check(mstate m); #endif /* DEBUG */ /* ---------------------------- Indexing Bins ---------------------------- */ #define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) #define small_index(s) ((s) >> SMALLBIN_SHIFT) #define small_index2size(i) ((i) << SMALLBIN_SHIFT) #define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) /* addressing by index. See above about smallbin repositioning */ #define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) #define treebin_at(M,i) (&((M)->treebins[i])) /* assign tree index for size S to variable I */ #if defined(__GNUC__) && defined(i386) #define compute_tree_index(S, I)\ {\ size_t X = S >> TREEBIN_SHIFT;\ if (X == 0)\ I = 0;\ else if (X > 0xFFFF)\ I = NTREEBINS-1;\ else {\ unsigned int K;\ __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\ I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ }\ } #else /* GNUC */ #define compute_tree_index(S, I)\ {\ size_t X = S >> TREEBIN_SHIFT;\ if (X == 0)\ I = 0;\ else if (X > 0xFFFF)\ I = NTREEBINS-1;\ else {\ unsigned int Y = (unsigned int)X;\ unsigned int N = ((Y - 0x100) >> 16) & 8;\ unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\ N += K;\ N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\ K = 14 - N + ((Y <<= K) >> 15);\ I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\ }\ } #endif /* GNUC */ /* Bit representing maximum resolved size in a treebin at i */ #define bit_for_tree_index(i) \ (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) /* Shift placing maximum resolved bit in a treebin at i as sign bit */ #define leftshift_for_tree_index(i) \ ((i == NTREEBINS-1)? 0 : \ ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2))) /* The size of the smallest chunk held in bin with index i */ #define minsize_for_tree_index(i) \ ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \ (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1))) /* ------------------------ Operations on bin maps ----------------------- */ /* bit corresponding to given index */ #define idx2bit(i) ((binmap_t)(1) << (i)) /* Mark/Clear bits with given index */ #define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i)) #define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i)) #define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i)) #define mark_treemap(M,i) ((M)->treemap |= idx2bit(i)) #define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i)) #define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i)) /* index corresponding to given bit */ #if defined(__GNUC__) && defined(i386) #define compute_bit2idx(X, I)\ {\ unsigned int J;\ __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\ I = (bindex_t)J;\ } #else /* GNUC */ #if USE_BUILTIN_FFS #define compute_bit2idx(X, I) I = ffs(X)-1 #else /* USE_BUILTIN_FFS */ #define compute_bit2idx(X, I)\ {\ unsigned int Y = X - 1;\ unsigned int K = Y >> (16-4) & 16;\ unsigned int N = K; Y >>= K;\ N += K = Y >> (8-3) & 8; Y >>= K;\ N += K = Y >> (4-2) & 4; Y >>= K;\ N += K = Y >> (2-1) & 2; Y >>= K;\ N += K = Y >> (1-0) & 1; Y >>= K;\ I = (bindex_t)(N + Y);\ } #endif /* USE_BUILTIN_FFS */ #endif /* GNUC */ /* isolate the least set bit of a bitmap */ #define least_bit(x) ((x) & -(x)) /* mask with all bits to left of least bit of x on */ #define left_bits(x) ((x<<1) | -(x<<1)) /* mask with all bits to left of or equal to least bit of x on */ #define same_or_left_bits(x) ((x) | -(x)) /* ----------------------- Runtime Check Support ------------------------- */ /* For security, the main invariant is that malloc/free/etc never writes to a static address other than malloc_state, unless static malloc_state itself has been corrupted, which cannot occur via malloc (because of these checks). In essence this means that we believe all pointers, sizes, maps etc held in malloc_state, but check all of those linked or offsetted from other embedded data structures. These checks are interspersed with main code in a way that tends to minimize their run-time cost. When FOOTERS is defined, in addition to range checking, we also verify footer fields of inuse chunks, which can be used guarantee that the mstate controlling malloc/free is intact. This is a streamlined version of the approach described by William Robertson et al in "Run-time Detection of Heap-based Overflows" LISA'03 http://www.usenix.org/events/lisa03/tech/robertson.html The footer of an inuse chunk holds the xor of its mstate and a random seed, that is checked upon calls to free() and realloc(). This is (probablistically) unguessable from outside the program, but can be computed by any code successfully malloc'ing any chunk, so does not itself provide protection against code that has already broken security through some other means. Unlike Robertson et al, we always dynamically check addresses of all offset chunks (previous, next, etc). This turns out to be cheaper than relying on hashes. */ #if !INSECURE /* Check if address a is at least as high as any from MORECORE or MMAP */ #define ok_address(M, a) ((char*)(a) >= (M)->least_addr) /* Check if address of next chunk n is higher than base chunk p */ #define ok_next(p, n) ((char*)(p) < (char*)(n)) /* Check if p has its cinuse bit on */ #define ok_cinuse(p) cinuse(p) /* Check if p has its pinuse bit on */ #define ok_pinuse(p) pinuse(p) #else /* !INSECURE */ #define ok_address(M, a) (1) #define ok_next(b, n) (1) #define ok_cinuse(p) (1) #define ok_pinuse(p) (1) #endif /* !INSECURE */ #if (FOOTERS && !INSECURE) /* Check if (alleged) mstate m has expected magic field */ #define ok_magic(M) ((M)->magic == mparams.magic) #else /* (FOOTERS && !INSECURE) */ #define ok_magic(M) (1) #endif /* (FOOTERS && !INSECURE) */ /* In gcc, use __builtin_expect to minimize impact of checks */ #if !INSECURE #if defined(__GNUC__) && __GNUC__ >= 3 #define RTCHECK(e) __builtin_expect(e, 1) #else /* GNUC */ #define RTCHECK(e) (e) #endif /* GNUC */ #else /* !INSECURE */ #define RTCHECK(e) (1) #endif /* !INSECURE */ /* macros to set up inuse chunks with or without footers */ #if !FOOTERS #define mark_inuse_foot(M,p,s) /* Set cinuse bit and pinuse bit of next chunk */ #define set_inuse(M,p,s)\ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) /* Set cinuse and pinuse of this chunk and pinuse of next chunk */ #define set_inuse_and_pinuse(M,p,s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) /* Set size, cinuse and pinuse bit of this chunk */ #define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) #else /* FOOTERS */ /* Set foot of inuse chunk to be xor of mstate and seed */ #define mark_inuse_foot(M,p,s)\ (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic)) #define get_mstate_for(p)\ ((mstate)(((mchunkptr)((char*)(p) +\ (chunksize(p))))->prev_foot ^ mparams.magic)) #define set_inuse(M,p,s)\ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \ mark_inuse_foot(M,p,s)) #define set_inuse_and_pinuse(M,p,s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\ mark_inuse_foot(M,p,s)) #define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ mark_inuse_foot(M, p, s)) #endif /* !FOOTERS */ /* ---------------------------- setting mparams -------------------------- */ /* Initialize mparams */ static int init_mparams(void) { if (mparams.page_size == 0) { size_t s; mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; #if MORECORE_CONTIGUOUS mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT; #else /* MORECORE_CONTIGUOUS */ mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT; #endif /* MORECORE_CONTIGUOUS */ #if (FOOTERS && !INSECURE) { #if USE_DEV_RANDOM int fd; unsigned char buf[sizeof(size_t)]; /* Try to use /dev/urandom, else fall back on using time */ if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && read(fd, buf, sizeof(buf)) == sizeof(buf)) { s = *((size_t *) buf); close(fd); } else #endif /* USE_DEV_RANDOM */ s = (size_t)(time(0) ^ (size_t)0x55555555U); s |= (size_t)8U; /* ensure nonzero */ s &= ~(size_t)7U; /* improve chances of fault for bad values */ } #else /* (FOOTERS && !INSECURE) */ s = (size_t)0x58585858U; #endif /* (FOOTERS && !INSECURE) */ ACQUIRE_MAGIC_INIT_LOCK(); if (mparams.magic == 0) { mparams.magic = s; /* Set up lock for main malloc area */ INITIAL_LOCK(&gm->mutex); gm->mflags = mparams.default_mflags; } RELEASE_MAGIC_INIT_LOCK(); #ifndef WIN32 mparams.page_size = malloc_getpagesize; mparams.granularity = ((DEFAULT_GRANULARITY != 0)? DEFAULT_GRANULARITY : mparams.page_size); #else /* WIN32 */ { SYSTEM_INFO system_info; GetSystemInfo(&system_info); mparams.page_size = system_info.dwPageSize; mparams.granularity = system_info.dwAllocationGranularity; } #endif /* WIN32 */ /* Sanity-check configuration: size_t must be unsigned and as wide as pointer type. ints must be at least 4 bytes. alignment must be at least 8. Alignment, min chunk size, and page size must all be powers of 2. */ if ((sizeof(size_t) != sizeof(char*)) || (MAX_SIZE_T < MIN_CHUNK_SIZE) || (sizeof(int) < 4) || (MALLOC_ALIGNMENT < (size_t)8U) || ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) || ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) || ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) || ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0)) ABORT; } return 0; } /* support for mallopt */ static int change_mparam(int param_number, int value) { size_t val = (size_t)value; init_mparams(); switch(param_number) { case M_TRIM_THRESHOLD: mparams.trim_threshold = val; return 1; case M_GRANULARITY: if (val >= mparams.page_size && ((val & (val-1)) == 0)) { mparams.granularity = val; return 1; } else return 0; case M_MMAP_THRESHOLD: mparams.mmap_threshold = val; return 1; default: return 0; } } #if DEBUG /* ------------------------- Debugging Support --------------------------- */ /* Check properties of any chunk, whether free, inuse, mmapped etc */ static void do_check_any_chunk(mstate m, mchunkptr p) { assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); assert(ok_address(m, p)); } /* Check properties of top chunk */ static void do_check_top_chunk(mstate m, mchunkptr p) { msegmentptr sp = segment_holding(m, (char*)p); size_t sz = chunksize(p); assert(sp != 0); assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); assert(ok_address(m, p)); assert(sz == m->topsize); assert(sz > 0); assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE); assert(pinuse(p)); assert(!next_pinuse(p)); } /* Check properties of (inuse) mmapped chunks */ static void do_check_mmapped_chunk(mstate m, mchunkptr p) { size_t sz = chunksize(p); size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); assert(is_mmapped(p)); assert(use_mmap(m)); assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); assert(ok_address(m, p)); assert(!is_small(sz)); assert((len & (mparams.page_size-SIZE_T_ONE)) == 0); assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0); } /* Check properties of inuse chunks */ static void do_check_inuse_chunk(mstate m, mchunkptr p) { do_check_any_chunk(m, p); assert(cinuse(p)); assert(next_pinuse(p)); /* If not pinuse and not mmapped, previous chunk has OK offset */ assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); if (is_mmapped(p)) do_check_mmapped_chunk(m, p); } /* Check properties of free chunks */ static void do_check_free_chunk(mstate m, mchunkptr p) { size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); mchunkptr next = chunk_plus_offset(p, sz); do_check_any_chunk(m, p); assert(!cinuse(p)); assert(!next_pinuse(p)); assert (!is_mmapped(p)); if (p != m->dv && p != m->top) { if (sz >= MIN_CHUNK_SIZE) { assert((sz & CHUNK_ALIGN_MASK) == 0); assert(is_aligned(chunk2mem(p))); assert(next->prev_foot == sz); assert(pinuse(p)); assert (next == m->top || cinuse(next)); assert(p->fd->bk == p); assert(p->bk->fd == p); } else /* markers are always of size SIZE_T_SIZE */ assert(sz == SIZE_T_SIZE); } } /* Check properties of malloced chunks at the point they are malloced */ static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { if (mem != 0) { mchunkptr p = mem2chunk(mem); size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); do_check_inuse_chunk(m, p); assert((sz & CHUNK_ALIGN_MASK) == 0); assert(sz >= MIN_CHUNK_SIZE); assert(sz >= s); /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); } } /* Check a tree and its subtrees. */ static void do_check_tree(mstate m, tchunkptr t) { tchunkptr head = 0; tchunkptr u = t; bindex_t tindex = t->index; size_t tsize = chunksize(t); bindex_t idx; compute_tree_index(tsize, idx); assert(tindex == idx); assert(tsize >= MIN_LARGE_SIZE); assert(tsize >= minsize_for_tree_index(idx)); assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1)))); do { /* traverse through chain of same-sized nodes */ do_check_any_chunk(m, ((mchunkptr)u)); assert(u->index == tindex); assert(chunksize(u) == tsize); assert(!cinuse(u)); assert(!next_pinuse(u)); assert(u->fd->bk == u); assert(u->bk->fd == u); if (u->parent == 0) { assert(u->child[0] == 0); assert(u->child[1] == 0); } else { assert(head == 0); /* only one node on chain has parent */ head = u; assert(u->parent != u); assert (u->parent->child[0] == u || u->parent->child[1] == u || *((tbinptr*)(u->parent)) == u); if (u->child[0] != 0) { assert(u->child[0]->parent == u); assert(u->child[0] != u); do_check_tree(m, u->child[0]); } if (u->child[1] != 0) { assert(u->child[1]->parent == u); assert(u->child[1] != u); do_check_tree(m, u->child[1]); } if (u->child[0] != 0 && u->child[1] != 0) { assert(chunksize(u->child[0]) < chunksize(u->child[1])); } } u = u->fd; } while (u != t); assert(head != 0); } /* Check all the chunks in a treebin. */ static void do_check_treebin(mstate m, bindex_t i) { tbinptr* tb = treebin_at(m, i); tchunkptr t = *tb; int empty = (m->treemap & (1U << i)) == 0; if (t == 0) assert(empty); if (!empty) do_check_tree(m, t); } /* Check all the chunks in a smallbin. */ static void do_check_smallbin(mstate m, bindex_t i) { sbinptr b = smallbin_at(m, i); mchunkptr p = b->bk; unsigned int empty = (m->smallmap & (1U << i)) == 0; if (p == b) assert(empty); if (!empty) { for (; p != b; p = p->bk) { size_t size = chunksize(p); mchunkptr q; /* each chunk claims to be free */ do_check_free_chunk(m, p); /* chunk belongs in bin */ assert(small_index(size) == i); assert(p->bk == b || chunksize(p->bk) == chunksize(p)); /* chunk is followed by an inuse chunk */ q = next_chunk(p); if (q->head != FENCEPOST_HEAD) do_check_inuse_chunk(m, q); } } } /* Find x in a bin. Used in other check functions. */ static int bin_find(mstate m, mchunkptr x) { size_t size = chunksize(x); if (is_small(size)) { bindex_t sidx = small_index(size); sbinptr b = smallbin_at(m, sidx); if (smallmap_is_marked(m, sidx)) { mchunkptr p = b; do { if (p == x) return 1; } while ((p = p->fd) != b); } } else { bindex_t tidx; compute_tree_index(size, tidx); if (treemap_is_marked(m, tidx)) { tchunkptr t = *treebin_at(m, tidx); size_t sizebits = size << leftshift_for_tree_index(tidx); while (t != 0 && chunksize(t) != size) { t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; sizebits <<= 1; } if (t != 0) { tchunkptr u = t; do { if (u == (tchunkptr)x) return 1; } while ((u = u->fd) != t); } } } return 0; } /* Traverse each chunk and check it; return total */ static size_t traverse_and_check(mstate m) { size_t sum = 0; if (is_initialized(m)) { msegmentptr s = &m->seg; sum += m->topsize + TOP_FOOT_SIZE; while (s != 0) { mchunkptr q = align_as_chunk(s->base); mchunkptr lastq = 0; assert(pinuse(q)); while (segment_holds(s, q) && q != m->top && q->head != FENCEPOST_HEAD) { sum += chunksize(q); if (cinuse(q)) { assert(!bin_find(m, q)); do_check_inuse_chunk(m, q); } else { assert(q == m->dv || bin_find(m, q)); assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ do_check_free_chunk(m, q); } lastq = q; q = next_chunk(q); } s = s->next; } } return sum; } /* Check all properties of malloc_state. */ static void do_check_malloc_state(mstate m) { bindex_t i; size_t total; /* check bins */ for (i = 0; i < NSMALLBINS; ++i) do_check_smallbin(m, i); for (i = 0; i < NTREEBINS; ++i) do_check_treebin(m, i); if (m->dvsize != 0) { /* check dv chunk */ do_check_any_chunk(m, m->dv); assert(m->dvsize == chunksize(m->dv)); assert(m->dvsize >= MIN_CHUNK_SIZE); assert(bin_find(m, m->dv) == 0); } if (m->top != 0) { /* check top chunk */ do_check_top_chunk(m, m->top); assert(m->topsize == chunksize(m->top)); assert(m->topsize > 0); assert(bin_find(m, m->top) == 0); } total = traverse_and_check(m); assert(total <= m->footprint); assert(m->footprint <= m->max_footprint); } #endif /* DEBUG */ /* ----------------------------- statistics ------------------------------ */ #if !NO_MALLINFO static struct mallinfo internal_mallinfo(mstate m) { struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (!PREACTION(m)) { check_malloc_state(m); if (is_initialized(m)) { size_t nfree = SIZE_T_ONE; /* top always free */ size_t mfree = m->topsize + TOP_FOOT_SIZE; size_t sum = mfree; msegmentptr s = &m->seg; while (s != 0) { mchunkptr q = align_as_chunk(s->base); while (segment_holds(s, q) && q != m->top && q->head != FENCEPOST_HEAD) { size_t sz = chunksize(q); sum += sz; if (!cinuse(q)) { mfree += sz; ++nfree; } q = next_chunk(q); } s = s->next; } nm.arena = sum; nm.ordblks = nfree; nm.hblkhd = m->footprint - sum; nm.usmblks = m->max_footprint; nm.uordblks = m->footprint - mfree; nm.fordblks = mfree; nm.keepcost = m->topsize; } POSTACTION(m); } return nm; } #endif /* !NO_MALLINFO */ static void internal_malloc_stats(mstate m) { if (!PREACTION(m)) { size_t maxfp = 0; size_t fp = 0; size_t used = 0; check_malloc_state(m); if (is_initialized(m)) { msegmentptr s = &m->seg; maxfp = m->max_footprint; fp = m->footprint; used = fp - (m->topsize + TOP_FOOT_SIZE); while (s != 0) { mchunkptr q = align_as_chunk(s->base); while (segment_holds(s, q) && q != m->top && q->head != FENCEPOST_HEAD) { if (!cinuse(q)) used -= chunksize(q); q = next_chunk(q); } s = s->next; } } fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp)); fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp)); fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used)); POSTACTION(m); } } /* ----------------------- Operations on smallbins ----------------------- */ /* Various forms of linking and unlinking are defined as macros. Even the ones for trees, which are very long but have very short typical paths. This is ugly but reduces reliance on inlining support of compilers. */ /* Link a free chunk into a smallbin */ #define insert_small_chunk(M, P, S) {\ bindex_t I = small_index(S);\ mchunkptr B = smallbin_at(M, I);\ mchunkptr F = B;\ assert(S >= MIN_CHUNK_SIZE);\ if (!smallmap_is_marked(M, I))\ mark_smallmap(M, I);\ else if (RTCHECK(ok_address(M, B->fd)))\ F = B->fd;\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ B->fd = P;\ F->bk = P;\ P->fd = F;\ P->bk = B;\ } /* Unlink a chunk from a smallbin */ #define unlink_small_chunk(M, P, S) {\ mchunkptr F = P->fd;\ mchunkptr B = P->bk;\ bindex_t I = small_index(S);\ assert(P != B);\ assert(P != F);\ assert(chunksize(P) == small_index2size(I));\ if (F == B)\ clear_smallmap(M, I);\ else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\ (B == smallbin_at(M,I) || ok_address(M, B)))) {\ F->bk = B;\ B->fd = F;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ } /* Unlink the first chunk from a smallbin */ #define unlink_first_small_chunk(M, B, P, I) {\ mchunkptr F = P->fd;\ assert(P != B);\ assert(P != F);\ assert(chunksize(P) == small_index2size(I));\ if (B == F)\ clear_smallmap(M, I);\ else if (RTCHECK(ok_address(M, F))) {\ B->fd = F;\ F->bk = B;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ } /* Replace dv node, binning the old one */ /* Used only when dvsize known to be small */ #define replace_dv(M, P, S) {\ size_t DVS = M->dvsize;\ if (DVS != 0) {\ mchunkptr DV = M->dv;\ assert(is_small(DVS));\ insert_small_chunk(M, DV, DVS);\ }\ M->dvsize = S;\ M->dv = P;\ } /* ------------------------- Operations on trees ------------------------- */ /* Insert chunk into tree */ #define insert_large_chunk(M, X, S) {\ tbinptr* H;\ bindex_t I;\ compute_tree_index(S, I);\ H = treebin_at(M, I);\ X->index = I;\ X->child[0] = X->child[1] = 0;\ if (!treemap_is_marked(M, I)) {\ mark_treemap(M, I);\ *H = X;\ X->parent = (tchunkptr)H;\ X->fd = X->bk = X;\ }\ else {\ tchunkptr T = *H;\ size_t K = S << leftshift_for_tree_index(I);\ for (;;) {\ if (chunksize(T) != S) {\ tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\ K <<= 1;\ if (*C != 0)\ T = *C;\ else if (RTCHECK(ok_address(M, C))) {\ *C = X;\ X->parent = T;\ X->fd = X->bk = X;\ break;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ break;\ }\ }\ else {\ tchunkptr F = T->fd;\ if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\ T->fd = F->bk = X;\ X->fd = F;\ X->bk = T;\ X->parent = 0;\ break;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ break;\ }\ }\ }\ }\ } /* Unlink steps: 1. If x is a chained node, unlink it from its same-sized fd/bk links and choose its bk node as its replacement. 2. If x was the last node of its size, but not a leaf node, it must be replaced with a leaf node (not merely one with an open left or right), to make sure that lefts and rights of descendents correspond properly to bit masks. We use the rightmost descendent of x. We could use any other leaf, but this is easy to locate and tends to counteract removal of leftmosts elsewhere, and so keeps paths shorter than minimally guaranteed. This doesn't loop much because on average a node in a tree is near the bottom. 3. If x is the base of a chain (i.e., has parent links) relink x's parent and children to x's replacement (or null if none). */ #define unlink_large_chunk(M, X) {\ tchunkptr XP = X->parent;\ tchunkptr R;\ if (X->bk != X) {\ tchunkptr F = X->fd;\ R = X->bk;\ if (RTCHECK(ok_address(M, F))) {\ F->bk = R;\ R->fd = F;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ else {\ tchunkptr* RP;\ if (((R = *(RP = &(X->child[1]))) != 0) ||\ ((R = *(RP = &(X->child[0]))) != 0)) {\ tchunkptr* CP;\ while ((*(CP = &(R->child[1])) != 0) ||\ (*(CP = &(R->child[0])) != 0)) {\ R = *(RP = CP);\ }\ if (RTCHECK(ok_address(M, RP)))\ *RP = 0;\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ }\ if (XP != 0) {\ tbinptr* H = treebin_at(M, X->index);\ if (X == *H) {\ if ((*H = R) == 0) \ clear_treemap(M, X->index);\ }\ else if (RTCHECK(ok_address(M, XP))) {\ if (XP->child[0] == X) \ XP->child[0] = R;\ else \ XP->child[1] = R;\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ if (R != 0) {\ if (RTCHECK(ok_address(M, R))) {\ tchunkptr C0, C1;\ R->parent = XP;\ if ((C0 = X->child[0]) != 0) {\ if (RTCHECK(ok_address(M, C0))) {\ R->child[0] = C0;\ C0->parent = R;\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ }\ if ((C1 = X->child[1]) != 0) {\ if (RTCHECK(ok_address(M, C1))) {\ R->child[1] = C1;\ C1->parent = R;\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ } /* Relays to large vs small bin operations */ #define insert_chunk(M, P, S)\ if (is_small(S)) insert_small_chunk(M, P, S)\ else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); } #define unlink_chunk(M, P, S)\ if (is_small(S)) unlink_small_chunk(M, P, S)\ else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); } /* Relays to internal calls to malloc/free from realloc, memalign etc */ #if ONLY_MSPACES #define internal_malloc(m, b) mspace_malloc(m, b) #define internal_free(m, mem) mspace_free(m,mem); #else /* ONLY_MSPACES */ #if MSPACES #define internal_malloc(m, b)\ (m == gm)? dlmalloc(b) : mspace_malloc(m, b) #define internal_free(m, mem)\ if (m == gm) dlfree(mem); else mspace_free(m,mem); #else /* MSPACES */ #define internal_malloc(m, b) dlmalloc(b) #define internal_free(m, mem) dlfree(mem) #endif /* MSPACES */ #endif /* ONLY_MSPACES */ /* ----------------------- Direct-mmapping chunks ----------------------- */ /* Directly mmapped chunks are set up with an offset to the start of the mmapped region stored in the prev_foot field of the chunk. This allows reconstruction of the required argument to MUNMAP when freed, and also allows adjustment of the returned chunk to meet alignment requirements (especially in memalign). There is also enough space allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain the PINUSE bit so frees can be checked. */ /* Malloc using mmap */ static void* mmap_alloc(mstate m, size_t nb) { size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); if (mmsize > nb) { /* Check for wrap around 0 */ char* mm = (char*)(DIRECT_MMAP(mmsize)); if (mm != CMFAIL) { size_t offset = align_offset(chunk2mem(mm)); size_t psize = mmsize - offset - MMAP_FOOT_PAD; mchunkptr p = (mchunkptr)(mm + offset); p->prev_foot = offset | IS_MMAPPED_BIT; (p)->head = (psize|CINUSE_BIT); mark_inuse_foot(m, p, psize); chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; if (mm < m->least_addr) m->least_addr = mm; if ((m->footprint += mmsize) > m->max_footprint) m->max_footprint = m->footprint; assert(is_aligned(chunk2mem(p))); check_mmapped_chunk(m, p); return chunk2mem(p); } } return 0; } /* Realloc using mmap */ static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) { size_t oldsize = chunksize(oldp); if (is_small(nb)) /* Can't shrink mmap regions below small size */ return 0; /* Keep old chunk if big enough but not too big */ if (oldsize >= nb + SIZE_T_SIZE && (oldsize - nb) <= (mparams.granularity << 1)) return oldp; else { size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); char* cp = (char*)CALL_MREMAP((char*)oldp - offset, oldmmsize, newmmsize, 1); if (cp != CMFAIL) { mchunkptr newp = (mchunkptr)(cp + offset); size_t psize = newmmsize - offset - MMAP_FOOT_PAD; newp->head = (psize|CINUSE_BIT); mark_inuse_foot(m, newp, psize); chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; if (cp < m->least_addr) m->least_addr = cp; if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) m->max_footprint = m->footprint; check_mmapped_chunk(m, newp); return newp; } } return 0; } /* -------------------------- mspace management -------------------------- */ /* Initialize top chunk and its size */ static void init_top(mstate m, mchunkptr p, size_t psize) { /* Ensure alignment */ size_t offset = align_offset(chunk2mem(p)); p = (mchunkptr)((char*)p + offset); psize -= offset; m->top = p; m->topsize = psize; p->head = psize | PINUSE_BIT; /* set size of fake trailing chunk holding overhead space only once */ chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; m->trim_check = mparams.trim_threshold; /* reset on each update */ } /* Initialize bins for a new mstate that is otherwise zeroed out */ static void init_bins(mstate m) { /* Establish circular links for smallbins */ bindex_t i; for (i = 0; i < NSMALLBINS; ++i) { sbinptr bin = smallbin_at(m,i); bin->fd = bin->bk = bin; } } #if PROCEED_ON_ERROR /* default corruption action */ static void reset_on_error(mstate m) { int i; ++malloc_corruption_error_count; /* Reinitialize fields to forget about all memory */ m->smallbins = m->treebins = 0; m->dvsize = m->topsize = 0; m->seg.base = 0; m->seg.size = 0; m->seg.next = 0; m->top = m->dv = 0; for (i = 0; i < NTREEBINS; ++i) *treebin_at(m, i) = 0; init_bins(m); } #endif /* PROCEED_ON_ERROR */ /* Allocate chunk and prepend remainder with chunk in successor base. */ static void* prepend_alloc(mstate m, char* newbase, char* oldbase, size_t nb) { mchunkptr p = align_as_chunk(newbase); mchunkptr oldfirst = align_as_chunk(oldbase); size_t psize = (char*)oldfirst - (char*)p; mchunkptr q = chunk_plus_offset(p, nb); size_t qsize = psize - nb; set_size_and_pinuse_of_inuse_chunk(m, p, nb); assert((char*)oldfirst > (char*)q); assert(pinuse(oldfirst)); assert(qsize >= MIN_CHUNK_SIZE); /* consolidate remainder with first chunk of old base */ if (oldfirst == m->top) { size_t tsize = m->topsize += qsize; m->top = q; q->head = tsize | PINUSE_BIT; check_top_chunk(m, q); } else if (oldfirst == m->dv) { size_t dsize = m->dvsize += qsize; m->dv = q; set_size_and_pinuse_of_free_chunk(q, dsize); } else { if (!cinuse(oldfirst)) { size_t nsize = chunksize(oldfirst); unlink_chunk(m, oldfirst, nsize); oldfirst = chunk_plus_offset(oldfirst, nsize); qsize += nsize; } set_free_with_pinuse(q, qsize, oldfirst); insert_chunk(m, q, qsize); check_free_chunk(m, q); } check_malloced_chunk(m, chunk2mem(p), nb); return chunk2mem(p); } /* Add a segment to hold a new noncontiguous region */ static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) { /* Determine locations and sizes of segment, fenceposts, old top */ char* old_top = (char*)m->top; msegmentptr oldsp = segment_holding(m, old_top); char* old_end = oldsp->base + oldsp->size; size_t ssize = pad_request(sizeof(struct malloc_segment)); char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); size_t offset = align_offset(chunk2mem(rawsp)); char* asp = rawsp + offset; char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; mchunkptr sp = (mchunkptr)csp; msegmentptr ss = (msegmentptr)(chunk2mem(sp)); mchunkptr tnext = chunk_plus_offset(sp, ssize); mchunkptr p = tnext; int nfences = 0; /* reset top to new space */ init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); /* Set up segment record */ assert(is_aligned(ss)); set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); *ss = m->seg; /* Push current record */ m->seg.base = tbase; m->seg.size = tsize; m->seg.sflags = mmapped; m->seg.next = ss; /* Insert trailing fenceposts */ for (;;) { mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); p->head = FENCEPOST_HEAD; ++nfences; if ((char*)(&(nextp->head)) < old_end) p = nextp; else break; } assert(nfences >= 2); /* Insert the rest of old top into a bin as an ordinary free chunk */ if (csp != old_top) { mchunkptr q = (mchunkptr)old_top; size_t psize = csp - old_top; mchunkptr tn = chunk_plus_offset(q, psize); set_free_with_pinuse(q, psize, tn); insert_chunk(m, q, psize); } check_top_chunk(m, m->top); } /* -------------------------- System allocation -------------------------- */ /* Get memory from system using MORECORE or MMAP */ static void* sys_alloc(mstate m, size_t nb) { char* tbase = CMFAIL; size_t tsize = 0; flag_t mmap_flag = 0; init_mparams(); /* Directly map large chunks */ if (use_mmap(m) && nb >= mparams.mmap_threshold) { void* mem = mmap_alloc(m, nb); if (mem != 0) return mem; } /* Try getting memory in any of three ways (in most-preferred to least-preferred order): 1. A call to MORECORE that can normally contiguously extend memory. (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or or main space is mmapped or a previous contiguous call failed) 2. A call to MMAP new space (disabled if not HAVE_MMAP). Note that under the default settings, if MORECORE is unable to fulfill a request, and HAVE_MMAP is true, then mmap is used as a noncontiguous system allocator. This is a useful backup strategy for systems with holes in address spaces -- in this case sbrk cannot contiguously expand the heap, but mmap may be able to find space. 3. A call to MORECORE that cannot usually contiguously extend memory. (disabled if not HAVE_MORECORE) */ if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { char* br = CMFAIL; msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top); size_t asize = 0; ACQUIRE_MORECORE_LOCK(); if (ss == 0) { /* First time through or recovery */ char* base = (char*)CALL_MORECORE(0); if (base != CMFAIL) { asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE); /* Adjust to end on a page boundary */ if (!is_page_aligned(base)) asize += (page_align((size_t)base) - (size_t)base); /* Can't call MORECORE if size is negative when treated as signed */ if (asize < HALF_MAX_SIZE_T && (br = (char*)(CALL_MORECORE(asize))) == base) { tbase = base; tsize = asize; } } } else { /* Subtract out existing available top space from MORECORE request. */ asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + SIZE_T_ONE); /* Use mem here only if it did continuously extend old space */ if (asize < HALF_MAX_SIZE_T && (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) { tbase = br; tsize = asize; } } if (tbase == CMFAIL) { /* Cope with partial failure */ if (br != CMFAIL) { /* Try to use/extend the space we did get */ if (asize < HALF_MAX_SIZE_T && asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { size_t esize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE - asize); if (esize < HALF_MAX_SIZE_T) { char* end = (char*)CALL_MORECORE(esize); if (end != CMFAIL) asize += esize; else { /* Can't use; try to release */ CALL_MORECORE(-asize); br = CMFAIL; } } } } if (br != CMFAIL) { /* Use the space we did get */ tbase = br; tsize = asize; } else disable_contiguous(m); /* Don't try contiguous path in the future */ } RELEASE_MORECORE_LOCK(); } if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE; size_t rsize = granularity_align(req); if (rsize > nb) { /* Fail if wraps around zero */ char* mp = (char*)(CALL_MMAP(rsize)); if (mp != CMFAIL) { tbase = mp; tsize = rsize; mmap_flag = IS_MMAPPED_BIT; } } } if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ size_t asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE); if (asize < HALF_MAX_SIZE_T) { char* br = CMFAIL; char* end = CMFAIL; ACQUIRE_MORECORE_LOCK(); br = (char*)(CALL_MORECORE(asize)); end = (char*)(CALL_MORECORE(0)); RELEASE_MORECORE_LOCK(); if (br != CMFAIL && end != CMFAIL && br < end) { size_t ssize = end - br; if (ssize > nb + TOP_FOOT_SIZE) { tbase = br; tsize = ssize; } } } } if (tbase != CMFAIL) { if ((m->footprint += tsize) > m->max_footprint) m->max_footprint = m->footprint; if (!is_initialized(m)) { /* first-time initialization */ m->seg.base = m->least_addr = tbase; m->seg.size = tsize; m->seg.sflags = mmap_flag; m->magic = mparams.magic; init_bins(m); if (is_global(m)) init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); else { /* Offset top by embedded malloc_state */ mchunkptr mn = next_chunk(mem2chunk(m)); init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE); } } else { /* Try to merge with an existing segment */ msegmentptr sp = &m->seg; while (sp != 0 && tbase != sp->base + sp->size) sp = sp->next; if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & IS_MMAPPED_BIT) == mmap_flag && segment_holds(sp, m->top)) { /* append */ sp->size += tsize; init_top(m, m->top, m->topsize + tsize); } else { if (tbase < m->least_addr) m->least_addr = tbase; sp = &m->seg; while (sp != 0 && sp->base != tbase + tsize) sp = sp->next; if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) { char* oldbase = sp->base; sp->base = tbase; sp->size += tsize; return prepend_alloc(m, tbase, oldbase, nb); } else add_segment(m, tbase, tsize, mmap_flag); } } if (nb < m->topsize) { /* Allocate from new or extended top space */ size_t rsize = m->topsize -= nb; mchunkptr p = m->top; mchunkptr r = m->top = chunk_plus_offset(p, nb); r->head = rsize | PINUSE_BIT; set_size_and_pinuse_of_inuse_chunk(m, p, nb); check_top_chunk(m, m->top); check_malloced_chunk(m, chunk2mem(p), nb); return chunk2mem(p); } } MALLOC_FAILURE_ACTION; return 0; } /* ----------------------- system deallocation -------------------------- */ /* Unmap and unlink any mmapped segments that don't contain used chunks */ static size_t release_unused_segments(mstate m) { size_t released = 0; msegmentptr pred = &m->seg; msegmentptr sp = pred->next; while (sp != 0) { char* base = sp->base; size_t size = sp->size; msegmentptr next = sp->next; if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { mchunkptr p = align_as_chunk(base); size_t psize = chunksize(p); /* Can unmap if first chunk holds entire segment and not pinned */ if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { tchunkptr tp = (tchunkptr)p; assert(segment_holds(sp, (char*)sp)); if (p == m->dv) { m->dv = 0; m->dvsize = 0; } else { unlink_large_chunk(m, tp); } if (CALL_MUNMAP(base, size) == 0) { released += size; m->footprint -= size; /* unlink obsoleted record */ sp = pred; sp->next = next; } else { /* back out if cannot unmap */ insert_large_chunk(m, tp, psize); } } } pred = sp; sp = next; } return released; } static int sys_trim(mstate m, size_t pad) { size_t released = 0; if (pad < MAX_REQUEST && is_initialized(m)) { pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ if (m->topsize > pad) { /* Shrink top space in granularity-size units, keeping at least one */ size_t unit = mparams.granularity; size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - SIZE_T_ONE) * unit; msegmentptr sp = segment_holding(m, (char*)m->top); if (!is_extern_segment(sp)) { if (is_mmapped_segment(sp)) { if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) { /* can't shrink if pinned */ size_t newsize = sp->size - extra; /* Prefer mremap, fall back to munmap */ if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { released = extra; } } } else if (HAVE_MORECORE) { if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; ACQUIRE_MORECORE_LOCK(); { /* Make sure end of memory is where we last set it. */ char* old_br = (char*)(CALL_MORECORE(0)); if (old_br == sp->base + sp->size) { char* rel_br = (char*)(CALL_MORECORE(-extra)); char* new_br = (char*)(CALL_MORECORE(0)); if (rel_br != CMFAIL && new_br < old_br) released = old_br - new_br; } } RELEASE_MORECORE_LOCK(); } } if (released != 0) { sp->size -= released; m->footprint -= released; init_top(m, m->top, m->topsize - released); check_top_chunk(m, m->top); } } /* Unmap any unused mmapped segments */ if (HAVE_MMAP) released += release_unused_segments(m); /* On failure, disable autotrim to avoid repeated failed future calls */ if (released == 0) m->trim_check = MAX_SIZE_T; } return (released != 0)? 1 : 0; } /* ---------------------------- malloc support --------------------------- */ /* allocate a large request from the best fitting chunk in a treebin */ static void* tmalloc_large(mstate m, size_t nb) { tchunkptr v = 0; size_t rsize = -nb; /* Unsigned negation */ tchunkptr t; bindex_t idx; compute_tree_index(nb, idx); if ((t = *treebin_at(m, idx)) != 0) { /* Traverse tree for this bin looking for node with size == nb */ size_t sizebits = nb << leftshift_for_tree_index(idx); tchunkptr rst = 0; /* The deepest untaken right subtree */ for (;;) { tchunkptr rt; size_t trem = chunksize(t) - nb; if (trem < rsize) { v = t; if ((rsize = trem) == 0) break; } rt = t->child[1]; t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; if (rt != 0 && rt != t) rst = rt; if (t == 0) { t = rst; /* set t to least subtree holding sizes > nb */ break; } sizebits <<= 1; } } if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; if (leftbits != 0) { bindex_t i; binmap_t leastbit = least_bit(leftbits); compute_bit2idx(leastbit, i); t = *treebin_at(m, i); } } while (t != 0) { /* find smallest of tree or subtree */ size_t trem = chunksize(t) - nb; if (trem < rsize) { rsize = trem; v = t; } t = leftmost_child(t); } /* If dv is a better fit, return 0 so malloc will use it */ if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { if (RTCHECK(ok_address(m, v))) { /* split */ mchunkptr r = chunk_plus_offset(v, nb); assert(chunksize(v) == rsize + nb); if (RTCHECK(ok_next(v, r))) { unlink_large_chunk(m, v); if (rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(m, v, (rsize + nb)); else { set_size_and_pinuse_of_inuse_chunk(m, v, nb); set_size_and_pinuse_of_free_chunk(r, rsize); insert_chunk(m, r, rsize); } return chunk2mem(v); } } CORRUPTION_ERROR_ACTION(m); } return 0; } /* allocate a small request from the best fitting chunk in a treebin */ static void* tmalloc_small(mstate m, size_t nb) { tchunkptr t, v; size_t rsize; bindex_t i; binmap_t leastbit = least_bit(m->treemap); compute_bit2idx(leastbit, i); v = t = *treebin_at(m, i); rsize = chunksize(t) - nb; while ((t = leftmost_child(t)) != 0) { size_t trem = chunksize(t) - nb; if (trem < rsize) { rsize = trem; v = t; } } if (RTCHECK(ok_address(m, v))) { mchunkptr r = chunk_plus_offset(v, nb); assert(chunksize(v) == rsize + nb); if (RTCHECK(ok_next(v, r))) { unlink_large_chunk(m, v); if (rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(m, v, (rsize + nb)); else { set_size_and_pinuse_of_inuse_chunk(m, v, nb); set_size_and_pinuse_of_free_chunk(r, rsize); replace_dv(m, r, rsize); } return chunk2mem(v); } } CORRUPTION_ERROR_ACTION(m); return 0; } /* --------------------------- realloc support --------------------------- */ static void* internal_realloc(mstate m, void* oldmem, size_t bytes) { if (bytes >= MAX_REQUEST) { MALLOC_FAILURE_ACTION; return 0; } if (!PREACTION(m)) { mchunkptr oldp = mem2chunk(oldmem); size_t oldsize = chunksize(oldp); mchunkptr next = chunk_plus_offset(oldp, oldsize); mchunkptr newp = 0; void* extra = 0; /* Try to either shrink or extend into top. Else malloc-copy-free */ if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && ok_next(oldp, next) && ok_pinuse(next))) { size_t nb = request2size(bytes); if (is_mmapped(oldp)) newp = mmap_resize(m, oldp, nb); else if (oldsize >= nb) { /* already big enough */ size_t rsize = oldsize - nb; newp = oldp; if (rsize >= MIN_CHUNK_SIZE) { mchunkptr remainder = chunk_plus_offset(newp, nb); set_inuse(m, newp, nb); set_inuse(m, remainder, rsize); extra = chunk2mem(remainder); } } else if (next == m->top && oldsize + m->topsize > nb) { /* Expand into top */ size_t newsize = oldsize + m->topsize; size_t newtopsize = newsize - nb; mchunkptr newtop = chunk_plus_offset(oldp, nb); set_inuse(m, oldp, nb); newtop->head = newtopsize |PINUSE_BIT; m->top = newtop; m->topsize = newtopsize; newp = oldp; } } else { USAGE_ERROR_ACTION(m, oldmem); POSTACTION(m); return 0; } POSTACTION(m); if (newp != 0) { if (extra != 0) { internal_free(m, extra); } check_inuse_chunk(m, newp); return chunk2mem(newp); } else { void* newmem = internal_malloc(m, bytes); if (newmem != 0) { size_t oc = oldsize - overhead_for(oldp); memcpy(newmem, oldmem, (oc < bytes)? oc : bytes); internal_free(m, oldmem); } return newmem; } } return 0; } /* --------------------------- memalign support -------------------------- */ static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ return internal_malloc(m, bytes); if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ alignment = MIN_CHUNK_SIZE; if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */ size_t a = MALLOC_ALIGNMENT << 1; while (a < alignment) a <<= 1; alignment = a; } if (bytes >= MAX_REQUEST - alignment) { if (m != 0) { /* Test isn't needed but avoids compiler warning */ MALLOC_FAILURE_ACTION; } } else { size_t nb = request2size(bytes); size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; char* mem = (char*)internal_malloc(m, req); if (mem != 0) { void* leader = 0; void* trailer = 0; mchunkptr p = mem2chunk(mem); if (PREACTION(m)) return 0; if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */ /* Find an aligned spot inside chunk. Since we need to give back leading space in a chunk of at least MIN_CHUNK_SIZE, if the first calculation places us at a spot with less than MIN_CHUNK_SIZE leader, we can move to the next aligned spot. We've allocated enough total room so that this is always possible. */ char* br = (char*)mem2chunk((size_t)(((size_t)(mem + alignment - SIZE_T_ONE)) & -alignment)); char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? br : br+alignment; mchunkptr newp = (mchunkptr)pos; size_t leadsize = pos - (char*)(p); size_t newsize = chunksize(p) - leadsize; if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ newp->prev_foot = p->prev_foot + leadsize; newp->head = (newsize|CINUSE_BIT); } else { /* Otherwise, give back leader, use the rest */ set_inuse(m, newp, newsize); set_inuse(m, p, leadsize); leader = chunk2mem(p); } p = newp; } /* Give back spare room at the end */ if (!is_mmapped(p)) { size_t size = chunksize(p); if (size > nb + MIN_CHUNK_SIZE) { size_t remainder_size = size - nb; mchunkptr remainder = chunk_plus_offset(p, nb); set_inuse(m, p, nb); set_inuse(m, remainder, remainder_size); trailer = chunk2mem(remainder); } } assert (chunksize(p) >= nb); assert((((size_t)(chunk2mem(p))) % alignment) == 0); check_inuse_chunk(m, p); POSTACTION(m); if (leader != 0) { internal_free(m, leader); } if (trailer != 0) { internal_free(m, trailer); } return chunk2mem(p); } } return 0; } /* ------------------------ comalloc/coalloc support --------------------- */ static void** ialloc(mstate m, size_t n_elements, size_t* sizes, int opts, void* chunks[]) { /* This provides common support for independent_X routines, handling all of the combinations that can result. The opts arg has: bit 0 set if all elements are same size (using sizes[0]) bit 1 set if elements should be zeroed */ size_t element_size; /* chunksize of each element, if all same */ size_t contents_size; /* total size of elements */ size_t array_size; /* request size of pointer array */ void* mem; /* malloced aggregate space */ mchunkptr p; /* corresponding chunk */ size_t remainder_size; /* remaining bytes while splitting */ void** marray; /* either "chunks" or malloced ptr array */ mchunkptr array_chunk; /* chunk for malloced ptr array */ flag_t was_enabled; /* to disable mmap */ size_t size; size_t i; /* compute array length, if needed */ if (chunks != 0) { if (n_elements == 0) return chunks; /* nothing to do */ marray = chunks; array_size = 0; } else { /* if empty req, must still return chunk representing empty array */ if (n_elements == 0) return (void**)internal_malloc(m, 0); marray = 0; array_size = request2size(n_elements * (sizeof(void*))); } /* compute total element size */ if (opts & 0x1) { /* all-same-size */ element_size = request2size(*sizes); contents_size = n_elements * element_size; } else { /* add up all the sizes */ element_size = 0; contents_size = 0; for (i = 0; i != n_elements; ++i) contents_size += request2size(sizes[i]); } size = contents_size + array_size; /* Allocate the aggregate chunk. First disable direct-mmapping so malloc won't use it, since we would not be able to later free/realloc space internal to a segregated mmap region. */ was_enabled = use_mmap(m); disable_mmap(m); mem = internal_malloc(m, size - CHUNK_OVERHEAD); if (was_enabled) enable_mmap(m); if (mem == 0) return 0; if (PREACTION(m)) return 0; p = mem2chunk(mem); remainder_size = chunksize(p); assert(!is_mmapped(p)); if (opts & 0x2) { /* optionally clear the elements */ memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); } /* If not provided, allocate the pointer array as final part of chunk */ if (marray == 0) { size_t array_chunk_size; array_chunk = chunk_plus_offset(p, contents_size); array_chunk_size = remainder_size - contents_size; marray = (void**) (chunk2mem(array_chunk)); set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); remainder_size = contents_size; } /* split out elements */ for (i = 0; ; ++i) { marray[i] = chunk2mem(p); if (i != n_elements-1) { if (element_size != 0) size = element_size; else size = request2size(sizes[i]); remainder_size -= size; set_size_and_pinuse_of_inuse_chunk(m, p, size); p = chunk_plus_offset(p, size); } else { /* the final element absorbs any overallocation slop */ set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); break; } } #if DEBUG if (marray != chunks) { /* final element must have exactly exhausted chunk */ if (element_size != 0) { assert(remainder_size == element_size); } else { assert(remainder_size == request2size(sizes[i])); } check_inuse_chunk(m, mem2chunk(marray)); } for (i = 0; i != n_elements; ++i) check_inuse_chunk(m, mem2chunk(marray[i])); #endif /* DEBUG */ POSTACTION(m); return marray; } /* -------------------------- public routines ---------------------------- */ #if !ONLY_MSPACES void* dlmalloc(size_t bytes) { /* Basic algorithm: If a small request (< 256 bytes minus per-chunk overhead): 1. If one exists, use a remainderless chunk in associated smallbin. (Remainderless means that there are too few excess bytes to represent as a chunk.) 2. If it is big enough, use the dv chunk, which is normally the chunk adjacent to the one used for the most recent small request. 3. If one exists, split the smallest available chunk in a bin, saving remainder in dv. 4. If it is big enough, use the top chunk. 5. If available, get memory from system and use it Otherwise, for a large request: 1. Find the smallest available binned chunk that fits, and use it if it is better fitting than dv chunk, splitting if necessary. 2. If better fitting than any binned chunk, use the dv chunk. 3. If it is big enough, use the top chunk. 4. If request size >= mmap threshold, try to directly mmap this chunk. 5. If available, get memory from system and use it The ugly goto's here ensure that postaction occurs along all paths. */ if (!PREACTION(gm)) { void* mem; size_t nb; if (bytes <= MAX_SMALL_REQUEST) { bindex_t idx; binmap_t smallbits; nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); idx = small_index(nb); smallbits = gm->smallmap >> idx; if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ mchunkptr b, p; idx += ~smallbits & 1; /* Uses next bin if idx empty */ b = smallbin_at(gm, idx); p = b->fd; assert(chunksize(p) == small_index2size(idx)); unlink_first_small_chunk(gm, b, p, idx); set_inuse_and_pinuse(gm, p, small_index2size(idx)); mem = chunk2mem(p); check_malloced_chunk(gm, mem, nb); goto postaction; } else if (nb > gm->dvsize) { if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ mchunkptr b, p, r; size_t rsize; bindex_t i; binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); binmap_t leastbit = least_bit(leftbits); compute_bit2idx(leastbit, i); b = smallbin_at(gm, i); p = b->fd; assert(chunksize(p) == small_index2size(i)); unlink_first_small_chunk(gm, b, p, i); rsize = small_index2size(i) - nb; /* Fit here cannot be remainderless if 4byte sizes */ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(gm, p, small_index2size(i)); else { set_size_and_pinuse_of_inuse_chunk(gm, p, nb); r = chunk_plus_offset(p, nb); set_size_and_pinuse_of_free_chunk(r, rsize); replace_dv(gm, r, rsize); } mem = chunk2mem(p); check_malloced_chunk(gm, mem, nb); goto postaction; } else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { check_malloced_chunk(gm, mem, nb); goto postaction; } } } else if (bytes >= MAX_REQUEST) nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ else { nb = pad_request(bytes); if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { check_malloced_chunk(gm, mem, nb); goto postaction; } } if (nb <= gm->dvsize) { size_t rsize = gm->dvsize - nb; mchunkptr p = gm->dv; if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ mchunkptr r = gm->dv = chunk_plus_offset(p, nb); gm->dvsize = rsize; set_size_and_pinuse_of_free_chunk(r, rsize); set_size_and_pinuse_of_inuse_chunk(gm, p, nb); } else { /* exhaust dv */ size_t dvs = gm->dvsize; gm->dvsize = 0; gm->dv = 0; set_inuse_and_pinuse(gm, p, dvs); } mem = chunk2mem(p); check_malloced_chunk(gm, mem, nb); goto postaction; } else if (nb < gm->topsize) { /* Split top */ size_t rsize = gm->topsize -= nb; mchunkptr p = gm->top; mchunkptr r = gm->top = chunk_plus_offset(p, nb); r->head = rsize | PINUSE_BIT; set_size_and_pinuse_of_inuse_chunk(gm, p, nb); mem = chunk2mem(p); check_top_chunk(gm, gm->top); check_malloced_chunk(gm, mem, nb); goto postaction; } mem = sys_alloc(gm, nb); postaction: POSTACTION(gm); return mem; } return 0; } void dlfree(void* mem) { /* Consolidate freed chunks with preceeding or succeeding bordering free chunks, if they exist, and then place in a bin. Intermixed with special cases for top, dv, mmapped chunks, and usage errors. */ if (mem != 0) { mchunkptr p = mem2chunk(mem); #if FOOTERS mstate fm = get_mstate_for(p); if (!ok_magic(fm)) { USAGE_ERROR_ACTION(fm, p); return; } #else /* FOOTERS */ #define fm gm #endif /* FOOTERS */ if (!PREACTION(fm)) { check_inuse_chunk(fm, p); if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { size_t psize = chunksize(p); mchunkptr next = chunk_plus_offset(p, psize); if (!pinuse(p)) { size_t prevsize = p->prev_foot; if ((prevsize & IS_MMAPPED_BIT) != 0) { prevsize &= ~IS_MMAPPED_BIT; psize += prevsize + MMAP_FOOT_PAD; if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) fm->footprint -= psize; goto postaction; } else { mchunkptr prev = chunk_minus_offset(p, prevsize); psize += prevsize; p = prev; if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ if (p != fm->dv) { unlink_chunk(fm, p, prevsize); } else if ((next->head & INUSE_BITS) == INUSE_BITS) { fm->dvsize = psize; set_free_with_pinuse(p, psize, next); goto postaction; } } else goto erroraction; } } if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { if (!cinuse(next)) { /* consolidate forward */ if (next == fm->top) { size_t tsize = fm->topsize += psize; fm->top = p; p->head = tsize | PINUSE_BIT; if (p == fm->dv) { fm->dv = 0; fm->dvsize = 0; } if (should_trim(fm, tsize)) sys_trim(fm, 0); goto postaction; } else if (next == fm->dv) { size_t dsize = fm->dvsize += psize; fm->dv = p; set_size_and_pinuse_of_free_chunk(p, dsize); goto postaction; } else { size_t nsize = chunksize(next); psize += nsize; unlink_chunk(fm, next, nsize); set_size_and_pinuse_of_free_chunk(p, psize); if (p == fm->dv) { fm->dvsize = psize; goto postaction; } } } else set_free_with_pinuse(p, psize, next); insert_chunk(fm, p, psize); check_free_chunk(fm, p); goto postaction; } } erroraction: USAGE_ERROR_ACTION(fm, p); postaction: POSTACTION(fm); } } #if !FOOTERS #undef fm #endif /* FOOTERS */ } void* dlcalloc(size_t n_elements, size_t elem_size) { void* mem; size_t req = 0; if (n_elements != 0) { req = n_elements * elem_size; if (((n_elements | elem_size) & ~(size_t)0xffff) && (req / n_elements != elem_size)) req = MAX_SIZE_T; /* force downstream failure on overflow */ } mem = dlmalloc(req); if (mem != 0 && calloc_must_clear(mem2chunk(mem))) memset(mem, 0, req); return mem; } void* dlrealloc(void* oldmem, size_t bytes) { if (oldmem == 0) return dlmalloc(bytes); #ifdef REALLOC_ZERO_BYTES_FREES if (bytes == 0) { dlfree(oldmem); return 0; } #endif /* REALLOC_ZERO_BYTES_FREES */ else { #if ! FOOTERS mstate m = gm; #else /* FOOTERS */ mstate m = get_mstate_for(mem2chunk(oldmem)); if (!ok_magic(m)) { USAGE_ERROR_ACTION(m, oldmem); return 0; } #endif /* FOOTERS */ return internal_realloc(m, oldmem, bytes); } } void* dlmemalign(size_t alignment, size_t bytes) { return internal_memalign(gm, alignment, bytes); } void** dlindependent_calloc(size_t n_elements, size_t elem_size, void* chunks[]) { size_t sz = elem_size; /* serves as 1-element array */ return ialloc(gm, n_elements, &sz, 3, chunks); } void** dlindependent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]) { return ialloc(gm, n_elements, sizes, 0, chunks); } void* dlvalloc(size_t bytes) { size_t pagesz; init_mparams(); pagesz = mparams.page_size; return dlmemalign(pagesz, bytes); } void* dlpvalloc(size_t bytes) { size_t pagesz; init_mparams(); pagesz = mparams.page_size; return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); } int dlmalloc_trim(size_t pad) { int result = 0; if (!PREACTION(gm)) { result = sys_trim(gm, pad); POSTACTION(gm); } return result; } size_t dlmalloc_footprint(void) { return gm->footprint; } size_t dlmalloc_max_footprint(void) { return gm->max_footprint; } #if !NO_MALLINFO struct mallinfo dlmallinfo(void) { return internal_mallinfo(gm); } #endif /* NO_MALLINFO */ void dlmalloc_stats() { internal_malloc_stats(gm); } size_t dlmalloc_usable_size(void* mem) { if (mem != 0) { mchunkptr p = mem2chunk(mem); if (cinuse(p)) return chunksize(p) - overhead_for(p); } return 0; } int dlmallopt(int param_number, int value) { return change_mparam(param_number, value); } #endif /* !ONLY_MSPACES */ /* ----------------------------- user mspaces ---------------------------- */ #if MSPACES static mstate init_user_mstate(char* tbase, size_t tsize) { size_t msize = pad_request(sizeof(struct malloc_state)); mchunkptr mn; mchunkptr msp = align_as_chunk(tbase); mstate m = (mstate)(chunk2mem(msp)); memset(m, 0, msize); INITIAL_LOCK(&m->mutex); msp->head = (msize|PINUSE_BIT|CINUSE_BIT); m->seg.base = m->least_addr = tbase; m->seg.size = m->footprint = m->max_footprint = tsize; m->magic = mparams.magic; m->mflags = mparams.default_mflags; disable_contiguous(m); init_bins(m); mn = next_chunk(mem2chunk(m)); init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE); check_top_chunk(m, m->top); return m; } mspace create_mspace(size_t capacity, int locked) { mstate m = 0; size_t msize = pad_request(sizeof(struct malloc_state)); init_mparams(); /* Ensure pagesize etc initialized */ if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { size_t rs = ((capacity == 0)? mparams.granularity : (capacity + TOP_FOOT_SIZE + msize)); size_t tsize = granularity_align(rs); char* tbase = (char*)(CALL_MMAP(tsize)); if (tbase != CMFAIL) { m = init_user_mstate(tbase, tsize); m->seg.sflags = IS_MMAPPED_BIT; set_lock(m, locked); } } return (mspace)m; } mspace create_mspace_with_base(void* base, size_t capacity, int locked) { mstate m = 0; size_t msize = pad_request(sizeof(struct malloc_state)); init_mparams(); /* Ensure pagesize etc initialized */ if (capacity > msize + TOP_FOOT_SIZE && capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { m = init_user_mstate((char*)base, capacity); m->seg.sflags = EXTERN_BIT; set_lock(m, locked); } return (mspace)m; } size_t destroy_mspace(mspace msp) { size_t freed = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { msegmentptr sp = &ms->seg; while (sp != 0) { char* base = sp->base; size_t size = sp->size; flag_t flag = sp->sflags; sp = sp->next; if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && CALL_MUNMAP(base, size) == 0) freed += size; } } else { USAGE_ERROR_ACTION(ms,ms); } return freed; } /* mspace versions of routines are near-clones of the global versions. This is not so nice but better than the alternatives. */ void* mspace_malloc(mspace msp, size_t bytes) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } if (!PREACTION(ms)) { void* mem; size_t nb; if (bytes <= MAX_SMALL_REQUEST) { bindex_t idx; binmap_t smallbits; nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); idx = small_index(nb); smallbits = ms->smallmap >> idx; if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ mchunkptr b, p; idx += ~smallbits & 1; /* Uses next bin if idx empty */ b = smallbin_at(ms, idx); p = b->fd; assert(chunksize(p) == small_index2size(idx)); unlink_first_small_chunk(ms, b, p, idx); set_inuse_and_pinuse(ms, p, small_index2size(idx)); mem = chunk2mem(p); check_malloced_chunk(ms, mem, nb); goto postaction; } else if (nb > ms->dvsize) { if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ mchunkptr b, p, r; size_t rsize; bindex_t i; binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); binmap_t leastbit = least_bit(leftbits); compute_bit2idx(leastbit, i); b = smallbin_at(ms, i); p = b->fd; assert(chunksize(p) == small_index2size(i)); unlink_first_small_chunk(ms, b, p, i); rsize = small_index2size(i) - nb; /* Fit here cannot be remainderless if 4byte sizes */ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(ms, p, small_index2size(i)); else { set_size_and_pinuse_of_inuse_chunk(ms, p, nb); r = chunk_plus_offset(p, nb); set_size_and_pinuse_of_free_chunk(r, rsize); replace_dv(ms, r, rsize); } mem = chunk2mem(p); check_malloced_chunk(ms, mem, nb); goto postaction; } else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { check_malloced_chunk(ms, mem, nb); goto postaction; } } } else if (bytes >= MAX_REQUEST) nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ else { nb = pad_request(bytes); if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { check_malloced_chunk(ms, mem, nb); goto postaction; } } if (nb <= ms->dvsize) { size_t rsize = ms->dvsize - nb; mchunkptr p = ms->dv; if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ mchunkptr r = ms->dv = chunk_plus_offset(p, nb); ms->dvsize = rsize; set_size_and_pinuse_of_free_chunk(r, rsize); set_size_and_pinuse_of_inuse_chunk(ms, p, nb); } else { /* exhaust dv */ size_t dvs = ms->dvsize; ms->dvsize = 0; ms->dv = 0; set_inuse_and_pinuse(ms, p, dvs); } mem = chunk2mem(p); check_malloced_chunk(ms, mem, nb); goto postaction; } else if (nb < ms->topsize) { /* Split top */ size_t rsize = ms->topsize -= nb; mchunkptr p = ms->top; mchunkptr r = ms->top = chunk_plus_offset(p, nb); r->head = rsize | PINUSE_BIT; set_size_and_pinuse_of_inuse_chunk(ms, p, nb); mem = chunk2mem(p); check_top_chunk(ms, ms->top); check_malloced_chunk(ms, mem, nb); goto postaction; } mem = sys_alloc(ms, nb); postaction: POSTACTION(ms); return mem; } return 0; } void mspace_free(mspace msp, void* mem) { if (mem != 0) { mchunkptr p = mem2chunk(mem); #if FOOTERS mstate fm = get_mstate_for(p); #else /* FOOTERS */ mstate fm = (mstate)msp; #endif /* FOOTERS */ if (!ok_magic(fm)) { USAGE_ERROR_ACTION(fm, p); return; } if (!PREACTION(fm)) { check_inuse_chunk(fm, p); if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { size_t psize = chunksize(p); mchunkptr next = chunk_plus_offset(p, psize); if (!pinuse(p)) { size_t prevsize = p->prev_foot; if ((prevsize & IS_MMAPPED_BIT) != 0) { prevsize &= ~IS_MMAPPED_BIT; psize += prevsize + MMAP_FOOT_PAD; if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) fm->footprint -= psize; goto postaction; } else { mchunkptr prev = chunk_minus_offset(p, prevsize); psize += prevsize; p = prev; if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ if (p != fm->dv) { unlink_chunk(fm, p, prevsize); } else if ((next->head & INUSE_BITS) == INUSE_BITS) { fm->dvsize = psize; set_free_with_pinuse(p, psize, next); goto postaction; } } else goto erroraction; } } if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { if (!cinuse(next)) { /* consolidate forward */ if (next == fm->top) { size_t tsize = fm->topsize += psize; fm->top = p; p->head = tsize | PINUSE_BIT; if (p == fm->dv) { fm->dv = 0; fm->dvsize = 0; } if (should_trim(fm, tsize)) sys_trim(fm, 0); goto postaction; } else if (next == fm->dv) { size_t dsize = fm->dvsize += psize; fm->dv = p; set_size_and_pinuse_of_free_chunk(p, dsize); goto postaction; } else { size_t nsize = chunksize(next); psize += nsize; unlink_chunk(fm, next, nsize); set_size_and_pinuse_of_free_chunk(p, psize); if (p == fm->dv) { fm->dvsize = psize; goto postaction; } } } else set_free_with_pinuse(p, psize, next); insert_chunk(fm, p, psize); check_free_chunk(fm, p); goto postaction; } } erroraction: USAGE_ERROR_ACTION(fm, p); postaction: POSTACTION(fm); } } } void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) { void* mem; size_t req = 0; mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } if (n_elements != 0) { req = n_elements * elem_size; if (((n_elements | elem_size) & ~(size_t)0xffff) && (req / n_elements != elem_size)) req = MAX_SIZE_T; /* force downstream failure on overflow */ } mem = internal_malloc(ms, req); if (mem != 0 && calloc_must_clear(mem2chunk(mem))) memset(mem, 0, req); return mem; } void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) { if (oldmem == 0) return mspace_malloc(msp, bytes); #ifdef REALLOC_ZERO_BYTES_FREES if (bytes == 0) { mspace_free(msp, oldmem); return 0; } #endif /* REALLOC_ZERO_BYTES_FREES */ else { #if FOOTERS mchunkptr p = mem2chunk(oldmem); mstate ms = get_mstate_for(p); #else /* FOOTERS */ mstate ms = (mstate)msp; #endif /* FOOTERS */ if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } return internal_realloc(ms, oldmem, bytes); } } void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } return internal_memalign(ms, alignment, bytes); } void** mspace_independent_calloc(mspace msp, size_t n_elements, size_t elem_size, void* chunks[]) { size_t sz = elem_size; /* serves as 1-element array */ mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } return ialloc(ms, n_elements, &sz, 3, chunks); } void** mspace_independent_comalloc(mspace msp, size_t n_elements, size_t sizes[], void* chunks[]) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } return ialloc(ms, n_elements, sizes, 0, chunks); } int mspace_trim(mspace msp, size_t pad) { int result = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { if (!PREACTION(ms)) { result = sys_trim(ms, pad); POSTACTION(ms); } } else { USAGE_ERROR_ACTION(ms,ms); } return result; } void mspace_malloc_stats(mspace msp) { mstate ms = (mstate)msp; if (ok_magic(ms)) { internal_malloc_stats(ms); } else { USAGE_ERROR_ACTION(ms,ms); } } size_t mspace_footprint(mspace msp) { size_t result; mstate ms = (mstate)msp; if (ok_magic(ms)) { result = ms->footprint; } USAGE_ERROR_ACTION(ms,ms); return result; } size_t mspace_max_footprint(mspace msp) { size_t result; mstate ms = (mstate)msp; if (ok_magic(ms)) { result = ms->max_footprint; } USAGE_ERROR_ACTION(ms,ms); return result; } #if !NO_MALLINFO struct mallinfo mspace_mallinfo(mspace msp) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); } return internal_mallinfo(ms); } #endif /* NO_MALLINFO */ int mspace_mallopt(int param_number, int value) { return change_mparam(param_number, value); } #endif /* MSPACES */ /* -------------------- Alternative MORECORE functions ------------------- */ /* Guidelines for creating a custom version of MORECORE: * For best performance, MORECORE should allocate in multiples of pagesize. * MORECORE may allocate more memory than requested. (Or even less, but this will usually result in a malloc failure.) * MORECORE must not allocate memory when given argument zero, but instead return one past the end address of memory from previous nonzero call. * For best performance, consecutive calls to MORECORE with positive arguments should return increasing addresses, indicating that space has been contiguously extended. * Even though consecutive calls to MORECORE need not return contiguous addresses, it must be OK for malloc'ed chunks to span multiple regions in those cases where they do happen to be contiguous. * MORECORE need not handle negative arguments -- it may instead just return MFAIL when given negative arguments. Negative arguments are always multiples of pagesize. MORECORE must not misinterpret negative args as large positive unsigned args. You can suppress all such calls from even occurring by defining MORECORE_CANNOT_TRIM, As an example alternative MORECORE, here is a custom allocator kindly contributed for pre-OSX macOS. It uses virtually but not necessarily physically contiguous non-paged memory (locked in, present and won't get swapped out). You can use it by uncommenting this section, adding some #includes, and setting up the appropriate defines above: #define MORECORE osMoreCore There is also a shutdown routine that should somehow be called for cleanup upon program exit. #define MAX_POOL_ENTRIES 100 #define MINIMUM_MORECORE_SIZE (64 * 1024U) static int next_os_pool; void *our_os_pools[MAX_POOL_ENTRIES]; void *osMoreCore(int size) { void *ptr = 0; static void *sbrk_top = 0; if (size > 0) { if (size < MINIMUM_MORECORE_SIZE) size = MINIMUM_MORECORE_SIZE; if (CurrentExecutionLevel() == kTaskLevel) ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0); if (ptr == 0) { return (void *) MFAIL; } // save ptrs so they can be freed during cleanup our_os_pools[next_os_pool] = ptr; next_os_pool++; ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK); sbrk_top = (char *) ptr + size; return ptr; } else if (size < 0) { // we don't currently support shrink behavior return (void *) MFAIL; } else { return sbrk_top; } } // cleanup any allocated memory pools // called as last thing before shutting down driver void osCleanupMem(void) { void **ptr; for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++) if (*ptr) { PoolDeallocate(*ptr); *ptr = 0; } } */ /* ----------------------------------------------------------------------- History: V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee) * Add max_footprint functions * Ensure all appropriate literals are size_t * Fix conditional compilation problem for some #define settings * Avoid concatenating segments with the one provided in create_mspace_with_base * Rename some variables to avoid compiler shadowing warnings * Use explicit lock initialization. * Better handling of sbrk interference. * Simplify and fix segment insertion, trimming and mspace_destroy * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x * Thanks especially to Dennis Flanagan for help on these. V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee) * Fix memalign brace error. V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee) * Fix improper #endif nesting in C++ * Add explicit casts needed for C++ V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee) * Use trees for large bins * Support mspaces * Use segments to unify sbrk-based and mmap-based system allocation, removing need for emulation on most platforms without sbrk. * Default safety checks * Optional footer checks. Thanks to William Robertson for the idea. * Internal code refactoring * Incorporate suggestions and platform-specific changes. Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas, Aaron Bachmann, Emery Berger, and others. * Speed up non-fastbin processing enough to remove fastbins. * Remove useless cfree() to avoid conflicts with other apps. * Remove internal memcpy, memset. Compilers handle builtins better. * Remove some options that no one ever used and rename others. V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee) * Fix malloc_state bitmap array misdeclaration V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee) * Allow tuning of FIRST_SORTED_BIN_SIZE * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte. * Better detection and support for non-contiguousness of MORECORE. Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger * Bypass most of malloc if no frees. Thanks To Emery Berger. * Fix freeing of old top non-contiguous chunk im sysmalloc. * Raised default trim and map thresholds to 256K. * Fix mmap-related #defines. Thanks to Lubos Lunak. * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield. * Branch-free bin calculation * Default trim and mmap thresholds now 256K. V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee) * Introduce independent_comalloc and independent_calloc. Thanks to Michael Pachos for motivation and help. * Make optional .h file available * Allow > 2GB requests on 32bit systems. * new WIN32 sbrk, mmap, munmap, lock code from . Thanks also to Andreas Mueller , and Anonymous. * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for helping test this.) * memalign: check alignment arg * realloc: don't try to shift chunks backwards, since this leads to more fragmentation in some programs and doesn't seem to help in any others. * Collect all cases in malloc requiring system memory into sysmalloc * Use mmap as backup to sbrk * Place all internal state in malloc_state * Introduce fastbins (although similar to 2.5.1) * Many minor tunings and cosmetic improvements * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS Thanks to Tony E. Bennett and others. * Include errno.h to support default failure action. V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee) * return null for negative arguments * Added Several WIN32 cleanups from Martin C. Fong * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h' (e.g. WIN32 platforms) * Cleanup header file inclusion for WIN32 platforms * Cleanup code to avoid Microsoft Visual C++ compiler complaints * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing memory allocation routines * Set 'malloc_getpagesize' for WIN32 platforms (needs more work) * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to usage of 'assert' in non-WIN32 code * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to avoid infinite loop * Always call 'fREe()' rather than 'free()' V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee) * Fixed ordering problem with boundary-stamping V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee) * Added pvalloc, as recommended by H.J. Liu * Added 64bit pointer support mainly from Wolfram Gloger * Added anonymously donated WIN32 sbrk emulation * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen * malloc_extend_top: fix mask error that caused wastage after foreign sbrks * Add linux mremap support code from HJ Liu V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee) * Integrated most documentation with the code. * Add support for mmap, with help from Wolfram Gloger (Gloger@lrz.uni-muenchen.de). * Use last_remainder in more cases. * Pack bins using idea from colin@nyx10.cs.du.edu * Use ordered bins instead of best-fit threshhold * Eliminate block-local decls to simplify tracing and debugging. * Support another case of realloc via move into top * Fix error occuring when initial sbrk_base not word-aligned. * Rely on page size for units instead of SBRK_UNIT to avoid surprises about sbrk alignment conventions. * Add mallinfo, mallopt. Thanks to Raymond Nijssen (raymond@es.ele.tue.nl) for the suggestion. * Add `pad' argument to malloc_trim and top_pad mallopt parameter. * More precautions for cases where other routines call sbrk, courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de). * Added macros etc., allowing use in linux libc from H.J. Lu (hjl@gnu.ai.mit.edu) * Inverted this history list V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee) * Re-tuned and fixed to behave more nicely with V2.6.0 changes. * Removed all preallocation code since under current scheme the work required to undo bad preallocations exceeds the work saved in good cases for most test programs. * No longer use return list or unconsolidated bins since no scheme using them consistently outperforms those that don't given above changes. * Use best fit for very large chunks to prevent some worst-cases. * Added some support for debugging V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee) * Removed footers when chunks are in use. Thanks to Paul Wilson (wilson@cs.texas.edu) for the suggestion. V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee) * Added malloc_trim, with help from Wolfram Gloger (wmglo@Dent.MED.Uni-Muenchen.DE). V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g) V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g) * realloc: try to expand in both directions * malloc: swap order of clean-bin strategy; * realloc: only conditionally expand backwards * Try not to scavenge used bins * Use bin counts as a guide to preallocation * Occasionally bin return list chunks in first scan * Add a few optimizations from colin@nyx10.cs.du.edu V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g) * faster bin computation & slightly different binning * merged all consolidations to one part of malloc proper (eliminating old malloc_find_space & malloc_clean_bin) * Scan 2 returns chunks (not just 1) * Propagate failure in realloc if malloc returns 0 * Add stuff to allow compilation on non-ANSI compilers from kpv@research.att.com V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu) * removed potential for odd address access in prev_chunk * removed dependency on getpagesize.h * misc cosmetics and a bit more internal documentation * anticosmetics: mangled names in macros to evade debugger strangeness * tested on sparc, hp-700, dec-mips, rs6000 with gcc & native cc (hp, dec only) allowing Detlefs & Zorn comparison study (in SIGPLAN Notices.) Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) * Based loosely on libg++-1.2X malloc. (It retains some of the overall structure of old version, but most details differ.) */ #endif mona-1.4/Mem/mem.c0000644000414100000240000000404110756504321010661 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "dlmalloc.h" /* (must be before stdio/string) */ #include #include #include "mem.h" #ifdef MAXALLOCATED int maxallocated = 0; void updatemaxallocated() { int t = mem_allocated(); if (t>maxallocated) maxallocated = t; } #endif int memlimit = 0; void mem_error() { if (memlimit) printf("\n\n-----\n" "Interactive Demo memory limit exceeded, execution stopped.\n"); else printf("\n*** out of memory, execution aborted ***\n"); exit(-1); } void *mem_alloc(size_t s) { #ifdef USE_MALLOC void *x = malloc(s); #else void *x = dlmalloc(s); #endif if (!x) mem_error(); #ifdef MAXALLOCATED updatemaxallocated(); #endif return x; } void mem_free(void *x) { #ifdef USE_MALLOC free(x); #else dlfree(x); #endif } void *mem_resize(void *x, size_t s) { #ifdef USE_MALLOC void *y = realloc(x, s); #else void *y = dlrealloc(x, s); #endif if (!y) mem_error(); #ifdef MAXALLOCATED updatemaxallocated(); #endif return y; } void mem_copy(void *dst, void *src, size_t s) { memcpy(dst, src, s); } void mem_zero(void *x, size_t s) { memset(x, 0, s); } unsigned int mem_allocated() { #ifdef USE_MALLOC return -1; #else struct mallinfo m = dlmallinfo(); return (unsigned) m.uordblks+m.hblkhd; #endif } mona-1.4/BDD/0000777000414100000240000000000011045777450007706 500000000000000mona-1.4/BDD/bdd.h0000644000414100000240000003053610756504267010535 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef _BDD_PACKAGE #define _BDD_PACKAGE #include /*CUSTOMIZED CONSTANTS*/ /* before a bdd manager is killed, its statistics can be added to the i'th statistics group, where i is less than BDD_STAT_INDEX_SIZE */ #define BDD_STAT_INDEX_SIZE 3 #define _BDD_STAT_ /*MISCELLANEOUS DEFINITIONS*/ extern int memlimit; typedef unsigned boolean; #define TRUE 1 #define FALSE 0 #define BDD_MAX_TOTAL_TABLE_SIZE 0x1000000 /* = 2^24 corresponding to three bytes */ #define BDD_MAX_INDEX 0xfffe /* = 0xfffe (since 0xffff = BDD_LEAF_INDEX denotes a leaf) */ /*BDD DATA STRUCTURES AND ELEMENTARY OPERATIONS*/ /* convention: "left" means "low" successor (corresponding to false) "right" means "high" successor (corresponding to true) */ typedef unsigned bdd_ptr; /* a BDD node is identified by an unsigned offset into the node table, so this is not really a pointer */ /* each BDD node sits in the hashed node table and consists of four 32-bit words */ /* macros for getting at the packed fields are given at the end of this file */ struct bdd_record_ { unsigned lri[2]; /*left and right, of type bdd_ptr, each consists of three bytes, and index (name of variable) is a two byte an integer */ bdd_ptr next; /*only the next field of 0th record in a bucket is used*/ unsigned mark; /*this field is used in apply1 as a bdd_ptr;it is also used in other routines such as bdd_operate_on_nodes */ }; typedef struct bdd_record_ bdd_record; typedef unsigned bdd_handle; /* an offset into the bdd_roots array */ /* BDD MANAGER */ typedef struct bdd_manager_ bdd_manager; /* MANAGER AND CACHE */ extern bdd_manager *bdd_new_manager(unsigned table_size, unsigned table_overflow_increment); extern void bdd_kill_manager(bdd_manager *bddm); extern void bdd_make_cache(bdd_manager *bddm, unsigned size, unsigned overflow_increment); extern void bdd_kill_cache(bdd_manager *bddm); extern unsigned bdd_size(bdd_manager *bbdm); /* STATISTICS */ extern void bdd_init(void); extern void bdd_update_statistics(bdd_manager *bddm, unsigned stat_index); extern void bdd_print_statistics(unsigned stat_index, char info[]); /* SIMPLE BDD OPERATIONS */ extern unsigned bdd_ifindex(bdd_manager *bbdm, bdd_ptr p); extern bdd_ptr bdd_then (bdd_manager *bbdm, bdd_ptr p); extern bdd_ptr bdd_else(bdd_manager *bbdm, bdd_ptr p) ; extern unsigned bdd_is_leaf(bdd_manager *bbdm, bdd_ptr p); extern unsigned bdd_leaf_value(bdd_manager *bbdm, bdd_ptr p); /* sequential access */ extern bdd_ptr bdd_get_free_node_sequential(bdd_manager *bbdm); extern bdd_ptr bdd_find_node_sequential(bdd_manager *bbdm, bdd_ptr l, bdd_ptr r, unsigned i); extern bdd_ptr bdd_find_leaf_sequential(bdd_manager *bbdm, unsigned val); /* hashed access */ extern bdd_ptr bdd_find_node_hashed(bdd_manager *bddm, bdd_ptr l, bdd_ptr r, unsigned indx, bdd_ptr *some_roots, void (*update_fn) (bdd_ptr (*new_place)(bdd_ptr node))); extern bdd_ptr bdd_find_node_hashed_add_root(bdd_manager *bddm, bdd_ptr l, bdd_ptr r, unsigned indx); extern bdd_handle bdd_handle_find_node_hashed_add_root(bdd_manager *bddm, bdd_ptr l, bdd_ptr r, unsigned indx); extern bdd_ptr bdd_find_leaf_hashed(bdd_manager *bddm, unsigned val, void *some_roots, void (*update_fn) (bdd_ptr (*new_place)(bdd_ptr node))); extern bdd_ptr bdd_find_leaf_hashed_add_root(bdd_manager *bddm, unsigned val); extern bdd_handle bdd_handle_find_leaf_hashed_add_root(bdd_manager *bddm, unsigned val); /* COMPLEX OPERATIONS (UNARY) */ extern void bdd_prepare_apply1(bdd_manager *bddm); extern bdd_ptr bdd_apply1(bdd_manager *bddm, bdd_ptr p, bdd_manager *bbdm_r, unsigned (*apply1_leaf_function)(unsigned value)); /* call *operator_function for each node accessible from p */ extern void bdd_operate_on_nodes(bdd_manager *bddm_p, bdd_ptr p, void (*operator_function) (bdd_record *node_pointer)); /* call *leaf_function for each leaf accessible from p */ extern void bdd_call_leafs(bdd_manager *bddm, bdd_ptr p, void (*leaf_function)(unsigned value)); /* replace the index i of any internal node accessible from p by indices_map[i] */ extern void bdd_replace_indices (bdd_manager *bddm_p, bdd_ptr p, unsigned indices_map []); /* COMPLEX OPERATIONS (BINARY) */ extern bdd_ptr bdd_apply2_sequential(bdd_manager *bddm_p, bdd_ptr p, bdd_manager *bddm_q, bdd_ptr q, bdd_manager *bbdm_r, unsigned (*apply2_leaf_function) (unsigned p_value, unsigned q_value)); extern bdd_ptr bdd_apply2_hashed(bdd_manager *bddm_p, bdd_ptr p, bdd_manager *bddm_q, bdd_ptr q, bdd_manager *bbdm_r, unsigned (*apply2_leaf_function) (bdd_ptr p_value, bdd_ptr q_value)); extern bdd_ptr bdd_project(bdd_manager *bddm_p, bdd_ptr p, unsigned var_index, bdd_manager *bddm_r, unsigned (*project_leaf_function)(unsigned value1, unsigned value2)); /* BDD_ROOTS */ extern bdd_ptr *bdd_roots(bdd_manager *bddm); /* SHOULD NOT BE USED */ #define BDD_ROOTS(bddm) \ SEQUENTIAL_LIST(bddm->roots) extern unsigned bdd_roots_length(bdd_manager *bddm); /* SHOULD NOT BE USED */ #define BDD_ROOT(bddm, handle) \ SEQUENTIAL_LIST(bddm->roots)[handle] #define BDD_ADD_ROOT(bddm, p) \ PUSH_SEQUENTIAL_LIST(bddm->roots, unsigned, p) #define BDD_LAST_HANDLE(bddm) \ (LENGTH_SEQUENTIAL_LIST(bddm->roots) - 1) #define BDD_ADD_ROOT_SET_HANDLE(bddm, p, h) \ BDD_ADD_ROOT(bddm, p) \ h = BDD_LAST_HANDLE(bddm) /* MARK STUFF */ extern unsigned bdd_mark(bdd_manager *bddm, bdd_ptr p); extern void bdd_set_mark(bdd_manager *bddm, bdd_ptr p, unsigned mark); /* PRINT */ extern void print_bddpaths(bdd_ptr p, bdd_ptr q, bdd_manager *bddm, unsigned b, unsigned no_free_vars, unsigned *offsets); extern void print_bddpaths_verbose(bdd_ptr p, bdd_ptr q, bdd_manager *bddm, unsigned b); /* BDD TRACE */ struct trace_descr_ { unsigned index; boolean value; struct trace_descr_ *next; }; typedef struct trace_descr_ *trace_descr; struct paths_ { unsigned to; trace_descr trace; struct paths_ *next; }; typedef struct paths_ *paths; paths make_paths(bdd_manager *bddm, bdd_ptr p); void kill_trace(trace_descr t); void kill_paths(paths p); trace_descr find_one_path(bdd_manager *bddm, bdd_ptr p, bdd_ptr q); void print_bddpaths(bdd_ptr p, bdd_ptr q, bdd_manager *bddm, unsigned b, unsigned no_free_vars, unsigned *offsets); void print_bddpaths_verbose(bdd_ptr p, bdd_ptr q, bdd_manager *bddm, unsigned b); void print_one_path(bdd_ptr p, bdd_ptr q, bdd_manager *bddm, unsigned no_free_vars, unsigned *offsets); /* BDD NODES INTERNALS */ /* invariant throughout hashed use: the r-field is different from BDD_UNUSED (0) if and only if the record is in use*/ #define BDD_UNUSED 0 #define BDD_USED 1 /*the index of an "undefined" BDD node*/ #define BDD_UNDEF (unsigned) -1 /*value of variable index in BDD node used to indicate that node is a leaf*/ #define BDD_LEAF_INDEX ((unsigned) 0xffff) /* look up the two lri fields in a bdd_record_ and extract the value of the left child, the right child, and the node index */ #define LOAD_lri(node_ptr, l, r, i)\ i = (node_ptr)->lri[1];\ r = i>>16;\ i &= 0xffff;\ l = (node_ptr)->lri[0];\ r |= ((l & 0xff) << 16);\ l = l >> 8;\ #define LOAD_lr(node_ptr, l, r)\ l = (node_ptr)->lri[0];\ r = (l << 16) & 0x00ff0000;\ l = l >> 8;\ r |= ((node_ptr)->lri[1] >> 16);\ #define LOAD_index(node_ptr, i)\ i = ((node_ptr)->lri[1] & 0xffff);\ #define LOAD_r(node_ptr)\ ((((node_ptr)->lri[0] << 16) & 0x00ff0000) | ((node_ptr)->lri[1] >> 16))\ #define STR_lri(node_ptr, l, r, i)\ (node_ptr)->lri[0] = (l << 8) | (r >> 16);\ (node_ptr)->lri[1] = ((r & 0x0000ffff) << 16) | i;\ /* pack l, r, and i in two unsigned words (corresponding to the lri[0] and lri[1] fields */ #define TWO_UNS_STR_lri(i0, i1, l, r, i)\ i0 = (l << 8) | (r >> 16);\ i1 = ((r & 0x0000ffff) << 16) | i;\ /* SEQUENTIAL LISTS */ /* results of BDD operations are stored in lists implemented as sequential arrays */ #define DECLARE_SEQUENTIAL_LIST(name, element_type) \ element_type *name##_array; \ unsigned name##_length; \ unsigned name##_index; \ #define MAKE_SEQUENTIAL_LIST(name, element_type, size) \ name##_array = (element_type *) mem_alloc((size_t) size * (sizeof (element_type))); \ name##_length = size; \ name##_index = 0; \ name##_array[0] = (element_type) 0; \ #define FREE_SEQUENTIAL_LIST(name) \ mem_free(name##_array) \ #define PUSH_SEQUENTIAL_LIST(name, element_type, element) \ if (!(name##_index < name##_length - 1)) { \ name##_array = (element_type *) mem_resize(name##_array, \ (size_t)((name##_length *= 2) * (sizeof (element_type)))); \ } \ name##_array[name##_index] = element; \ name##_array[++name##_index] = (element_type) 0; \ #define POP_SEQUENTIAL_LIST(name, element_type, res) \ {res = name##_array[--name##_index]; \ name##_array[name##_index] = (element_type) 0;} \ #define PEEL_SEQUENTIAL_LIST(name, element_type) \ name##_array[--name##_index] = (element_type) 0; \ #define STORE_TOP_SEQUENTIAL_LIST(name, element) \ name##_array[name##_index - 1] = element; \ #define TOP_SEQUENTIAL_LIST(name) \ name##_array[name##_index - 1] \ #define SEQUENTIAL_LIST(name) \ name##_array #define LENGTH_SEQUENTIAL_LIST(name) \ (name##_index) /* complete definition of bdd_manager */ typedef struct cache_record_ cache_record; /*defined in bdd_internal.h*/ struct bdd_manager_ { /* table */ unsigned table_log_size; unsigned table_size; /* = 2^table_log_size*/ unsigned table_total_size; /* including overflow area */ unsigned table_mask; /*table_log_size - the number of bits in table_mask is the logarithm of the number of bins per hash address*/ unsigned table_overflow_increment; /*the number of new nodes added when overflow area is full; also initial size of overflow area*/ unsigned table_elements; /*number of elements inserted in hashed mode*/ bdd_ptr table_next; /*next available position when nodes are inserted sequentially*/ bdd_ptr table_overflow; /*next free node in overflow area when node_table used in hashed mode*/ unsigned table_double_trigger; /* when to trigger doubting of the table */ bdd_record *node_table; /*node_table is the beginning of array of BDD nodes*/ DECLARE_SEQUENTIAL_LIST(roots, unsigned) /*results of applys and projects*/ /* cache */ cache_record *cache; /*cache is the beginning of cache table*/ unsigned cache_total_size; /*size of hashed area + overflow area*/ unsigned cache_size; /*size of hashed area (which is initialized to unused)*/ unsigned cache_mask; /*table_log_size - the number of bits in cache_mask is the logarithm of the number of bins per hash address*/ unsigned cache_overflow_increment; /*initial size of overflow area and increment when full*/ unsigned cache_overflow; /*points to next available position in overflow area*/ boolean cache_erase_on_doubling; /*if not set, cache is rehashed when table is doubled in hashed access mode; default is true*/ /* statistics */ unsigned number_double; unsigned number_cache_collissions; unsigned number_cache_link_followed; unsigned number_node_collissions; unsigned number_node_link_followed; unsigned number_lookup_cache; unsigned number_insert_cache; unsigned apply1_steps; unsigned call_steps; unsigned apply2_steps; }; extern unsigned fn_identity(unsigned p); /* invariant check - can't be disabled */ #define invariant(exp) \ ((void) ((exp) ? 0 : \ (printf("%s:%u: failed invariant - please inform mona@brics.dk\n", \ __FILE__, __LINE__), \ abort(), 0))) #endif mona-1.4/BDD/makefile.am0000644000414100000240000000057410764207701011716 00000000000000MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonabdd.la libmonabdd_la_SOURCES = bdd.c bdd_cache.c bdd_double.c bdd_dump.c bdd_dump.h \ bdd_external.c bdd_external.h bdd_internal.h bdd_manager.c \ bdd_trace.c hash.c hash.h libmonabdd_la_LDFLAGS = -version-info 1:4 libmonabdd_la_LIBADD = ../Mem/libmonamem.la monadir = $(includedir)/mona mona_HEADERS = bdd.h mona-1.4/BDD/makefile.in0000644000414100000240000003736711045777400011742 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = BDD DIST_COMMON = $(mona_HEADERS) $(srcdir)/makefile.am \ $(srcdir)/makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libmonabdd_la_DEPENDENCIES = ../Mem/libmonamem.la am_libmonabdd_la_OBJECTS = bdd.lo bdd_cache.lo bdd_double.lo \ bdd_dump.lo bdd_external.lo bdd_manager.lo bdd_trace.lo \ hash.lo libmonabdd_la_OBJECTS = $(am_libmonabdd_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmonabdd_la_SOURCES) DIST_SOURCES = $(libmonabdd_la_SOURCES) monaHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(mona_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonabdd.la libmonabdd_la_SOURCES = bdd.c bdd_cache.c bdd_double.c bdd_dump.c bdd_dump.h \ bdd_external.c bdd_external.h bdd_internal.h bdd_manager.c \ bdd_trace.c hash.c hash.h libmonabdd_la_LDFLAGS = -version-info 1:4 libmonabdd_la_LIBADD = ../Mem/libmonamem.la monadir = $(includedir)/mona mona_HEADERS = bdd.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu BDD/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu BDD/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmonabdd.la: $(libmonabdd_la_OBJECTS) $(libmonabdd_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libmonabdd_la_LDFLAGS) $(libmonabdd_la_OBJECTS) $(libmonabdd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_double.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_dump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_trace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-monaHEADERS: $(mona_HEADERS) @$(NORMAL_INSTALL) test -z "$(monadir)" || $(mkdir_p) "$(DESTDIR)$(monadir)" @list='$(mona_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(monaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(monadir)/$$f'"; \ $(monaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(monadir)/$$f"; \ done uninstall-monaHEADERS: @$(NORMAL_UNINSTALL) @list='$(mona_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(monadir)/$$f'"; \ rm -f "$(DESTDIR)$(monadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-monaHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-monaHEADERS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/BDD/bdd.c0000644000414100000240000010630710756504320010516 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "bdd.h" #include "bdd_internal.h" extern int memlimit; struct stat_record_ stat_record[BDD_STAT_INDEX_SIZE]; boolean table_has_been_doubled; /* if something is cached for (p, q), then return it; otherwise, return 0. In any case, set *h to the hash value calculated) */ GNUC_INLINE unsigned lookup_cache(bdd_manager *bddm, unsigned *h, unsigned p, unsigned q) { unsigned temp, res; cache_record *cache_ptr; #ifdef _BDD_STAT_ bddm->number_lookup_cache++; #endif *h = HASH2(p, q, bddm->cache_mask); cache_ptr = &bddm->cache[*h]; CACHE_LOOKUP_RECORD(bddm, (*cache_ptr), p, q, res, temp); return (res); } /* insert in cache, while calculating cache value. Note: bddm->cache may change during this operation */ GNUC_INLINE void insert_cache(bdd_manager *bddm, unsigned h, unsigned p, unsigned q, unsigned res){ unsigned temp; unsigned p_, q_, r_; cache_record *cache_ptr = &bddm->cache[h]; #ifdef _BDD_STAT_ bddm->number_insert_cache++; #endif if (!CACHE_FULL_BIN0((*cache_ptr))) {CACHE_STORE_BIN0((*cache_ptr), p, q, res);} else if (!CACHE_FULL_BIN1((*cache_ptr))) {CACHE_STORE_BIN1((*cache_ptr), p, q, res);} else { #ifdef _BDD_STAT_ bddm->number_cache_collissions++; #endif CACHE_NEW_RECORD(bddm, temp); cache_ptr = &bddm->cache[h]; /*since preceding creation of record may have changed bddm->cache*/ CACHE_LOAD_BIN0((*cache_ptr), p_, q_, r_); CACHE_STORE_BIN0(bddm->cache[temp], p_, q_, r_); CACHE_LOAD_BIN1((*cache_ptr), p_, q_, r_); CACHE_STORE_BIN1(bddm->cache[temp], p_, q_, r_); CACHE_STORE_BIN0((*cache_ptr), p, q, res); CACHE_CLEAR_BIN1((*cache_ptr)); bddm->cache[temp].next = (*cache_ptr).next; cache_ptr->next = temp; } } unsigned bdd_ifindex(bdd_manager *bddm, unsigned p) { unsigned index; LOAD_index(&bddm->node_table[p], index); return (index); } unsigned bdd_then(bdd_manager *bddm, unsigned p) { unsigned l, r, index; LOAD_lri(&bddm->node_table[p], l, r, index); return (r); } unsigned bdd_else(bdd_manager *bddm, unsigned p) { unsigned l, r, index; LOAD_lri(&bddm->node_table[p], l, r, index); return (l); } unsigned bdd_is_leaf(bdd_manager *bddm, unsigned p) { unsigned index; LOAD_index(&bddm->node_table[p], index); return (index == BDD_LEAF_INDEX); } unsigned bdd_leaf_value(bdd_manager *bddm, unsigned p) { unsigned l, r, index; LOAD_lri(&bddm->node_table[p], l, r, index); return (l); } unsigned same_r(unsigned r) { return (r); } GNUC_INLINE bdd_ptr bdd_get_free_node_sequential(bdd_manager *bddm) { bddm->table_elements++; if (bddm->table_next < bddm->table_total_size) { return (bddm->table_next++); } else { double_table_sequential(bddm); if (bddm->cache) { double_cache(bddm, &same_r); } return (bddm->table_next++); } } bdd_ptr bdd_find_node_sequential(bdd_manager *bddm, unsigned l, unsigned r, unsigned i) { unsigned res = bdd_get_free_node_sequential(bddm); invariant(i <= BDD_MAX_INDEX); STR_lri(&bddm->node_table[res], l, r, i); return (res); } GNUC_INLINE unsigned bdd_find_leaf_sequential(bdd_manager *bddm, unsigned val) { unsigned res = bdd_get_free_node_sequential(bddm); STR_lri(&bddm->node_table[res], val, BDD_USED, BDD_LEAF_INDEX); return (res); } GNUC_INLINE unsigned bdd_find_node_hashed(bdd_manager *bddm, unsigned l, unsigned r, unsigned indx, unsigned *some_roots, void (*update_fn)(unsigned (*new_place)(unsigned node))) { unsigned h; bdd_record *ptr; unsigned i0, i1; unsigned i; unsigned temp; table_has_been_doubled = FALSE; start: h = HASH3(l, r, indx, bddm->table_mask) + BDD_NUMBER_OF_BINS; ptr = &bddm->node_table[h]; TWO_UNS_STR_lri(i0, i1, l, r, indx); /*look in primary bucket indicated by hash function*/ for (i = BDD_NUMBER_OF_BINS; i--; ) { if (LOAD_r(ptr + i) == BDD_UNUSED) { goto insert_in_existing; } else { if (i0 == (ptr + i)->lri[0] && i1 == (ptr + i)->lri[1]) { return (h + i); } } } /*now look in overflow area*/ for (temp = ptr->next; temp; temp = bddm->node_table[temp].next) { #ifdef _BDD_STAT_ bddm->number_node_link_followed++; #endif ptr = &bddm->node_table[temp]; for (i = BDD_NUMBER_OF_BINS; i--; ) { if (LOAD_r(ptr + i) == BDD_UNUSED) { goto insert_in_existing; } else if (i0 == (ptr + i)->lri[0] && i1 == (ptr + i)->lri[1]) { return (temp + i); } } } goto insert_in_new_bucket; /*we didn't find the node, but found an available bin*/ insert_in_existing: bddm->table_elements++; (ptr + i)->lri[0] = i0; (ptr + i)->lri[1] = i1; (ptr + i)->mark = 0; return ((ptr - bddm->node_table) + i); /*no room; create a new bucket in overflow area*/ insert_in_new_bucket: #ifdef _BDD_STAT_ bddm->number_node_collissions++; #endif /*but first check that table is not too full to warrant doubling*/ if (bddm->table_elements > bddm->table_double_trigger) { /* printf("double_table_and_cache_hashed called:\n"); */ /*only change l and r if node is not a leaf*/ double_table_and_cache_hashed(bddm, some_roots, update_fn, &l, &r, (indx != BDD_LEAF_INDEX)); /*now nodes l and r are possibly to be found in new places, and we should use quite a different primary bucket, so...*/ table_has_been_doubled = TRUE; goto start; } /*and check that overflow area is big enough; be careful with ptr, which should be pointing to same indexed position even if node_table is moved */ if (bddm->table_overflow + BDD_NUMBER_OF_BINS > bddm->table_total_size) { unsigned ptr_as_index = ptr - bddm->node_table; bddm->table_total_size += bddm->table_overflow_increment; bddm->node_table = mem_resize(bddm->node_table, (size_t) (sizeof (bdd_record)) * bddm->table_total_size); ptr = bddm->node_table + ptr_as_index; } /* now do the insertion */ bddm->table_elements++; ptr->next = bddm->table_overflow; ptr = &bddm->node_table[bddm->table_overflow]; (ptr + (BDD_NUMBER_OF_BINS - 1))->lri[0] = i0; (ptr + (BDD_NUMBER_OF_BINS - 1))->lri[1] = i1; (ptr + (BDD_NUMBER_OF_BINS - 1))->mark = 0; ptr->next = 0; /*unnecessary to initialize other next fields in same bucket as we only use the next field of the 0th*/ /*but mark other bins as unused*/ for (i = BDD_NUMBER_OF_BINS - 1; i--; ) { (ptr + i)->lri[1] = BDD_UNUSED; (ptr + i)->lri[0] = BDD_UNUSED; } /*advance table_overflow to next available bucket*/ return ((bddm->table_overflow += BDD_NUMBER_OF_BINS) - 1); } GNUC_INLINE bdd_ptr bdd_find_node_hashed_add_root(bdd_manager *bddm, bdd_ptr l, bdd_ptr r, unsigned indx) { bdd_ptr p; invariant(indx <= BDD_MAX_INDEX); p = bdd_find_node_hashed(bddm, l, r, indx, BDD_ROOTS(bddm), NULL); BDD_ADD_ROOT(bddm, p); return (p); } GNUC_INLINE bdd_handle bdd_handle_find_node_hashed_add_root(bdd_manager *bddm, bdd_ptr l, bdd_ptr r, unsigned indx) { bdd_ptr p; invariant(indx <= BDD_MAX_INDEX); p = bdd_find_node_hashed(bddm, l, r, indx, BDD_ROOTS(bddm), NULL); BDD_ADD_ROOT(bddm, p); return (BDD_LAST_HANDLE(bddm)); } GNUC_INLINE unsigned bdd_find_leaf_hashed(bdd_manager *bddm, unsigned val, void *some_roots, void (*update_fn)(unsigned (*new_place)(unsigned node))) { return (bdd_find_node_hashed(bddm, val, BDD_USED, BDD_LEAF_INDEX, some_roots, update_fn)); } GNUC_INLINE bdd_ptr bdd_find_leaf_hashed_add_root(bdd_manager *bddm, unsigned val) { bdd_ptr p = bdd_find_leaf_hashed(bddm, val, BDD_ROOTS(bddm), NULL); BDD_ADD_ROOT(bddm, p); return (p); } GNUC_INLINE bdd_handle bdd_handle_find_leaf_hashed_add_root(bdd_manager *bddm, unsigned val) { bdd_ptr p = bdd_find_leaf_hashed(bddm, val, BDD_ROOTS(bddm), NULL); BDD_ADD_ROOT(bddm, p); return (BDD_LAST_HANDLE(bddm)); } /*APPLY ROUTINES*/ #define DECLARE_LOCAL(record) \ struct local_##record {\ unsigned a_size;\ record *act_stack;\ record *a;\ record *a_last;\ bdd_manager *bddm_p, *bddm_q, *bddm_r;\ }; \ unsigned local_##record##_in_use = 0; \ struct local_##record *local_##record##_primary = NULL #define DECLARE_POINTER_TO_LOCAL(record, pointer) \ struct local_##record *pointer /* we keep a distinguished local record, kept through local_##record##_primary; usually, we can just use that one without wasting time getting memory */ #define NEW_LOCAL(record, local, bddm_p, bddm_q, bddm_r) \ record *a; \ if (local_##record##_primary && (local_##record##_in_use == 0)) \ local = local_##record##_primary; /* use the current one */ \ else { \ local = (struct local_##record *) \ mem_alloc((size_t)(sizeof (struct local_##record))); \ local->a_size = 1024; \ local->act_stack = (record*) \ mem_alloc((size_t)(sizeof (record)) * local->a_size); \ local->a_last = &(local->act_stack[local->a_size - 1]); \ if (!local_##record##_primary) \ local_##record##_primary = local; \ }; \ local->a = local->act_stack; \ a = local->a; \ local->bddm_p = bddm_p; \ local->bddm_q = bddm_q; \ local->bddm_r = bddm_r; \ local_##record##_in_use++ #define INCREMENT_LOCAL(local) \ if (local->a == local->a_last) { \ unsigned size = ((local->a_last - local->act_stack) + 1) * 2; \ unsigned i = local->a_last - local->act_stack; \ local->act_stack = mem_resize(local->act_stack, \ (size_t)(sizeof *(local->act_stack)) \ * size); \ local->a_last = &(local->act_stack)[size - 1]; \ local->a = &(local->act_stack)[i + 1]; \ } else \ local->a++; \ a = local->a #define DECREMENT_LOCAL(local) \ local->a--; \ a = local->a #define BOTTOM_LOCAL(local) \ local->a == local->act_stack \ #define BEGINNING_LOCAL(local) \ local->act_stack \ #define FREE_LOCAL(record,local) \ if (local_##record##_in_use > 1) { \ mem_free(local->act_stack); \ mem_free(local); }; \ local_##record##_in_use-- #define DECLARE_A(record) \ unsigned a_size = 1024; \ record *act_stack = (record*) \ mem_alloc((size_t)(sizeof (record)) * a_size); \ record *a = act_stack; \ record *a_last = &act_stack[a_size - 1] \ #define INCREMENT_A \ if (a == a_last) { \ unsigned size = ((a_last - act_stack) + 1) * 2; \ unsigned i = a_last - act_stack; \ act_stack = mem_resize(act_stack, \ (size_t)(sizeof *act_stack) \ * size); \ a_last = &(act_stack)[size - 1]; \ a = &(act_stack)[i + 1]; \ } else \ a++; \ #define DECREMENT_A \ a-- \ #define BOTTOM_A \ a == act_stack \ #define BEGINNING_A \ act_stack #define FREE_A \ mem_free(act_stack) \ const unsigned going_left = BDD_UNDEF; const unsigned hash_value_invalid = (unsigned) (-1); void bdd_prepare_apply1(bdd_manager *bddm) { bdd_record *p; for (p = &bddm->node_table[BDD_NUMBER_OF_BINS]; p < &bddm->node_table[bddm->table_total_size]; p++) { p->mark = 0; } } typedef struct { int index; unsigned p; unsigned second; } activation_record_apply1; /* declare the type of activation frames for apply1 */ DECLARE_LOCAL(activation_record_apply1); /* apply1_ptr points to the current activation frame for an apply1 operation */ DECLARE_POINTER_TO_LOCAL(activation_record_apply1, apply1_ptr); void update_activation_stack(unsigned (*new_place)(unsigned node)) { activation_record_apply1 *a_; if (apply1_ptr->bddm_p == apply1_ptr->bddm_r) { for (a_ = apply1_ptr->act_stack; a_ <= apply1_ptr->a ; a_++) { a_->p = new_place(a_->p); /* a corresponds to a leaf, and a_->second is only well_defined * for internal nodes */ if (apply1_ptr->a != a_) a_->second = new_place(a_->second); } } /* all mark fields are invalid at this point */ bdd_prepare_apply1(apply1_ptr->bddm_p); } unsigned bdd_apply1_internal(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_r, unsigned (*apply1_leaf_function)(unsigned value), boolean add_roots) { unsigned res; bdd_record *node_ptr; unsigned tmp1, tmpp; bdd_record *p_table; p_table = bddm_p->node_table; node_ptr = &p_table[p]; if ((res = node_ptr->mark) != 0) { #ifdef _BDD_STAT_ bddm_r->apply1_steps++; #endif if (add_roots) { PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); } return res; } else { DECLARE_POINTER_TO_LOCAL(activation_record_apply1, local); DECLARE_POINTER_TO_LOCAL(activation_record_apply1, old_apply1_ptr); /* bdd_apply1 restores the local data; this is necessary, for example when the table is doubled during an bdd_apply1 (which entails a call of bdd_apply1 to copy the table into a fresh one) */ DECLARE_SEQUENTIAL_LIST(intermediate, unsigned) NEW_LOCAL(activation_record_apply1, local, bddm_p, bddm_p, bddm_r); /* second last argument is dummy */ MAKE_SEQUENTIAL_LIST(intermediate, unsigned, 1024); old_apply1_ptr = apply1_ptr; apply1_ptr = local; start: node_ptr = &p_table[p]; #ifdef _BDD_STAT_ bddm_r->apply1_steps++; #endif PUSH_SEQUENTIAL_LIST(intermediate, unsigned, going_left); if ((res = node_ptr->mark) != 0) goto finish; else { LOAD_index(node_ptr,a->index); /*get index*/ /*CACHE MISS STALL*/ if (a->index == BDD_LEAF_INDEX) { /*we are at leaf*/ LOAD_lr(node_ptr, tmpp, tmp1); res = bdd_find_leaf_hashed(bddm_r, apply1_leaf_function(tmpp), SEQUENTIAL_LIST(intermediate), /* (void*)0); */ &update_activation_stack); p_table = bddm_p->node_table; node_ptr = &p_table[p]; node_ptr->mark = res; goto finish;} else { a->p = p; /*descend left from p, then right*/ LOAD_lr(node_ptr, p, a->second); INCREMENT_LOCAL(local); /*prepare recursion*/ /*now do the apply for the left successor*/ goto start;} second: /*we are now done with apply along the left*/ /*now do the apply along the right*/ STORE_TOP_SEQUENTIAL_LIST(intermediate, res); p = a->second; INCREMENT_LOCAL(local); goto start; /*we are done with both left and right apply's*/ third: if (TOP_SEQUENTIAL_LIST(intermediate) == res) { /* then res is the right answer, because of path compression */ } else { res = bdd_find_node_hashed(bddm_r, TOP_SEQUENTIAL_LIST(intermediate), res, a->index, SEQUENTIAL_LIST(intermediate), &update_activation_stack); } p_table = bddm_p->node_table; p_table[a->p].mark = res; /*CACHE MISS STALL*/ finish: if (BOTTOM_LOCAL(local)) { FREE_LOCAL(activation_record_apply1,local); FREE_SEQUENTIAL_LIST(intermediate); if (add_roots) { PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); } apply1_ptr = old_apply1_ptr; return (res); } else { DECREMENT_LOCAL(local); PEEL_SEQUENTIAL_LIST(intermediate, unsigned); if (TOP_SEQUENTIAL_LIST(intermediate) == going_left) goto second; else goto third; } } } } unsigned bdd_apply1(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_r, unsigned (*apply1_leaf_function)(unsigned value)) { return (bdd_apply1_internal(bddm_p, p, bddm_r,apply1_leaf_function, TRUE)); } unsigned bdd_apply1_dont_add_roots(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_r, unsigned (*apply1_leaf_function)(unsigned value)) { return (bdd_apply1_internal(bddm_p, p, bddm_r,apply1_leaf_function, FALSE)); } typedef struct { int index; unsigned p, q, h; unsigned second_p, second_q; } activation_record_apply2_hashed; DECLARE_LOCAL(activation_record_apply2_hashed); /* apply2_ptr contains pointer to current activation frame of bdd_apply2_hashed */ DECLARE_POINTER_TO_LOCAL(activation_record_apply2_hashed, apply2_ptr); void update_activation_stack_apply2_hashed (unsigned (*new_place)(unsigned node)) { activation_record_apply2_hashed *a_; if (apply2_ptr->bddm_p == apply2_ptr->bddm_r) { for (a_ = apply2_ptr->act_stack; a_ <= apply2_ptr->a ; a_++) { a_->p = new_place(a_->p); a_->h = hash_value_invalid; /* a correspond to a leaf, and a_->second_p is only well_defined * for internal nodes */ if (apply2_ptr->a!= a_) a_->second_p = new_place(a_->second_p); } if (apply2_ptr->bddm_q == apply2_ptr->bddm_r) { for (a_ = apply2_ptr->act_stack; a_ <= apply2_ptr->a; a_++) { a_->q = new_place(a_->q); a_->h = hash_value_invalid; /* a correspond to a leaf, and a_->second_q is only well_defined * for internal nodes */ if (apply2_ptr->a != a_) a_->second_q = new_place(a_->second_q); } } } } unsigned bdd_apply2_hashed(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_q, unsigned q, bdd_manager *bddm_r, unsigned (*apply2_leaf_function) (unsigned p_value, unsigned q_value)) { unsigned p_i, q_i; unsigned res; bdd_record *node_ptr; unsigned tmp1, tmpp, tmpq; unsigned h; bdd_record *p_table, *q_table; res = lookup_cache(bddm_r, &h, p, q); /*CACHE MISS STALL*/ if (res != 0) { #ifdef _BDD_STAT_ bddm_r->apply2_steps++; #endif PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); return res; } else { DECLARE_POINTER_TO_LOCAL(activation_record_apply2_hashed, local); DECLARE_POINTER_TO_LOCAL(activation_record_apply2_hashed, old_apply2_ptr); DECLARE_SEQUENTIAL_LIST(intermediate, unsigned) NEW_LOCAL(activation_record_apply2_hashed, local, bddm_p, bddm_q, bddm_r); MAKE_SEQUENTIAL_LIST(intermediate, unsigned, 1024); old_apply2_ptr = apply2_ptr; apply2_ptr = local; start: #ifdef _BDD_STAT_ bddm_r->apply2_steps++; #endif PUSH_SEQUENTIAL_LIST(intermediate, unsigned, going_left); res = lookup_cache(bddm_r, &h, p, q); /*CACHE MISS STALL*/ if (res != 0) goto finish; else { p_table = bddm_p->node_table; /* when we get here from second: or third: bddm_p->node_table may have changed as a result of a resize operation */ q_table = bddm_q->node_table; node_ptr = &p_table[p]; LOAD_index(node_ptr,p_i); /*get indices*/ /*CACHE MISS STALL*/ node_ptr = &q_table[q]; LOAD_index(node_ptr,q_i); /*CACHE MISS STALL*/ a->p = p; /*this for later insert_cache operation*/ a->q = q; a->h = h; if ((p_i == BDD_LEAF_INDEX) && (q_i == BDD_LEAF_INDEX)){ /*we are at leaves*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, tmpp, tmp1); node_ptr = &q_table[q]; LOAD_lr(node_ptr, tmpq, tmp1); res = bdd_find_leaf_hashed(bddm_r, apply2_leaf_function(tmpp, tmpq), SEQUENTIAL_LIST(intermediate), &update_activation_stack_apply2_hashed); if (a->h == hash_value_invalid) a->h = HASH2(a->p, a->q, bddm_r->cache_mask); insert_cache(bddm_r, a->h, a->p, a->q, res); /*don't use p, q since they may have changed after bdd_find_leaf_hashed*/ goto finish;} else if (p_i == q_i){ /*descend in both*/ /*descend left from p, then right*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, p, a->second_p); /*descend left from q, then right*/ node_ptr = &q_table[q]; LOAD_lr(node_ptr, q, a->second_q); a->index = p_i; /*remember for upcoming store operation*/ INCREMENT_LOCAL(local); /*prepare recursion*/ /*now do the apply for the left successor*/ goto start;} else if ((q_i == BDD_LEAF_INDEX) || (p_i < q_i)){ /*descend in p (which is not terminal), remain in q*/ /*descend left from p, then right*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, p, a->second_p); a->second_q = q; a->index = p_i; INCREMENT_LOCAL(local); goto start;} else { /*remain in p, descend in q (which is not terminal)*/ /*descend left from q, then right*/ node_ptr = &q_table[q]; LOAD_lr(node_ptr, q, a->second_q); a->second_p = p; a->index = q_i; INCREMENT_LOCAL(local); goto start;} second: /*we are now done with apply along the left*/ /*now do the apply along the right*/ p = a->second_p; q = a->second_q; STORE_TOP_SEQUENTIAL_LIST(intermediate, res); INCREMENT_LOCAL(local); goto start; /*we are done with both apply's*/ third: if (TOP_SEQUENTIAL_LIST(intermediate) == res) { /*then res is the right answer*/ } else res = bdd_find_node_hashed(bddm_r, TOP_SEQUENTIAL_LIST(intermediate), res, a->index, SEQUENTIAL_LIST(intermediate), &update_activation_stack_apply2_hashed); /*CACHE MISS STALL*/ if (a->h == hash_value_invalid) a->h = HASH2(a->p, a->q, bddm_r->cache_mask); insert_cache(bddm_r, a->h, a->p, a->q, res); /*CACHE MISS STALL*/ finish: if (BOTTOM_LOCAL(local)) { FREE_LOCAL(activation_record_apply2_hashed, local); FREE_SEQUENTIAL_LIST(intermediate); PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); apply2_ptr = old_apply2_ptr; return res; } else { DECREMENT_LOCAL(local); PEEL_SEQUENTIAL_LIST(intermediate, unsigned); if (TOP_SEQUENTIAL_LIST(intermediate) == going_left) goto second; else goto third; } } } } typedef struct { int index; unsigned result_node, inter_m, second_p, second_q; } activation_record_apply2_sequential; unsigned bdd_apply2_sequential(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_q, unsigned q, bdd_manager *bddm_r, unsigned (*apply2_leaf_function) (unsigned p_value, unsigned q_value)) { unsigned p_i, q_i; unsigned res; bdd_record *node_ptr; unsigned tmp1, tmpp, tmpq; unsigned h; bdd_record *p_table, *q_table; res = lookup_cache(bddm_r, &h, p, q); /*CACHE MISS STALL*/ if (res != 0) { #ifdef _BDD_STAT_ bddm_r->apply1_steps++; #endif PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); return res; } else { DECLARE_A(activation_record_apply2_sequential); start: #ifdef _BDD_STAT_ bddm_r->apply2_steps++; #endif res = lookup_cache(bddm_r, &h, p, q); /*CACHE MISS STALL*/ if (res != 0) goto finish; else { p_table = bddm_p->node_table; q_table = bddm_q->node_table; node_ptr = &p_table[p]; LOAD_index(node_ptr,p_i); /*get indices*/ /*CACHE MISS STALL*/ node_ptr = &q_table[q]; LOAD_index(node_ptr,q_i); /*CACHE MISS STALL*/ a->inter_m = 0; /*to denote that we are descending along the left*/ a->result_node = bdd_get_free_node_sequential(bddm_r); insert_cache(bddm_r, h, p, q, a->result_node); if ((p_i == BDD_LEAF_INDEX) && (q_i == BDD_LEAF_INDEX)){ /*we are at leaves*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, tmpp, tmp1); node_ptr = &q_table[q]; LOAD_lr(node_ptr, tmpq, tmp1); res = a->result_node; node_ptr = &bddm_r->node_table[res]; STR_lri(node_ptr, apply2_leaf_function(tmpp, tmpq), BDD_USED, BDD_LEAF_INDEX); goto finish;} else if (p_i == q_i){ /*descend in both*/ /*descend left from p, then right*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, p, a->second_p); /*descend left from q, then right*/ node_ptr = &q_table[q]; LOAD_lr(node_ptr, q, a->second_q); a->index = p_i; /*remember for upcoming store operation*/ INCREMENT_A; /*prepare recursion*/ /*now do the apply for the left successor*/ goto start;} else if ((q_i == BDD_LEAF_INDEX) || (p_i < q_i)){ /*descend in p (which is not terminal), remain in q*/ /*descend left from p, then right*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, p, a->second_p); a->second_q = q; a->index = p_i; INCREMENT_A; goto start;} else { /*remain in p, descend in q (which is not terminal)*/ /*descend left from q, then right*/ node_ptr = &q_table[q]; LOAD_lr(node_ptr, q, a->second_q); a->second_p = p; a->index = q_i; INCREMENT_A; goto start;} second: /*we are now done with apply along the left*/ /*now do the apply along the right*/ a->inter_m = res; p = a->second_p; q = a->second_q; INCREMENT_A; goto start; /*we are done with both apply's*/ third: node_ptr = &bddm_r->node_table[a->result_node]; STR_lri(node_ptr, a->inter_m, res, a->index); /*CACHE MISS STALL*/ res = a->result_node; finish: if (BOTTOM_A) { FREE_A; PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); return res; } else { DECREMENT_A; if (a->inter_m) goto third; else goto second;} } } } /* BDD_PROJECT */ typedef struct { int index; unsigned p, q, h; /* q == 0 iff we are above variable projected away*/ unsigned second_p, second_q; } activation_record_project; DECLARE_LOCAL(activation_record_project); DECLARE_POINTER_TO_LOCAL(activation_record_project, apply_project_ptr); void update_activation_stack_project(unsigned (*new_place)(unsigned node)) { activation_record_project *a_; if (apply_project_ptr->bddm_p == apply_project_ptr->bddm_r) { for (a_ = apply_project_ptr->act_stack; a_ <= apply_project_ptr->a ; a_++) { a_->p = new_place(a_->p); a_->q = new_place(a_->q); a_->h = hash_value_invalid; /* a correspond to a leaf, and a_->second_p is only well_defined * for internal nodes */ if (apply_project_ptr->a != a_) { a_->second_p = new_place(a_->second_p); if (a_->second_q != BDD_UNUSED) a_->second_q = new_place(a_->second_q); } } } } unsigned bdd_project(bdd_manager *bddm_p, unsigned p, unsigned var_index, bdd_manager *bddm_r, unsigned (*project_leaf_function)(unsigned value1, unsigned value2)) { unsigned p_i, q_i; unsigned res; bdd_record *node_ptr; unsigned tmp1, tmpp, tmpq; unsigned h; bdd_record *p_table; unsigned q; res = lookup_cache(bddm_r, &h, p, 0); /*CACHE MISS STALL*/ if (res) { #ifdef _BDD_STAT_ bddm_r->apply1_steps++; #endif PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); return res; } else { DECLARE_POINTER_TO_LOCAL(activation_record_project, local); DECLARE_POINTER_TO_LOCAL(activation_record_project, old_apply_project_ptr); DECLARE_SEQUENTIAL_LIST(intermediate, unsigned) NEW_LOCAL(activation_record_project, local, bddm_p, bddm_p, bddm_r); /* second last argument is dummy */ MAKE_SEQUENTIAL_LIST(intermediate, unsigned, 1024); old_apply_project_ptr = apply_project_ptr; apply_project_ptr = local; q = 0; start: p_table = bddm_p->node_table; node_ptr = &p_table[p]; LOAD_index(node_ptr, a->index); /*get index*/ /*CACHE MISS STALL*/ PUSH_SEQUENTIAL_LIST(intermediate, unsigned, going_left); if (q != 0) { if (p == q) q = 0; /*we are below var_index, but have converged on same node*/ else goto start_p_q_diff; } else if (a->index == var_index) { /*split into two calculations*/ LOAD_lr(node_ptr, p, q); node_ptr = &p_table[p]; goto start_p_q_diff; }; a->q = 0; /*to indicate that we are in only one node in bddm_p*/ res = lookup_cache(bddm_r, &h, p, 0); /*CACHE MISS STALL*/ if (res) goto finish; else { #ifdef _BDD_STAT_ bddm_r->apply1_steps++; #endif a->p = p; /*this for later insert_cache operation*/ a->h = h; /*this for later insert_cache operation*/ if (a->index == BDD_LEAF_INDEX) { /*we are at leaf*/ LOAD_lr(node_ptr, tmpp, tmp1); res = bdd_find_leaf_hashed(bddm_r, project_leaf_function(tmpp, tmpp), SEQUENTIAL_LIST(intermediate), &update_activation_stack_project); apply_project_ptr = local; if (a->h == hash_value_invalid) a->h = HASH2(a->p, a->q, bddm_r->cache_mask); insert_cache(bddm_r, a->h, a->p, 0, res); goto finish;} else { /*descend left from p, then right*/ LOAD_lr(node_ptr, p, a->second_p); a->second_q = BDD_UNUSED; INCREMENT_LOCAL(local); /*prepare recursion*/ /*now do the apply for the left successor*/ goto start;} second_p: /*we are now done with apply along the left*/ /*now do the apply along the right*/ p = a->second_p; q = 0; STORE_TOP_SEQUENTIAL_LIST(intermediate, res); INCREMENT_LOCAL(local); goto start; /*we are done with both left and right apply's*/ third_p: if (TOP_SEQUENTIAL_LIST(intermediate) == res) { /*then res is the right answer*/ } else { res = bdd_find_node_hashed(bddm_r, TOP_SEQUENTIAL_LIST(intermediate), res, a->index, SEQUENTIAL_LIST(intermediate), &update_activation_stack_project); /*CACHE MISS STALL*/ } apply_project_ptr = local; if (a->h == hash_value_invalid) a->h = HASH2(a->p, 0, bddm_r->cache_mask); insert_cache(bddm_r, a->h, a->p, 0, res); /*CACHE MISS STALL*/ goto finish; start_p_q_diff: #ifdef _BDD_STAT_ bddm_r->apply2_steps++; #endif /*assertion: node_ptr == &p_table[p] && p != q*/ a->q = q; res = lookup_cache(bddm_r, &h, p, q); /*CACHE MISS STALL*/ if (res) goto finish; else { LOAD_index(node_ptr,p_i); /*get indices*/ /*CACHE MISS STALL*/ node_ptr = &p_table[q]; LOAD_index(node_ptr,q_i); /*CACHE MISS STALL*/ a->p = p; /*this for later insert_cache operation*/ a->h = h; if ((p_i == BDD_LEAF_INDEX) && (q_i == BDD_LEAF_INDEX)){ /*we are at leaves*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, tmpp, tmp1); node_ptr = &p_table[q]; LOAD_lr(node_ptr, tmpq, tmp1); res = bdd_find_leaf_hashed(bddm_r, project_leaf_function(tmpp, tmpq), SEQUENTIAL_LIST(intermediate), &update_activation_stack_project); apply_project_ptr = local; if (a->h == hash_value_invalid) a->h = HASH2(a->p, a->q, bddm_r->cache_mask); insert_cache(bddm_r, a->h, a->p, a->q, res); goto finish; } else if (p_i == q_i){ /*descend in both*/ /*descend left from p, then right*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, p, a->second_p); /*descend left from q, then right*/ node_ptr = &p_table[q]; LOAD_lr(node_ptr, q, a->second_q); a->index = p_i; /*remember for upcoming store operation*/ INCREMENT_LOCAL(local); /*prepare recursion*/ /*now do the apply for the left successor*/ goto start; } else if ((q_i == BDD_LEAF_INDEX) || (p_i < q_i)){ /*descend in p (which is not a leaf), remain in q*/ /*descend left from p, then right*/ node_ptr = &p_table[p]; LOAD_lr(node_ptr, p, a->second_p); a->second_q = q; a->index = p_i; INCREMENT_LOCAL(local); goto start;} else { /*remain in p, descend in q (which is not a leaf)*/ /*descend left from q, then right*/ node_ptr = &p_table[q]; LOAD_lr(node_ptr, q, a->second_q); a->second_p = p; a->index = q_i; INCREMENT_LOCAL(local); goto start; } } second_p_q_diff: /*we are now done with apply along the left*/ /*now do the apply along the right*/ p = a->second_p; q = a->second_q; STORE_TOP_SEQUENTIAL_LIST(intermediate, res); INCREMENT_LOCAL(local); goto start; /*we are done with both apply's*/ third_p_q_diff: if (TOP_SEQUENTIAL_LIST(intermediate) == res) { /*then res is the right answer*/ } else res = bdd_find_node_hashed(bddm_r, TOP_SEQUENTIAL_LIST(intermediate), res, a->index, SEQUENTIAL_LIST(intermediate), &update_activation_stack_project); /*CACHE MISS STALL*/ apply_project_ptr = local; if (a->h == hash_value_invalid) a->h = HASH2(a->p, a->q, bddm_r->cache_mask); insert_cache(bddm_r, a->h, a->p, a->q, res); /*CACHE MISS STALL*/ finish: if (BOTTOM_LOCAL(local)) { FREE_LOCAL(activation_record_project,local); FREE_SEQUENTIAL_LIST(intermediate); PUSH_SEQUENTIAL_LIST(bddm_r->roots, unsigned, res); apply_project_ptr = old_apply_project_ptr; return res; } else { DECREMENT_LOCAL(local); PEEL_SEQUENTIAL_LIST(intermediate, unsigned); if (a->q) { if (TOP_SEQUENTIAL_LIST(intermediate) == going_left) goto second_p_q_diff; else goto third_p_q_diff; } else /* a->q == 0 */ if (TOP_SEQUENTIAL_LIST(intermediate) == going_left) goto second_p ; else goto third_p; } } } } /* BDD_OPERATE_ON_NODES */ void bdd_operate_on_nodes(bdd_manager *bddm_p, unsigned p, void (*operator_function) (bdd_record *node_pointer)) { bdd_record *node_ptr; bdd_record *p_table; DECLARE_A(activation_record_apply1); DECLARE_SEQUENTIAL_LIST(intermediate, unsigned); MAKE_SEQUENTIAL_LIST(intermediate, unsigned, 1024); start: #ifdef _BDD_STAT_ bddm_p->call_steps++; #endif PUSH_SEQUENTIAL_LIST(intermediate, unsigned, going_left); p_table = bddm_p->node_table; node_ptr = &p_table[p]; if (node_ptr->mark) goto finish; else { LOAD_index(node_ptr,a->index); /*get index*/ /*CACHE MISS STALL*/ node_ptr->mark = 1; operator_function(node_ptr); if (a->index == BDD_LEAF_INDEX) { /*we are at leaf*/ goto finish;} else { a->p = p; /*descend left from p, then right*/ LOAD_lr(node_ptr, p, a->second); INCREMENT_A; /*prepare recursion*/ /*now do the calls for the left successor*/ goto start;} second: /*we are now done with calls along the left*/ /*now do the calls along the right*/ STORE_TOP_SEQUENTIAL_LIST(intermediate, 1); p = a->second; INCREMENT_A; goto start; /*we are done with both left and right calls*/ third: {} finish: if (BOTTOM_A) { FREE_A; FREE_SEQUENTIAL_LIST(intermediate); return; } else { DECREMENT_A; PEEL_SEQUENTIAL_LIST(intermediate, unsigned); if (TOP_SEQUENTIAL_LIST(intermediate) == going_left) goto second; else goto third; } } } /* BDD_CALL_LEAFS */ void (*leaf_function_global)(unsigned value); void bbd_operate_on_leaf (bdd_record *node_pointer) { unsigned indx, tmpp, tmp1; LOAD_index(node_pointer, indx); if (indx == BDD_LEAF_INDEX) { LOAD_lr(node_pointer, tmpp, tmp1); (*leaf_function_global) (tmpp); } } void bdd_call_leafs(bdd_manager *bddm_p, unsigned p, void (*leaf_function)(unsigned value)) { leaf_function_global = leaf_function; bdd_operate_on_nodes (bddm_p, p, bbd_operate_on_leaf); } /* BDD_REPLACE_INDICES */ unsigned *indices_map_global; void bbd_replace_index (bdd_record *node_pointer) { unsigned indx, l, r; LOAD_lri(node_pointer, l, r, indx); if (indx != BDD_LEAF_INDEX) { invariant(indices_map_global[indx] <= BDD_MAX_INDEX); STR_lri(node_pointer, l, r, indices_map_global[indx]); } } void bdd_replace_indices (bdd_manager *bddm_p, unsigned p, unsigned indices_map []) { indices_map_global = indices_map; bdd_operate_on_nodes (bddm_p, p, bbd_replace_index); } extern unsigned fn_identity(unsigned p) { return p; } mona-1.4/BDD/bdd_cache.c0000644000414100000240000000524210756504320011635 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "bdd.h" #include "bdd_internal.h" /*CACHE DOUBLING stuff*/ void copy_cache_record_and_overflow(bdd_manager *bddm, cache_record *old_cache, unsigned i, unsigned (*result_fn)(unsigned r)) { unsigned p, q, r, h; if (CACHE_FULL_BIN0(old_cache[i])) { CACHE_LOAD_BIN0(old_cache[i], p, q, r); h = HASH2(p, q, bddm->cache_mask); insert_cache(bddm, h, p, q, result_fn(r)); if (CACHE_FULL_BIN1(old_cache[i])) { CACHE_LOAD_BIN1(old_cache[i], p, q, r); h = HASH2(p, q, bddm->cache_mask); insert_cache(bddm, h, p, q, result_fn(r)); } } if (old_cache[i].next != 0) { copy_cache_record_and_overflow(bddm, old_cache, old_cache[i].next, result_fn); } } void double_cache(bdd_manager *bddm, unsigned (*result_fn)(unsigned r)) { cache_record *old_cache = bddm->cache; unsigned i; unsigned old_size = bddm->cache_size; bddm->cache_size *= 2; bddm->cache_overflow_increment *= 2; bddm->cache_total_size = bddm->cache_size + bddm->cache_overflow_increment; bddm->cache_overflow = bddm->cache_size; bddm->cache = (cache_record*) mem_alloc((size_t) bddm->cache_total_size * (sizeof (cache_record))); /*initialize hashed area*/ mem_zero(bddm->cache, (size_t)(bddm->cache_size * (sizeof (cache_record)))); bddm->cache_mask = bddm->cache_size - 1; /* printf("Doubling cache to: Cache %u Total %u\n", bddm->cache_size, bddm->cache_total_size); */ /*now rehash in an entirely sequential fashion (except for overflow)*/ for (i = 0; i < old_size ; i++) { CACHE_INITIALIZE_RECORD(bddm->cache[i]); CACHE_INITIALIZE_RECORD(bddm->cache[i + old_size]); /*since the hash function is the same for the new cache except that an extra bit in position (log old_size) is added*/ copy_cache_record_and_overflow(bddm, old_cache, i, result_fn); } mem_free(old_cache); } mona-1.4/BDD/bdd_double.c0000644000414100000240000001115610756504320012045 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "bdd.h" #include "bdd_internal.h" /*DOUBLE_TABLE stuff*/ void double_table_sequential(bdd_manager *bddm) { bddm->table_total_size += bddm->table_size; bddm->table_size += bddm->table_size; /* printf("Doubling table to: Size %u Total %u\n", bddm->table_size, bddm->table_total_size); */ bddm->node_table = mem_resize(bddm->node_table, (size_t)(sizeof (bdd_record)) * (bddm->table_total_size)); bddm->table_log_size++; #ifdef _BDD_STAT_ bddm->number_double++; #endif } unsigned double_leaf_fn(unsigned value) { return (value); } static bdd_manager *old_bddm; unsigned get_new_r(unsigned r) { if (r == 0 || r == BDD_UNDEF) { return (r); } return (old_bddm->node_table[r].mark); } void double_table_and_cache_hashed(bdd_manager *bddm, unsigned* some_roots, void (*update_fn)(unsigned (*new_place)(unsigned node)), unsigned *p_of_find, unsigned *q_of_find, boolean rehash_p_and_q) { unsigned *p; old_bddm = mem_alloc((size_t) sizeof (bdd_manager)); *old_bddm = *bddm; /*make new bigger table, but only if a bigger one is possible */ if (bddm->table_total_size > BDD_MAX_TOTAL_TABLE_SIZE) { printf("\nBDD too large (>%d nodes)\n", BDD_MAX_TOTAL_TABLE_SIZE); abort(); } bddm->table_log_size++; bddm->table_size *= 2; bddm->table_overflow_increment *= 2; { unsigned desired_size = bddm->table_size + BDD_NUMBER_OF_BINS + bddm->table_overflow_increment; bddm->table_total_size = (desired_size <= BDD_MAX_TOTAL_TABLE_SIZE)? desired_size: BDD_MAX_TOTAL_TABLE_SIZE; } bddm->node_table = (bdd_record*) mem_alloc( (size_t) bddm->table_total_size * (sizeof (bdd_record))); bddm->table_mask = bddm->table_size - BDD_NUMBER_OF_BINS; bddm->table_double_trigger *= 2; bddm->table_overflow = bddm->table_size + BDD_NUMBER_OF_BINS; #ifdef _BDD_STAT_ bddm->number_double++; #endif /* initialize to unused */ bddm->table_elements = 0; mem_zero(&bddm->node_table[BDD_NUMBER_OF_BINS], (size_t) bddm->table_size * (sizeof (bdd_record))); /* initialize bddm roots to the empty list, this new list will contain the rehashed addresses of old_bddm->roots*/ MAKE_SEQUENTIAL_LIST(bddm->roots, unsigned, 1024); /*now rehash all nodes reachable from the old roots; we must be sure that the apply1 operation does not entail doubling of bddm node table: this is achieved by our having just doubled the size of the table*/ bdd_prepare_apply1(old_bddm); for (p = SEQUENTIAL_LIST(old_bddm->roots); *p ; p++) { bdd_apply1(old_bddm, *p, bddm, &double_leaf_fn); } /*also make sure to rehash portion that is accessible from some_roots*/ for (p = some_roots; *p; p++) { if (*p != BDD_UNDEF) *p = bdd_apply1_dont_add_roots(old_bddm, *p, bddm, &double_leaf_fn); } /*and fix values p_of_find and q_of_find if indicated*/ if (rehash_p_and_q) { *p_of_find = bdd_apply1_dont_add_roots(old_bddm, *p_of_find, bddm, &double_leaf_fn); *q_of_find = bdd_apply1_dont_add_roots(old_bddm, *q_of_find, bddm, &double_leaf_fn); } /*perform user supplied updates*/ if (update_fn) (*update_fn)(&get_new_r); /*old_table now contains nodes whose mark field designates the new position of the node*/ if (bddm->cache) { if (bddm->cache_erase_on_doubling) { bdd_kill_cache(bddm); bdd_make_cache(bddm, 2 * bddm->cache_size * CACHE_NUMBER_OF_BINS, 2 * bddm->cache_overflow_increment * CACHE_NUMBER_OF_BINS); } else /*this is only a good idea when bddm is different from the managers the current apply operation is performed over*/ double_cache(bddm, &get_new_r); } old_bddm->cache = (cache_record*) 0; /* old cache has been deallocated by now*/ /*deallocated old table and old roots*/ bdd_kill_manager(old_bddm); } mona-1.4/BDD/bdd_dump.c0000644000414100000240000000350010756504320011532 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "bdd_dump.h" void bddReverseMarks(bdd_manager *bddm, bdd_ptr p) { if ((signed) bdd_mark(bddm, p) < 0) { bdd_set_mark(bddm, p, ~bdd_mark(bddm, p)); if (!bdd_is_leaf(bddm, p)) { bddReverseMarks(bddm, bdd_else(bddm, p)); bddReverseMarks(bddm, bdd_then(bddm, p)); } } } void bddDumpNode(bdd_manager *bddm, bdd_ptr p) { if ((signed) bdd_mark(bddm, p) >= 0) { bdd_set_mark(bddm, p, ~bdd_mark(bddm, p)); if (!bdd_is_leaf(bddm, p)) { printf("%-3u: idx=%-3u lo=%-3u hi=%-3u\n", p, bdd_ifindex(bddm, p), bdd_else(bddm, p), bdd_then(bddm, p)); bddDumpNode(bddm, bdd_else(bddm, p)); bddDumpNode(bddm, bdd_then(bddm, p)); } else printf("%-3u: state=%-3u\n", p, bdd_leaf_value(bddm, p)); } } void bddDump(bdd_manager *bddm) { int i; printf("\nBDD DUMP:\n"); for (i = 0; i < bdd_roots_length(bddm); i++) bddDumpNode(bddm, BDD_ROOT(bddm, i)); printf("END\n\n"); for (i = 0; i < bdd_roots_length(bddm); i++) bddReverseMarks(bddm, BDD_ROOT(bddm, i)); } mona-1.4/BDD/bdd_dump.h0000644000414100000240000000171510756504267011557 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __BDD_DUMP_H #define __BDD_DUMP_H #include "bdd.h" void bddReverseMarks(bdd_manager *bddm, bdd_ptr p); void bddDumpNode(bdd_manager *bddm, bdd_ptr p); void bddDump(bdd_manager *bddm); #endif mona-1.4/BDD/bdd_external.c0000644000414100000240000000546710756504320012425 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "bdd_external.h" #include "../Mem/mem.h" Table *tableInit() { Table *t = (Table *) mem_alloc(sizeof(Table)); t->allocated = 0; t->noelems = 0; t->elms = 0; return t; } void tableInsert(Table *t, BddNode *elm) { if (t->allocated == t->noelems) { t->allocated = t->allocated * 2 + 5; t->elms = (BddNode *) mem_resize(t->elms, sizeof(BddNode)*t->allocated); } t->elms[t->noelems++] = *elm; } void tableFree(Table *t) { mem_free(t->elms); mem_free(t); } /* EXPORT */ void export(bdd_manager *bddm, unsigned p, Table *table) { if (!bdd_mark(bddm,p)) { BddNode *e = (BddNode *) mem_alloc(sizeof(BddNode)); if (bdd_is_leaf(bddm,p)) { e->idx = -1; e->lo = bdd_leaf_value(bddm, p); e->hi = 0; tableInsert(table, e); bdd_set_mark(bddm,p,table->noelems); /* table index+1 put in mark */ } else { e->idx = bdd_ifindex(bddm,p); e->lo = bdd_else(bddm,p); e->hi = bdd_then(bddm,p); tableInsert(table, e); bdd_set_mark(bddm,p,table->noelems); /* table index+1 put in mark */ export(bddm, bdd_then(bddm,p), table); export(bddm, bdd_else(bddm,p), table); } mem_free(e); } } /* IMPORT */ BddNode *table; bdd_manager *import_bddm; unsigned make_node(int i) { if (table[i].p == -1) { /* bdd_node not created yet */ if (table[i].idx == -1) /* a leaf */ table[i].p = bdd_find_leaf_sequential(import_bddm, table[i].lo); else { invariant(table[i].lo != table[i].hi); table[i].lo = make_node(table[i].lo); table[i].hi = make_node(table[i].hi); table[i].p = bdd_find_node_sequential(import_bddm, table[i].lo, table[i].hi, table[i].idx); } } /* printf("make_note i: %4d table[i].lo: %4d table[i].hi: %4d " "table[i].idx %4d p: %4d\n", i,table[i].lo, table[i].hi, table[i].idx, table[i].p); */ return table[i].p; } mona-1.4/BDD/bdd_external.h0000644000414100000240000000225410756504267012433 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __BDD_EXTERNAL_H #define __BDD_EXTERNAL_H #include "bdd.h" typedef struct _BddNode { int idx; unsigned lo; unsigned hi; int p; } BddNode; typedef struct _Table { BddNode *elms; unsigned allocated, noelems; } Table; Table *tableInit(); void tableInsert(Table *t, BddNode *elm); void tableFree(Table *t); void export(bdd_manager *bddm, unsigned p, Table *table); unsigned make_node(int i); #endif mona-1.4/BDD/bdd_internal.h0000644000414100000240000001234310756504267012425 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef _BDD_INTERNAL #define _BDD_INTERNAL #include "../Mem/mem.h" /*ARCHITECTURE DEPENDENT CONSTANTS*/ /*memory allocation should take place in chunks the size of, or divisible by, this constant*/ #define PROCESSOR_CACHE_LINE_SIZE 32 /*the number of bins per bucket; hash function indicates the address of the 0th bin*/ #define BDD_LOG_NUMBER_OF_BINS 1 #define BDD_NUMBER_OF_BINS 2 #define CACHE_LOG_NUMBER_OF_BINS 1 #define CACHE_NUMBER_OF_BINS 2 /*logarithm of the maximal number of BDD nodes*/ #define BDD_MAX_TABLE_INDEX 24 #define HASH2(p, q, mask) \ ((((((unsigned)p) * 46349) + (unsigned)q) * 67108859) & mask) #define HASH3(p, q, r, mask) \ ((((((((unsigned)p) * 46349) + (unsigned)q) * 67108859) + (unsigned)r) \ * 10007) & mask) /*CACHE DATA TYPES AND ELEMENTARY OPERATIONS*/ /* a cache record contains two bins */ struct cache_record_ {unsigned p0, q0, res0, p1, q1, res1; unsigned next; unsigned align; /*to make record fill 32 bytes*/ }; #define CACHE_UNUSED ((unsigned) 0) #define CACHE_USED ((unsigned) 1) #define CACHE_INITIALIZE_RECORD(cache_rec) \ cache_rec.p0 = cache_rec.p1 = CACHE_UNUSED; \ cache_rec.next = 0; #define CACHE_LOOKUP_BIN0(cache_rec, p, q) \ (((p == cache_rec.p0) && (q == cache_rec.q0))? cache_rec.res0 : 0) #define CACHE_LOOKUP_BIN1(cache_rec, p, q) \ (((p == cache_rec.p1) && (q == cache_rec.q1))? cache_rec.res1 : 0) #define CACHE_LOOKUP_BINS(cache_rec, p, q, res) \ ((res = CACHE_LOOKUP_BIN0(cache_rec, p, q)) ? \ res : (res = CACHE_LOOKUP_BIN1(cache_rec, p, q))) \ #ifdef _BDD_STAT_ #define CACHE_LOOKUP_RECORD(bddm, cache_rec, p, q, res, temp) \ {if (!(CACHE_LOOKUP_BINS(cache_rec, p, q, res))) \ for (temp = cache_rec.next; temp; temp = bddm->cache[temp].next) { \ bddm->number_cache_link_followed++; \ if (CACHE_LOOKUP_BINS(bddm->cache[temp], p, q, res)) \ break;} \ }\ #else #define CACHE_LOOKUP_RECORD(bddm, cache_rec, p, q, res, temp) \ {if (!(CACHE_LOOKUP_BINS(cache_rec, p, q, res))) \ for (temp = cache_rec.next; temp; temp = bddm->cache[temp].next) { \ if (CACHE_LOOKUP_BINS(bddm->cache[temp], p, q, res)) \ break;} \ }\ #endif #define CACHE_FULL_BIN0(cache_rec) \ (cache_rec.p0 != CACHE_UNUSED)\ #define CACHE_FULL_BIN1(cache_rec) \ (cache_rec.p1 != CACHE_UNUSED)\ #define CACHE_CLEAR_BIN0(cache_rec) \ cache_rec.p0 = CACHE_UNUSED; \ #define CACHE_CLEAR_BIN1(cache_rec) \ cache_rec.p1 = CACHE_UNUSED; \ #define CACHE_STORE_BIN0(cache_rec, p, q, res) \ cache_rec.p0 = p; \ cache_rec.q0 = q; \ cache_rec.res0 = res; \ #define CACHE_STORE_BIN1(cache_rec, p, q, res) \ cache_rec.p1 = p; \ cache_rec.q1 = q; \ cache_rec.res1 = res; \ #define CACHE_LOAD_BIN0(cache_rec, p, q, res) \ p = cache_rec.p0; \ q = cache_rec.q0; \ res = cache_rec.res0; \ #define CACHE_LOAD_BIN1(cache_rec, p, q, res) \ p = cache_rec.p1; \ q = cache_rec.q1; \ res = cache_rec.res1; \ #define CACHE_NEW_RECORD(bddm, temp) \ if (bddm->cache_overflow == bddm->cache_total_size) \ bddm->cache = mem_resize(bddm->cache, \ (size_t) (sizeof (cache_record))\ * (bddm->cache_total_size \ += bddm->cache_overflow_increment)); \ temp=bddm->cache_overflow++; \ CACHE_INITIALIZE_RECORD(bddm->cache[temp]);\ /* STATISTICS */ struct stat_item { unsigned number_bddms; unsigned number_double; unsigned number_node_collissions; unsigned number_node_link_followed; unsigned number_cache_collissions; unsigned number_cache_link_followed; unsigned number_lookup_cache; unsigned number_insert_cache; unsigned apply1_steps; unsigned apply2_steps; }; struct stat_record_ { unsigned max_index; unsigned number_insertions; struct stat_item statistics[BDD_MAX_TABLE_INDEX]; }; extern struct stat_record_ stat_record[]; extern boolean table_has_been_doubled; GNUC_INLINE unsigned lookup_cache(bdd_manager *bddm, unsigned *h, unsigned p, unsigned q); GNUC_INLINE void insert_cache(bdd_manager *bddm, unsigned h, unsigned p, unsigned q, unsigned res); void double_cache( bdd_manager *bddm, unsigned (*result_fn)(unsigned r)); void double_table_sequential(bdd_manager *bddm); void double_table_and_cache_hashed(bdd_manager *bddm, unsigned* some_roots, void (*update_fn)(unsigned (*new_place) (unsigned node)), unsigned *p_of_find, unsigned *q_of_find, boolean rehash_p_and_q); unsigned bdd_apply1_dont_add_roots(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_r, unsigned (*apply1_leaf_function) (unsigned value)); #endif mona-1.4/BDD/bdd_manager.c0000644000414100000240000002043410756504320012204 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "bdd.h" #include "bdd_internal.h" unsigned bdd_apply1_dont_add_roots(bdd_manager *bddm_p, unsigned p, bdd_manager *bddm_r, unsigned (*apply1_leaf_function)(unsigned value)); unsigned unsigned_log_ceiling(unsigned i) { unsigned j, k; for (j = 0, k = 1; k < i ; j++, k = k << 1); return(j); } unsigned unsigned_exponential(unsigned i) { unsigned j; for (j = 1; i ; i--, j = j << 1); return(j); } /* set out statistics data structures */ void bdd_init(void) { struct stat_item *r; unsigned i, j; for (i = 0; i < BDD_STAT_INDEX_SIZE; i++) { stat_record[i].number_insertions = 0; stat_record[i].max_index = 0; for (j = 0; j < BDD_MAX_TABLE_INDEX ; j++) { r = &stat_record[i].statistics[j]; r->number_bddms = 0; r->number_double = 0; r->number_cache_collissions = 0; r->number_node_collissions = 0; r->number_node_link_followed = 0; r->number_insert_cache = 0; r->number_lookup_cache = 0; r->apply1_steps = 0; r->apply2_steps = 0; } } } bdd_manager *bdd_new_manager(unsigned table_size, unsigned table_overflow_increment){ bdd_manager *new_bddm = (bdd_manager*) mem_alloc((size_t)(sizeof (bdd_manager))); /*make table of BDD nodes*/ new_bddm->table_log_size = unsigned_log_ceiling(table_size); new_bddm->table_next = BDD_NUMBER_OF_BINS; /*used for sequential operations*/ /*we use 0 for indicating a miss in the result cache, so skip that position, but keep CPU cache alignment*/ new_bddm->table_size = unsigned_exponential(new_bddm->table_log_size); if (new_bddm->table_size < BDD_NUMBER_OF_BINS) new_bddm->table_size= BDD_NUMBER_OF_BINS; new_bddm->table_overflow_increment = (table_overflow_increment < BDD_NUMBER_OF_BINS) ? BDD_NUMBER_OF_BINS : table_overflow_increment; new_bddm->table_total_size = new_bddm->table_size + BDD_NUMBER_OF_BINS + new_bddm->table_overflow_increment; if (new_bddm->table_total_size > BDD_MAX_TOTAL_TABLE_SIZE) { printf("\nBDD too large (>%d nodes)\n", BDD_MAX_TOTAL_TABLE_SIZE); abort(); } new_bddm->node_table = (bdd_record*) mem_alloc((size_t) new_bddm->table_total_size * (sizeof (bdd_record))); new_bddm->table_mask = new_bddm->table_size - BDD_NUMBER_OF_BINS; /*to zero out the last log BDD_NUMBER_OF_BINS*/ new_bddm->table_elements = 0; /*prepare hashed access*/ new_bddm->table_overflow = new_bddm->table_size + BDD_NUMBER_OF_BINS; new_bddm->table_double_trigger = (4 * new_bddm->table_size) / 4; mem_zero(&new_bddm->node_table[BDD_NUMBER_OF_BINS], (size_t) new_bddm->table_size * (sizeof (bdd_record))); new_bddm->cache_erase_on_doubling = TRUE; MAKE_SEQUENTIAL_LIST(new_bddm->roots, unsigned, 1024); /*indicate that there is no result cache*/ new_bddm->cache = (cache_record*)0; /*prepare statistics*/ new_bddm->number_double = 0; new_bddm->number_node_collissions = 0; new_bddm->number_node_link_followed = 0; new_bddm->number_cache_collissions = 0; new_bddm->number_cache_link_followed = 0; new_bddm->number_insert_cache = 0; new_bddm->number_lookup_cache = 0; new_bddm->apply1_steps = 0; new_bddm->apply2_steps = 0; new_bddm->call_steps = 0; return(new_bddm); } void bdd_make_cache(bdd_manager *bddm, unsigned size, unsigned overflow_increment) { unsigned overflow = overflow_increment / CACHE_NUMBER_OF_BINS; bddm->cache_size = unsigned_exponential(unsigned_log_ceiling(size) - CACHE_LOG_NUMBER_OF_BINS); bddm->cache_total_size = bddm->cache_size + overflow; bddm->cache_overflow_increment = overflow; bddm->cache_overflow = bddm->cache_size; bddm->cache_mask = bddm->cache_size - 1; bddm->cache = (cache_record*) mem_alloc((size_t)(bddm->cache_total_size * (sizeof (cache_record)))); {/*initialize hashed area*/ mem_zero(bddm->cache, (size_t)(bddm->cache_size * (sizeof (cache_record)))); } } void bdd_kill_cache(bdd_manager *bddm) { if (bddm->cache) { mem_free(bddm->cache); } bddm->cache = (cache_record*) 0; } void bdd_update_statistics(bdd_manager *bddm, unsigned stat_index) { struct stat_item *r; stat_record[stat_index].number_insertions++; if (stat_record[stat_index].max_index < bddm->table_log_size) { stat_record[stat_index].max_index = bddm->table_log_size; } r = &stat_record[stat_index].statistics[bddm->table_log_size]; r->number_bddms++; r->number_double += bddm->number_double; r->number_cache_collissions += bddm->number_cache_collissions; r->number_cache_link_followed += bddm->number_cache_link_followed; r->number_node_collissions += bddm->number_node_collissions; r->number_node_link_followed += bddm->number_node_link_followed; r->number_lookup_cache += bddm->number_lookup_cache; r->number_insert_cache += bddm->number_insert_cache; r->apply1_steps += bddm->apply1_steps; r->apply2_steps += bddm->apply2_steps; } void bdd_kill_manager(bdd_manager *bddm) { mem_free(bddm->node_table); FREE_SEQUENTIAL_LIST(bddm->roots); if (bddm->cache) { mem_free(bddm->cache); } mem_free(bddm); } void bdd_print_statistics(unsigned stat_index, char info[]) { const char title[] = "%4s %6s %6s %8s %8s %8s %8s %8s %8s %8s %8s\n"; const char form[] = "%4i %6i %6i %8i %8i %8i %8i %8i %8i %8i %8i\n"; const char total_form[] = "%4s %6i %6i %8i %8i %8i %8i %8i %8i %8i %8i\n"; unsigned i; struct stat_item *r; struct stat_item total = {0, 0, 0, 0, 0, 0, 0, 0, 0}; printf("Statistics: %s. Collected: %i\n", info, stat_record[stat_index].number_insertions); printf(title, "size", "bddms", "double", "app1", "app2", "node coll", "node link", "cach look", "cach ins", "cach coll", "cach link"); for (i = 0; i <= stat_record[stat_index].max_index; i++) { r = &stat_record[stat_index].statistics[i]; printf(form, i, r->number_bddms, r->number_double, r->apply1_steps, r->apply2_steps, r->number_node_collissions, r->number_node_link_followed, r->number_lookup_cache, r->number_insert_cache, r->number_cache_collissions, r->number_cache_link_followed); total.number_bddms += r->number_bddms; total.number_double += r->number_double; total.number_node_collissions += r->number_node_collissions; total.number_node_link_followed += r->number_node_link_followed; total.number_lookup_cache += r->number_lookup_cache; total.number_insert_cache += r->number_insert_cache; total.number_cache_collissions += r->number_cache_collissions; total.number_cache_link_followed += r->number_cache_link_followed; total.apply1_steps += r->apply1_steps; total.apply2_steps += r->apply2_steps; } printf(total_form, "tot", total.number_bddms, total.number_double, total.apply1_steps, total.apply2_steps, total.number_node_collissions, total.number_node_link_followed, total.number_lookup_cache, total.number_insert_cache, total.number_cache_collissions, total.number_cache_link_followed); } unsigned bdd_size(bdd_manager *bddm) { return (bddm->table_elements);} unsigned *bdd_roots(bdd_manager *bddm) { return (SEQUENTIAL_LIST(bddm->roots)); } void bdd_add_root(bdd_manager *bddm, unsigned p) { PUSH_SEQUENTIAL_LIST(bddm->roots, unsigned, p); } unsigned bdd_roots_length(bdd_manager *bddm) { return (LENGTH_SEQUENTIAL_LIST(bddm->roots)); } unsigned bdd_mark(bdd_manager *bddm, bdd_ptr p) { return bddm->node_table[p].mark; } void bdd_set_mark(bdd_manager *bddm, bdd_ptr p, unsigned mark) { bddm->node_table[p].mark = mark; } mona-1.4/BDD/bdd_trace.c0000644000414100000240000001233510756504320011671 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "bdd.h" #include "bdd_internal.h" trace_descr copy_reversed_trace(trace_descr current_trace) { trace_descr reversed_trace; trace_descr this_trace; reversed_trace = NULL; while (current_trace) { this_trace = (trace_descr) mem_alloc(sizeof(struct trace_descr_)); this_trace->index = current_trace->index; this_trace->value = current_trace->value; this_trace->next = reversed_trace; reversed_trace = this_trace; current_trace = current_trace->next; } return reversed_trace; } paths join_paths(paths *plist1, paths plist2) { if (*plist1) { paths pp; for (pp = *plist1; pp->next; pp = pp->next); pp->next = plist2; } else *plist1 = plist2; return (*plist1); } paths mk_paths(bdd_manager *bddm, unsigned p, trace_descr current_trace) { unsigned l, r, index; LOAD_lri(&bddm->node_table[p], l, r, index); if (index == BDD_LEAF_INDEX) { paths this_path; this_path = (paths) mem_alloc(sizeof(struct paths_)); this_path->to = l; this_path->trace = copy_reversed_trace (current_trace); this_path->next = NULL; return this_path; } else { trace_descr this_trace; paths right_paths, left_paths; this_trace = (trace_descr) mem_alloc(sizeof(struct trace_descr_)); this_trace->index = index; this_trace->value = TRUE; this_trace->next = current_trace; right_paths = mk_paths(bddm, r, this_trace); this_trace->value = FALSE; left_paths = mk_paths(bddm, l, this_trace); mem_free (this_trace); return (join_paths(&left_paths, right_paths)); } } paths make_paths(bdd_manager *bddm, unsigned p) { return (mk_paths(bddm, p, NULL)); } void kill_trace(trace_descr t) { if (t) { kill_trace (t->next); mem_free(t); } } void kill_paths(paths p) { if (p) { kill_trace (p->trace); kill_paths (p->next); mem_free(p); } } trace_descr find_one_path(bdd_manager *bddm, unsigned p, unsigned q) { unsigned l, r, index; LOAD_lri(&bddm->node_table[p], l, r, index); if (index == BDD_LEAF_INDEX) { if (l == q) { trace_descr this_trace; this_trace = (trace_descr) mem_alloc(sizeof(struct trace_descr_)); this_trace->index = index; this_trace->value = TRUE; this_trace->next = NULL; return this_trace; } else return NULL; } else { trace_descr sub_trace, this_trace; sub_trace = find_one_path(bddm, l, q); if (sub_trace) { this_trace = (trace_descr) mem_alloc(sizeof(struct trace_descr_)); this_trace->index = index; this_trace->value = FALSE; this_trace->next = sub_trace; return this_trace; } sub_trace = find_one_path(bddm, r, q); if (sub_trace) { this_trace = (trace_descr) mem_alloc(sizeof(struct trace_descr_)); this_trace->index = index; this_trace->value = TRUE; this_trace->next = sub_trace; return this_trace; } return NULL; } } void print_bddpaths(unsigned p, unsigned q, bdd_manager *bddm, unsigned b, unsigned no_free_vars, unsigned *offsets) { paths state_paths, pp; trace_descr tp; int j; state_paths = pp = make_paths(bddm, b); while (pp) { printf ("(%d,%d,", p,q); for (j = 0; j < no_free_vars; j++) { for (tp = pp->trace; tp && (tp->index != offsets[j]); tp = tp->next); if (tp) { if (tp->value) printf("1"); else printf("0"); } else printf("X"); } printf (") -> %d\n", pp->to); pp = pp->next; } kill_paths(state_paths); } void print_bddpaths_verbose(unsigned p, unsigned q, bdd_manager *bddm, unsigned b) { paths state_paths, pp; trace_descr tp; state_paths = pp = make_paths(bddm, b); while (pp) { printf("(%d,%d,", p,q); for (tp = pp->trace; tp; tp = tp->next) { printf("#%d=%c", tp->index, tp->value ? '1' : '0'); if (tp->next) printf(", "); } printf(") -> %d\n", pp->to); pp = pp->next; } kill_paths(state_paths); } void print_one_path(unsigned p, unsigned q, bdd_manager *bddm, unsigned no_free_vars, unsigned *offsets) { trace_descr tp,tp_run; unsigned j; tp = find_one_path(bddm, p, q); for (j = 0; j < no_free_vars; j++) { tp_run = tp; for (;tp_run && (tp_run->index != offsets[j]); tp_run = tp_run->next); if (tp_run) { if (tp_run->value) printf("1"); else printf("0"); } else printf("X"); }; kill_trace(tp); } mona-1.4/BDD/hash.c0000644000414100000240000001032010756504320010675 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "../Mem/mem.h" #include "hash.h" long primes[]= { 1, 2, 3, 7, 13, 23, 59, 113, 241, 503, 1019, 2039, 4091, 8179, 11587, 16369, 23143, 32749, 46349, 65521, 92683, 131063, 185363, 262139, 330287, 416147, 524269, 660557, 832253, 1048571, 1321109, 1664501, 2097143, 2642201, 3328979, 4194287, 5284393, 6657919, 8388593, 10568797, 13315831, 16777199, 33554393, 67108859, 134217689, 268435399, 536870879, 1073741789, 2147483629 }; #define TABLE_SIZE(size_index) (primes[size_index]) #define REDUCE(i, size)\ do\ {\ (i)%=(size);\ if ((i) < 0)\ (i)= -(i);\ }\ while (0) long hash2(long d1, long d2) { return(d1*10007+d2); } char eq2(long d11, long d12, long d21, long d22) { return((d11 == d21) && (d12 == d22) ); } long hashlong(long p1, long p2) { long res = 0; int *pp1 = (int *)p1; while(*pp1 != -1) res = ((res*100001) + (*pp1++)); return(res); } char eqlong(long p11, long p12, long p21, long p22) { int *pp11 = (int *)p11; int *pp21 = (int *)p21; while((*pp11!= -1) && (*pp11 == *pp21)) {pp11++ ; pp21++;} if((*pp11 != -1) || (*pp21 != -1)) return (0); else return (1); } /* rehash_hash_tab(h) increases the size of h by roughly a */ /* factor of 2 and rehashes all of its entries. */ static void rehash_hash_tab(hash_tab h) { long i; long hash; long oldsize; hash_rc *newtable; hash_rc p, q; oldsize=h->size; h->size_index++; h->size=TABLE_SIZE(h->size_index); newtable=(hash_rc *)mem_alloc((size_t)(h->size*sizeof(hash_rc))); for (i=0; i < h->size; ++i) newtable[i]=0; for (i=0; i < oldsize; ++i) for (p=h->table[i]; p; p=q) { q=p->next; hash=h->hash_fn(p->key1, p->key2); REDUCE(hash, h->size); p->next=newtable[hash]; newtable[hash]=p; } mem_free((void *)h->table); h->table=newtable; } /* insert_in_hash_tab(h, f, data) associates the specified data */ /* with f in h. */ void insert_in_hash_tab(hash_tab h, long f, long g, void * data) { long hash; hash_rc p; p=mem_alloc(sizeof(*p)); p->key1=f; p->key2=g; p->data=data; hash=h->hash_fn(f,g); REDUCE(hash, h->size); p->next=h->table[hash]; h->table[hash]=p; h->entries++; if ((h->size << 2) < h->entries) rehash_hash_tab(h); } /* bdd_lookup_in_hash_tab(h, f) looks up f in h and returns either a */ /* pointer to the associated data or null. */ void * lookup_in_hash_tab(hash_tab h, long f, long g) { long hash; hash_rc p; hash=h->hash_fn(f,g); REDUCE(hash, h->size); for (p=h->table[hash]; p; p=p->next) if (h->eq_fn(p->key1, p->key2, f, g)) return (p->data); return ((void *)0); } /* new_hash_tab(item_size) creates a new hash table with */ /* the key a sequence of longs. */ hash_tab new_hash_tab(long (*hash_fn)(long, long), char (*eq_fn)(long, long, long, long)) { long i; hash_tab h; h=(hash_tab)mem_alloc(sizeof(struct hash_tab_)); h->size_index=6; h->size=TABLE_SIZE(h->size_index); h->table=(hash_rc *)mem_alloc((size_t)(h->size*sizeof(hash_rc))); for (i=0; i < h->size; ++i) h->table[i]=0; h->entries=0; h->hash_fn = hash_fn; h->eq_fn = eq_fn; return (h); } /* free_hash_tab(h) frees up the storage associated with h. */ void free_hash_tab(hash_tab h) { long i; hash_rc p, q; for (i=0; i < h->size; ++i) for (p=h->table[i]; p; p=q) { q=p->next; mem_free((void *)p); } mem_free((void *)h->table); mem_free(h); } mona-1.4/BDD/hash.h0000644000414100000240000000332210756504267010720 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* hash table routines based on David Long's BDD package */ #ifndef __HASH_H #define __HASH_H struct hash_rc_ { long key1; long key2; void * data; struct hash_rc_ *next; }; typedef struct hash_rc_ *hash_rc; struct hash_tab_ { hash_rc *table; int size_index; long size; long entries; long (*hash_fn)(long, long); char (*eq_fn)(long, long, long, long); }; typedef struct hash_tab_ *hash_tab; /* Hash table routines */ extern void insert_in_hash_tab(hash_tab, long, long, void *); extern void *lookup_in_hash_tab(hash_tab, long, long) ; extern hash_tab new_hash_tab(long (*hash_fn)(long, long), char (*eq_fn)(long, long, long, long)); extern void free_hash_tab(hash_tab); extern long hash2(long, long); extern char eq2(long, long, long, long); extern long hashlong(long, long); extern char eqlong(long, long, long, long); extern void free_hash_tab_with_destructor(hash_tab, void (*destruct)(long,long,void *)); #endif mona-1.4/DFA/0000777000414100000240000000000011045777450007707 500000000000000mona-1.4/DFA/dfa.h0000644000414100000240000000671710764441307010535 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* See the 'MONA User Manual' for documentation */ #ifndef __DFA_H #define __DFA_H #include "bdd.h" enum astat {PRODUCT, PROJECT, MINIMIZATION}; typedef enum { dfaIMPL = 11, dfaBIIMPL = 9, dfaAND = 8, dfaOR = 14 } dfaProductType; typedef struct { bdd_manager *bddm; /* manager of BDD nodes */ int ns; /* number of states */ bdd_ptr *q; /* transition array */ int s; /* start state */ int *f; /* state statuses; -1:reject, 0:don't care, +1:accept */ } DFA; extern int dfa_in_mem; /* number of automata currently in memory */ extern int max_dfa_in_mem; /* maximum number of automata in memory */ /* dfa.c */ DFA *dfaMake(int n); DFA *dfaMakeNoBddm(int n); void dfaFree(DFA *a); void dfaNegation(DFA *a); void dfaRestrict(DFA *a); void dfaUnrestrict(DFA *a); DFA *dfaCopy(DFA *a); void dfaReplaceIndices(DFA *a, int map[]); /* product.c */ DFA *dfaProduct(DFA *a1, DFA *a2, dfaProductType mode); /* project.c */ DFA *dfaProject(DFA *a, unsigned index); /* minimize.c */ DFA *dfaMinimize(DFA *a); /* quotient.c */ void dfaRightQuotient(DFA *a, unsigned index); /* prefix.c */ void dfaPrefixClose(DFA *a); /* analyze.c */ char *dfaMakeExample(DFA *a, int kind, int num, unsigned indices[]); void dfaAnalyze(DFA *a, int num, char *names[], unsigned indices[], char orders[], int treestyle); int dfaStatus(DFA *a); /* makebasic.c */ void dfaSetup(int s, int len, int indices[]); void dfaAllocExceptions(int n); void dfaStoreException(int s, char *path); void dfaStoreState(int s); DFA *dfaBuild(char statuses[]); /* printdfa.c */ void dfaPrintVitals(DFA *a); void dfaPrint(DFA *a, int num, char *names[], unsigned indices[]); void dfaPrintGraphviz(DFA *a, int num, unsigned indices[]); void dfaPrintVerbose(DFA *a); /* external.c */ int dfaExport(DFA *a, char *filename, int num, char *names[], char orders[]); DFA* dfaImport(char *filename, char ***names, int **orders); /* basic.c */ DFA *dfaTrue(); DFA *dfaFalse(); DFA *dfaSingleton(int i); DFA *dfaEq2(int i, int j); DFA *dfaSubset(int i, int j); DFA *dfaEmpty(int i); DFA *dfaPlus2(int i, int j); DFA *dfaMinus2(int i, int j); DFA *dfaUnion(int i, int j, int k); DFA *dfaInter(int i, int j, int k); DFA *dfaSetminus(int i, int j, int k); DFA *dfaBoolvar(int b); DFA *dfaIn(int i, int j); DFA *dfaEq1(int i, int j); DFA *dfaLastPos(int i); DFA *dfaAllPos(int i); DFA *dfaFirstOrder(int i); DFA *dfaLess(int i, int j); DFA *dfaLesseq(int i, int j); DFA *dfaConst(int n, int i); DFA *dfaPlus1(int i, int j, int n); DFA *dfaMinus1(int i, int j); DFA *dfaMax(int i, int j); DFA *dfaMin(int i, int j); DFA *dfaPlusModulo1(int i, int j, int k); DFA *dfaMinusModulo1(int i, int j, int k); DFA *dfaPresbConst(int i, int n); #endif mona-1.4/DFA/makefile.am0000644000414100000240000000063310764207701011713 00000000000000MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonadfa.la libmonadfa_la_SOURCES = analyze.c basic.c dfa.c external.c hash.h makebasic.c \ minimize.c prefix.c printdfa.c product.c project.c quotient.c libmonadfa_la_CPPFLAGS = -I ../BDD libmonadfa_la_LDFLAGS = -version-info 1:4 libmonadfa_la_LIBADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la monadir = $(includedir)/mona mona_HEADERS = dfa.h mona-1.4/DFA/makefile.in0000644000414100000240000006574711045777400011746 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DFA DIST_COMMON = $(mona_HEADERS) $(srcdir)/makefile.am \ $(srcdir)/makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libmonadfa_la_DEPENDENCIES = ../Mem/libmonamem.la ../BDD/libmonabdd.la am_libmonadfa_la_OBJECTS = libmonadfa_la-analyze.lo \ libmonadfa_la-basic.lo libmonadfa_la-dfa.lo \ libmonadfa_la-external.lo libmonadfa_la-makebasic.lo \ libmonadfa_la-minimize.lo libmonadfa_la-prefix.lo \ libmonadfa_la-printdfa.lo libmonadfa_la-product.lo \ libmonadfa_la-project.lo libmonadfa_la-quotient.lo libmonadfa_la_OBJECTS = $(am_libmonadfa_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmonadfa_la_SOURCES) DIST_SOURCES = $(libmonadfa_la_SOURCES) monaHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(mona_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonadfa.la libmonadfa_la_SOURCES = analyze.c basic.c dfa.c external.c hash.h makebasic.c \ minimize.c prefix.c printdfa.c product.c project.c quotient.c libmonadfa_la_CPPFLAGS = -I ../BDD libmonadfa_la_LDFLAGS = -version-info 1:4 libmonadfa_la_LIBADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la monadir = $(includedir)/mona mona_HEADERS = dfa.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DFA/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu DFA/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmonadfa.la: $(libmonadfa_la_OBJECTS) $(libmonadfa_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libmonadfa_la_LDFLAGS) $(libmonadfa_la_OBJECTS) $(libmonadfa_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-analyze.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-basic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-dfa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-makebasic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-minimize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-prefix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-printdfa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-product.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-project.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonadfa_la-quotient.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libmonadfa_la-analyze.lo: analyze.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-analyze.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-analyze.Tpo" -c -o libmonadfa_la-analyze.lo `test -f 'analyze.c' || echo '$(srcdir)/'`analyze.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-analyze.Tpo" "$(DEPDIR)/libmonadfa_la-analyze.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-analyze.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='analyze.c' object='libmonadfa_la-analyze.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-analyze.lo `test -f 'analyze.c' || echo '$(srcdir)/'`analyze.c libmonadfa_la-basic.lo: basic.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-basic.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-basic.Tpo" -c -o libmonadfa_la-basic.lo `test -f 'basic.c' || echo '$(srcdir)/'`basic.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-basic.Tpo" "$(DEPDIR)/libmonadfa_la-basic.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-basic.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='basic.c' object='libmonadfa_la-basic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-basic.lo `test -f 'basic.c' || echo '$(srcdir)/'`basic.c libmonadfa_la-dfa.lo: dfa.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-dfa.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-dfa.Tpo" -c -o libmonadfa_la-dfa.lo `test -f 'dfa.c' || echo '$(srcdir)/'`dfa.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-dfa.Tpo" "$(DEPDIR)/libmonadfa_la-dfa.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-dfa.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dfa.c' object='libmonadfa_la-dfa.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-dfa.lo `test -f 'dfa.c' || echo '$(srcdir)/'`dfa.c libmonadfa_la-external.lo: external.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-external.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-external.Tpo" -c -o libmonadfa_la-external.lo `test -f 'external.c' || echo '$(srcdir)/'`external.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-external.Tpo" "$(DEPDIR)/libmonadfa_la-external.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-external.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='external.c' object='libmonadfa_la-external.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-external.lo `test -f 'external.c' || echo '$(srcdir)/'`external.c libmonadfa_la-makebasic.lo: makebasic.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-makebasic.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-makebasic.Tpo" -c -o libmonadfa_la-makebasic.lo `test -f 'makebasic.c' || echo '$(srcdir)/'`makebasic.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-makebasic.Tpo" "$(DEPDIR)/libmonadfa_la-makebasic.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-makebasic.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='makebasic.c' object='libmonadfa_la-makebasic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-makebasic.lo `test -f 'makebasic.c' || echo '$(srcdir)/'`makebasic.c libmonadfa_la-minimize.lo: minimize.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-minimize.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-minimize.Tpo" -c -o libmonadfa_la-minimize.lo `test -f 'minimize.c' || echo '$(srcdir)/'`minimize.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-minimize.Tpo" "$(DEPDIR)/libmonadfa_la-minimize.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-minimize.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minimize.c' object='libmonadfa_la-minimize.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-minimize.lo `test -f 'minimize.c' || echo '$(srcdir)/'`minimize.c libmonadfa_la-prefix.lo: prefix.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-prefix.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-prefix.Tpo" -c -o libmonadfa_la-prefix.lo `test -f 'prefix.c' || echo '$(srcdir)/'`prefix.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-prefix.Tpo" "$(DEPDIR)/libmonadfa_la-prefix.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-prefix.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='prefix.c' object='libmonadfa_la-prefix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-prefix.lo `test -f 'prefix.c' || echo '$(srcdir)/'`prefix.c libmonadfa_la-printdfa.lo: printdfa.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-printdfa.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-printdfa.Tpo" -c -o libmonadfa_la-printdfa.lo `test -f 'printdfa.c' || echo '$(srcdir)/'`printdfa.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-printdfa.Tpo" "$(DEPDIR)/libmonadfa_la-printdfa.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-printdfa.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printdfa.c' object='libmonadfa_la-printdfa.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-printdfa.lo `test -f 'printdfa.c' || echo '$(srcdir)/'`printdfa.c libmonadfa_la-product.lo: product.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-product.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-product.Tpo" -c -o libmonadfa_la-product.lo `test -f 'product.c' || echo '$(srcdir)/'`product.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-product.Tpo" "$(DEPDIR)/libmonadfa_la-product.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-product.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='product.c' object='libmonadfa_la-product.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-product.lo `test -f 'product.c' || echo '$(srcdir)/'`product.c libmonadfa_la-project.lo: project.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-project.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-project.Tpo" -c -o libmonadfa_la-project.lo `test -f 'project.c' || echo '$(srcdir)/'`project.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-project.Tpo" "$(DEPDIR)/libmonadfa_la-project.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-project.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='project.c' object='libmonadfa_la-project.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-project.lo `test -f 'project.c' || echo '$(srcdir)/'`project.c libmonadfa_la-quotient.lo: quotient.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonadfa_la-quotient.lo -MD -MP -MF "$(DEPDIR)/libmonadfa_la-quotient.Tpo" -c -o libmonadfa_la-quotient.lo `test -f 'quotient.c' || echo '$(srcdir)/'`quotient.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonadfa_la-quotient.Tpo" "$(DEPDIR)/libmonadfa_la-quotient.Plo"; else rm -f "$(DEPDIR)/libmonadfa_la-quotient.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='quotient.c' object='libmonadfa_la-quotient.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonadfa_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonadfa_la-quotient.lo `test -f 'quotient.c' || echo '$(srcdir)/'`quotient.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-monaHEADERS: $(mona_HEADERS) @$(NORMAL_INSTALL) test -z "$(monadir)" || $(mkdir_p) "$(DESTDIR)$(monadir)" @list='$(mona_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(monaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(monadir)/$$f'"; \ $(monaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(monadir)/$$f"; \ done uninstall-monaHEADERS: @$(NORMAL_UNINSTALL) @list='$(mona_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(monadir)/$$f'"; \ rm -f "$(DESTDIR)$(monadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-monaHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-monaHEADERS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/DFA/analyze.c0000644000414100000240000001646610764441307011443 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "dfa.h" #include "../Mem/mem.h" static int *bfs_queue; static int *bfs_dist; static int *bfs_prev; static int bfs_current_distance; static unsigned bfs_current_state; static unsigned head, tail; static void automaton_bfs_explore_leaf(unsigned leaf_value) { /* each leaf (except perhaps initial state) is visited exactly once */ bfs_dist[leaf_value] = bfs_current_distance + 1; bfs_prev[leaf_value] = bfs_current_state; bfs_queue[head++] = leaf_value; } static void automaton_bfs(DFA *a, int *dist, int *prev) { head = 1, tail = 0; bfs_dist = dist, bfs_prev = prev; bfs_queue = (int *) mem_alloc((a->ns+1)*sizeof(int)); bfs_current_state = a->s; bfs_queue[0] = bfs_current_state; bfs_dist[bfs_current_state] = 0; bfs_prev[bfs_current_state] = -1; bdd_prepare_apply1(a->bddm); while (tail < head) { bfs_current_state = bfs_queue[tail++]; bfs_current_distance = bfs_dist[bfs_current_state]; bdd_call_leafs(a->bddm, a->q[bfs_current_state], &automaton_bfs_explore_leaf); } mem_free(bfs_queue); } typedef struct intlist { int item; struct intlist *next; } intlist; char *dfaMakeExample(DFA *a, int polarity, int no_free_vars, unsigned *offsets) { int i, j, min_dist = -1, minv, length; intlist *state_list, *ip; char *example; int *dist, *prev; dist = (int *) mem_alloc(a->ns * (sizeof(int))); /* distance from start */ prev = (int *) mem_alloc(a->ns * (sizeof(int))); /* previous in path */ automaton_bfs(a, dist, prev); /* breadth-first-search */ /* dist[a->s]==0 iff initial state not reachable on path of length >0 */ for (i = 0, minv = -1; i < a->ns; i++) if (a->f[i] == polarity) if ((minv == -1 || dist[i] < min_dist) && dist[i] >= 1) { minv = i; min_dist = dist[i]; } if (min_dist == -1) { mem_free(dist); mem_free(prev); return NULL; } state_list = (intlist *) mem_alloc(sizeof(intlist)); state_list->item = minv; state_list->next = NULL; for (length = 0; length < min_dist; length++) { minv = prev[minv]; ip = (intlist *) mem_alloc(sizeof(intlist)); ip->item = minv; ip->next = state_list; state_list = ip; } example = (char *) mem_alloc((no_free_vars+1) * length * sizeof(char) + 1); for (i = 0; i < (no_free_vars+1) * length * sizeof(char); i++) example[i] = 1; example[(no_free_vars+1) * length] = 0; ip = state_list; j = 0; while (ip && ip->next) { trace_descr trace, tp; trace = find_one_path(a->bddm, a->q[ip->item], ip->next->item); for (i = 0; i < no_free_vars; i++) { tp = trace; while (tp && (tp->index != offsets[i])) tp = tp->next; if (!tp) example[i*length+j] = 'X'; else if (tp->value) example[i*length+j] = '1'; else example[i*length+j] = '0'; } kill_trace(trace); ip = ip->next; j++; } while (state_list) { ip = state_list->next; mem_free(state_list); state_list = ip; } mem_free(state_list); mem_free(dist); mem_free(prev); return example; } static void print_example(char *example, char *name, int no_free_vars, char **free_variables, unsigned *offsets, char *types, int treestyle) { int i, j; int length; length = strlen(example)/(no_free_vars+1); if (treestyle) { printf("Free variables are: "); for (i = 0; i < no_free_vars; i++) printf ("%s%s", free_variables[i], i == no_free_vars-1 ? "" : ", "); printf("\n\nA %s of least length (%d) is:\n" "Booleans:\n", name, length-1); for (i = 0; i < no_free_vars; i++) putchar(example[i*length]); printf("\nUniverse:\n"); for (i = 1; i < length; i++) { putchar('('); for (j = 0; j < no_free_vars; j++) putchar(example[j*length+i]); putchar(','); } printf("()"); for (i = 1; i < length; i++) printf(",())"); printf("\n"); } else { printf("A %s of least length (%d) is:\n", name, length-1); for (i = 0; i < no_free_vars; i++) { printf("%-15s %c ", free_variables[i], example[i*length]); for (j = 0; j < length-1; j++) putchar(example[i*length+1+j]); printf("\n"); } printf("\n"); for (i = 0; i < no_free_vars; i++) switch (types[i]) { case 0: printf("%s = %s\n", free_variables[i], example[i*length] == '1' ? "true" : "false"); break; case 1: { int j = 0; while (example[i*length+j+1] == '0' && j < length) j++; printf("%s = %i\n", free_variables[i], j); } break; case 2: { int j, t = 0; printf("%s = {", free_variables[i]); for (j = 0; j < length; j++) if (example[i*length+j+1] == '1') { if (t++ != 0) printf(","); printf("%i",j); } printf("}\n"); } break; } } mem_free(example); } void dfaAnalyze(DFA *dfa, int no_free_vars, char **free_variables, unsigned *offsets, char *types, int treestyle) { char *counterexample, *satisfyingexample; counterexample = dfaMakeExample(dfa, -1, no_free_vars, offsets); satisfyingexample = dfaMakeExample(dfa, 1, no_free_vars, offsets); if (!counterexample && satisfyingexample) printf("Formula is valid\n"); else if (!satisfyingexample) printf("Formula is unsatisfiable\n"); if (counterexample) { if (!satisfyingexample) printf("\n"); print_example(counterexample, "counter-example", no_free_vars, free_variables, offsets, types, treestyle); } if (satisfyingexample){ if (no_free_vars) printf("\n"); print_example(satisfyingexample, "satisfying example", no_free_vars, free_variables, offsets, types, treestyle); } } int dfaStatus(DFA *a) { int i, min_dist = -1, min_dist_ctr = -1, minv, minv_ctr; int *dist, *prev; dist = (int *) mem_alloc(a->ns * (sizeof(int))); /* distance from start */ prev = (int *) mem_alloc(a->ns * (sizeof(int))); /* previous in path */ automaton_bfs(a, dist, prev); /* breadth-first-search */ /* dist[a->s]==0 iff initial state not reachable on path of length >0 */ for (i = 0, minv = minv_ctr = -1; i < a->ns; i++) { if (a->f[i] == -1) { if ((minv_ctr == -1 || dist[i] < min_dist_ctr) && dist[i] >= 1) { minv_ctr = i; min_dist_ctr = dist[i]; } } else if (a->f[i] == 1) { if ((minv == -1 || dist[i] < min_dist) && dist[i] >= 1) { minv = i; min_dist = dist[i]; } } } mem_free(dist); mem_free(prev); if (min_dist == -1) return -1; /* Formula is unsatisfiable */ if (min_dist_ctr == -1) return 1; /* Formula is satisfiable */ return 0; /* Formula is invalid */ } mona-1.4/DFA/basic.c0000644000414100000240000006626011045777364011066 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "dfa.h" #include "../Mem/mem.h" DFA *dfaTrue() { dfaSetup(2, 0, NULL); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(0); dfaStoreState(1); return dfaBuild("0+"); } DFA *dfaFalse() { dfaSetup(2, 0, NULL); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(0); dfaStoreState(1); return dfaBuild("0-"); } DFA *dfaSingleton(int i) { int var_index[1]; var_index[0] = i; dfaSetup(4, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(2, "1"); dfaStoreState(1); /* state 2 */ dfaAllocExceptions(1); dfaStoreException(3, "1"); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0-+-"); } DFA *dfaEq2(int i, int j) { if (i == j) return dfaTrue(); else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(3, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(1, "00"); dfaStoreException(1, "11"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } } DFA *dfaSubset(int i, int j) { if (i == j) return dfaTrue(); else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(3, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(2, "10"); dfaStoreState(1); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } } DFA *dfaEmpty(int i) { int var_index[1]; var_index[0] = i; dfaSetup(3, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(1, "0"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } DFA *dfaPlus2(int i, int j) { if (i == j) return dfaEmpty(i); /* Pi = Pi+1 iff Pi = empty */ else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(4, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(1, "00"); dfaStoreException(2, "01"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(2); dfaStoreException(3, "0X"); dfaStoreException(1, "10"); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0+--"); } } DFA *dfaMinus2(int i, int j) { if (i == j) { int var_index[1]; var_index[0] = i; dfaSetup(4, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(1); dfaStoreException(2, "0"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0++-"); } else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(6, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(3, "00"); dfaStoreException(4, "10"); dfaStoreException(2, "11"); dfaStoreState(5); /* state 2 */ dfaAllocExceptions(1); dfaStoreException(4, "1X"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(2); dfaStoreException(3, "00"); dfaStoreException(4, "10"); dfaStoreState(5); /* state 4 */ dfaAllocExceptions(2); dfaStoreException(4, "11"); dfaStoreException(3, "01"); dfaStoreState(5); /* state 5 */ dfaAllocExceptions(0); dfaStoreState(5); return dfaBuild("0+++--"); } } DFA *dfaUnion(int i, int j, int k) { if (i == j) return dfaSubset(k, i); else if (i == k) return dfaSubset(j, i); else if (j == k) return dfaEq2(i, j); else { int var_index[3]; var_index[0] = i; var_index[1] = j; var_index[2] = k; dfaSetup(3, 3, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(1, "000"); dfaStoreException(1, "1X1"); dfaStoreException(1, "110"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } } DFA *dfaInter(int i, int j, int k) { if (i == j) return dfaSubset(i, k); else if (i == k) return dfaSubset(i, j); else if (j == k) return dfaEq2(i, j); else { int var_index[3]; var_index[0] = i; var_index[1] = j; var_index[2] = k; dfaSetup(3, 3, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(1, "111"); dfaStoreException(1, "00X"); dfaStoreException(1, "010"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } } DFA *dfaSetminus(int i, int j, int k) { if (j == k || i == k) return dfaEmpty(i); else if (i == j) { /* make: k inter i = empty */ int var_index[2]; var_index[0] = i; var_index[1] = k; dfaSetup(3, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(1,"0X"); dfaStoreException(1,"10"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } else { int var_index[3]; var_index[0] = i; var_index[1] = j; var_index[2] = k; dfaSetup(3, 3, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(1, "00X"); dfaStoreException(1, "110"); dfaStoreException(1, "011"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } } DFA *dfaBoolvar(int b) { int var_index[1]; var_index[0] = b; dfaSetup(3, 1, var_index); /* boolvar */ dfaAllocExceptions(1); dfaStoreException(2, "0"); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(0); dfaStoreState(1); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+-"); } DFA *dfaFirstOrder(int i) { int var_index[1]; var_index[0] = i; dfaSetup(3, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(1, "0"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0-+"); } /* an automaton that expresses a non-WS1S property: it accepts iff it reads an empty string or if first-order variable i assumes the value n-1, where n is the length of the string */ DFA *dfaLastPos(int i) { int var_index[1]; var_index[0] = i; dfaSetup(5, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(4); /* state 1, rejecting */ dfaAllocExceptions(1); dfaStoreException(1, "0"); dfaStoreState(2); /* on "1" go to transitory accepting state */ /* state 2, accepting */ dfaAllocExceptions(0); dfaStoreState(3); /* state 3, rejecting */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4, accepting so as to accept word that describes only Booleans (the empty word when Boolean part is removed) */ dfaAllocExceptions(1); dfaStoreException(1, "0"); dfaStoreState(2); /* on "1" go to transitory accepting state */ return dfaBuild("00+0+"); } /* an automaton that expresses a non-WS1S property: it accepts iff it never reads a 0 on the i'th track and don't-cares otherwise */ DFA *dfaAllPos(int i) { int var_index[1]; var_index[0] = i; dfaSetup(3, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1, accepting */ dfaAllocExceptions(1); dfaStoreException(2, "0"); dfaStoreState(1); /* state 2, rejecting */ dfaAllocExceptions(0); dfaStoreState(2); return dfaBuild("0+0"); } DFA *dfaIn(int i, int j) { int var_index[2]; var_index[0] = i; var_index[1] = j; invariant(i != j); dfaSetup(4, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(3, "10"); dfaStoreException(2, "11"); dfaStoreState(1); /* state 2 accept */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 reject */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0-+-"); } DFA *dfaEq1(int i, int j) { if (i == j) return dfaTrue(); else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(4, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(1, "00"); dfaStoreException(2, "11"); dfaStoreState(3); /* state 2 accept */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 reject */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0-+-"); } } DFA *dfaLess(int i, int j) { if (i == j) return dfaFalse(); else { int var_index[2]; var_index[0] = i, var_index[1] = j; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(1, "00"); dfaStoreException(2, "10"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(1); dfaStoreException(2, "X0"); dfaStoreState(4); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0---+"); } } DFA *dfaLesseq(int i, int j) { if (i == j) return dfaTrue(); else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(1, "00"); dfaStoreException(2, "10"); dfaStoreException(4, "11"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(1); dfaStoreException(2, "X0"); dfaStoreState(4); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0---+"); } } DFA *dfaConst(int n, int i) { DFA *aut; int var_index[1]; int state_no; char *finals; var_index[0] = i; dfaSetup(n+4, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(3); /* state 1 - Accept */ dfaAllocExceptions(0); dfaStoreState(1); /* state 2 - Reject */ dfaAllocExceptions(0); dfaStoreState(2); /* states 3 .. (n+2) */ for (state_no = 3; state_no < n+3; state_no++) { dfaAllocExceptions(1); dfaStoreException(state_no+1, "0"); dfaStoreState(2); } /* state n+3 */ dfaAllocExceptions(1); dfaStoreException(1, "1"); dfaStoreState(2); { int k; finals = (char *) mem_alloc((n+4) * (sizeof(char *))); for (k = 0; k < n+4; k++) finals[k] = '-'; finals[0] = '0'; finals[1] = '+'; } aut = dfaBuild(finals); mem_free(finals); return aut; } DFA *dfaPlus1(int i, int j, int n) { if (n == 0) return dfaEq1(i, j); else if (i == j) return dfaFalse(); else { DFA *aut; int var_index[2]; int state_no; char *finals; var_index[0] = i; var_index[1] = j; dfaSetup(n+4, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(1, "00"); dfaStoreException(3, "01"); dfaStoreState(2); /* state 2 - Reject */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 .. (n+1) */ for (state_no = 3; state_no <= n+1; state_no++) { dfaAllocExceptions(1); dfaStoreException(state_no+1,"0X"); dfaStoreState(2); } /* state n+2 */ dfaAllocExceptions(1); dfaStoreException(n+3, "1X"); dfaStoreState(2); /* state n+3 - Accept */ dfaAllocExceptions(0); dfaStoreState(n+3); { int k; finals = (char *) mem_alloc((n+4) * (sizeof(char *))); for (k = 0; k < n+4; k++) finals[k] = '-'; finals[0] = '0'; finals[n+3] = '+'; } aut = dfaBuild(finals); mem_free(finals); return aut; } } DFA *dfaMinus1(int i, int j) { if (i == j) { /* <=> pi=0 */ int var_index[1]; var_index[0] = i; dfaSetup(4, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(3,"1"); dfaStoreState(2); /* state 2 - Reject */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 - Accept */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0--+"); } else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(6, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(2, "00"); dfaStoreException(3, "01"); dfaStoreException(4, "10"); dfaStoreState(5); /* state 2 */ dfaAllocExceptions(3); dfaStoreException(2, "00"); dfaStoreException(3, "01"); dfaStoreException(4, "10"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(1); dfaStoreException(3, "X0"); dfaStoreState(5); /* state 5 */ dfaAllocExceptions(0); dfaStoreState(5); return dfaBuild("0----+"); } } DFA *dfaMax(int i, int j) { if (i == j) return dfaTrue(); else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(2, "0X"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(2); dfaStoreException(2, "0X"); dfaStoreException(4, "10"); dfaStoreState(3); /* state 3 - Accept */ dfaAllocExceptions(1); dfaStoreException(3, "X0"); dfaStoreState(4); /* state 4 - All reject */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0--+-"); } } /* is i (first-order) lowest element in j?; i=0 if j is empty */ DFA *dfaMin(int i, int j) { if (i == j) return dfaTrue(); else { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(6, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(2, "00"); dfaStoreException(3, "01"); dfaStoreException(4, "10"); dfaStoreState(5); /* state 2 */ dfaAllocExceptions(2); dfaStoreException(2, "00"); dfaStoreException(5, "11"); dfaStoreState(3); /* state 3 - Reject */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 - Accept */ dfaAllocExceptions(1); dfaStoreException(4, "X0"); dfaStoreState(3); /* state 5 - Accept */ dfaAllocExceptions(0); dfaStoreState(5); return dfaBuild("0---++"); } } DFA *dfaPlusModulo1(int i, int j, int k) /* see plusmodulo.mona */ { if (i == j) { if (i == k) { int var_index[1]; var_index[0] = i; dfaSetup(4, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(2, "0"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0--+"); } else { int var_index[2]; var_index[0] = i; var_index[1] = k; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(2, "0X"); dfaStoreException(3, "10"); dfaStoreState(4); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(1); dfaStoreException(2, "X0"); dfaStoreState(4); /* state 4 */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0---+"); } } else if (j == k) { int var_index[2]; var_index[0] = i; var_index[1] = k; dfaSetup(7, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(2, "00"); dfaStoreException(3, "01"); dfaStoreException(4, "10"); dfaStoreState(5); /* state 2 */ dfaAllocExceptions(1); dfaStoreException(6, "10"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(1); dfaStoreException(3, "X0"); dfaStoreState(5); /* state 5 */ dfaAllocExceptions(0); dfaStoreState(5); /* state 6 */ dfaAllocExceptions(1); dfaStoreException(6, "X0"); dfaStoreState(5); return dfaBuild("0----+-"); } else if (i == k) { int var_index[2]; var_index[0] = k; var_index[1] = j; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(2, "0X"); dfaStoreException(3, "10"); dfaStoreState(4); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(1); dfaStoreException(3, "X0"); dfaStoreState(4); /* state 4 */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0---+"); } else { int var_index[3]; var_index[0] = i; var_index[1] = j; var_index[2] = k; dfaSetup(13, 3, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(6); dfaStoreException(2, "000"); dfaStoreException(3, "0X1"); dfaStoreException(4, "010"); dfaStoreException(5, "100"); dfaStoreException(6, "101"); dfaStoreException(7, "110"); dfaStoreState(8); /* state 2 */ dfaAllocExceptions(3); dfaStoreException(9, "000"); dfaStoreException(4, "010"); dfaStoreException(10, "100"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(1); dfaStoreException(11, "1X0"); dfaStoreState(3); /* state 5 */ dfaAllocExceptions(3); dfaStoreException(12, "X00"); dfaStoreException(6, "X01"); dfaStoreException(7, "X10"); dfaStoreState(8); /* state 6 */ dfaAllocExceptions(1); dfaStoreException(6, "X0X"); dfaStoreState(8); /* state 7 */ dfaAllocExceptions(1); dfaStoreException(8, "XX1"); dfaStoreState(3); /* state 8 */ dfaAllocExceptions(0); dfaStoreState(8); /* state 9 */ dfaAllocExceptions(2); dfaStoreException(9, "000"); dfaStoreException(4, "010"); dfaStoreState(3); /* state 10 */ dfaAllocExceptions(2); dfaStoreException(10, "X00"); dfaStoreException(8, "X11"); dfaStoreState(3); /* state 11 */ dfaAllocExceptions(1); dfaStoreException(11, "XX0"); dfaStoreState(8); /* state 12 */ dfaAllocExceptions(3); dfaStoreException(12, "X00"); dfaStoreException(6, "X01"); dfaStoreException(7, "X10"); dfaStoreState(3); return dfaBuild("0-------+----"); } } DFA *dfaMinusModulo1(int i, int j, int k) /* see minusmodulo.mona */ { if (i == j) { if (i == k) { int var_index[1]; var_index[0] = i; dfaSetup(4, 1, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(1); dfaStoreException(2, "0"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); return dfaBuild("0--+"); } else { int var_index[2]; var_index[0] = i; var_index[1] = k; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(2, "0X"); dfaStoreException(3, "10"); dfaStoreState(4); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(1); dfaStoreException(2, "X0"); dfaStoreState(4); /* state 4 */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0---+"); } } else if (j == k) { int var_index[2]; var_index[0] = i; var_index[1] = j; dfaSetup(6, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(3); dfaStoreException(2, "00"); dfaStoreException(3, "01"); dfaStoreException(4, "10"); dfaStoreState(5); /* state 2 */ dfaAllocExceptions(2); dfaStoreException(2, "00"); dfaStoreException(4, "10"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(1); dfaStoreException(3, "X0"); dfaStoreState(5); /* state 5 */ dfaAllocExceptions(0); dfaStoreState(5); return dfaBuild("0----+"); } else if (i == k) { int var_index[2]; var_index[0] = j; var_index[1] = k; dfaSetup(5, 2, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(2); dfaStoreException(3, "01"); dfaStoreException(4, "11"); dfaStoreState(2); /* state 2 */ dfaAllocExceptions(0); dfaStoreState(2); /* state 3 */ dfaAllocExceptions(1); dfaStoreException(3, "0X"); dfaStoreState(4); /* state 4 */ dfaAllocExceptions(0); dfaStoreState(4); return dfaBuild("0---+"); } else { int var_index[3]; var_index[0] = i; var_index[1] = j; var_index[2] = k; dfaSetup(12, 3, var_index); /* boolvar */ dfaAllocExceptions(0); dfaStoreState(1); /* state 1 */ dfaAllocExceptions(6); dfaStoreException(2, "000"); dfaStoreException(4, "010"); dfaStoreException(5, "100"); dfaStoreException(6, "101"); dfaStoreException(7, "110"); dfaStoreException(8, "111"); dfaStoreState(3); /* state 2 */ dfaAllocExceptions(2); dfaStoreException(2, "000"); dfaStoreException(9, "100"); dfaStoreState(3); /* state 3 */ dfaAllocExceptions(0); dfaStoreState(3); /* state 4 */ dfaAllocExceptions(2); dfaStoreException(4, "0X0"); dfaStoreException(7, "1X0"); dfaStoreState(3); /* state 5 */ dfaAllocExceptions(3); dfaStoreException(10, "X00"); dfaStoreException(6, "X01"); dfaStoreException(11, "X10"); dfaStoreState(8); /* state 6 */ dfaAllocExceptions(1); dfaStoreException(6, "X0X"); dfaStoreState(8); /* state 7 */ dfaAllocExceptions(1); dfaStoreException(8, "XX1"); dfaStoreState(3); /* state 8 */ dfaAllocExceptions(0); dfaStoreState(8); /* state 9 */ dfaAllocExceptions(2); dfaStoreException(11, "X10"); dfaStoreException(8, "X11"); dfaStoreState(3); /* state 10 */ dfaAllocExceptions(2); dfaStoreException(10, "X00"); dfaStoreException(6, "X01"); dfaStoreState(3); /* state 11 */ dfaAllocExceptions(1); dfaStoreException(11, "XX0"); dfaStoreState(8); return dfaBuild("0-------+---"); } } DFA *dfaPresbConst(int i, int n) { /* the following code constructs an automaton for the Presburger relation 'p_i = n' where (non-negative) numbers are encoded with least-significant bit first */ int var_index[1]; /* array of indices of the free variables */ int bits; /* total number of bits required to represent 'n' */ char *status; /* array used for state kinds (-1/0/1) */ DFA *res; int t, s; /* fill 'var_index', only one variable in this case */ var_index[0] = i; /* calculate 'bits' */ for (t = n, bits = 0; t != 0; t >>= 1) bits++; /* prepare construction of automaton with 'bits + 3' states and 1 variable */ status = (char *) mem_alloc(bits + 3); dfaSetup(bits + 3, 1, var_index); /* now create the states on at a time, always start with the initial state (state 0), state 0: */ dfaAllocExceptions(0); dfaStoreState(2); status[0] = '0'; /* '0' denotes "don't care" */ /* these two lines read: there are 0 exceptions for going to state 2, this is what we want since the first symbol being read encodes the values of the Boolean variables of which there are none in this case */ /* we choose to use state 1 as the 'all reject' state, state 1: */ dfaAllocExceptions(0); dfaStoreState(1); status[1] = '-'; /* '-' denotes "reject" */ /* now generate one state for each bit in 'n' */ for (t = n, s = 2; s <= bits+1; s++, t >>= 1) { /* state 's' goes to state 's+1' or all reject depending on the next bit */ dfaAllocExceptions(1); dfaStoreException(1, (t&1) ? "0" : "1"); dfaStoreState(s+1); status[s] = '-'; /* '-' denotes "reject" */ } /* the last state accepts and loops on '0' */ dfaAllocExceptions(1); dfaStoreException(1, "1"); dfaStoreState(bits+2); status[bits+2] = '+'; /* '+' denotes "accept" */ /* finalize the construction */ res = dfaBuild(status); mem_free(status); /* deallocate 'status' */ return res; } mona-1.4/DFA/dfa.c0000644000414100000240000000545010756504320010515 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "dfa.h" #include "../BDD/hash.h" #include "../Mem/mem.h" int dfa_in_mem; /* number of automata currently in memory */ int max_dfa_in_mem; /* maximum number of automata in memory */ DFA *dfaMake(int n) { DFA *a; a = mem_alloc(sizeof *a); a->bddm = bdd_new_manager(8 * n, ((n+3)/4)*4 ); /* overflow_increment rounded up to be div. by 4 */ a->ns = n; a->q = mem_alloc((sizeof *(a->q)) * n); a->f = mem_alloc((sizeof *(a->f)) * n); dfa_in_mem++; if (dfa_in_mem>max_dfa_in_mem) max_dfa_in_mem = dfa_in_mem; return a; } DFA *dfaMakeNoBddm(int n) { DFA *a; a = mem_alloc(sizeof *a); a->ns = n; a->q = mem_alloc((sizeof *(a->q)) * n); a->f = mem_alloc((sizeof *(a->f)) * n); dfa_in_mem++; if (dfa_in_mem>max_dfa_in_mem) max_dfa_in_mem = dfa_in_mem; return a; } void dfaFree(DFA *a) { bdd_kill_manager(a->bddm); mem_free(a->q); mem_free(a->f); mem_free(a); dfa_in_mem--; } void dfaNegation(DFA *a) { int i; for (i = 0; i < a->ns; i++) a->f[i] = - a->f[i]; } void dfaRestrict(DFA *a) { int i; for (i = 0; i < a->ns; i++) if (a->f[i] == -1) a->f[i] = 0; } void dfaUnrestrict(DFA *a) { int i; for (i = 0; i < a->ns; i++) if (a->f[i] == 0) a->f[i] = -1; } /** void dfaPrintStatistics() { bdd_print_statistics((unsigned)MINIMIZATION, "Minimization"); bdd_print_statistics((unsigned)PRODUCT, "Product"); bdd_print_statistics((unsigned)PROJECT, "Project"); } **/ DFA *dfaCopy(DFA *a) { unsigned i; DFA * result = dfaMake(a->ns); result->ns = a->ns; result->s = a->s; mem_copy(result->f, a->f, sizeof(*a->f)*a->ns); bdd_prepare_apply1(a->bddm); for (i = 0; i < a->ns; i++) (void) bdd_apply1(a->bddm, a->q[i], result->bddm, &fn_identity); mem_copy(result->q, bdd_roots(result->bddm), sizeof(bdd_ptr)*a->ns); return result; } void dfaReplaceIndices(DFA *a, int *indices_map) { unsigned i; bdd_prepare_apply1(a->bddm); for (i = 0; i < a->ns; i++) bdd_replace_indices(a->bddm, a->q[i], (unsigned*) indices_map); } mona-1.4/DFA/external.c0000644000414100000240000001042210756504320011600 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "dfa.h" #include "../BDD/bdd_external.h" #include "../Mem/mem.h" /* EXPORT */ int dfaExport(DFA *a, char *filename, int num, char *vars[], char orders[]) { Table *table = tableInit(); int i; FILE *file; if (filename) { if ((file = fopen(filename, "w")) == 0) return 0; } else file = stdout; /* remove all marks in a->bddm */ bdd_prepare_apply1(a->bddm); /* build table of tuples (idx,lo,hi) */ for (i = 0; i < a->ns; i++) export(a->bddm, a->q[i], table); /* renumber lo/hi pointers to new table ordering */ for (i = 0; i < table->noelems; i++) { if (table->elms[i].idx != -1) { table->elms[i].lo = bdd_mark(a->bddm, table->elms[i].lo) - 1; table->elms[i].hi = bdd_mark(a->bddm, table->elms[i].hi) - 1; } } /* write to file */ fprintf(file, "MONA DFA\n" "number of variables: %u\n" "variables:", num); for (i = 0; i < num; i++) fprintf(file, " %s", vars[i]); fprintf(file, "\n" "orders:"); for (i = 0; i < num; i++) fprintf(file, " %u", (unsigned) orders[i]); fprintf(file, "\n" "states: %u\n" "initial: %u\n" "bdd nodes: %u\n" "final:", a->ns, a->s, table->noelems); for (i = 0; i < a->ns; i++) fprintf(file, " %d", a->f[i]); fprintf(file, "\nbehaviour:"); for (i = 0; i < a->ns; i++) fprintf(file, " %u", bdd_mark(a->bddm, a->q[i]) - 1); fprintf(file, "\nbdd:\n"); for (i = 0; i < table->noelems; i++) fprintf(file, " %i %u %u\n", table->elms[i].idx, table->elms[i].lo, table->elms[i].hi); fprintf(file, "end\n"); tableFree(table); if (filename) fclose(file); return 1; } /* IMPORT */ extern BddNode *table; extern bdd_manager *import_bddm; DFA *dfaImport(char* filename, char ***vars, int **orders) { unsigned int i, numvars, bdd_nodes, ns, s; FILE *file; DFA *a; char ts[100]; int ti; /* Read file */ if ((file = fopen(filename, "r")) == 0) return 0; fscanf(file, "MONA DFA\n" "number of variables: %u\n" "variables: ", &numvars); if (vars) { *vars = (char **) mem_alloc(sizeof(char *) * (numvars + 1)); (*vars)[numvars] = 0; for (i = 0; i < numvars; i++) { (*vars)[i] = (char *) mem_alloc(100); fscanf(file, " %s ", (*vars)[i]); } } else { for (i = 0; i < numvars; i++) fscanf(file, " %s ", ts); } fscanf(file, "orders: "); if (orders) { *orders = (int *) mem_alloc(sizeof(int) * numvars); for (i = 0; i < numvars; i++) fscanf(file, " %d ", &((*orders)[i])); } else for (i = 0; i < numvars; i++) fscanf(file, " %d ", &ti); if (fscanf(file, "states: %u\n" "initial: %u\n" "bdd nodes: %u\n" "final:", &ns, &s, &bdd_nodes) != 3) return 0; a = dfaMake(ns); a->s = s; for (i = 0; ins; i++) fscanf(file, " %d", &a->f[i]); fscanf(file, "\nbehaviour:"); for (i = 0; i < a->ns; i++) fscanf(file, " %u", &a->q[i]); fscanf(file, "\nbdd:\n"); table = (BddNode *) mem_alloc(sizeof(BddNode)*bdd_nodes); for (i = 0; i < bdd_nodes; i++) { table[i].p = -1; fscanf(file, "%i %u %u\n", &table[i].idx, &table[i].lo, &table[i].hi); } if (fgetc(file) != 'e' || fgetc(file) != 'n' || fgetc(file) != 'd') return 0; fclose(file); /* fill bdd-manager */ import_bddm = a->bddm; for (i = 0; i < a->ns; i++) a->q[i] = make_node(a->q[i]); mem_free(table); return a; } mona-1.4/DFA/hash.h0000644000414100000240000000301310756504267010716 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef _HASH_TABS #define _HASH_TABS struct hash_rc_ { long key1; long key2; pointer data; struct hash_rc_ *next; }; typedef struct hash_rc_ *hash_rc; struct hash_tab_ { hash_rc *table; int size_index; long size; long entries; long (*hash_fn)(long, long); char (*eq_fn)(long, long, long, long); }; typedef struct hash_tab_ *hash_tab; /* Hash table routines */ void insert_in_hash_tab(hash_tab, long, long, pointer); pointer lookup_in_hash_tab(hash_tab, long, long) ; hash_tab new_hash_tab(long (*hash_fn)(long, long), char (*eq_fn)(long, long, long, long)); void free_hash_tab(hash_tab); long hash2(long, long); char eq2(long, long, long, long); long hashlong(long, long); char eqlong(long, long, long, long); #endif mona-1.4/DFA/makebasic.c0000644000414100000240000001423510756504320011703 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "dfa.h" #include "../BDD/bdd_internal.h" #define MAX_EXCEPTION 50 #define MAX_VARIABLES 10 /* #warning INTERNAL LIMITS */ struct path_descr { int value; char path[MAX_VARIABLES+1]; }; int exception_index, no_exceptions; struct path_descr exceptions[MAX_EXCEPTION]; void dfaAllocExceptions(int n) { invariant(n<=MAX_EXCEPTION); no_exceptions = n; exception_index = 0; } void dfaStoreException(int value, char *path) { invariant(exception_indexroots_array is non empty */ bdd_ptr unite_roots(bdd_manager *bddm) { int no_roots = bddm->roots_index; int i; bdd_ptr result; if ( !(result = bddm->roots_array[0]) ) { printf("Error in unite: no roots to unite.\n"); exit (-1); } /* * Number of iterations must be fixed/controlled, since * bdd_apply2_hashed add roots */ for (i = 1; i < no_roots; i++) result = bdd_apply2_hashed(bddm, result, bddm, bddm->roots_array[i], bddm, &unite_leaf_fn); return result; } int sorted_indices[MAX_VARIABLES]; /* holds indices, which order the offsets argument to dfaBuild */ int global_offsets[MAX_VARIABLES]; /* holds the offsets argument to dfaBuild */ int offsets_size; /* holds the offsets_size argument to dfaBuild */ char sorted_path[MAX_VARIABLES]; /* holds the current exception path, sorted according to the offsets */ DECLARE_SEQUENTIAL_LIST(sub_results, unsigned) bdd_ptr makepath(bdd_manager *bddm, int n, unsigned leaf_value, void (*update_bddpaths) (unsigned (*new_place) (unsigned node))) { bdd_ptr res, sub_res, default_state_ptr; unsigned index; while ((n < offsets_size) && (sorted_path[n] == 'X')) n++; if (n >= offsets_size) return (bdd_find_leaf_hashed(bddm, leaf_value, SEQUENTIAL_LIST(sub_results), update_bddpaths)); sub_res = makepath(bddm, n+1, leaf_value, update_bddpaths); PUSH_SEQUENTIAL_LIST(sub_results, unsigned, sub_res); default_state_ptr = bdd_find_leaf_hashed(bddm, default_state, SEQUENTIAL_LIST(sub_results), update_bddpaths); POP_SEQUENTIAL_LIST(sub_results, unsigned, sub_res); index = global_offsets[sorted_indices[n]]; if (sorted_path[n] == '0') res = bdd_find_node_hashed(bddm, sub_res, default_state_ptr, index, SEQUENTIAL_LIST(sub_results), update_bddpaths); else res = bdd_find_node_hashed(bddm, default_state_ptr, sub_res, index, SEQUENTIAL_LIST(sub_results), update_bddpaths); return res; } int exp_count; bdd_ptr bddpaths[MAX_EXCEPTION]; void update_bddpaths(unsigned (*new_place) (unsigned node)) { int j; for (j = 0; j < exp_count; j++) bddpaths[j] = new_place(bddpaths[j]); } void makebdd(bdd_manager *bddm) { bdd_manager *tmp_bddm; bdd_ptr united_bdds, default_ptr; int i; tmp_bddm = bdd_new_manager(8, 4); /* ** insert a leaf with value 'default_state' in tmp_bddm, ** if not already present */ default_ptr = bdd_find_leaf_hashed(tmp_bddm, default_state, SEQUENTIAL_LIST(sub_results), &update_bddpaths); for (exp_count = 0; exp_count < no_exceptions; exp_count++) { for (i = 0; i < offsets_size; i++) sorted_path[i] = exceptions[exp_count].path[sorted_indices[i]]; /* clear the cache */ bdd_kill_cache(tmp_bddm); bdd_make_cache(tmp_bddm, 8, 4); tmp_bddm->cache_erase_on_doubling = TRUE; bddpaths[exp_count] = makepath(tmp_bddm, 0, exceptions[exp_count].value, &update_bddpaths); PUSH_SEQUENTIAL_LIST(tmp_bddm->roots, unsigned, bddpaths[exp_count]); } if (no_exceptions == 0) united_bdds = default_ptr; else if (no_exceptions == 1) united_bdds = TOP_SEQUENTIAL_LIST(tmp_bddm->roots); else united_bdds = unite_roots(tmp_bddm); bdd_prepare_apply1(tmp_bddm); bdd_apply1(tmp_bddm, united_bdds, bddm, &fn_identity); /* store the result in bddm->roots */ bdd_kill_manager(tmp_bddm); } int offsets_cmp(const void *index1, const void *index2) { int o1, o2; o1 = global_offsets[*((int *)index1)]; o2 = global_offsets[*((int *)index2)]; if (o1 < o2) return -1; else if (o1 == o2) return 0; else return 1; } DFA *aut; void dfaSetup(int ns, int os, int *offsets) { int i; invariant(os<=MAX_VARIABLES); MAKE_SEQUENTIAL_LIST(sub_results, unsigned, 64); no_states = ns; offsets_size = os; for (i = 0; i < offsets_size; i++) { sorted_indices[i] = i; global_offsets[i] = offsets[i]; } qsort(sorted_indices, offsets_size, sizeof(int), &offsets_cmp); aut = dfaMake(no_states); aut->ns = no_states; aut->s = 0; } void dfaStoreState(int ds) { default_state = ds; bdd_kill_cache(aut->bddm); bdd_make_cache(aut->bddm, 8, 4); makebdd(aut->bddm); } DFA *dfaBuild(char *finals) { int i; unsigned *root_ptr; for (i=0, root_ptr = bdd_roots(aut->bddm); i < no_states; root_ptr++, i++) { aut->q[i] = *root_ptr; aut->f[i] = (finals[i] == '-') ? -1 : (finals[i] == '+' ? 1 : 0); } FREE_SEQUENTIAL_LIST(sub_results); return aut; } mona-1.4/DFA/minimize.c0000644000414100000240000000567710756504320011617 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "dfa.h" #include "../BDD/hash.h" #include "../Mem/mem.h" /* used by minimization_term_fn */ static int *final; static unsigned *discrs; static unsigned length; static bdd_ptr minimization_term_fn(bdd_ptr p) { return (discrs[p]); } static unsigned rename_partition(unsigned *roots) /* calculate equivalence classes as given by the conjunction of bdd_roots and final; put the result in discrs and return the number of classes*/ { hash_tab htbl = new_hash_tab(&hash2, &eq2); unsigned next = 0; unsigned i; for (i = 0; i < length; i++) { unsigned k = (unsigned) lookup_in_hash_tab(htbl, (unsigned)roots[i], final[i]); if (k == 0) { insert_in_hash_tab(htbl, (unsigned)roots[i], final[i], (void *) ++next); discrs[i] = next - 1; } else discrs[i] = k - 1; }; free_hash_tab(htbl); return(next); } DFA *dfaMinimize(DFA *a) { unsigned num_old_blocs; unsigned num_new_blocs = 2; unsigned i; bdd_manager *bddm = a->bddm; bdd_manager *new_bddm = 0; unsigned not_first = 0; length = a->ns; final = a->f; discrs = mem_alloc((sizeof *discrs) * length); { unsigned *roots = mem_alloc((size_t)(sizeof *roots) * length); mem_zero(roots,(size_t)(sizeof *roots) * length); rename_partition(roots); mem_free(roots); } do { if (not_first) { bdd_update_statistics(new_bddm, (unsigned)MINIMIZATION); bdd_kill_manager(new_bddm); } else not_first = 1; new_bddm = bdd_new_manager(bddm->table_elements, bddm->table_elements/8 + 4); bdd_prepare_apply1(bddm); for (i = 0; i < length; i++) (void) bdd_apply1(bddm, a->q[i], new_bddm, &minimization_term_fn); num_old_blocs = num_new_blocs; num_new_blocs = rename_partition(bdd_roots(new_bddm)); } while (num_new_blocs > num_old_blocs); { DFA *b = dfaMakeNoBddm(num_new_blocs); unsigned *roots = bdd_roots(new_bddm); b->bddm = new_bddm; for (i = 0; i < length; i++) { b->q[discrs[i]] = roots[i]; b->f[discrs[i]] = final[i]; } b->s = discrs[a->s]; bdd_update_statistics(new_bddm, (unsigned)MINIMIZATION); mem_free(discrs); return (b); } } mona-1.4/DFA/prefix.c0000644000414100000240000000504510756504320011260 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "dfa.h" #include "../Mem/mem.h" static int **preds; /* preds[i] is the set of predecessors of i */ static int *predalloc, *predused; /* allocated/used size of preds[i] */ static int current_state; void successors(bdd_manager *bddm, bdd_ptr p) { if (bdd_is_leaf(bddm, p)) { int i; int s = bdd_leaf_value(bddm, p); /* current_state is a predecessor of s */ for (i = 0; i < predused[s]; i++) /* already there? */ if (preds[s][i] == current_state) return; if (predalloc[s] == predused[s]) { /* need to reallocate? */ predalloc[s] = predalloc[s]*2+8; preds[s] = (int *) mem_resize(preds[s], sizeof(int) * predalloc[s]); } preds[s][predused[s]++] = current_state; } else { successors(bddm, bdd_else(bddm, p)); successors(bddm, bdd_then(bddm, p)); } } void dfaPrefixClose(DFA *a) { unsigned i; int *queue = (int *) mem_alloc(sizeof(int) * a->ns); int queueused = 0, next = 0; predalloc = (int *) mem_alloc(sizeof(int) * a->ns); predused = (int *) mem_alloc(sizeof(int) * a->ns); preds = (int **) mem_alloc(sizeof(int *) * a->ns); for (i = 0; i < a->ns; i++) { predalloc[i] = predused[i] = 0; preds[i] = 0; } /* find predecessor sets and initialize queue with final states */ for (i = 0; i < a->ns; i++) { current_state = i; successors(a->bddm, a->q[i]); if (a->f[i] == 1) queue[queueused++] = i; } /* color */ while (next < queueused) { for (i = 0; i < predused[queue[next]]; i++) if (a->f[preds[queue[next]][i]] != 1) { a->f[preds[queue[next]][i]] = 1; queue[queueused++] = preds[queue[next]][i]; } next++; } for (i = 0; i < a->ns; i++) mem_free(preds[i]); mem_free(preds); mem_free(predused); mem_free(predalloc); mem_free(queue); } mona-1.4/DFA/printdfa.c0000644000414100000240000001742110756504320011573 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "dfa.h" #include "../Mem/mem.h" void dfaPrintVitals(DFA *a) { unsigned i = bdd_size(a->bddm); printf("\nAutomaton has %d state%s and %d BDD-node%s\n", a->ns, a->ns==1 ? "" : "s", i, i==1 ? "" : "s"); } void dfaPrint(DFA *a, int no_free_vars, char **free_variables, unsigned *offsets) { paths state_paths, pp; trace_descr tp; int i, j, any = 0; printf("DFA for formula with free variables: "); for (i = 0; i < no_free_vars; i++) printf ("%s ", free_variables[i]); printf("\nInitial state: %d\n", a->s); printf("Accepting states: "); for (i = 0; i < a->ns; i++) if (a->f[i] == 1) printf ("%d ", i); printf("\n"); printf("Rejecting states: "); for (i = 0; i < a->ns; i++) if (a->f[i] == -1) printf ("%d ", i); printf("\n"); for (i = 0; i < a->ns; i++) if (a->f[i] == 0) { any = 1; break; } if (any) { printf("Don't-care states: "); for (i = 0; i < a->ns; i++) if (a->f[i] == 0) printf ("%d ", i); printf("\n"); } dfaPrintVitals(a); printf ("Transitions:\n"); for (i = 0; i < a->ns; i++) { state_paths = pp = make_paths(a->bddm, a->q[i]); while (pp) { printf ("State %d: ", i); for (j = 0; j < no_free_vars; j++) { for (tp = pp->trace; tp && (tp->index != offsets[j]); tp = tp->next); if (tp) { if (tp->value) printf("1"); else printf("0"); } else printf("X"); } printf (" -> state %d\n", pp->to); pp = pp->next; } kill_paths(state_paths); } } /* void printdfa_vcg(DFA *a, int no_free_vars, char **free_variables, unsigned *offsets) { paths state_paths, pp; trace_descr tp; int i, j, k, l; char **buffer; int *used, *allocated; printf("graph: {\n" " display_edge_labels: yes\n" " layoutalgorithm: dfs\n" " finetuning: yes\n" " near_edges: yes\n" " orientation: left_to_right\n" " splines: yes\n" " node.shape: ellipse\n" " node.width: 50\n" " node.height: 50\n" " node.textmode: center\n" " node: {\n" " title: \"dummy\"\n" " label: \"\"\n" " borderwidth: 0\n" " }\n"); for (i = 0; i < a->ns; i++) printf(" node: {\n" " title: \"%d\"\n" " label: \"%c\"\n" " }\n", i, (a->f[i] == -1) ? '-' : ((a->f[i] == 1) ? '+' : '0')); printf(" edge: {\n" " sourcename: \"dummy\"\n" " targetname: \"%d\"\n" " }\n", a->s); buffer = (char **) mem_alloc(sizeof(char *) * a->ns); used = (int *) mem_alloc(sizeof(int) * a->ns); allocated = (int *) mem_alloc(sizeof(int) * a->ns); for (i = 0; i < a->ns; i++) { state_paths = pp = make_paths(a->bddm, a->q[i]); for (j = 0; j < a->ns; j++) { buffer[j] = 0; used[j] = allocated[j] = 0; } while (pp) { if (used[pp->to] >= allocated[pp->to]) { allocated[pp->to] = allocated[pp->to]*2+2; buffer[pp->to] = (char *) mem_resize(buffer[pp->to], sizeof(char) * allocated[pp->to] * no_free_vars); } for (j = 0; j < no_free_vars; j++) { char c; for (tp = pp->trace; tp && (tp->index != offsets[j]); tp = tp->next); if (tp) { if (tp->value) c = '1'; else c = '0'; } else c = 'X'; buffer[pp->to][no_free_vars*used[pp->to] + j] = c; } used[pp->to]++; pp = pp->next; } for (j = 0; j < a->ns; j++) if (buffer[j]) { printf(" edge: {\n" " sourcename: \"%d\"\n" " targetname: \"%d\"\n" " label: \"", i, j); for (k = 0; k < no_free_vars; k++) { for (l = 0; l < used[j]; l++) { putchar(buffer[j][no_free_vars*l+k]); if (l+1 < used[j]) { if (k+1 == no_free_vars) putchar(','); else putchar(' '); } } if (k+1 < no_free_vars) printf("\\n"); } printf ("\"\n" " }\n"); mem_free(buffer[j]); } kill_paths(state_paths); } mem_free(allocated); mem_free(used); mem_free(buffer); printf("}\n"); } */ void dfaPrintGraphviz(DFA *a, int no_free_vars, unsigned *offsets) { paths state_paths, pp; trace_descr tp; int i, j, k, l; char **buffer; int *used, *allocated; printf("digraph MONA_DFA {\n" " rankdir = LR;\n" " center = true;\n" " size = \"7.5,10.5\";\n" " edge [fontname = Courier];\n" " node [height = .5, width = .5];\n" " node [shape = doublecircle];"); for (i = 0; i < a->ns; i++) if (a->f[i] == 1) printf(" %d;", i); printf("\n node [shape = circle];"); for (i = 0; i < a->ns; i++) if (a->f[i] == -1) printf(" %d;", i); printf("\n node [shape = box];"); for (i = 0; i < a->ns; i++) if (a->f[i] == 0) printf(" %d;", i); printf("\n init [shape = plaintext, label = \"\"];\n" " init -> %d;\n", a->s); buffer = (char **) mem_alloc(sizeof(char *) * a->ns); used = (int *) mem_alloc(sizeof(int) * a->ns); allocated = (int *) mem_alloc(sizeof(int) * a->ns); for (i = 0; i < a->ns; i++) { state_paths = pp = make_paths(a->bddm, a->q[i]); for (j = 0; j < a->ns; j++) { buffer[j] = 0; used[j] = allocated[j] = 0; } while (pp) { if (used[pp->to] >= allocated[pp->to]) { allocated[pp->to] = allocated[pp->to]*2+2; buffer[pp->to] = (char *) mem_resize(buffer[pp->to], sizeof(char) * allocated[pp->to] * no_free_vars); } for (j = 0; j < no_free_vars; j++) { char c; for (tp = pp->trace; tp && (tp->index != offsets[j]); tp = tp->next); if (tp) { if (tp->value) c = '1'; else c = '0'; } else c = 'X'; buffer[pp->to][no_free_vars*used[pp->to] + j] = c; } used[pp->to]++; pp = pp->next; } for (j = 0; j < a->ns; j++) if (buffer[j]) { printf(" %d -> %d [label=\"", i, j); for (k = 0; k < no_free_vars; k++) { for (l = 0; l < used[j]; l++) { putchar(buffer[j][no_free_vars*l+k]); if (l+1 < used[j]) { if (k+1 == no_free_vars) putchar(','); else putchar(' '); } } if (k+1 < no_free_vars) printf("\\n"); } printf ("\"];\n"); mem_free(buffer[j]); } kill_paths(state_paths); } mem_free(allocated); mem_free(used); mem_free(buffer); printf("}\n"); } void dfaPrintVerbose(DFA *a) { paths state_paths, pp; trace_descr tp; int i; printf ("Resulting DFA:\n"); printf("Initial state: %d\n", a->s); printf("Accepting states: "); for (i = 0; i < a->ns; i++) if (a->f[i] == 1) printf ("%d ", i); printf("\n"); printf("Rejecting states: "); for (i = 0; i < a->ns; i++) if (a->f[i] == -1) printf ("%d ", i); printf("\n"); printf("Don't-care states: "); for (i = 0; i < a->ns; i++) if (a->f[i] == 0) printf ("%d ", i); printf("\n"); printf ("Transitions:\n"); for (i = 0; i < a->ns; i++) { state_paths = pp = make_paths(a->bddm, a->q[i]); while (pp) { printf ("State %d: ", i); for (tp = pp->trace; tp; tp = tp->next) { printf("@%d=%c", tp->index, tp->value ? '1' : '0'); if (tp->next) printf(", "); } printf (" -> state %d\n", pp->to); pp = pp->next; } kill_paths(state_paths); } printf("\n"); } mona-1.4/DFA/product.c0000644000414100000240000001331610756504320011443 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "dfa.h" #include "../BDD/hash.h" #include "../Mem/mem.h" #define STATUS_TO_BOOL(s) \ ((s == -1)? 0: 1) #define BOOL_TO_STATUS(s) \ ((s == 0)? -1 : 1) struct list_ { unsigned li1; unsigned li2; struct list_ *next; }; typedef struct list_ *list; list new_list(unsigned i1, unsigned i2, list nxt) { list l = mem_alloc(sizeof *l); l->li1 = i1; l->li2 = i2; l->next = nxt; return(l); } /* These global because used in prod_term_fn. */ static int last_state; static list qst, qh, qt; static hash_tab htbl; unsigned prod_term_fn(unsigned p, unsigned q) { int res; if ( (res = (int) lookup_in_hash_tab(htbl, p, q)) ) /* res = 0 or id+1 */ return (--res); else { insert_in_hash_tab(htbl, p, q, (void *) (res = ++last_state)); qt->next = new_list(p, q, (list) 0); qt = qt->next; return (--res); } } /*insert a loop for the product state (p, q) */ GNUC_INLINE void make_loop (bdd_manager *bddm, unsigned p, unsigned q) { int res; res = (int) lookup_in_hash_tab(htbl, p, q); invariant(res); /* res = 0 or id+1 */ (--res); /* make the next entry in bdd_roots(bddm) a leaf with value res; thus a loop is created */ invariant(bdd_roots_length(bddm) == res); #ifdef _AUTOMATON_HASHED_IN_PRODUCT_ bdd_find_leaf_hashed_add_root(bddm, res); #else BDD_ADD_ROOT(bddm, bdd_find_leaf_sequential(bddm, res)); #endif } GNUC_INLINE int lookup_binfun(int x, int y, char *binfun) { return binfun[2*x + y]; } GNUC_INLINE int is_loop (bdd_manager *bddm, unsigned p, unsigned w) { return (bdd_is_leaf (bddm, w) && (bdd_leaf_value (bddm, w) == p)); } /* return 1 if a loop involving an accepting state can be made; return -1 if a loop with a rejecting state can be made; return 0 if loop with bottom can be made, otherwise return 2 */ GNUC_INLINE int make_a_loop_status (int is_loop_p, int status_p, int is_loop_q, int status_q, char *binfun) { if (is_loop_p) { /* if the accept status of the second argument doesn't impact the status of the product automaton, then a loop can made */ if (status_p == 0) /* product state is bottom */ return 0; /* so, status_p is not bottom; however, the resulting automaton must still correctly distingusih between bottom and non-bottom states */ return 2; /* note: in case both are loops, we don't need to create a resulting loop explicitly */ } else if (is_loop_q) if (status_q == 0) return 0; return 2; } DFA *dfaProduct(DFA* a1, DFA* a2, dfaProductType ff) { DFA *b; int i; unsigned *root_ptr; char binfun[4]; int make_a_loop; unsigned size_estimate = 4 + 4 * (bdd_size(a1->bddm) > bdd_size(a2->bddm) ? bdd_size(a1->bddm) : bdd_size(a2->bddm)); bdd_manager *bddm; /* #define _AUTOMATON_HASHED_IN_PRODUCT_ */ #ifdef _AUTOMATON_HASHED_IN_PRODUCT_ /*prepare hashed access */ bddm = bdd_new_manager(size_estimate, size_estimate/8 + 2); bdd_make_cache(bddm, size_estimate, size_estimate/8 + 2); bddm->cache_erase_on_doubling = TRUE ; #else /*prepare sequential access*/ bddm = bdd_new_manager(size_estimate, 0); bdd_make_cache(bddm, size_estimate, size_estimate/8 + 2); #endif binfun[0] = ff&1; binfun[1] = (ff&2)>>1; /* The binary function */ binfun[2] = (ff&4)>>2; binfun[3] = (ff&8)>>3; qst = qh = qt = new_list(a1->s, a2->s, (list) 0); htbl = new_hash_tab(&hash2, &eq2); insert_in_hash_tab(htbl, a1->s, a2->s, (void *) 1); last_state = 1; /* Careful here! Bdd's start at 0, hashtbl at 1 */ while(qh) { /* Our main loop, nice and tight */ make_a_loop = make_a_loop_status(is_loop(a1->bddm, qh->li1, a1->q[qh->li1]), a1->f[qh->li1], is_loop(a2->bddm, qh->li2, a2->q[qh->li2]), a2->f[qh->li2], binfun); if (make_a_loop != 2) make_loop(bddm, qh->li1, qh->li2); else { #ifdef _AUTOMATON_HASHED_IN_PRODUCT_ (void) bdd_apply2_hashed (a1->bddm, a1->q[qh->li1], a2->bddm, a2->q[qh->li2], bddm, &prod_term_fn); #else (void) bdd_apply2_sequential (a1->bddm, a1->q[qh->li1], a2->bddm, a2->q[qh->li2], bddm, &prod_term_fn); #endif } qh = qh->next; } b = dfaMakeNoBddm(last_state); /* Return the result */ b->s = 0; /* Always first on list */ b->bddm = bddm; for (i=0, root_ptr = bdd_roots(bddm); i < last_state; root_ptr++, i++) { list qnxt; b->q[i] = *root_ptr; b->f[i] = ((a1->f[qst->li1] != 0) && (a2->f[qst->li2] != 0)) ? /* both states are non-bottom, use "binfun" */ BOOL_TO_STATUS(binfun[STATUS_TO_BOOL(a1->f[qst->li1])*2 + STATUS_TO_BOOL(a2->f[qst->li2])]) : /* at least one is bottom */ 0; qnxt = qst->next; mem_free(qst); /* Free the list */ qst = qnxt; } free_hash_tab(htbl); bdd_update_statistics(bddm, (unsigned) PRODUCT); bdd_kill_cache(b->bddm); return(b); } mona-1.4/DFA/project.c0000644000414100000240000001704210756504320011431 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "dfa.h" #include "../BDD/hash.h" #include "../Mem/mem.h" static bdd_manager *bddm_res; #define SET_BDD_NOT_CALCULATED (unsigned)-1 struct set { int size; int *elements; unsigned sq; /* bddm->SEQUENTIAL_LIST(roots)[sq] is the BDD node of the subset state; if equal SET_BDD_NOT_CALCULATED then not calculated yet */ int decomp1, decomp2; /* union these to get this set */ int permanent; /* state in final automata, -1 = none */ }; static int n_ssets; static struct set *ssets; static int next_sset; static hash_tab htbl_set; void init_ssets(int sz) { n_ssets = sz; ssets = mem_alloc((sizeof *ssets) * sz); next_sset = 0; } int make_sset(int sz, int *elem, unsigned sq, int d1, int d2) { if (next_sset == n_ssets) { struct set *new_ssets = mem_alloc((sizeof *ssets) * n_ssets * 2); mem_copy(new_ssets, ssets, (sizeof *new_ssets) * n_ssets); mem_free(ssets); ssets = new_ssets; n_ssets *= 2; } ssets[next_sset].size = sz; ssets[next_sset].elements = elem; ssets[next_sset].sq = sq; ssets[next_sset].decomp1 = d1; ssets[next_sset].decomp2 = d2; ssets[next_sset].permanent = -1; insert_in_hash_tab(htbl_set, (long)elem, 0, (void *)(next_sset+1)); /* htbl maps to ++id, since 0 = not_found */ return(next_sset++); } struct sslist_ { int sset_id; struct sslist_ *next; }; typedef struct sslist_ *sslist; sslist new_sslist(int si, sslist nxt) { sslist sl = mem_alloc(sizeof *sl); sl->sset_id = si; sl->next = nxt; return(sl); } /* These global because used in proj_term. */ static sslist lst, lh, lt; /* Fn to create pairs */ unsigned proj_term1(unsigned state1, unsigned state2) { int res; int *s; int size; if (state1 == state2) { size = 1; s = mem_alloc((sizeof *s) * 2); s[0] = state1; s[1] = -1; } else { size = 2; s = mem_alloc((sizeof *s) * 3); if(state1size + ss2->size + 1) * (sizeof *s)); /* Union the sets */ for (e1 = ss1->elements, e2 = ss2->elements, e3 = s; (*e1 >= 0) && (*e2 >= 0);) { if (*e1 < *e2) *e3++ = *e1++; else if (*e1 == *e2) { *e3++ = *e1++; e2++; } else *e3++ = *e2++; } if(*e1 >= 0) do { *e3++ = *e1++; } while(*e1 >= 0); else if (*e2 >= 0) do { *e3++ = *e2++; } while(*e2 >= 0); *e3 = -1; /* Terminate the new set */ /* res = 0 or id+1 */ if ( (res = (int) lookup_in_hash_tab(htbl_set, (long) s, 0)) ) { mem_free(s); /* it was already there */ return (--res); } else { res = make_sset((e3-s), s, SET_BDD_NOT_CALCULATED, set_index1, set_index2); return (res); } } static int next_state; /* Fn to insert leaves and return permanent "q" */ bdd_ptr proj_term3(unsigned p) { if(ssets[p].permanent < 0) { lt->next = new_sslist(p, 0); /* Put in queue */ lt = lt->next; ssets[p].permanent = next_state++; } return (ssets[p].permanent); } unsigned eval_bdd(int ss) { unsigned root1, root2; if (ssets[ss].sq == SET_BDD_NOT_CALCULATED) { root1 = eval_bdd(ssets[ss].decomp1); root2 = eval_bdd(ssets[ss].decomp2); (void) bdd_apply2_hashed(bddm_res, bdd_roots(bddm_res)[root1], bddm_res, bdd_roots(bddm_res)[root2], bddm_res, &proj_term2); ssets[ss].sq = bdd_roots_length(bddm_res) - 1; } return(ssets[ss].sq); } DFA *dfaProject(DFA *a, unsigned var_index) { int i,*e; DFA *res; sslist lnxt; unsigned size_estimate = 2 * bdd_size(a->bddm); bddm_res = bdd_new_manager(size_estimate, size_estimate/8 + 2); bdd_make_cache(bddm_res, size_estimate, size_estimate/8 + 2); bddm_res->cache_erase_on_doubling = TRUE; init_ssets(a->ns * 2); htbl_set = new_hash_tab(hashlong, eqlong); next_state = 0; for(i = 0; i < a->ns; i++) { /* Allocate singletons, ssets[i] = {i} */ int *s = mem_alloc(2 * (sizeof *s)); s[0] = i; s[1] = -1; make_sset(1, s, SET_BDD_NOT_CALCULATED, -1, -1); } for (i = 0; i < a->ns; i++) { /* Update bdd's */ (void) bdd_project(a->bddm, a->q[i], var_index, bddm_res, &proj_term1); ssets[i].sq = bdd_roots_length(bddm_res) - 1; /* bdd_roots_length(bddm_res) - 1 == i */ /* bdd_roots(bddm_res)[ssets[i].sq] now contains place where a node index is to be found*/ } /* Create a list of reachable sets. */ lst = lh = lt = new_sslist(a->s, 0); /* start singleton */ ssets[a->s].permanent = next_state++; /* Should be 0 */ { unsigned root_place; bdd_manager *bddm_res_ = bdd_new_manager(size_estimate, size_estimate / 8 + 2); bdd_make_cache(bddm_res_, size_estimate, size_estimate /8 + 2); bdd_kill_cache(bddm_res); bdd_make_cache(bddm_res, size_estimate, size_estimate/8 + 2); bddm_res->cache_erase_on_doubling = TRUE; bdd_prepare_apply1(bddm_res); while (lh) { root_place = eval_bdd(lh->sset_id); /* Insert leaves */ (void) bdd_apply1(bddm_res, bdd_roots(bddm_res)[root_place], bddm_res_, &proj_term3); /*evaluate bdd_roots(bddm_res) at each iteration since bdd_apply1 is called*/ lh = lh -> next; } { unsigned *new_roots; res = dfaMakeNoBddm(next_state); res->bddm = bddm_res_; new_roots = bdd_roots(bddm_res_); for (i = 0; i < next_state; i++) { /* Walk through list */ int non_bottom_found = 0; int plus_one_found = 0; res->q[i] = new_roots[i]; for (e = ssets[lst->sset_id].elements; *e >= 0; e++) { non_bottom_found += (a->f[*e] != 0); plus_one_found += (a->f[*e] == 1); } if (!non_bottom_found) res->f[i] = 0; else if (plus_one_found) res->f[i] = 1; else res->f[i] = -1; res->s = ssets[a->s].permanent; /* Move to out of loop */ lnxt = lst -> next; mem_free(lst); /* Free the list */ lst = lnxt; } for(i = 0; i < next_sset; i++) mem_free(ssets[i].elements); mem_free(ssets); free_hash_tab(htbl_set); bdd_update_statistics(bddm_res, (unsigned)PROJECT); bdd_update_statistics(bddm_res_, (unsigned)PROJECT); bdd_kill_manager(bddm_res); return(res); } } } mona-1.4/DFA/quotient.c0000644000414100000240000001142610756504320011633 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "dfa.h" #include "../BDD/hash.h" #include "../Mem/mem.h" struct slist_ { int state; struct slist_ *next; }; typedef struct slist_ *slist; struct state_inf_fwd_ { int is_final; int go_1,go_2; }; typedef struct state_inf_fwd_ state_inf_fwd; struct graph_ { int *stack; int top; slist *V; int *F; }; typedef struct graph_ graph; graph *new_graph(int sz) { int i; graph *G=mem_alloc(sizeof(graph)); G->stack = mem_alloc((sizeof *(G->stack)) * sz); G->top=0; G->V = mem_alloc((sizeof *(G->V)) * sz); G->F = mem_alloc((sizeof *(G->F)) * sz); for (i=0;iV[i] = NULL; G->F[i]= 0; } return G; } void reset_finals(graph *G, int sz) { int i; G->top=0; for (i=0;iF[i] = 0; } slist new_state(int state, slist nxt) { slist l = mem_alloc(sizeof *l); l->state = state; l->next = nxt; return(l); } void insert_edge(graph *G, int from, int to) { (G->V)[from] = new_state(to, (G->V)[from]); } void final_add(graph *G, int i) { if (!G->F[i]) { G->stack[G->top] = i; G->top++; G->F[i]=1; } } int pick_final(graph *G) { if (G->top) { G->top--; return G->stack[G->top]; } else return -1; } graph *revert(state_inf_fwd *R, int size) { int i; graph *G=new_graph(size); for(i=0; itop=0; for (i=0;iF[i] = 0; for(i=0; iV[v]; while (sl) { final_add(G,sl->state); sl = sl->next; } } } int read00(bdd_manager *bddm, bdd_ptr p, unsigned var_index, int choice) { if (bdd_is_leaf(bddm, p)) { return bdd_leaf_value(bddm, p); } else { if (bdd_ifindex(bddm,p)==var_index) { if (choice) return (read00(bddm, bdd_then(bddm,p), var_index, choice)); else return (read00(bddm, bdd_else(bddm,p), var_index, choice)); } else return (read00(bddm, bdd_else(bddm,p), var_index, choice)); } } /* void print_G(graph *G, int sz) { slist sl; int i; for (i=0; iV[i]; while (sl) { printf("%i ",sl->state); sl = sl->next; } if (G->F[i]) printf("\nis final"); } } void print_R(state_inf_fwd *R, int sz) { int i; for (i=0; iV[i]; while ((sold=snxt)) { snxt = sold->next; mem_free(sold); } } mem_free(G->V); mem_free(G->F); mem_free(G->stack); mem_free(G); } void dfaRightQuotient(DFA *a, unsigned var_index) { graph *G; int i; state_inf_fwd *R = mem_alloc(sizeof(*R)*(a->ns)); int *f = mem_alloc(sizeof(*f)*(a->ns)); for (i=0; ins; i++) { R[i].go_1 = read00(a->bddm, a->q[i], var_index, 0); R[i].go_2 = read00(a->bddm, a->q[i], var_index, 1); R[i].is_final = (a->f[i] == 1)? 1 : 0; }; /* find states from which some string of 00..00X00..00 letters can reach a +1 state; put result in f */ G = revert(R, a->ns); make_finals(G, R, a->ns); color(G); for(i=0;ins;i++) f[i] = (G->F[i]? 1 : 0); /* find states from which some string of 00..00X00..00 letters can reach a -1 state */ for (i=0; ins; i++) R[i].is_final = (a->f[i] == -1)? 1 : 0; make_finals(G, R, a->ns); color(G); /* now a state is +1 if some path along 00..00x00..00 letters takes it to an original +1 state; otherwise, the state is -1 if some such path takes it to an original -1 state: */ for(i=0;ins;i++) { a->f[i] = (f[i]? 1 : (G->F[i]? -1 : 0)); } free_G(G, a->ns); mem_free(f); mem_free(R); } mona-1.4/GTA/0000777000414100000240000000000011045777451007731 500000000000000mona-1.4/GTA/gta.h0000644000414100000240000002012410764207701010561 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* See the 'MONA User Manual' for documentation */ #ifndef __GTA_H #define __GTA_H #include "bdd.h" /* Guided Tree Automaton */ typedef unsigned State; /* automaton state */ typedef unsigned SsId; /* state space id */ typedef enum { gtaSSUNIVHAT, gtaSSORHAT, gtaSSORLEAF, gtaSSAND, gtaSSDUMMY } SsKind; /* state space kind */ typedef struct { unsigned numSs; /* number of state spaces */ SsId *muLeft; /* array of left successors */ SsId *muRight; /* array of right successors */ SsId **hitsLeft; /* [i]: array of s.s. that have i as left suc.*/ unsigned *numHitsLeft; /* [i]: size of hitsLeft[i] */ SsId **hitsRight; /* [i]: array of s.s. that have i as right suc. */ unsigned *numHitsRight; /* [i]: size of hitsRight[i] */ char **ssName; /* [i]: name of state space i */ int *ssUniv; /* [i]: universe of state space i, -1:none, -2:hat */ char *ssUnivRoot; /* [i]: non-zero if s.s. i is root of a universe */ int *ssType; /* [i]: tree type of s.s. i, -1 if not type root */ SsKind *ssKind; /* [i]: kind of s.s. i, 0 if not using types */ char **univName; /* [i]: name of universe i */ char **univPos; /* [i]: pos ('0'/'1' string) of universe i */ SsId **univSS; /* [i]: state spaces for universe i */ unsigned *numUnivSS; /* [i]: size of univSS[i] */ unsigned numUnivs; /* number of universes */ } Guide; extern Guide guide; /* common global guide is declared in the front end */ typedef struct { State initial; /* initial state */ unsigned size; /* number of states */ unsigned ls, rs; /* dimensions of behaviour matrix incl. unused */ bdd_handle *behaviour; /* behaviour[i*rs+j]: BDD ptr for state pair (i,j) */ bdd_manager *bddm; /* BDD manager */ } StateSpace; typedef struct { int *final; /* final-status vector, -1:reject, 0:don't care, +1:accept */ StateSpace *ss; /* array of state spaces */ } GTA; /* misc. */ typedef enum { gtaIMPL = 11, gtaBIIMPL = 9, gtaAND = 8, gtaOR = 14 } gtaProductType; typedef char *SSSet; /* set of state-spaces, bitvector of size guide.numSs */ /* macro for indexing into behaviour matrix */ #define BEH(ss, i, j) ss.behaviour[(i)*ss.rs+(j)] /* tree for examples and counter-examples */ typedef struct Tree { SsId d; /* state space for tree node */ SsId state; /* state reachable by tree */ bdd_manager *bddm; /* the manager into which behavior_handle points */ bdd_handle behavior_handle; /* BDD handle of behavior of state */ int depth; int size; boolean empty; /* if tree is empty, then left, right makes no sense */ struct Tree *left, *right; /* left and right succesors (when not "empty") */ struct Tree *next; /* all trees allocated are linked through "next" */ } Tree; /* recursive type */ typedef struct gtaType { char *name; /* name of type */ int numVariants; /* number of variants */ char **variantName; /* [i]: name of variant i */ char **variantPos; /* [i]: position of variant i */ int *numComponents; /* [i]: number of components in variant i */ char ***componentName; /* [i][j]: name of comp. j in var. i */ char ***componentPos; /* [i][j]: position of comp. j in var. i */ int **componentType; /* [i][j]: type number of comp. j in var. i */ char ***ct; /* type names - only used during setup */ } gtaType; extern gtaType *treetypes; /* array of tree types (0 if no types) */ extern int num_types; /* number of types */ extern int gta_in_mem; /* number of automata currently in memory */ extern int max_gta_in_mem; /* maximum_number of automata in memory */ /* functions */ /* gta.c */ void makeGuide(unsigned numSs, SsId muLeft[], SsId muRight[], char *ssName[], unsigned numUnivs, char *univPos[], char *univName[], int ssType[], SsKind *ssKind); void makeDefaultGuide(unsigned numUnivs, char *univName[]); void freeGuide(); void printGuide(); int hasMember(SSSet ss, SsId s); int checkAllCovered(); /* check guide covered by universes */ int checkDisjoint(); /* check each s.s. associated to max one universe */ int checkAllUsed(); /* check all state spaces used */ GTA *gtaMake(); void gtaFree(GTA* a); /* external.c */ int gtaExport(GTA *a, char *filename, int num, char *names[], char orders[], SSSet *statespaces, int opt_inhacc); GTA *gtaImport(char *filename, char ***names, int **orders, SSSet **ss, int set_guideandtypes); /* set or check guide and types */ /* printgta.c */ void gtaPrintVerbose(GTA *a); void gtaPrint(GTA *a, unsigned indices[], unsigned num, char *names[], int inherited_acceptance); /* analyze inh. acc. if true */ void gtaPrintVitals(GTA *a); void gtaPrintTotalSize(GTA *a); /* analyze.c */ void gtaAnalyze(GTA *a, unsigned num, char *names[], unsigned indices[], int opt_gs, int opt_gc); Tree *gtaMakeExample(GTA *a, int kind); void gtaFreeTrees(); /* types.c */ void initTreetypes(int num); int initTreetype(char *name, int numVariants); void initTreetypeVariant(char *name, int numComponents); void setTreetypeComponent(char *name, char *type); void setVariantPos(int type, int var, char *pos); void setComponentPos(int type, int var, int comp, char *pos); void setComponentTypes(); void freeTreetypes(); void gtaTypeAnalyze(GTA *a, unsigned num, char *names[], char orders[], unsigned indices[], int *univs[], int trees[]); /* replace_indices.c */ void gtaReplaceIndices(GTA *a, unsigned map[]); /* copy.c */ GTA *gtaCopy(GTA *a); /* negation.c */ void gtaNegation(GTA *a); /* product.c */ GTA *gtaProduct(GTA *a1, GTA *a2, gtaProductType mode); /* project.c */ GTA *gtaQuotientAndProject(GTA *a, unsigned index, int quotient); /* minimize.c */ GTA *gtaMinimize(GTA *a); /* reachable.c */ GTA *gtaReachable(GTA *a); /* restrict.c */ void gtaRestrict(GTA *a); void gtaUnrestrict(GTA *a); /* analyze_acceptance.c */ boolean ***gtaCalcInheritedAcceptance(GTA *a); void gtaFreeInheritedAcceptance(boolean ***ia); /* makebasic.c */ void gtaSetup(unsigned rootsize); void gtaSetupDelta(SsId d, unsigned lsize, unsigned rsize, int indices[], unsigned num); void gtaAllocExceptions(SsId l, SsId r, unsigned n); void gtaStoreException(unsigned s, char *path); void gtaStoreDefault(unsigned s); void gtaBuildDelta(State initial); GTA *gtaBuild(char statuses[]); /* basic.c */ GTA *gtaEq1(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaEq2(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaTrue(); GTA *gtaFalse(); GTA *gtaSingleton(int i, SSSet s_i); GTA *gtaIn(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaFirstOrder(int i, SSSet s_i); GTA *gtaAllPos(int i, SSSet s_i); GTA *gtaDot1(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaDot0(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaUp(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaEmpty(int i, SSSet s_i); GTA *gtaSub(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaRoot(int i, SSSet s_i, SSSet s_); GTA *gtaLess(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaLesseq(int i, int j, SSSet s_i, SSSet s_j); GTA *gtaBoolvar(int alpha); GTA *gtaBoolvar2(int alpha); GTA *gtaUnion(int i, int j, int k, SSSet s_i, SSSet s_j, SSSet s_k); GTA *gtaInter(int i, int j, int k, SSSet s_i, SSSet s_j, SSSet s_k); GTA *gtaSetminus(int i, int j, int k, SSSet s_i, SSSet s_j, SSSet s_k); GTA *gtaInStateSpace(int i, SSSet s_s, SSSet s_i); GTA *gtaWellFormedTree(int i, SSSet s_i); GTA *gtaSomeType(int i, SSSet s_i); #endif mona-1.4/GTA/makefile.am0000644000414100000240000000105010764207701011726 00000000000000MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonagta.la libmonagta_la_SOURCES = analyze.c analyze_acceptance.c basic.c copy.c dyn.c \ dyn.h external.c gta.c makebasic.c minimize.c negation.c pairhash.c \ pairhash.h printgta.c product.c project.c projset.c projset.h \ reachable.c replace_indices.c restrict.c subsets.c subsets.h types.c libmonagta_la_CPPFLAGS = -I ../BDD libmonagta_la_LDFLAGS = -version-info 1:4 libmonagta_la_LIBADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la monadir = $(includedir)/mona mona_HEADERS = gta.h mona-1.4/GTA/makefile.in0000644000414100000240000011212211045777401011744 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = GTA DIST_COMMON = $(mona_HEADERS) $(srcdir)/makefile.am \ $(srcdir)/makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libmonagta_la_DEPENDENCIES = ../Mem/libmonamem.la ../BDD/libmonabdd.la am_libmonagta_la_OBJECTS = libmonagta_la-analyze.lo \ libmonagta_la-analyze_acceptance.lo libmonagta_la-basic.lo \ libmonagta_la-copy.lo libmonagta_la-dyn.lo \ libmonagta_la-external.lo libmonagta_la-gta.lo \ libmonagta_la-makebasic.lo libmonagta_la-minimize.lo \ libmonagta_la-negation.lo libmonagta_la-pairhash.lo \ libmonagta_la-printgta.lo libmonagta_la-product.lo \ libmonagta_la-project.lo libmonagta_la-projset.lo \ libmonagta_la-reachable.lo libmonagta_la-replace_indices.lo \ libmonagta_la-restrict.lo libmonagta_la-subsets.lo \ libmonagta_la-types.lo libmonagta_la_OBJECTS = $(am_libmonagta_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmonagta_la_SOURCES) DIST_SOURCES = $(libmonagta_la_SOURCES) monaHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(mona_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile lib_LTLIBRARIES = libmonagta.la libmonagta_la_SOURCES = analyze.c analyze_acceptance.c basic.c copy.c dyn.c \ dyn.h external.c gta.c makebasic.c minimize.c negation.c pairhash.c \ pairhash.h printgta.c product.c project.c projset.c projset.h \ reachable.c replace_indices.c restrict.c subsets.c subsets.h types.c libmonagta_la_CPPFLAGS = -I ../BDD libmonagta_la_LDFLAGS = -version-info 1:4 libmonagta_la_LIBADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la monadir = $(includedir)/mona mona_HEADERS = gta.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu GTA/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu GTA/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmonagta.la: $(libmonagta_la_OBJECTS) $(libmonagta_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libmonagta_la_LDFLAGS) $(libmonagta_la_OBJECTS) $(libmonagta_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-analyze.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-analyze_acceptance.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-basic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-copy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-dyn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-external.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-gta.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-makebasic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-minimize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-negation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-pairhash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-printgta.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-product.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-project.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-projset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-reachable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-replace_indices.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-restrict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-subsets.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmonagta_la-types.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libmonagta_la-analyze.lo: analyze.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-analyze.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-analyze.Tpo" -c -o libmonagta_la-analyze.lo `test -f 'analyze.c' || echo '$(srcdir)/'`analyze.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-analyze.Tpo" "$(DEPDIR)/libmonagta_la-analyze.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-analyze.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='analyze.c' object='libmonagta_la-analyze.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-analyze.lo `test -f 'analyze.c' || echo '$(srcdir)/'`analyze.c libmonagta_la-analyze_acceptance.lo: analyze_acceptance.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-analyze_acceptance.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-analyze_acceptance.Tpo" -c -o libmonagta_la-analyze_acceptance.lo `test -f 'analyze_acceptance.c' || echo '$(srcdir)/'`analyze_acceptance.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-analyze_acceptance.Tpo" "$(DEPDIR)/libmonagta_la-analyze_acceptance.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-analyze_acceptance.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='analyze_acceptance.c' object='libmonagta_la-analyze_acceptance.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-analyze_acceptance.lo `test -f 'analyze_acceptance.c' || echo '$(srcdir)/'`analyze_acceptance.c libmonagta_la-basic.lo: basic.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-basic.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-basic.Tpo" -c -o libmonagta_la-basic.lo `test -f 'basic.c' || echo '$(srcdir)/'`basic.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-basic.Tpo" "$(DEPDIR)/libmonagta_la-basic.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-basic.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='basic.c' object='libmonagta_la-basic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-basic.lo `test -f 'basic.c' || echo '$(srcdir)/'`basic.c libmonagta_la-copy.lo: copy.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-copy.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-copy.Tpo" -c -o libmonagta_la-copy.lo `test -f 'copy.c' || echo '$(srcdir)/'`copy.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-copy.Tpo" "$(DEPDIR)/libmonagta_la-copy.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-copy.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='copy.c' object='libmonagta_la-copy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-copy.lo `test -f 'copy.c' || echo '$(srcdir)/'`copy.c libmonagta_la-dyn.lo: dyn.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-dyn.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-dyn.Tpo" -c -o libmonagta_la-dyn.lo `test -f 'dyn.c' || echo '$(srcdir)/'`dyn.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-dyn.Tpo" "$(DEPDIR)/libmonagta_la-dyn.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-dyn.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dyn.c' object='libmonagta_la-dyn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-dyn.lo `test -f 'dyn.c' || echo '$(srcdir)/'`dyn.c libmonagta_la-external.lo: external.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-external.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-external.Tpo" -c -o libmonagta_la-external.lo `test -f 'external.c' || echo '$(srcdir)/'`external.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-external.Tpo" "$(DEPDIR)/libmonagta_la-external.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-external.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='external.c' object='libmonagta_la-external.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-external.lo `test -f 'external.c' || echo '$(srcdir)/'`external.c libmonagta_la-gta.lo: gta.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-gta.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-gta.Tpo" -c -o libmonagta_la-gta.lo `test -f 'gta.c' || echo '$(srcdir)/'`gta.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-gta.Tpo" "$(DEPDIR)/libmonagta_la-gta.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-gta.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gta.c' object='libmonagta_la-gta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-gta.lo `test -f 'gta.c' || echo '$(srcdir)/'`gta.c libmonagta_la-makebasic.lo: makebasic.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-makebasic.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-makebasic.Tpo" -c -o libmonagta_la-makebasic.lo `test -f 'makebasic.c' || echo '$(srcdir)/'`makebasic.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-makebasic.Tpo" "$(DEPDIR)/libmonagta_la-makebasic.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-makebasic.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='makebasic.c' object='libmonagta_la-makebasic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-makebasic.lo `test -f 'makebasic.c' || echo '$(srcdir)/'`makebasic.c libmonagta_la-minimize.lo: minimize.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-minimize.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-minimize.Tpo" -c -o libmonagta_la-minimize.lo `test -f 'minimize.c' || echo '$(srcdir)/'`minimize.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-minimize.Tpo" "$(DEPDIR)/libmonagta_la-minimize.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-minimize.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minimize.c' object='libmonagta_la-minimize.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-minimize.lo `test -f 'minimize.c' || echo '$(srcdir)/'`minimize.c libmonagta_la-negation.lo: negation.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-negation.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-negation.Tpo" -c -o libmonagta_la-negation.lo `test -f 'negation.c' || echo '$(srcdir)/'`negation.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-negation.Tpo" "$(DEPDIR)/libmonagta_la-negation.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-negation.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='negation.c' object='libmonagta_la-negation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-negation.lo `test -f 'negation.c' || echo '$(srcdir)/'`negation.c libmonagta_la-pairhash.lo: pairhash.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-pairhash.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-pairhash.Tpo" -c -o libmonagta_la-pairhash.lo `test -f 'pairhash.c' || echo '$(srcdir)/'`pairhash.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-pairhash.Tpo" "$(DEPDIR)/libmonagta_la-pairhash.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-pairhash.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pairhash.c' object='libmonagta_la-pairhash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-pairhash.lo `test -f 'pairhash.c' || echo '$(srcdir)/'`pairhash.c libmonagta_la-printgta.lo: printgta.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-printgta.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-printgta.Tpo" -c -o libmonagta_la-printgta.lo `test -f 'printgta.c' || echo '$(srcdir)/'`printgta.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-printgta.Tpo" "$(DEPDIR)/libmonagta_la-printgta.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-printgta.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printgta.c' object='libmonagta_la-printgta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-printgta.lo `test -f 'printgta.c' || echo '$(srcdir)/'`printgta.c libmonagta_la-product.lo: product.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-product.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-product.Tpo" -c -o libmonagta_la-product.lo `test -f 'product.c' || echo '$(srcdir)/'`product.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-product.Tpo" "$(DEPDIR)/libmonagta_la-product.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-product.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='product.c' object='libmonagta_la-product.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-product.lo `test -f 'product.c' || echo '$(srcdir)/'`product.c libmonagta_la-project.lo: project.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-project.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-project.Tpo" -c -o libmonagta_la-project.lo `test -f 'project.c' || echo '$(srcdir)/'`project.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-project.Tpo" "$(DEPDIR)/libmonagta_la-project.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-project.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='project.c' object='libmonagta_la-project.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-project.lo `test -f 'project.c' || echo '$(srcdir)/'`project.c libmonagta_la-projset.lo: projset.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-projset.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-projset.Tpo" -c -o libmonagta_la-projset.lo `test -f 'projset.c' || echo '$(srcdir)/'`projset.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-projset.Tpo" "$(DEPDIR)/libmonagta_la-projset.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-projset.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='projset.c' object='libmonagta_la-projset.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-projset.lo `test -f 'projset.c' || echo '$(srcdir)/'`projset.c libmonagta_la-reachable.lo: reachable.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-reachable.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-reachable.Tpo" -c -o libmonagta_la-reachable.lo `test -f 'reachable.c' || echo '$(srcdir)/'`reachable.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-reachable.Tpo" "$(DEPDIR)/libmonagta_la-reachable.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-reachable.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reachable.c' object='libmonagta_la-reachable.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-reachable.lo `test -f 'reachable.c' || echo '$(srcdir)/'`reachable.c libmonagta_la-replace_indices.lo: replace_indices.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-replace_indices.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-replace_indices.Tpo" -c -o libmonagta_la-replace_indices.lo `test -f 'replace_indices.c' || echo '$(srcdir)/'`replace_indices.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-replace_indices.Tpo" "$(DEPDIR)/libmonagta_la-replace_indices.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-replace_indices.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='replace_indices.c' object='libmonagta_la-replace_indices.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-replace_indices.lo `test -f 'replace_indices.c' || echo '$(srcdir)/'`replace_indices.c libmonagta_la-restrict.lo: restrict.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-restrict.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-restrict.Tpo" -c -o libmonagta_la-restrict.lo `test -f 'restrict.c' || echo '$(srcdir)/'`restrict.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-restrict.Tpo" "$(DEPDIR)/libmonagta_la-restrict.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-restrict.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='restrict.c' object='libmonagta_la-restrict.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-restrict.lo `test -f 'restrict.c' || echo '$(srcdir)/'`restrict.c libmonagta_la-subsets.lo: subsets.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-subsets.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-subsets.Tpo" -c -o libmonagta_la-subsets.lo `test -f 'subsets.c' || echo '$(srcdir)/'`subsets.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-subsets.Tpo" "$(DEPDIR)/libmonagta_la-subsets.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-subsets.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='subsets.c' object='libmonagta_la-subsets.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-subsets.lo `test -f 'subsets.c' || echo '$(srcdir)/'`subsets.c libmonagta_la-types.lo: types.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmonagta_la-types.lo -MD -MP -MF "$(DEPDIR)/libmonagta_la-types.Tpo" -c -o libmonagta_la-types.lo `test -f 'types.c' || echo '$(srcdir)/'`types.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libmonagta_la-types.Tpo" "$(DEPDIR)/libmonagta_la-types.Plo"; else rm -f "$(DEPDIR)/libmonagta_la-types.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='types.c' object='libmonagta_la-types.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmonagta_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmonagta_la-types.lo `test -f 'types.c' || echo '$(srcdir)/'`types.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-monaHEADERS: $(mona_HEADERS) @$(NORMAL_INSTALL) test -z "$(monadir)" || $(mkdir_p) "$(DESTDIR)$(monadir)" @list='$(mona_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(monaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(monadir)/$$f'"; \ $(monaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(monadir)/$$f"; \ done uninstall-monaHEADERS: @$(NORMAL_UNINSTALL) @list='$(mona_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(monadir)/$$f'"; \ rm -f "$(DESTDIR)$(monadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(monadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-monaHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-monaHEADERS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-monaHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/GTA/analyze.c0000644000414100000240000003541511015334321011442 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "../Mem/mem.h" #include "../BDD/bdd.h" #include "gta.h" /* GLOBAL VARIABLES */ static SsId *leafs_gathered; /* used to collect leafs of a BDD node */ static unsigned leafs_gathered_size; /* space allocated for array above, only needed for "invariant" */ static unsigned leafs_gathered_next; /* next available space in leafs_gathered for the description of a leaf */ static Tree *all_trees = NULL; /* list of all trees */ static GTA *gta_global; /* for invariant only */ /* DATA STRUCTURES */ Tree *make_tree_leaf(SsId d_, State p) { Tree *t = (Tree *) mem_alloc(sizeof (Tree)); t->empty = TRUE; t->d = d_; t->state = p; t->depth = 0; t->size = 0; t->next = all_trees; all_trees = t; return t; } Tree *make_tree_internal(Tree *left1, Tree *right1, SsId d_, State p, bdd_manager *bddm_, bdd_handle behavior_handle_) { Tree *t = (Tree *) mem_alloc(sizeof (Tree)); t->empty = FALSE; t->bddm = bddm_; t->behavior_handle = behavior_handle_; t->d = d_; t->state = p; t->left = left1; t->right = right1; t->depth = 1+((left1->depth>right1->depth)?left1->depth:right1->depth); t->size = 1+left1->size+right1->size; t->next = all_trees; all_trees = t; return t; } /* FUNCTIONS */ void leaf_gather_fn(unsigned val) { invariant(leafs_gathered_next < leafs_gathered_size); leafs_gathered[leafs_gathered_next++] = val; } /* calculate states (leaves) reachable from ptr; if ptr has already been involved in a states_reachable calculation, then no states are returned. Note: "*leafs" is changed to NULL or a freshly allocated array with leafs_length number of fresh leafs */ void states_reachable(StateSpace *ss, bdd_ptr ptr, unsigned **leafs, unsigned *leafs_length) { if (!bdd_mark(ss->bddm, ptr)) { leafs_gathered = (State *) mem_alloc(sizeof(State) * ss->size); leafs_gathered_size = ss->size; leafs_gathered_next = 0; bdd_call_leafs(ss->bddm, ptr, &leaf_gather_fn); *leafs = leafs_gathered; *leafs_length = leafs_gathered_next; } else { *leafs = NULL; *leafs_length = 0; } } void print_tree(Tree *t, unsigned no, unsigned *free_map) { invariant(t); if (t->empty) printf("()"); else { printf("("); print_one_path(bdd_roots(t->bddm)[t->behavior_handle], /* the BDD node */ t->state, /* the leaf (state to be reached) */ t->bddm, /* the BDD manager */ no, free_map); printf(","); print_tree(t->left,no,free_map); printf(","); print_tree(t->right,no,free_map); printf(")"); } } void print_tree_graphviz(Tree *t, unsigned no, unsigned *free_map, int num) { if (t->empty) printf(" N%dN%d [label = \"%s: -\"];\n", t->d, num, guide.ssName[t->d]); else { printf(" N%dN%d [label = \"%s: ", t->d, num, guide.ssName[t->d]); print_one_path(bdd_roots(t->bddm)[t->behavior_handle], /* the BDD node */ t->state, /* the leaf (state to be reached) */ t->bddm, /* the BDD manager */ no, free_map); printf("\"];\n"); print_tree_graphviz(t->left, no, free_map, 2*num); printf(" N%dN%d -> N%dN%d;\n", t->d, num, t->left->d, 2*num); print_tree_graphviz(t->right, no, free_map, 2*num+1); printf(" N%dN%d -> N%dN%d;\n", t->d, num, t->right->d, 2*num+1); } } /* UNPROCESSED AND MORE GLOBALS */ static State **unprocessed; /* unprocessed[d][i], i < next[d] is a state in state space d */ static unsigned *next; /* next[d]= index of next state to be inserted in unprocessed[d] */ static unsigned *done; /* done[d]= index of oldest state in d that has been processed; done[d] <= next[d] */ static void unprocessed_push(SsId d, State p) { invariant(next[d] < gta_global->ss[d].size); unprocessed[d][next[d]++] = p; } static State unprocessed_get(SsId d) { invariant(done[d] <= next[d]); return unprocessed[d][done[d]++]; } static boolean unprocessed_is_empty(SsId d) { invariant(done[d] <= next[d]); return (done[d] == next[d]); } /* UPDATE TREE */ /* see if (left, right) is a less deep alternative to res; if yes, update res. We do not in this version update further all tree records that in turn has res as a left or right descendant. If we did this recursively, an algorithm calculating a mininum (depth-wise) counter example would emerge */ void update_tree(Tree *res, Tree *left, Tree *right, SsId d, State p, bdd_manager *bddm, bdd_handle behavior_handle) { unsigned l_d = left->depth + 1; unsigned r_d = right->depth + 1; if ((l_d < res->depth) && (r_d < res->depth)) { res->depth = (l_d < r_d)? r_d : l_d; res->state = p; res->left = left; res->right = right; res->bddm = bddm; res->d = d; res->behavior_handle = behavior_handle; } } /* CALCULATE EXAMPLES */ Tree *gtaMakeExample(GTA *gta, int status) { Tree ***sample_tree; /* sample_tree[d][p] is a pointer to a tree that brings the automaton in state p */ SsId d; State p; sample_tree = (Tree ***) mem_alloc(sizeof(Tree**) * guide.numSs); gta_global = gta; /* for invariant purposes */ unprocessed = (State **) mem_alloc(sizeof(State *) * guide.numSs); next = (unsigned *) mem_alloc(sizeof (unsigned) * guide.numSs); done = (unsigned *) mem_alloc(sizeof (unsigned) * guide.numSs); /* initialize sample_tree so that sample_tree[d][p] is the empty tree for initial states of state spaces in universes and null otherwise */ for (d = 0; d < guide.numSs; d++) { next[d] = 0; done[d] = 0; unprocessed[d] = (State *) mem_alloc(sizeof (State) * gta->ss[d].size); sample_tree[d] = (Tree **) mem_alloc(sizeof (Tree *) * gta->ss[d].size); for (p=0; p < gta->ss[d].size; p++) if (p == gta->ss[d].initial && guide.ssUniv[d] >= 0) { /* p is initial and not in the hat of the universe embedding into the infinite binary tree */ sample_tree[d][p] = make_tree_leaf(d,p); unprocessed_push(d,p); } else sample_tree[d][p] = NULL; bdd_prepare_apply1(gta->ss[d].bddm); } { SsId d_hat; State p_hat; unsigned i, j; d_hat = 0; while (d_hat < guide.numSs) if (!unprocessed_is_empty(d_hat)) { p_hat = unprocessed_get(d_hat); /* regard p_hat under the left view, i.e., study all p2 in appropriate state spaces such that a transition function is defined for (p_hat, p2) */ for (j=0; j < guide.numHitsLeft[d_hat]; j++) { SsId d = guide.hitsLeft[d_hat][j]; SsId d2; State p2; StateSpace *ss_ptr = >a->ss[d]; d2 = guide.muRight[d]; for (p2 = 0; p2 < gta->ss[d2].size; p2++) if (sample_tree[d2][p2] != NULL) { bdd_handle behavior_handle = ss_ptr->behaviour[p_hat * ss_ptr->rs + p2]; State *new_states; unsigned new_states_size; states_reachable(ss_ptr, BDD_ROOT(ss_ptr->bddm, behavior_handle), &new_states, &new_states_size); for (i = 0; i < new_states_size; i++) { State new_state = new_states[i]; /* have we gotten a new tree? */ if (sample_tree[d][new_state] == NULL) { sample_tree[d][new_state] = make_tree_internal(sample_tree[d_hat][p_hat], sample_tree[d2][p2], d, new_state, ss_ptr->bddm, behavior_handle); unprocessed_push(d, new_state); } else update_tree(sample_tree[d][new_state], sample_tree[d_hat][p_hat], sample_tree[d2][p2], d, new_state, ss_ptr->bddm, behavior_handle); } if (new_states != NULL) mem_free(new_states); } } /* now regard p_hat under the right view */ for (j=0; j < guide.numHitsRight[d_hat]; j++) { SsId d = guide.hitsRight[d_hat][j]; SsId d1; State p1; StateSpace *ss_ptr = >a->ss[d]; d1 = guide.muLeft[d]; for (p1 = 0; p1 < gta->ss[d1].size; p1++) if (sample_tree[d1][p1] != NULL) { bdd_handle behavior_handle = ss_ptr->behaviour[p1 * ss_ptr->rs + p_hat]; State *new_states; unsigned new_states_size; states_reachable(ss_ptr, BDD_ROOT(ss_ptr->bddm,behavior_handle), &new_states, &new_states_size); for (i = 0; i < new_states_size; i++) { State new_state = new_states[i]; if (sample_tree[d][new_state] == NULL) { sample_tree[d][new_state] = make_tree_internal(sample_tree[d1][p1], sample_tree[d_hat][p_hat], d, new_state, ss_ptr->bddm, behavior_handle); unprocessed_push(d, new_state); } else update_tree(sample_tree[d][new_state], sample_tree[d1][p1], sample_tree[d_hat][p_hat], d, new_state, ss_ptr->bddm, behavior_handle); } if (new_states != NULL) mem_free(new_states); } } d_hat = 0; /* we try the lowest numbered state space first */ } else /* d_hat seems to be done */ d_hat++; /* while loop ends here */ } /* look for a final state or non-final state reached, as determined by the status, (not every such state is interesting, only one that is actually reachable by a tree that fully contains the hat, i.e., one described by sample_tree */ { State p = 0; Tree *result = NULL; p = 0; while (p < gta->ss[0].size) { /* since only trees reachable from outside the hat are mentioned, there may be states in the root state space that have NULL entries---so check */ if (sample_tree[0][p] != NULL) { if (gta->final[p] == status ) { result = sample_tree[0][p]; break; } } p++; } /* remove table sample_tree */ for (d=0; d < guide.numSs; d++) { if (sample_tree[d] != NULL) mem_free(sample_tree[d]); else printf("internal error\n"); }; mem_free(sample_tree); /* the trees themselves must be deleted later */ for (d = 0; d < guide.numSs; d++) { mem_free(unprocessed[d]); } mem_free(unprocessed); mem_free(next); mem_free(done); return result; } } void print_universes(Tree *example, int no_of_free, unsigned *free_map) { if (guide.ssUniv[example->d] >= 0) { printf("Universe %s:\n", guide.univName[guide.ssUniv[example->d]]); print_tree(example, no_of_free, free_map); printf("\n"); } else { print_universes(example->left, no_of_free, free_map); print_universes(example->right, no_of_free, free_map); } } void print_universes_graphviz(Tree *example, int no_of_free, unsigned *free_map) { if (guide.ssUniv[example->d] >= 0) { print_tree_graphviz(example, no_of_free, free_map, 1); printf(" node [label = \"%s\"]; N%d;\n" " N%d -> N%dN1 [style = dotted];\n", guide.univName[guide.ssUniv[example->d]], example->d, example->d, example->d); printf(" L -> N%d [style = invis];\n", example->d); } else { print_universes_graphviz(example->left, no_of_free, free_map); print_universes_graphviz(example->right, no_of_free, free_map); } } void print_example_graphviz(Tree *example, int no_of_free, char **free_var_names, unsigned *free_map, char *title, char *empty) { int i; printf("digraph MONA_TREE {\n" " center = true;\n" " size = \"7.5,10.5\";\n" " node [shape = plaintext, fontname = Courier];\n"); if (example) { printf(" node [label = \"%s\\n\\nFree variables are: ", title); for (i = 0; i < no_of_free; i++) printf("%s%s", free_var_names[i], (i == no_of_free -1 ? "": ", ")); printf("\\n\\n"); printf("Booleans: "); print_one_path(BDD_ROOT(example->bddm, example->behavior_handle), example->state, example->bddm, no_of_free, free_map); printf("\"]; L;\n" " edge [dir = none];\n"); print_universes_graphviz(example, no_of_free, free_map); } else printf(" node [label = \"Formula is %s\"]; X;\n", empty); printf("}\n"); } void gtaAnalyze(GTA *gta, unsigned no_of_free, char **free_var_names, unsigned *free_map, int opt_gs, int opt_gc) { unsigned i; Tree *counterexample, *satisfyingexample; counterexample = gtaMakeExample(gta, -1); satisfyingexample = gtaMakeExample(gta, 1); if (opt_gs || opt_gc) { if (opt_gc) print_example_graphviz(counterexample, no_of_free, free_var_names, free_map, "COUNTER-EXAMPLE", "valid"); if (opt_gs) print_example_graphviz(satisfyingexample, no_of_free, free_var_names, free_map, "SATISFYING EXAMPLE", "unsatisfiable"); } else { if (!counterexample && satisfyingexample) printf("Formula is valid\n"); else if (!satisfyingexample) printf("Formula is unsatisfiable\n"); if (counterexample) { if (!satisfyingexample) printf("\n"); printf("Free variables are: "); for (i = 0; i < no_of_free; i++) printf("%s%s", free_var_names[i], (i == no_of_free -1 ? "": ", ")); printf("\n\n"); printf("A counter-example is:\n"); if (!counterexample->empty) { printf("Booleans:\n"); print_one_path(BDD_ROOT(counterexample->bddm, counterexample->behavior_handle), counterexample->state, counterexample->bddm, no_of_free, free_map); printf("\n"); } print_universes(counterexample, no_of_free, free_map); } if (satisfyingexample) { if (!counterexample) { printf("\nFree variables are: "); for (i = 0; i < no_of_free; i++) printf("%s%s", free_var_names[i], (i == no_of_free -1 ? "": ", ")); printf("\n"); } printf("\nA satisfying example is:\n"); if (!satisfyingexample->empty) { printf("Booleans:\n"); print_one_path(BDD_ROOT(satisfyingexample->bddm, satisfyingexample->behavior_handle), satisfyingexample->state, satisfyingexample->bddm, no_of_free, free_map); printf("\n"); } print_universes(satisfyingexample, no_of_free, free_map); } } gtaFreeTrees(); } void gtaFreeTrees() { Tree *tree_pointer; while (all_trees) { tree_pointer = all_trees->next; mem_free(all_trees); all_trees = tree_pointer; } all_trees = NULL; } mona-1.4/GTA/analyze_acceptance.c0000644000414100000240000002665210756504321013625 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* This package analyzes all states with respect to which kinds of final states (in state space 0) that are reachable */ #include #include "../Mem/mem.h" #include "gta.h" /* GLOBALS */ /* acceptance_statuses[d][p][s], where -1 <= s <= 1, is true if and only if there is a labeled tree that makes the GTA 1) enter a state at the root node that has status s and 2) enter the state p in a node assigned to state space d */ static boolean ***acceptance_statuses; /* touch_left[d][s] describes the set of all states s' in the left child space d' of d such that for some s'' in the right child space d'' and for some letter a, delta_d(s',s'')(a) = s */ /* touch_right is defined similarly */ static unsigned **touch_left_size, **touch_right_size; static State ***touch_left, ***touch_right; static unsigned **touch_left_index, **touch_right_index; static GTA *gta_global; /* UNPROCESSED AND MORE GLOBALS */ static State **unprocessed; /* unprocessed[d][i], i < next[d] is a state in state space d */ static unsigned *next; /* next[d]= index of next state to be inserted in unprocessed[d] */ static unsigned *done; /* done[d]= index of oldest state in d that has been processed; done[d] <= next[d] */ static void unprocessed_push(SsId d, State p) { unsigned i; invariant(next[d] <= gta_global->ss[d].size); /* the following check makes it a quadratic algorithm in the state space size, but that probably doesn't matter too much since much else is quadratic */ for (i = 0; i < next[d]; i++) if (unprocessed[d][i] == p) return; unprocessed[d][next[d]++] = p; } static State unprocessed_get(SsId d) { invariant(done[d] <= next[d]); return unprocessed[d][done[d]++]; } static boolean unprocessed_is_empty(SsId d) { invariant(done[d] <= next[d]); return (done[d] == next[d]); } SsId current_d; State current_left_state, current_right_state; void leaf_function_insert_left(unsigned leaf_value) { unsigned i = touch_left_index[current_d][leaf_value]++; touch_left[ current_d][leaf_value][i] = current_left_state; } void leaf_function_count_left(unsigned leaf_value) { invariant(touch_left_size[current_d][leaf_value] <= gta_global->ss[current_d].ls); touch_left_size[current_d][leaf_value]++; } void leaf_function_insert_right(unsigned leaf_value) { unsigned i = touch_right_index[current_d][leaf_value]++; touch_right[current_d][leaf_value][i] = current_right_state; } void leaf_function_count_right(unsigned leaf_value) { invariant(touch_right_size[current_d][leaf_value] <= gta_global->ss[current_d].rs); touch_right_size[current_d][leaf_value]++; } void calculate_touch_arrays() { SsId d; State p, p_left, p_right; touch_left_size = (unsigned **) mem_alloc((sizeof (unsigned *)) * guide.numSs); touch_right_size = (unsigned **) mem_alloc((sizeof (unsigned *)) * guide.numSs); touch_left_index = (unsigned **) mem_alloc((sizeof (unsigned *)) * guide.numSs); touch_right_index = (unsigned **) mem_alloc((sizeof (unsigned *)) * guide.numSs); touch_left = (boolean ***) mem_alloc((sizeof (boolean **))* guide.numSs); touch_right = (boolean ***) mem_alloc((sizeof (boolean **))* guide.numSs); for (d = 0; d < guide.numSs; d++) { touch_left_size[d] = (unsigned *) mem_alloc((sizeof (unsigned)) * gta_global->ss[d].size); touch_right_size[d] = (unsigned *) mem_alloc((sizeof (unsigned)) * gta_global->ss[d].size); touch_left_index [d] = (unsigned *) mem_alloc((sizeof (unsigned)) * gta_global->ss[d].size); touch_right_index [d] = (unsigned *) mem_alloc((sizeof (unsigned)) * gta_global->ss[d].size); touch_left[d] = (boolean **) mem_alloc((sizeof (boolean *)) * gta_global->ss[d].size); touch_right[d] = (boolean **) mem_alloc((sizeof (boolean *)) * gta_global->ss[d].size); for (p = 0; p < gta_global->ss[d].size; p++) { touch_left_size[d][p] = 0; touch_right_size[d][p] = 0; touch_left_index[d][p] = 0; touch_right_index[d][p] = 0; } } /* calculate sizes of the touch_left[d][p] arrays (and allocate) */ /* For each left state, we sweep the row in the transition table while visiting all leaves reachable in behaviors of the row; for each leaf p reached, we insert the left state in the touch_left[d][p] array; note that we must clear out the apply-cache each time a new role is begun. At this point in the algorithm, we are just calculating the sizes of the touch_left[d][p] arrays; the insertion proper is done in the next main loop */ for (d = 0; d < guide.numSs; d++) { for (p_left = 0; p_left < gta_global->ss[d].ls; p_left++) { bdd_prepare_apply1(gta_global->ss[d].bddm); current_d = d; current_left_state = p_left; for (p_right = 0; p_right < gta_global->ss[d].rs; p_right++) bdd_call_leafs(gta_global->ss[d].bddm, BDD_ROOT(gta_global->ss[d].bddm, BEH(gta_global->ss[d], p_left, p_right)), &leaf_function_count_left); } for (p = 0; p < gta_global->ss[d].size; p++) touch_left[d][p] = (State *) mem_alloc((sizeof (State)) * touch_left_size[d][p]); } /* same loop as above, but now insert the elements into touch_left */ for (d = 0; d < guide.numSs; d++) { for (p_left = 0; p_left < gta_global->ss[d].ls; p_left++) { bdd_prepare_apply1(gta_global->ss[d].bddm); current_d = d; current_left_state = p_left; for (p_right = 0; p_right < gta_global->ss[d].rs; p_right++) bdd_call_leafs(gta_global->ss[d].bddm, BDD_ROOT(gta_global->ss[d].bddm, BEH(gta_global->ss[d], p_left, p_right)), &leaf_function_insert_left); } } /* calculate sizes of the touch_right[d][p] arrays (and allocate) */ for (d = 0; d < guide.numSs; d++) { for (p_right = 0; p_right < gta_global->ss[d].rs; p_right++) { bdd_prepare_apply1(gta_global->ss[d].bddm); current_d = d; current_right_state = p_right; for (p_left = 0; p_left < gta_global->ss[d].ls; p_left++) bdd_call_leafs(gta_global->ss[d].bddm, BDD_ROOT(gta_global->ss[d].bddm, BEH(gta_global->ss[d], p_left, p_right)), &leaf_function_count_right); } for (p = 0; p < gta_global->ss[d].size; p++) touch_right[d][p] = (State *) mem_alloc((sizeof (State)) * touch_right_size[d][p]); } /* same loop as above, but now insert the elements into touch_right */ for (d = 0; d < guide.numSs; d++) { for (p_right = 0; p_right < gta_global->ss[d].rs; p_right++) { bdd_prepare_apply1(gta_global->ss[d].bddm); current_d = d; current_right_state = p_right; for (p_left = 0; p_left < gta_global->ss[d].ls; p_left++) bdd_call_leafs(gta_global->ss[d].bddm, BDD_ROOT(gta_global->ss[d].bddm, BEH(gta_global->ss[d], p_left, p_right)), &leaf_function_insert_right); } } } void gtaFreeInheritedAcceptance(boolean ***a) { SsId d; State p; for (d = 0; d < guide.numSs; d++) { for (p = 0; a[d][p]; p++) mem_free(a[d][p]-1); mem_free(a[d]); } mem_free(a); } boolean ***gtaCalcInheritedAcceptance(GTA *gta) { SsId d; State p; gta_global = gta; acceptance_statuses = (boolean ***) mem_alloc(sizeof (boolean **) * guide.numSs); unprocessed = (State **) mem_alloc(sizeof(State *) * guide.numSs); next = (unsigned *) mem_alloc(sizeof (unsigned) * guide.numSs); done = (unsigned *) mem_alloc(sizeof (unsigned) * guide.numSs); calculate_touch_arrays(); /* initialize acceptance_statuses to the empty set everywhere except in state space d == 0, where the accept status is included in acceptance_statuses (so that it becomes a singleton set) */ for (d = 0; d < guide.numSs; d++) { next[d] = 0; done[d] = 0; unprocessed[d] = (State *) mem_alloc(sizeof (State) * gta->ss[d].size); acceptance_statuses[d] = (boolean **) mem_alloc(sizeof (boolean *) * (gta->ss[d].size + 1)); acceptance_statuses[d][gta->ss[d].size] = 0; /* end-of-array marker */ for (p = 0; p < gta->ss[d].size; p++) { int s; acceptance_statuses[d][p] = ((boolean *) mem_alloc(sizeof (boolean) * 3)) + 1; /* "+ 1" above is a pointer-arithmetic offset so that we can index into the array using indices -1, 0, +1 */ for (s = -1; s <= 1; s++) acceptance_statuses[d][p][s] = 0; if (d == 0) { invariant(gta->final[p] <= 1 && gta->final[p] >=-1); acceptance_statuses[d][p][gta->final[p]] = 1; unprocessed_push(d,p); } } } { SsId d_hat, d_left, d_right; State p_hat, p_left, p_right; unsigned i; int s; d_hat = 0; while (d_hat < guide.numSs) if (!unprocessed_is_empty(d_hat)) { p_hat = unprocessed_get(d_hat); /* do left part */ d_left = guide.muLeft[d_hat]; for (i = 0; i < touch_left_size[d_hat][p_hat]; i++) { p_left = touch_left[d_hat][p_hat][i]; for (s = -1; s <= 1; s++) /* check to see whether s is a new possible status reachable from state p_left in state space d_left */ if (acceptance_statuses[d_hat][p_hat][s] && !acceptance_statuses[d_left][p_left][s]) { /* and if so, then mark it as such and push it onto stack */ acceptance_statuses[d_left][p_left][s] = 1; unprocessed_push(d_left, p_left); } } /* do right part */ d_right = guide.muRight[d_hat]; for (i = 0; i < touch_right_size[d_hat][p_hat]; i++) { p_right = touch_right[d_hat][p_hat][i]; for (s = -1; s <= 1; s++) /* check to see whether s is a new possible status reachable from state p_right in state space d_right */ if (acceptance_statuses[d_hat][p_hat][s] && !acceptance_statuses[d_right][p_right][s]) { /* and if so, then mark it as such and push it onto stack */ acceptance_statuses[d_right][p_right][s] = 1; unprocessed_push(d_right, p_right); } } /* done with processing p_hat */ d_hat = 0; /* we try the lowest numbered state space first */ } else /* d_hat seems to be done */ d_hat++; /* while loop ends here */ } for (d = 0; d < guide.numSs; d++) { mem_free(unprocessed[d]); } mem_free(unprocessed); mem_free(next); mem_free(done); for (d = 0; d < guide.numSs; d++) { for (p = 0; p < gta_global->ss[d].size; p++) { mem_free(touch_left[d][p]); mem_free(touch_right[d][p]); } mem_free(touch_left[d]); mem_free(touch_right[d]); mem_free(touch_left_size[d]); mem_free(touch_right_size[d]); mem_free(touch_left_index[d]); mem_free(touch_right_index[d]); } mem_free(touch_left); mem_free(touch_right); mem_free(touch_left_size); mem_free(touch_right_size); mem_free(touch_left_index); mem_free(touch_right_index); return acceptance_statuses; } mona-1.4/GTA/basic.c0000644000414100000240000014765010756504321011077 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "../Mem/mem.h" #include "gta.h" /* static SSSet copySSSet(SSSet s) { SSSet r = (SSSet) mem_alloc(guide.numSs); memcpy(r, s, guide.numSs); return r; } */ GTA *gtaIn(int P, int Q, SSSet uP, SSSet uQ) { if (P == Q) { /* this should never happen */ invariant(0); return 0; } else { int var[2], d, Ok = 0, Bad = 1, Done = 2; var[0] = P; var[1] = Q; gtaSetup(3); /* 3 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 2); /* 3 states in all state spaces */ if ((!hasMember(uP, d)) && (!hasMember(uQ, d))) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok, anything) -> OK */ } else if (hasMember(uP, d) && !hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0X"); /* (Ok, Ok, 0X) -> Ok */ gtaStoreDefault(Bad); /* (Ok, Ok, x) -> Bad, if x<>0X */ } else if (!hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } else { /* d \in uP \cap uQ */ gtaAllocExceptions(Ok, Ok, 3); gtaStoreException(Ok, "01"); gtaStoreException(Done, "11"); gtaStoreException(Ok, "00"); gtaStoreDefault(Bad); } gtaAllocExceptions(Done, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Done, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Done, Ok, 0); gtaStoreDefault(Done); gtaAllocExceptions(Ok, Done, 0); gtaStoreDefault(Done); gtaAllocExceptions(Done, Done, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); return gtaBuild("--+"); } } /* gtaFirstOrder checks that there is at least one position with a 1 in track P and that there are not two such positions that are incomparable */ GTA *gtaFirstOrder(int P, SSSet uP) { int var[1], d, Bad = 0, Notmet = 1, Met=2; /* Met in hat transition is accepting */ var[0] = P; gtaSetup(3); /* 3 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 1); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Notmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Met, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Notmet, Bad, 0); gtaStoreDefault(Bad); if (hasMember(uP, d)) { gtaAllocExceptions(Notmet,Notmet,1); gtaStoreException(Met, "1"); /* (Notmet,Notmet,H) -> Met */ gtaStoreDefault(Notmet); gtaAllocExceptions(Notmet,Met,1); gtaStoreException(Bad, "1"); /* (Notmet,Met,H) -> Bad (unique pos.) */ gtaStoreDefault(Met); gtaAllocExceptions(Met,Notmet,1); gtaStoreException(Bad, "1"); /* (Notmet,Met,H) -> Bad (unique pos.) */ gtaStoreDefault(Met); } else { gtaAllocExceptions(Notmet, Notmet, 0); gtaStoreDefault(Notmet); gtaAllocExceptions(Notmet, Met, 0); gtaStoreDefault(Met); gtaAllocExceptions(Met, Notmet, 0); gtaStoreDefault(Met); } gtaAllocExceptions(Met, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Met, 0); gtaStoreDefault(Bad); gtaBuildDelta(Notmet); } mem_free(uP); return gtaBuild("--+"); /* Met is the only accepting state */ } /* gtaLastPos accepts if and only if there is an occurrence of variable P in every leaf in every non-empty universe in uP; the condition that the universe be non-empty is derived from our use below of the state Initial;it is not possible currently to use initial states that depend on the universe, thus we are forced to accept an empty tree in a universe in uP */ GTA *gtaLastPos(int P, SSSet uP) { int var[1], d, Initial = 0, Bad = 1, Met=2; /* Met in hat transition is accepting */ var[0] = P; gtaSetup(3); /* 3 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 1); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Initial, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Initial, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Initial, 0); gtaStoreDefault(Met); gtaAllocExceptions(Initial, Met, 0); gtaStoreDefault(Met); gtaAllocExceptions(Met, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Met, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Met, 0); gtaStoreDefault(Met); if (hasMember(uP, d)) { /*check that we encounter an occurrence of an element in P */ gtaAllocExceptions(Initial,Initial,1); gtaStoreException(Met, "1"); gtaStoreDefault(Bad); } else { /* outside universes in uP, there is nothing to check, so we use the state Initial to denote that every thing is ok; even an empty tree in such a universe may be accepted, so Initial is also an accepting state */ gtaAllocExceptions(Initial,Initial, 0); gtaStoreDefault(Initial); } gtaBuildDelta(Initial); } mem_free(uP); return gtaBuild("+0+"); } /* gtaAllPos accepts if and only if there is an occurrence of variable P in every node in every universe in uP */ GTA *gtaAllPos(int P, SSSet uP) { int var[1], d, Initial = 0, Bad = 1, Met=2; var[0] = P; gtaSetup(3); /* 3 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 1); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Initial, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Initial, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Met, 0); gtaStoreDefault(Bad); if (hasMember(uP, d)) { gtaAllocExceptions(Initial,Initial,1); gtaStoreException(Met, "1"); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Met, 1); gtaStoreException(Met, "1"); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Initial, 1); gtaStoreException(Met, "1"); gtaStoreDefault(Bad); gtaAllocExceptions(Initial, Met, 1); gtaStoreException(Met, "1"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Initial,Initial, 0); gtaStoreDefault(Initial); gtaAllocExceptions(Met, Met, 0); gtaStoreDefault(Met); gtaAllocExceptions(Met, Initial, 0); gtaStoreDefault(Met); gtaAllocExceptions(Initial, Met, 0); gtaStoreDefault(Met); } gtaBuildDelta(Initial); } mem_free(uP); return gtaBuild("+0+"); } GTA *gtaEq1(int P, int Q, SSSet uP, SSSet uQ) { if (P == Q) { mem_free(uP); mem_free(uQ); return gtaTrue(); } else { int var[2], d, Ok = 0, Bad = 1, Done = 2; var[0] = P; var[1] = Q; gtaSetup(3); /* 3 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 2); /* 3 states in all state spaces */ if ((!hasMember(uP, d)) && (!hasMember(uQ, d))) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok, anything) -> OK */ } else if (hasMember(uP, d) && !hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0X"); /* (Ok, Ok, 0X) -> Ok */ gtaStoreDefault(Bad); /* (Ok, Ok, x) -> Bad, if x<>0X */ } else if (!hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "X0"); gtaStoreDefault(Bad); } else { /* d \in uP \cap uQ */ gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "00"); gtaStoreException(Done, "11"); gtaStoreDefault(Bad); } gtaAllocExceptions(Done, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Done, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Done, Ok, 0); gtaStoreDefault(Done); gtaAllocExceptions(Ok, Done, 0); gtaStoreDefault(Done); gtaAllocExceptions(Done, Done, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); return gtaBuild("--+"); } } GTA *gtaEq2(int P, int Q, SSSet uP, SSSet uQ) { if (P == Q) { mem_free(uP); mem_free(uQ); return gtaTrue(); } else { int var[2], d, Ok = 0, Bad = 1; var[0] = P; var[1] = Q; gtaSetup(2); /* 2 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 2); /* 2 states in all state spaces */ if ((!hasMember(uP, d)) && (!hasMember(uQ, d))) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok, anything) -> OK */ } else if (hasMember(uP, d) && !hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0X"); /* (Ok, Ok, 0X) -> Ok */ gtaStoreDefault(Bad); /* (Ok, Ok, x) -> Bad, if x<>0X */ } else if (!hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "X0"); gtaStoreDefault(Bad); } else { /* d \in uP \cap uQ */ gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "00"); gtaStoreException(Ok, "11"); gtaStoreDefault(Bad); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); return gtaBuild("+-"); } } GTA *gtaTrue() { int d, Ok = 0; int var[1]; gtaSetup(1); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 1, 1, var, 0); /* 1 state in all state spaces */ gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok) -> OK */ gtaBuildDelta(Ok); } return gtaBuild("+"); } GTA *gtaFalse() { int d, Ok = 0; int var[1]; gtaSetup(1); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 1, 1, var, 0); /* 1 state in all state spaces */ gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok) -> OK */ gtaBuildDelta(Ok); } return gtaBuild("-"); } GTA *gtaSingleton(int P, SSSet uP) { int var[1], d, Bad = 0, Notmet = 1, Met=2; /* Met in hat transition is accepting */ var[0] = P; gtaSetup(3); /* 3 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 1); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Notmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Met, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Notmet, Bad, 0); gtaStoreDefault(Bad); if (hasMember(uP, d)) { gtaAllocExceptions(Notmet, Notmet, 1); gtaStoreException(Met, "1"); /* (Notmet, Notmet, H) -> Met */ gtaStoreDefault(Notmet); gtaAllocExceptions(Notmet, Met, 1); gtaStoreException(Bad, "1"); /* (Notmet, Met, H) -> Bad (unique pos.) */ gtaStoreDefault(Met); gtaAllocExceptions(Met, Notmet, 1); gtaStoreException(Bad, "1"); /* (Notmet, Met, H) -> Bad (unique pos.) */ gtaStoreDefault(Met); } else { gtaAllocExceptions(Notmet, Notmet, 0); gtaStoreDefault(Notmet); gtaAllocExceptions(Notmet, Met, 0); gtaStoreDefault(Met); gtaAllocExceptions(Met, Notmet, 0); gtaStoreDefault(Met); } gtaAllocExceptions(Met, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Met, Met, 0); gtaStoreDefault(Bad); gtaBuildDelta(Notmet); } mem_free(uP); return gtaBuild("--+"); /* Met is the only accepting state */ } GTA *gtaDot1(int P, int Q, SSSet uP, SSSet uQ) { if (P == Q) { mem_free(uP); mem_free(uQ); return gtaFalse(); } else { int var[2], d, NoP = 0, Qtobemet = 1, Bad=2; /* Met in hat transition is accepting */ var[0] = P; var[1] = Q; gtaSetup(3); /* 4 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 2); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Qtobemet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, NoP, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(NoP, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, NoP, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, Qtobemet, 0); gtaStoreDefault(Bad); if (hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(NoP, NoP, 2); gtaStoreException(Qtobemet, "10"); /* (NoP, NoP, 10) -> Qtobemet */ gtaStoreException(NoP, "00"); /* (NoP, NoP, 00) -> NoP */ gtaStoreDefault(Bad); gtaAllocExceptions(NoP, Qtobemet, 2); gtaStoreException(NoP, "01"); gtaStoreException(Qtobemet, "11"); gtaStoreDefault(Bad); } else if (hasMember(uP, d) && !hasMember(uQ, d)) { gtaAllocExceptions(NoP, NoP, 2); gtaStoreException(Qtobemet, "1X"); /* (NoP, NoP, 10) -> Qtobemet */ gtaStoreException(NoP, "0X"); /* (NoP, NoP, 00) -> NoP */ gtaStoreDefault(Bad); gtaAllocExceptions(NoP, Qtobemet, 0); gtaStoreDefault(Bad); } else if (!hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(NoP, NoP, 1); gtaStoreException(NoP, "X0"); /* (NoP, NoP, 00) -> NoP */ gtaStoreDefault(Bad); gtaAllocExceptions(NoP, Qtobemet, 1); gtaStoreException(NoP, "X1"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(NoP, NoP, 0); gtaStoreDefault(NoP); gtaAllocExceptions(NoP, Qtobemet, 0); gtaStoreDefault(Bad); } gtaBuildDelta(NoP); } mem_free(uP); mem_free(uQ); return gtaBuild("+--"); /* NoP is the only accepting state */ } } GTA *gtaDot0(int P, int Q, SSSet uP, SSSet uQ) { if (P == Q) { mem_free(uP); mem_free(uQ); return gtaFalse(); } else { int var[2], d, NoP = 0, Qtobemet = 1, Bad=2; var[0] = P; var[1] = Q; gtaSetup(3); /* Three states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 2); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(NoP, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Qtobemet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, NoP, 0); gtaStoreDefault(Bad); gtaAllocExceptions(NoP, Qtobemet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, Qtobemet, 0); gtaStoreDefault(Bad); if (hasMember(uP, d) && hasMember(uQ,d)) { gtaAllocExceptions(NoP, NoP, 2); gtaStoreException(Qtobemet, "10"); /* (NoP, NoP, 10) -> Qtobemet */ gtaStoreException(NoP, "00"); /* (NoP, NoP, 00) -> NoP */ gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, NoP, 2); gtaStoreException(NoP, "01"); gtaStoreException(Qtobemet, "11"); gtaStoreDefault(Bad); } else if (hasMember(uP, d) && !hasMember(uQ,d)) { gtaAllocExceptions(NoP, NoP, 2); gtaStoreException(Qtobemet, "1X"); /* (NoP, NoP, 10) -> Qtobemet */ gtaStoreException(NoP, "0X"); /* (NoP, NoP, 00) -> NoP */ gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, NoP, 0); gtaStoreDefault(Bad); } else if (!hasMember(uP, d) && hasMember(uQ,d)) { gtaAllocExceptions(NoP, NoP, 1); gtaStoreException(NoP, "X0"); /* (NoP, NoP, 00) -> NoP */ gtaStoreDefault(Bad); gtaAllocExceptions(Qtobemet, NoP, 1); gtaStoreException(NoP, "X1"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(NoP, NoP, 0); gtaStoreDefault(NoP); gtaAllocExceptions(Qtobemet, NoP, 0); gtaStoreDefault(Bad); } gtaBuildDelta(NoP); } mem_free(uP); mem_free(uQ); return gtaBuild("+--"); /* NoP is the only accepting state */ } } /*#warning NEW: GTAUP, GTADOT0, AND GTADOT1 CHANGED*/ GTA *gtaUp(int P, int Q, SSSet uP, SSSet uQ) { /* Calculate the automaton that checks that the positions in P are those of Q moved one step upwards (towards the root). Only positions is universes uPQ are considered; also recall that a root (of one of the universes in uPQ) is a position p in the complete, binary tree such that if d is the state ID of p and d' is the state ID of the parent of p then uPQ.has_member(p) and !uPQ.has_member (p'). In case, there is only one universe, the root is the root of the infinite, binary tree. We use state Ok to denote that so far (below), everything is all right and (if we are in a universe, then we didn't just (right below) see an element in Q). State Qmet is similar, but it denotes that we just met an element in Q. State PQmet denotes that we met an element in Q below, but also one in P that is not a position in Q moved upwards; in this situation, we expect that the position below is a root. */ if (P == Q) return gtaRoot(P, uP, uQ); else { int var[2], d, Ok = 0, Bad = 1, Qmet=2, PQmet=3; var[0] = P; var[1] = Q; gtaSetup(4); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 4, 4, var, 2); gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(PQmet, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, PQmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(PQmet, Qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, PQmet, 0); gtaStoreDefault(Bad); /* at this point, the following is defined (as bad): ----- OK Bad Qmet PQmet OK * Bad * * * * Qmet * * PQmet * * so, we need to fill out the remaining seven entries */ if (hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 3); gtaStoreException(PQmet, "11"); gtaStoreException(Qmet, "01"); gtaStoreException(Ok, "00"); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Qmet, 2); gtaStoreException(Qmet, "11"); gtaStoreException(Ok, "10"); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Ok, 2); gtaStoreException(Qmet, "11"); gtaStoreException(Ok, "10"); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Qmet, 2); gtaStoreException(Qmet, "11"); gtaStoreException(Ok, "10"); gtaStoreDefault(Bad); gtaAllocExceptions(PQmet, Ok, 0); gtaStoreDefault(Bad); /* left child wasn't root after all */ gtaAllocExceptions(Ok, PQmet, 0); gtaStoreDefault(Bad); /* right child wasn't root after all */ gtaAllocExceptions(PQmet, PQmet, 0); gtaStoreDefault(Bad); /* children are not roots */ } else if (!hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Qmet, "X1"); gtaStoreException(Ok, "X0"); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(PQmet, Ok, 0); gtaStoreDefault(Bad); /* left child wasn't root after all */ gtaAllocExceptions(Ok, PQmet, 0); gtaStoreDefault(Bad); /* right child wasn't root after all */ gtaAllocExceptions(PQmet, PQmet, 0); gtaStoreDefault(Bad); /* children are not roots */ } else if (hasMember(uP, d) && !hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0X"); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Qmet, 1); gtaStoreException(Ok, "1X"); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Ok, 1); gtaStoreException(Ok, "1X"); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Qmet, 1); gtaStoreException(Ok, "1X"); gtaStoreDefault(Bad); gtaAllocExceptions(PQmet, Ok, 0); gtaStoreDefault(Bad); /* left child wasn't root after all */ gtaAllocExceptions(Ok, PQmet, 0); gtaStoreDefault(Bad); /* right child wasn't root after all */ gtaAllocExceptions(PQmet, PQmet, 0); gtaStoreDefault(Bad); /* children are not roots */ } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); gtaAllocExceptions(Ok, Qmet, 0); gtaStoreDefault(Bad); /*right child is a root, but we didn't see that position in P */ gtaAllocExceptions(Qmet, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Qmet, Qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(PQmet, Ok, 0); gtaStoreDefault(Ok); /* left child is a root (and so is possibly the right child) */ gtaAllocExceptions(Ok, PQmet, 0); gtaStoreDefault(Ok); gtaAllocExceptions(PQmet, PQmet, 0); gtaStoreDefault(Ok); } gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); return gtaBuild("+--+"); /* Ok and PQmet are accepting states; the latter to account for situation where there is only one universe */ } } GTA *gtaEmpty(int P, SSSet uP) { int var[1], d, Ok = 0, Bad = 1; var[0] = P; gtaSetup(2); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 1); /* 2 states in all state spaces */ gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); if (hasMember(uP, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Bad, "1"); gtaStoreDefault(Ok); } else { /* d not member of uP */ gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaBuildDelta(Ok); } mem_free(uP); return gtaBuild("+-"); } GTA *gtaSub(int P, int Q, SSSet uP, SSSet uQ) { if (P == Q) { mem_free(uP); mem_free(uQ); return gtaTrue(); } else{ int var[2], d, Ok = 0, Bad = 1; var[0] = P; var[1] = Q; gtaSetup(2); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 2); /* 2 states in all state spaces */ if ((!hasMember(uP, d)) && (!hasMember(uQ, d))) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok, anything) -> OK */ } else if (hasMember(uP, d) && !hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0X"); /* (Ok, Ok, 0X) -> Ok */ gtaStoreDefault(Bad); /* (Ok, Ok, x) -> Bad, if x<>0X */ } else if (!hasMember(uP, d) && hasMember(uQ, d)) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } else { /* d \in uP \cap uQ */ gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "X1"); gtaStoreException(Ok, "00"); gtaStoreDefault(Bad); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); return gtaBuild("+-"); } } /* all p in P: p is a root of one of the universes U */ GTA *gtaRoot(int P, SSSet uP, SSSet U) { int var[1], d, Ok = 0, Bad = 1, Pmet=2, notPmet=3; var[0] = P; gtaSetup(4); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 4, 4, var, 1); /* 4 states in all state spaces */ gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(notPmet, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, notPmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Pmet, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Pmet, 0); gtaStoreDefault(Bad); if (hasMember(uP, d)) { if (hasMember(U, d)) { gtaAllocExceptions(notPmet, notPmet, 1); gtaStoreException(Pmet, "1"); /* we are, presumable, at the root of a universe in U here */ gtaStoreDefault(notPmet); gtaAllocExceptions(Pmet, Ok, 0); /* Ok doesn't make sense here */ gtaStoreDefault(Bad); gtaAllocExceptions(Pmet, notPmet, 0); /* we met something in P below a root */ gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Pmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(notPmet, Pmet, 0); /* we met something in P below a root */ gtaStoreDefault(Bad); gtaAllocExceptions(Pmet, Pmet, 0); /* we met something in P below a root */ gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, notPmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(notPmet, Ok, 0); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Pmet, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Pmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Pmet, Pmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, notPmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(notPmet, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Pmet, notPmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(notPmet, Pmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(notPmet, notPmet, 1); gtaStoreException(Bad, "1"); /* we should't meet anything in P outside U */ gtaStoreDefault(notPmet); } } else { /* d is not member of uP; in particular this is the transition function used in the hat */ gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); gtaAllocExceptions(Pmet, Ok, 0); gtaStoreDefault(Ok); /* we are in the hat, and the left child is in P and is the root of a universe in uP mentioned in U */ gtaAllocExceptions(Ok, Pmet, 0); gtaStoreDefault(Ok); gtaAllocExceptions(Pmet, Pmet, 0); /* both children are roots mentioned in U */ gtaStoreDefault(Ok); gtaAllocExceptions(Ok, notPmet, 0); gtaStoreDefault(Ok); gtaAllocExceptions(notPmet, Ok, 0); gtaStoreDefault(Ok); gtaAllocExceptions(Pmet, notPmet, 0); /* both children are roots mentioned in U */ gtaStoreDefault(Ok); gtaAllocExceptions(notPmet, Pmet, 0); /* both children are roots mentioned in U */ gtaStoreDefault(Ok); gtaAllocExceptions(notPmet, notPmet, 0); /* both children are roots mentioned in U */ gtaStoreDefault(Ok); } gtaBuildDelta(notPmet); } mem_free(uP); mem_free(U); return gtaBuild("+-++"); /* Pmet, notPmet, and Ok are accepting */ } /* Use Single(p) and Single(q) to ensure correct first-order p and q */ GTA *gtaLess(int p, int q, SSSet up, SSSet uq) { if (p == q) { mem_free(up); mem_free(uq); return gtaFalse(); } else { int var[2], d, Ok = 0, qmet = 1, Bad=2; var[0] = p; var[1] = q; gtaSetup(3); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 2); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(qmet, qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(qmet, Bad, 0); gtaStoreDefault(Bad); if (hasMember(up, d) && hasMember(uq, d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(qmet, "01"); gtaStoreException(Bad, "1X"); gtaStoreDefault(Ok); gtaAllocExceptions(Ok, qmet, 2); gtaStoreException(Ok, "10"); gtaStoreException(qmet, "00"); gtaStoreDefault(Bad); gtaAllocExceptions(qmet, Ok, 2); gtaStoreException(Ok, "10"); gtaStoreException(qmet, "00"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); gtaAllocExceptions(qmet, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, qmet, 0); gtaStoreDefault(Bad); } gtaBuildDelta(Ok); } mem_free(up); mem_free(uq); return gtaBuild("+--"); } } /* Use Single(p) and Single(q) to ensure correct first-order p and q */ GTA *gtaLesseq(int p, int q, SSSet up, SSSet uq) { if (p == q) { mem_free(up); mem_free(uq); return gtaTrue(); } else { int var[2], d, Ok = 0, qmet = 1, Bad=2; var[0] = p; var[1] = q; gtaSetup(3); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 3, 3, var, 2); /* 3 states in all state spaces */ gtaAllocExceptions(Bad, qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(qmet, qmet, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(qmet, Bad, 0); gtaStoreDefault(Bad); if (hasMember(up, d) && hasMember(uq, d)) { gtaAllocExceptions(Ok, Ok, 2);/************** changed from 3 to 2 ********/ gtaStoreException(qmet, "01"); gtaStoreException(Bad, "10"); gtaStoreDefault(Ok); /* Goes to OK for "11", the only diff. betw. less & less_eq */ gtaAllocExceptions(Ok, qmet, 2); gtaStoreException(Ok, "10"); gtaStoreException(qmet, "00"); gtaStoreDefault(Bad); gtaAllocExceptions(qmet, Ok, 2); gtaStoreException(Ok, "10"); gtaStoreException(qmet, "00"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); gtaAllocExceptions(qmet, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Ok, qmet, 0); gtaStoreDefault(Bad); } gtaBuildDelta(Ok); } mem_free(up); mem_free(uq); return gtaBuild("+--"); } } GTA *gtaBoolvar(int alpha) { int d, Ok = 0, Bad = 1; int var[1]; var[0] = alpha; gtaSetup(2); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 1); /* 2 states in all state spaces */ if (d == 0) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Bad, "0"); gtaStoreDefault(Ok); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } return gtaBuild("+-"); } /*#warning NEW: gtaBoolvar2*/ /* should use statespaces! */ GTA *gtaBoolvar2(int alpha) { int d, Initial = 0, True = 1, False = 2, Bad = 3; int var[1]; var[0] = alpha; gtaSetup(4); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 4, 4, var, 1); gtaAllocExceptions(Initial, Initial, 1); gtaStoreException(False, "0"); gtaStoreDefault(True); gtaAllocExceptions(True, True, 0); gtaStoreDefault(True); gtaAllocExceptions(True, Initial, 0); gtaStoreDefault(True); gtaAllocExceptions(Initial, True, 0); gtaStoreDefault(True); gtaAllocExceptions(False, False, 0); gtaStoreDefault(False); gtaAllocExceptions(False, Initial, 0); gtaStoreDefault(False); gtaAllocExceptions(Initial, False, 0); gtaStoreDefault(False); gtaAllocExceptions(True, False, 0); gtaStoreDefault(Bad); gtaAllocExceptions(False, True, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Initial, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, True, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, False, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Initial, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(True, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(False, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Initial); } return gtaBuild("0+-0"); } /*#warning BUGFIX: NO LONGER ASSUMING COMMON UNIVERSES*/ GTA *gtaUnion(int P, int Q, int R, SSSet uP, SSSet uQ, SSSet uR) { if (P == Q) { mem_free(uQ); return gtaSub(R, P, uR, uP); } else if (P == R) { mem_free(uP); return gtaSub(Q, R, uQ, uR); } else if (Q == R) { mem_free(uR); return gtaEq2(P, Q, uP, uQ); } else { int var[3], d, Ok = 0, Bad = 1; var[0] = P; var[1] = Q; var[2] = R; gtaSetup(2); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 3); /* 2 states in all state spaces */ if (hasMember(uP,d) && hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 3); gtaStoreException(Ok, "1X1"); gtaStoreException(Ok, "110"); gtaStoreException(Ok, "000"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "11X"); gtaStoreException(Ok, "00X"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "1X1"); gtaStoreException(Ok, "0X0"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0XX"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "X00"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "X0X"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && !hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "XX0"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); mem_free(uR); return gtaBuild("+-"); } } /*#warning BUGFIX: NO LONGER ASSUMING COMMON UNIVERSES*/ GTA *gtaInter(int P, int Q, int R, SSSet uP, SSSet uQ, SSSet uR) { if (P == Q) { mem_free(uQ); return gtaSub(P, R, uP, uR); } else if (P == R) { mem_free(uR); return gtaSub(P, Q, uP, uQ); } else if (Q == R) { mem_free(uR); return gtaEq2(P, Q, uP, uQ); } else { int var[3], d, Ok = 0, Bad = 1; var[0] = P; var[1] = Q; var[2] = R; gtaSetup(2); /* Two states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 3); /* 2 states in all state spaces */ if (hasMember(uP,d) && hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 3); gtaStoreException(Ok, "111"); gtaStoreException(Ok, "00X"); gtaStoreException(Ok, "010"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0XX"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "1X1"); gtaStoreException(Ok, "0XX"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0XX"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 3); gtaStoreException(Ok, "X11"); gtaStoreException(Ok, "X0X"); gtaStoreException(Ok, "X10"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); mem_free(uR); return gtaBuild("+-"); } } /*#warning BUGFIX: NO LONGER ASSUMING COMMON UNIVERSES*/ GTA *gtaSetminus(int P, int Q, int R, SSSet uP, SSSet uQ, SSSet uR) { if (P == R) { if (P == Q) { mem_free(uQ); mem_free(uR); return gtaEmpty(P, uP); } else { /* P == R and P != Q, so P = Q \ R means that P and Q are empty */ int var[2], d, Ok = 0, Bad = 1; var[0] = P; var[1] = R; gtaSetup(2); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 3); if (hasMember(uP,d) && hasMember(uQ,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "00"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0X"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && hasMember(uQ,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "X0"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); mem_free(uR); return gtaBuild("+-"); } } else /* P != R */ if (Q == R) { mem_free(uQ); mem_free(uR); return gtaEmpty(P, uP); } else { if (P == Q) { /* P inter R = empty */ int var[2], d, Ok = 0, Bad = 1; var[0] = P; var[1] = R; gtaSetup(2); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 2); /* 2 states in all state spaces */ if (hasMember(uP,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Bad, "11"); gtaStoreDefault(Ok); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); mem_free(uR); return gtaBuild("+-"); } else { /* P, Q, R: they are all different */ int var[3], d, Ok = 0, Bad = 1; var[0] = P; var[1] = Q; var[2] = R; gtaSetup(2); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 3); /* 2 states in all state spaces */ if (hasMember(uP,d) && hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 3); gtaStoreException(Ok, "110"); gtaStoreException(Ok, "00X"); gtaStoreException(Ok, "011"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "11X"); gtaStoreException(Ok, "00X"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "0XX"); gtaStoreException(Ok, "0X1"); gtaStoreDefault(Bad); } else if (hasMember(uP,d) && !hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0XX"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && hasMember(uQ,d) && hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 2); gtaStoreException(Ok, "X0X"); gtaStoreException(Ok, "X11"); gtaStoreDefault(Bad); } else if (!hasMember(uP,d) && hasMember(uQ,d) && !hasMember(uR,d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "X0X"); gtaStoreDefault(Bad); } else { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(uQ); mem_free(uR); return gtaBuild("+-"); } } } /*#warning NEW: GTAINSTATESPACE CHANGED*/ GTA *gtaInStateSpace(int P, SSSet ss, SSSet uP) { int var[1], d, Ok = 0, Bad = 1; var[0] = P; gtaSetup(2); /* 2 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 1); /* 2 states in all state spaces */ if (!hasMember(uP, d)) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok, anything) -> OK */ } else if (hasMember(uP, d) && !hasMember(ss, d)) { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Ok, "0"); /* (Ok, Ok, L) -> Ok */ gtaStoreDefault(Bad); /* (Ok, Ok, x) -> Bad, if x<>L */ } else { /* d \in uP and d \in ss */ gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); mem_free(ss); return gtaBuild("+-"); } GTA *gtaWellFormedTree(int P, SSSet uP) { int var[1], d, ok = 0, empty = 1, error = 2, above = 3; invariant(guide.ssKind); var[0] = P; gtaSetup(4); /* 4 states in root */ for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 4, 4, var, 1); /* 4 states in all state spaces */ if (!hasMember(uP, d) && guide.ssKind[d] != gtaSSUNIVHAT) { /* anything -> empty */ gtaAllocExceptions(ok, ok, 0); gtaStoreDefault(empty); gtaAllocExceptions(ok, empty, 0); gtaStoreDefault(empty); gtaAllocExceptions(empty, ok, 0); gtaStoreDefault(empty); gtaAllocExceptions(empty, empty, 0); gtaStoreDefault(empty); gtaAllocExceptions(ok, error, 0); gtaStoreDefault(empty); gtaAllocExceptions(error, ok, 0); gtaStoreDefault(empty); gtaAllocExceptions(empty, error, 0); gtaStoreDefault(empty); gtaAllocExceptions(error, empty, 0); gtaStoreDefault(empty); gtaAllocExceptions(error, error, 0); gtaStoreDefault(empty); gtaAllocExceptions(above, ok, 0); gtaStoreDefault(empty); gtaAllocExceptions(above, empty, 0); gtaStoreDefault(empty); gtaAllocExceptions(above, error, 0); gtaStoreDefault(empty); gtaAllocExceptions(above, above, 0); gtaStoreDefault(empty); gtaAllocExceptions(ok, above, 0); gtaStoreDefault(empty); gtaAllocExceptions(empty, above, 0); gtaStoreDefault(empty); gtaAllocExceptions(error, above, 0); gtaStoreDefault(empty); gtaBuildDelta(empty); /* initial state: empty */ } else switch (guide.ssKind[d]) { case gtaSSORHAT: /* (ok, empty, 1) -> ok */ /* (empty, ok, 1) -> ok */ /* (empty, empty, 0) -> empty */ /* (above, empty, 0) -> above */ /* (empty, above, 0) -> above */ /* otherwise -> error */ gtaAllocExceptions(ok, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, empty, 1); gtaStoreException(ok, "1"); gtaStoreDefault(error); gtaAllocExceptions(empty, ok, 1); gtaStoreException(ok, "1"); gtaStoreDefault(error); gtaAllocExceptions(empty, empty, 1); gtaStoreException(empty, "0"); gtaStoreDefault(error); gtaAllocExceptions(ok, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(error, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(above, empty, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); gtaAllocExceptions(above, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, above, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, above, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, above, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); gtaAllocExceptions(error, above, 0); gtaStoreDefault(error); gtaBuildDelta(empty); /* initial state: empty */ break; case gtaSSORLEAF: /* (ok/(empty if dummy), ok/(empty if dummy), 1) -> ok */ /* (ok, empty, 0) -> above */ /* (empty, ok, 0) -> above */ /* (empty, empty, 0) -> empty */ /* otherwise -> error */ gtaAllocExceptions(ok, ok, 1); gtaStoreException(ok, "1"); gtaStoreDefault(error); if (guide.ssKind[guide.muRight[d]] == gtaSSDUMMY) { gtaAllocExceptions(ok, empty, 1); gtaStoreException(above, "0"); gtaStoreDefault(ok); } else { gtaAllocExceptions(ok, empty, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); } if (guide.ssKind[guide.muLeft[d]] == gtaSSDUMMY) { gtaAllocExceptions(empty, ok, 1); gtaStoreException(above, "0"); gtaStoreDefault(ok); } else { gtaAllocExceptions(empty, ok, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); } if (guide.ssKind[guide.muRight[d]] == gtaSSDUMMY && guide.ssKind[guide.muLeft[d]] == gtaSSDUMMY) { gtaAllocExceptions(empty, empty, 1); gtaStoreException(ok, "1"); gtaStoreDefault(empty); } else { gtaAllocExceptions(empty, empty, 1); gtaStoreException(error, "1"); gtaStoreDefault(empty); } gtaAllocExceptions(ok, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(error, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(above, empty, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); gtaAllocExceptions(above, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, above, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, above, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, above, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); gtaAllocExceptions(error, above, 0); gtaStoreDefault(error); gtaBuildDelta(empty); /* initial state: empty */ break; case gtaSSAND: /* (ok, ok, 1) -> ok */ /* (ok, ok, 0) -> above */ /* (empty, empty, 0) -> empty */ /* (above, empty, 0) -> above */ /* (empty, above, 0) -> above */ /* otherwise -> error */ gtaAllocExceptions(ok, ok, 1); gtaStoreException(above, "0"); gtaStoreDefault(ok); gtaAllocExceptions(ok, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, empty, 1); gtaStoreException(empty, "0"); gtaStoreDefault(error); gtaAllocExceptions(ok, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(error, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(above, empty, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); gtaAllocExceptions(above, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, above, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, above, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, above, 1); gtaStoreException(above, "0"); gtaStoreDefault(error); gtaAllocExceptions(error, above, 0); gtaStoreDefault(error); gtaBuildDelta(empty); /* initial state: empty */ break; case gtaSSDUMMY: /* (empty, empty, 0) -> empty */ /* otherwise -> error */ gtaAllocExceptions(ok, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, empty, 1); gtaStoreException(empty, "0"); gtaStoreDefault(error); gtaAllocExceptions(ok, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(error, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(above, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(above, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, above, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, above, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, above, 0); gtaStoreDefault(error); gtaAllocExceptions(error, above, 0); gtaStoreDefault(error); gtaBuildDelta(empty); /* initial state: empty */ break; case gtaSSUNIVHAT: /* (ok, empty, x) -> ok */ /* (empty, ok, x) -> ok */ /* (empty, empty, x) -> empty */ /* (above, ok, x) -> ok */ /* (ok, above, x) -> ok */ /* otherwise -> error */ gtaAllocExceptions(ok, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, empty, 0); gtaStoreDefault(ok); gtaAllocExceptions(empty, ok, 0); gtaStoreDefault(ok); gtaAllocExceptions(empty, empty, 0); gtaStoreDefault(empty); gtaAllocExceptions(ok, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, error, 0); gtaStoreDefault(error); gtaAllocExceptions(error, empty, 0); gtaStoreDefault(error); gtaAllocExceptions(error, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, ok, 0); gtaStoreDefault(error); gtaAllocExceptions(above, empty, 0); gtaStoreDefault(ok); gtaAllocExceptions(above, error, 0); gtaStoreDefault(error); gtaAllocExceptions(above, above, 0); gtaStoreDefault(error); gtaAllocExceptions(ok, above, 0); gtaStoreDefault(error); gtaAllocExceptions(empty, above, 0); gtaStoreDefault(ok); gtaAllocExceptions(error, above, 0); gtaStoreDefault(error); gtaBuildDelta(empty); /* initial state: empty */ break; } } mem_free(uP); return gtaBuild("+---"); } GTA * gtaSomeType(int P, SSSet uP) { int var[1], d, Ok = 0, Bad = 1; var[0] = P; gtaSetup(2); for (d = 0; d < guide.numSs; d++) { gtaSetupDelta(d, 2, 2, var, 1); if (!hasMember(uP, d) || guide.ssType[d] != -1) { gtaAllocExceptions(Ok, Ok, 0); gtaStoreDefault(Ok); /* (Ok, Ok, anything) -> OK */ } else { gtaAllocExceptions(Ok, Ok, 1); gtaStoreException(Bad, "1"); gtaStoreDefault(Ok); } gtaAllocExceptions(Ok, Bad, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Ok, 0); gtaStoreDefault(Bad); gtaAllocExceptions(Bad, Bad, 0); gtaStoreDefault(Bad); gtaBuildDelta(Ok); } mem_free(uP); return gtaBuild("+-"); } mona-1.4/GTA/copy.c0000644000414100000240000000337310756504321010761 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "../Mem/mem.h" #include "gta.h" GTA *gtaCopy(GTA *P) { unsigned i, p1, p2; GTA *res = gtaMake(); res->final = (int *) mem_alloc(sizeof(int)*P->ss[0].size); /* copy finals */ for (i = 0; i < P->ss[0].size; i++) res->final[i] = P->final[i]; /* copy state spaces */ for (i = 0; i < guide.numSs; i++) { StateSpace *ss = &res->ss[i]; ss->initial = P->ss[i].initial; ss->size = P->ss[i].size; ss->ls = P->ss[i].ls; ss->rs = P->ss[i].rs; ss->behaviour = (bdd_handle *) mem_alloc(sizeof(bdd_handle)*ss->ls*ss->rs); ss->bddm = bdd_new_manager(ss->size*8, ((ss->size+3)/4)*4); bdd_prepare_apply1(P->ss[i].bddm); for (p1 = 0; p1 < P->ss[guide.muLeft[i]].size; p1++) { for (p2 = 0; p2 < P->ss[guide.muRight[i]].size; p2++) { bdd_apply1(P->ss[i].bddm, BDD_ROOT(P->ss[i].bddm, BEH(P->ss[i], p1, p2)), ss->bddm, &fn_identity); BEH((*ss), p1, p2) = BDD_LAST_HANDLE(ss->bddm); } } } return res; } mona-1.4/GTA/dyn.c0000644000414100000240000000520110756504321010571 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "../Mem/mem.h" #include "../BDD/bdd_dump.h" #include "dyn.h" /* PairArray */ void paInit(PairArray *q) { q->m = 0; q->allocated = q->used = 0; } void paFree(PairArray *q) { mem_free(q->m); } void paInsert(PairArray *q, State i, State j) { if (q->used == q->allocated) { q->allocated = q->used*2+2; q->m = (State *) mem_resize(q->m, sizeof(State)*q->allocated*2); } q->m[q->used*2+0] = i; q->m[q->used*2+1] = j; q->used++; } /* BehaviourMatrix */ void initBM(BehaviourMatrix *b) { b->m = (bdd_handle *) mem_alloc(sizeof(bdd_handle)); b->lf = b->rf = 0; b->ls = b->rs = b->lu = b->ru = 1; } void initBMtoSize(BehaviourMatrix *b, unsigned l, unsigned r) { b->m = (bdd_handle *) mem_alloc(sizeof(bdd_handle)*l*r); b->lf = b->rf = 0; b->ls = b->lu = l; b->rs = b->ru = r; } void extendLeftBM(BehaviourMatrix *b) { if (b->lu >= b->ls) { unsigned l, r; bdd_handle *t = (bdd_handle *) mem_alloc(sizeof(bdd_handle)*(b->ls*2+1)*b->rs); for (l = 0; l < b->lu; l++) for (r = 0; r < b->ru; r++) t[l*b->rs+r] = b->m[l*b->rs+r]; mem_free(b->m); b->m = t; b->ls = b->ls*2+1; } b->lu += 1; } void extendRightBM(BehaviourMatrix *b) { if (b->ru >= b->rs) { unsigned l, r; bdd_handle *t = (bdd_handle *) mem_alloc(sizeof(bdd_handle)*b->ls*(b->rs*2+1)); for (l = 0; l < b->lu; l++) for (r = 0; r < b->ru; r++) t[l*(b->rs*2+1)+r] = b->m[l*b->rs+r]; mem_free(b->m); b->m = t; b->rs = b->rs*2+1; } b->ru += 1; } #ifndef NDEBUG void dumpBM(BehaviourMatrix *bbb, bdd_manager *bddm) { int i, j; printf("\nBEHAVIOUR:"); for (i = 0; i < bbb->lf; i++) { for (j = 0; j < bbb->rf; j++) printf("%u ", BDD_ROOT(bddm, bbb->m[i*bbb->rs+j])); printf("\n"); } bddDump(bddm); } #endif mona-1.4/GTA/dyn.h0000644000414100000240000000316610756504270010611 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __DYN_H #define __DYN_H #include "gta.h" /* Dynamic array containing pairs of states */ typedef struct { State *m; unsigned allocated, used; } PairArray; #define paLeft(q, n) q.m[(n)*2+0] #define paRight(q, n) q.m[(n)*2+1] #define paSize(q) q.used void paInit(PairArray *q); void paFree(PairArray *q); void paInsert(PairArray *q, State i, State j); /* Dynamic matrix containing bdd_handles */ typedef struct { bdd_handle *m; unsigned ls, rs; /* allocated size */ unsigned lu, ru; /* used size */ unsigned lf, rf; /* filled size */ } BehaviourMatrix; #define BM(b, i, j) b.m[(i)*b.rs+(j)] void initBM(BehaviourMatrix *b); void initBMtoSize(BehaviourMatrix *b, unsigned l, unsigned r); void extendLeftBM(BehaviourMatrix *b); void extendRightBM(BehaviourMatrix *b); #ifndef NDEBUG void dumpBM(BehaviourMatrix *bbb, bdd_manager *bddm); #endif #endif mona-1.4/GTA/external.c0000644000414100000240000003401110756504321011622 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include #include "gta.h" #include "../BDD/bdd_external.h" #include "../Mem/mem.h" extern BddNode *table; extern bdd_manager *import_bddm; int gtaExport(GTA *G, char *filename, int num, char *vars[], char orders[], SSSet *statespaces, int opt_inhacc) { unsigned i, j, k, l, r; FILE *file; boolean ***inherited = NULL; Table **tables = (Table **) mem_alloc(sizeof(Table*)*guide.numSs); if (opt_inhacc) inherited = gtaCalcInheritedAcceptance(G); for (i = 0; i < guide.numSs; i++) tables[i] = tableInit(); if (filename) { if ((file = fopen(filename, "w")) == 0) return 0; } else file = stdout; /* remove all marks G->bddm */ for (i = 0; i < guide.numSs; i++) bdd_prepare_apply1(G->ss[i].bddm); /* build table of tuples (idx,lo,hi) */ for (i = 0; i < guide.numSs; i++) for (l = 0; l < G->ss[guide.muLeft[i]].size; l++) for (r = 0; r < G->ss[guide.muRight[i]].size; r++) export(G->ss[i].bddm, BDD_ROOT(G->ss[i].bddm, BEH(G->ss[i], l, r)), tables[i]); for (i = 0; i < guide.numSs; i++) { for (j = 0; j < tables[i]->noelems; j++) { if (tables[i]->elms[j].idx != -1) { tables[i]->elms[j].lo = bdd_mark(G->ss[i].bddm, tables[i]->elms[j].lo)-1; tables[i]->elms[j].hi = bdd_mark(G->ss[i].bddm, tables[i]->elms[j].hi)-1; } } } fprintf(file, "MONA GTA\n" "number of variables: %u\n" "state spaces: %u\n" "universes: %u\n" "state space sizes:", num, guide.numSs, guide.numUnivs); for (i = 0; i < guide.numSs; i++) fprintf(file, " %u", G->ss[i].size); fprintf(file, "\nfinal:"); for (i = 0; i < G->ss[0].size; i++) fprintf(file, " %d", G->final[i]); fprintf(file, "\nguide:\n"); for (i = 0; i < guide.numSs; i++) fprintf(file, " %s %u %u\n", guide.ssName[i], guide.muLeft[i], guide.muRight[i]); fprintf(file, "types: %d\n", num_types); for (i = 0; i < num_types; i++) { fprintf(file, " type: %s\n", treetypes[i].name); fprintf(file, " variants: %d\n", treetypes[i].numVariants); for (j = 0; j < treetypes[i].numVariants; j++) { fprintf(file, " variant: %s %s\n", treetypes[i].variantName[j], treetypes[i].variantPos[j][0] ? treetypes[i].variantPos[j] : "-"); fprintf(file, " components: %d\n", treetypes[i].numComponents[j]); for (k = 0; k < treetypes[i].numComponents[j]; k++) fprintf(file, " %s %s %d\n", treetypes[i].componentName[j][k], treetypes[i].componentPos[j][k][0] ? treetypes[i].componentPos[j][k] : "-", treetypes[i].componentType[j][k]); } } fprintf(file, "universes:\n"); for (i = 0; i < guide.numUnivs; i++) fprintf(file, " %s %s\n", guide.univName[i], guide.univPos[i]); fprintf(file, "variable orders and state spaces:\n"); for (i = 0; i < num; i++) { fprintf(file, " %s %u:", vars[i], (unsigned) orders[i]); for (j = 0; j < guide.numSs; j++) if (statespaces[i][j]) fprintf(file, " %d", j); fprintf(file, "\n"); } for (i = 0; i < guide.numSs; i++) { fprintf(file, "\nstate space %u:\n" " initial state: %u\n" " bdd nodes: %u", i , G->ss[i].initial, tables[i]->noelems); if (inherited) { fprintf(file, "\n inherited-acceptance:"); for (j = 0; j < G->ss[i].size; j++) fprintf(file, "\n %u %u %u", inherited[i][j][-1], inherited[i][j][0], inherited[i][j][1]); } fprintf(file, "\n behaviour:\n "); for (l = 0; l < G->ss[guide.muLeft[i]].size; l++) { for (r = 0; r < G->ss[guide.muRight[i]].size; r++) fprintf(file, " %u", bdd_mark(G->ss[i].bddm, BDD_ROOT(G->ss[i].bddm, BEH(G->ss[i], l, r)))-1); fprintf(file, "\n "); } fprintf(file, "bdd:\n"); for (j = 0; j < tables[i]->noelems; j++) fprintf(file, " %i %u %u\n", tables[i]->elms[j].idx, tables[i]->elms[j].lo, tables[i]->elms[j].hi); } fprintf(file, "\nend\n"); for (i = 0; i < guide.numSs; i++) tableFree(tables[i]); if (filename) fclose(file); mem_free(tables); if (opt_inhacc) gtaFreeInheritedAcceptance(inherited); return 1; } GTA *gtaImport(char *filename, char ***vars, int **orders, SSSet **statespaces, int set_guideandtypes) { FILE *file; GTA *G; BddNode **tables; unsigned bddNodes, i, l, r, t, j, k; unsigned numvars; char buffer[1000], buffer2[1000]; int ti; unsigned f_numSs, f_numUnivs; SsId *f_muLeft, *f_muRight; char **f_ssName, **f_univPos, **f_univName; int f_num_types; gtaType *f_treetypes; /* read file */ if ((file = fopen(filename, "r")) == 0) return 0; G = (GTA *) mem_alloc(sizeof(GTA)); gta_in_mem++; if (fscanf(file, "MONA GTA\n" "number of variables: %u\n" "state spaces: %u\n" "universes: %u\n" "state space sizes:", &numvars, &f_numSs, &f_numUnivs) != 3) return 0; G->ss = (StateSpace *) mem_alloc(sizeof(StateSpace)*f_numSs); for (i = 0; i < f_numSs; i++) if (fscanf(file, " %u", &G->ss[i].size) != 1) return 0; fscanf(file, "\nfinal:"); G->final = (int *) mem_alloc(sizeof(int)*G->ss[0].size); for (i = 0; i < G->ss[0].size; i++) fscanf(file, " %d", &G->final[i]); fscanf(file, "\nguide:\n"); f_ssName = (char **) mem_alloc(sizeof(char *)*f_numSs); f_muLeft = (SsId *) mem_alloc(sizeof(SsId)*f_numSs); f_muRight = (SsId *) mem_alloc(sizeof(SsId)*f_numSs); for (i = 0; i < f_numSs; i++) { if (fscanf(file, "%s %u %u\n", buffer, &f_muLeft[i], &f_muRight[i]) != 3) return 0; f_ssName[i] = (char *) mem_alloc(strlen(buffer)+1); strcpy(f_ssName[i], buffer); } if (fscanf(file, "\ntypes: %d\n", &f_num_types) != 1) return 0; f_treetypes = (gtaType *) mem_alloc(sizeof(gtaType)*f_num_types); for (i = 0; i < f_num_types; i++) { fscanf(file, "\ntype: %s\n", buffer); f_treetypes[i].name = (char *) mem_alloc(strlen(buffer)+1); strcpy(f_treetypes[i].name, buffer); if (fscanf(file, "\nvariants: %d\n", &f_treetypes[i].numVariants) != 1) return 0; f_treetypes[i].variantName = (char **) mem_alloc(sizeof(char *)*f_treetypes[i].numVariants); f_treetypes[i].variantPos = (char **) mem_alloc(sizeof(char *)*f_treetypes[i].numVariants); f_treetypes[i].numComponents = (int *) mem_alloc(sizeof(int)*f_treetypes[i].numVariants); f_treetypes[i].componentName = (char ***) mem_alloc(sizeof(char **)*f_treetypes[i].numVariants); f_treetypes[i].componentPos = (char ***) mem_alloc(sizeof(char **)*f_treetypes[i].numVariants); f_treetypes[i].componentType = (int **) mem_alloc(sizeof(int *)*f_treetypes[i].numVariants); for (j = 0; j < f_treetypes[i].numVariants; j++) { fscanf(file, "\nvariant: %s ", buffer); f_treetypes[i].variantName[j] = (char *) mem_alloc(strlen(buffer)+1); strcpy(f_treetypes[i].variantName[j], buffer); fscanf(file, "%s\n", buffer); f_treetypes[i].variantPos[j] = (char *) mem_alloc(strlen(buffer)+1); if (buffer[0]=='-') buffer[0] = 0; strcpy(f_treetypes[i].variantPos[j], buffer); if (fscanf(file, "\ncomponents: %d\n", &f_treetypes[i].numComponents[j]) != 1) return 0; f_treetypes[i].componentName[j] = (char **) mem_alloc(sizeof(char *)*f_treetypes[i].numComponents[j]); f_treetypes[i].componentPos[j] = (char **) mem_alloc(sizeof(char *)*f_treetypes[i].numComponents[j]); f_treetypes[i].componentType[j] = (int *) mem_alloc(sizeof(int)*f_treetypes[i].numComponents[j]); for (k = 0; k < f_treetypes[i].numComponents[j]; k++) { fscanf(file, "\n%s ", buffer); f_treetypes[i].componentName[j][k] = (char *) mem_alloc(strlen(buffer)+1); strcpy(f_treetypes[i].componentName[j][k], buffer); fscanf(file, "%s ", buffer); f_treetypes[i].componentPos[j][k] = (char *) mem_alloc(strlen(buffer)+1); if (buffer[0]=='-') buffer[0] = 0; strcpy(f_treetypes[i].componentPos[j][k], buffer); fscanf(file, "%d\n", &f_treetypes[i].componentType[j][k]); } } } fscanf(file, "\nuniverses:\n"); f_univName = (char **) mem_alloc(sizeof(char *)*f_numUnivs); f_univPos = (char **) mem_alloc(sizeof(char *)*f_numUnivs); for (i = 0; i < f_numUnivs; i++) { if (fscanf(file, "%s %s\n", buffer, buffer2) != 2) return 0; f_univName[i] = (char *) mem_alloc(strlen(buffer)+1); strcpy(f_univName[i], buffer); f_univPos[i] = (char *) mem_alloc(strlen(buffer2)+1); strcpy(f_univPos[i], buffer2); } fscanf(file, "\nvariable orders and state spaces:\n"); if (vars) { *vars = (char **) mem_alloc(sizeof(char *)*(numvars + 1)); (*vars)[numvars] = 0; } if (orders) *orders = (int *) mem_alloc(sizeof(int)*numvars); if (statespaces) *statespaces = (SSSet *) mem_alloc(sizeof(SSSet)*numvars); for (i = 0; i < numvars; i++) { if (orders) fscanf(file, " %s %d:", buffer, &((*orders)[i])); else fscanf(file, " %s %d:", buffer, &ti); if (vars) { (*vars)[i] = (char *) mem_alloc(strlen(buffer)+1); strcpy((*vars)[i], buffer); } if (statespaces) { (*statespaces)[i] = mem_alloc(f_numSs); for (t = 0; t < f_numSs; t++) (*statespaces)[i][t] = 0; } while (1) { fscanf(file, " %u", &t); if (statespaces) (*statespaces)[i][t] = 1; if (fgetc(file)=='\n') break; } } tables = (BddNode **) mem_alloc(sizeof(BddNode *)*f_numSs); for (i = 0; i < f_numSs; i++) { unsigned le = G->ss[f_muLeft[i]].size; unsigned ri = G->ss[f_muRight[i]].size; if (fscanf(file, "\nstate space %u:\n" "initial state: %u\n" "bdd nodes: %u\n", &t, &G->ss[i].initial, &bddNodes) != 3) return 0; fscanf(file, "%s", buffer); if (strcmp(buffer, "inherited-acceptance:") == 0) { unsigned t; for (j = 0; j < G->ss[i].size; j++) fscanf(file, "\n%u %u %u ", &t, &t, &t); fscanf(file, "behaviour:\n"); } G->ss[i].behaviour = (bdd_ptr *) mem_alloc(sizeof(bdd_ptr)*ri*le); G->ss[i].ls = le; G->ss[i].rs = ri; for (l = 0; l < le; l++) for (r = 0; r < ri; r++) { fscanf(file, "%u ", &BEH(G->ss[i], l, r)); } fscanf(file, "\nbdd:\n"); tables[i] = (BddNode *) mem_alloc(sizeof(BddNode)*bddNodes); for (j = 0; j < bddNodes; j++) { tables[i][j].p = -1; fscanf(file, "%i %u %u\n", &tables[i][j].idx, &tables[i][j].lo, &tables[i][j].hi); } } if (fgetc(file) != 'e' || fgetc(file) != 'n' || fgetc(file) != 'd') return 0; fclose(file); /* fill G->bddm */ for (i = 0; i < f_numSs; i++) { table = tables[i]; G->ss[i].bddm = bdd_new_manager(8 * G->ss[i].size, G->ss[i].size*4); /* ?? */ import_bddm = G->ss[i].bddm; for (l = 0; l < G->ss[f_muLeft[i]].size; l++) for (r = 0; r < G->ss[f_muRight[i]].size; r++) { PUSH_SEQUENTIAL_LIST(import_bddm->roots, unsigned, make_node(BEH(G->ss[i], l, r))); BEH(G->ss[i], l, r) = BDD_LAST_HANDLE(import_bddm); } } if (set_guideandtypes) { /* set guide */ makeGuide(f_numSs, f_muLeft, f_muRight, f_ssName, f_numUnivs, f_univPos, f_univName, 0, 0); if (!checkDisjoint() || !checkAllCovered() || !checkAllUsed()) return 0; /* set types */ num_types = f_num_types; treetypes = f_treetypes; } else { /* check guide */ if (f_numSs != guide.numSs || f_numUnivs != guide.numUnivs) return 0; for (i = 0; i < f_numSs; i++) if (f_muLeft[i] != guide.muLeft[i] || f_muRight[i] != guide.muRight[i]) return 0; else mem_free(f_ssName[i]); for (i = 0; i < f_numUnivs; i++) if (strcmp(f_univPos[i], guide.univPos[i]) != 0) return 0; else { mem_free(f_univPos[i]); mem_free(f_univName[i]); } mem_free(f_muLeft); mem_free(f_muRight); mem_free(f_ssName); mem_free(f_univPos); mem_free(f_univName); /* check types */ if (f_num_types != num_types) return 0; for (i = 0; i < num_types; i++) { if (f_treetypes[i].numVariants != treetypes[i].numVariants) return 0; else for (j = 0; j < treetypes[i].numVariants; j++) { if (strcmp(f_treetypes[i].variantPos[j], treetypes[i].variantPos[j]) != 0 || f_treetypes[i].numComponents[j] != treetypes[i].numComponents[j]) return 0; else for (k = 0; k < treetypes[i].numComponents[j]; k++) if (strcmp(f_treetypes[i].componentPos[j][k], treetypes[i].componentPos[j][k]) != 0 || f_treetypes[i].componentType[j][k] != treetypes[i].componentType[j][k]) return 0; else { mem_free(f_treetypes[i].componentName[j][k]); mem_free(f_treetypes[i].componentPos[j][k]); } mem_free(f_treetypes[i].variantName[j]); mem_free(f_treetypes[i].variantPos[j]); mem_free(f_treetypes[i].componentName[j]); mem_free(f_treetypes[i].componentPos[j]); mem_free(f_treetypes[i].componentType[j]); } mem_free(f_treetypes[i].name); mem_free(f_treetypes[i].variantName); mem_free(f_treetypes[i].variantPos); mem_free(f_treetypes[i].numComponents); mem_free(f_treetypes[i].componentName); mem_free(f_treetypes[i].componentPos); mem_free(f_treetypes[i].componentType); } mem_free(f_treetypes); } for (i = 0; i < f_numSs; i++) mem_free(tables[i]); mem_free(tables); return G; } mona-1.4/GTA/gta.c0000644000414100000240000001747111015334572010564 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "../Mem/mem.h" #include "gta.h" int gta_in_mem; /* number of automata currently in memory */ int max_gta_in_mem; /* maximum number of automata in memory */ static void setHits() { SsId s; guide.hitsLeft = (SsId **) mem_alloc(sizeof(SsId *)*guide.numSs); guide.hitsRight = (SsId **) mem_alloc(sizeof(SsId *)*guide.numSs); guide.numHitsLeft = (unsigned *) mem_alloc(sizeof(unsigned)*guide.numSs); guide.numHitsRight = (unsigned *) mem_alloc(sizeof(unsigned)*guide.numSs); for (s = 0; s < guide.numSs; s++) guide.numHitsLeft[s] = guide.numHitsRight[s] = 0; for (s = 0; s < guide.numSs; s++) { guide.numHitsLeft[guide.muLeft[s]]++; guide.numHitsRight[guide.muRight[s]]++; } for (s = 0; s < guide.numSs; s++) { guide.hitsLeft[s] = (SsId *) mem_alloc(sizeof(SsId)*guide.numHitsLeft[s]); guide.hitsRight[s] = (SsId *) mem_alloc(sizeof(SsId)*guide.numHitsRight[s]); guide.numHitsLeft[s] = guide.numHitsRight[s] = 0; } for (s = 0; s < guide.numSs; s++) { guide.hitsLeft[guide.muLeft[s]] [(guide.numHitsLeft[guide.muLeft[s]])++] = s; guide.hitsRight[guide.muRight[s]] [(guide.numHitsRight[guide.muRight[s]])++] = s; } } static void setUnivSS() { int u, i; guide.numUnivSS = (unsigned *) mem_alloc(sizeof(unsigned)*guide.numUnivs); guide.univSS = (SsId **) mem_alloc(sizeof(SsId *)*guide.numUnivs); guide.ssUniv = (int *) mem_alloc(sizeof(int)*guide.numSs); guide.ssUnivRoot = (char *) mem_alloc(guide.numSs); for (i = 0; i < guide.numSs; i++) { guide.ssUniv[i] = -1; /* unmark */ guide.ssUnivRoot[i] = 0; } for (u = 0; u < guide.numUnivs; u++) { SsId s = 0; unsigned head = 0, tail = 0; /* find state space of universe root */ for (i = 0; guide.univPos[u][i]; i++) { guide.ssUniv[s] = -2; /* mark as 'hat' */ if (guide.univPos[u][i] == '0') s = guide.muLeft[s]; else s = guide.muRight[s]; } guide.univSS[u] = (SsId *) mem_alloc(sizeof(SsId)*guide.numSs); guide.univSS[u][head++] = s; guide.ssUniv[s] = u; guide.ssUnivRoot[s] = 1; /* find reachable state spaces */ while (head > tail) { SsId left, right; s = guide.univSS[u][tail++]; left = guide.muLeft[s]; right = guide.muRight[s]; if (guide.ssUniv[left] != u) { guide.univSS[u][head++] = left; guide.ssUniv[left] = u; } if (left != right && guide.ssUniv[right] != u) { guide.univSS[u][head++] = right; guide.ssUniv[right] = u; } } guide.numUnivSS[u] = head; } } void makeGuide(unsigned numSs, SsId *muLeft, SsId *muRight, char **ssName, unsigned numUnivs, char **univPos, char **univName, int ssType[], SsKind *ssKind) { guide.numSs = numSs; guide.muLeft = muLeft; guide.muRight = muRight; guide.ssName = ssName; guide.numUnivs = numUnivs; guide.univPos = univPos; guide.univName = univName; guide.ssKind = ssKind; guide.ssType = ssType; setHits(); setUnivSS(); } void makeDefaultGuide(unsigned numUnivs, char **univName) { int u; SsId s; char **ssPos; invariant(numUnivs > 0); guide.numUnivs = numUnivs; guide.univName = univName; guide.ssKind = 0; guide.numSs = numUnivs*2-1; guide.univPos = (char **) mem_alloc(sizeof(char *)*numUnivs); guide.muLeft = (SsId *) mem_alloc(sizeof(SsId)*guide.numSs); guide.muRight = (SsId *) mem_alloc(sizeof(SsId)*guide.numSs); guide.ssName = (char **) mem_alloc(sizeof(char *)*guide.numSs); ssPos = (char **) mem_alloc(sizeof(char *)*guide.numSs); ssPos[0] = (char *) mem_alloc(1); ssPos[0][0] = 0; for (s = 0; s < numUnivs - 1; s++) { guide.muLeft[s] = 2*s+1; guide.muRight[s] = 2*s+2; guide.ssName[s] = (char *) mem_alloc(6); strcpy(guide.ssName[s], ""); ssPos[2*s+1] = (char *) mem_alloc(strlen(ssPos[s])+2); strcpy(ssPos[2*s+1], ssPos[s]); strcat(ssPos[2*s+1], "0"); ssPos[2*s+2] = (char *) mem_alloc(strlen(ssPos[s])+2); strcpy(ssPos[2*s+2], ssPos[s]); strcat(ssPos[2*s+2], "1"); } for (u = 0; u < numUnivs; u++, s++) { guide.muLeft[s] = s; guide.muRight[s] = s; guide.ssName[s] = (char *) mem_alloc(strlen(univName[u])+1); guide.univPos[u] = (char *) mem_alloc(strlen(ssPos[s])+1); strcpy(guide.univPos[u], ssPos[s]); strcpy(guide.ssName[s], univName[u]); } for (s = 0; s < guide.numSs; s++) mem_free(ssPos[s]); mem_free(ssPos); setHits(); setUnivSS(); } void freeGuide() { SsId s; for (s = 0; s < guide.numSs; s++) { mem_free(guide.hitsLeft[s]); mem_free(guide.hitsRight[s]); } mem_free(guide.hitsLeft); mem_free(guide.hitsRight); mem_free(guide.numHitsLeft); mem_free(guide.numHitsRight); mem_free(guide.muLeft); mem_free(guide.muRight); mem_free(guide.ssKind); } void printGuide() { SsId s; printf("Guide:\n"); for (s = 0; s < guide.numSs; s++) { printf(" %s: %d -> (%d,%d)", guide.ssName[s], s, guide.muLeft[s], guide.muRight[s]); if (guide.ssKind) switch (guide.ssKind[s]) { case gtaSSUNIVHAT: printf(" [universe branch]"); break; case gtaSSORHAT: printf(" [variant-tree branch]"); break; case gtaSSORLEAF: printf(" [variant-tree leaf]"); break; case gtaSSAND: printf(" [component-tree branch]"); break; case gtaSSDUMMY: printf(" [dummy]"); break; } printf("\n"); } printf("\n"); } int hasMember(SSSet ss, SsId s) { return ss[s]; } static int univs_required; static int checkPosCovered(char *pos) { int u, res; char *pos0, *pos1; for (u = 0; u < guide.numUnivs; u++) if (strcmp(guide.univPos[u], pos) == 0) return 1; univs_required++; if (univs_required > guide.numUnivs) return 0; pos0 = (char *) mem_alloc(strlen(pos)+2); strcpy(pos0, pos); strcat(pos0, "0"); pos1 = (char *) mem_alloc(strlen(pos)+2); strcpy(pos1, pos); strcat(pos1, "1"); res = checkPosCovered(pos0) && checkPosCovered(pos1); mem_free(pos0); mem_free(pos1); return res; } int checkAllCovered() { univs_required = 1; return checkPosCovered(""); } int checkDisjoint() { int u, i; for (u = 0; u < guide.numUnivs; u++) for (i = 0; i < guide.numUnivSS[u]; i++) if (guide.ssUniv[guide.univSS[u][i]] != u) return 0; return 1; } int checkAllUsed() { int s; for (s = 0; s < guide.numSs; s++) if (guide.ssUniv[s] == -1) /* -1: not met, -2: hat */ return 0; return 1; } GTA *gtaMake() { SsId s; GTA *res = (GTA *) mem_alloc(sizeof(GTA)); res->final = 0; /* nothing allocated */ res->ss = (StateSpace *) mem_alloc(sizeof(StateSpace)*guide.numSs); for (s = 0; s < guide.numSs; s++) { StateSpace *ss = &res->ss[s]; ss->size = 0; ss->ls = ss->rs = 0; ss->behaviour = 0; /* nothing allocated */ ss->bddm = 0; /* nothing allocated */ } gta_in_mem++; if (gta_in_mem>max_gta_in_mem) max_gta_in_mem = gta_in_mem; return res; } void gtaFree(GTA* P) { SsId i; mem_free(P->final); for (i = 0; i < guide.numSs; i++) { mem_free(P->ss[i].behaviour); bdd_kill_manager(P->ss[i].bddm); } mem_free(P->ss); mem_free(P); gta_in_mem--; } mona-1.4/GTA/makebasic.c0000644000414100000240000001357010756504321011726 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "../Mem/mem.h" #include "gta.h" #define MAX_EXCEPTION 50 #define MAX_VARIABLES 10 /* #warning INTERNAL LIMITS */ typedef struct { unsigned value; char path[MAX_VARIABLES+1]; } Path; static GTA *gta; static unsigned numExceptions, nextException, exp; static Path exception[MAX_EXCEPTION]; static State left, right; /* current left and right state */ static State defState; static SsId s; /* current state space */ static unsigned sortedIndex[MAX_VARIABLES]; static int *offs; static unsigned numOffs; static char sortedPath[MAX_VARIABLES]; /* current exception path, sorted according to offsets */ static bdd_ptr bddPath[MAX_EXCEPTION]; static bdd_ptr def; /* USAGE: * * gtaSetup(number of states in root state space) * for each state space s do * gtaSetupDelta(s, size of left successor, size of right successor, * offset array, size of offset array) * for each pair (l,r) do * gtaAllocExceptions(l, r, number of exceptions) * gtaStoreException(state, path) [for each exception] * gtaStoreDefault(state) * gtaBuildDelta(initial state) * gtaBuild(final state array) */ /* auxiliary functions */ int offsCmp(const void *i1, const void *i2) { unsigned o1 = offs[*((unsigned *) i1)], o2 = offs[*((unsigned *) i2)]; if (o1 < o2) return -1; if (o1 > o2) return 1; return 0; } unsigned fn_unite(unsigned p, unsigned q) { if (p == q || q == defState) return p; invariant(p == defState); return q; } /* make path ..... */ bdd_ptr makePath(bdd_manager *bddm, unsigned leafValue) { int n; bdd_ptr p; /* insert leaf node */ p = bdd_find_leaf_hashed_add_root(bddm, leafValue); /* build path bottom-up */ for (n = numOffs - 1; n >= 0; n--) switch (sortedPath[n]) { case '0': p = bdd_find_node_hashed_add_root(bddm, p, def, offs[sortedIndex[n]]); break; case '1': p = bdd_find_node_hashed_add_root(bddm, def, p, offs[sortedIndex[n]]); break; case 'X': /* do nothing */ break; } return p; } /* unite bddPaths */ bdd_ptr unitePaths(bdd_manager *bddm) { int n; bdd_ptr p = bddPath[0]; bdd_make_cache(bddm, 8, 4); for (n = 1; n < numExceptions; n++) p = bdd_apply2_hashed(bddm, p, bddm, bddPath[n], bddm, &fn_unite); bdd_kill_cache(bddm); return p; } /* main functions */ /* prepare construction of a new GTA */ void gtaSetup(unsigned rootsize) { gta = gtaMake(); gta->ss[0].size = rootsize; } void gtaSetupDelta(SsId d, unsigned lsize, unsigned rsize, int *offsets, unsigned numOffsets) { int n; s = d; gta->ss[guide.muLeft[s]].size = lsize; gta->ss[guide.muRight[s]].size = rsize; /* prepare behaviour matrix and BDD manager */ gta->ss[s].ls = lsize; gta->ss[s].rs = rsize; gta->ss[s].behaviour = (bdd_handle *) mem_alloc(sizeof(bdd_handle)* gta->ss[s].ls* gta->ss[s].rs); gta->ss[s].bddm = bdd_new_manager(8, 4); /* sort offsets */ numOffs = numOffsets; offs = offsets; for (n = 0; n < numOffs; n++) sortedIndex[n] = n; qsort(sortedIndex, numOffs, sizeof(int), offsCmp); } /* prepare some exceptions from the (l,r) state pair to the default result state */ void gtaAllocExceptions(SsId l, SsId r, unsigned n) { invariant(n <= MAX_EXCEPTION); numExceptions = n; nextException = 0; left = l; right = r; } /* store an exception to the default rule */ void gtaStoreException(unsigned value, char *path) { exception[nextException].value = value; invariant(strlen(path) <= MAX_VARIABLES); strcpy(exception[nextException++].path, path); } /* set default state and make BDD for current state pair */ void gtaStoreDefault(unsigned p) { bdd_ptr united; int n; bdd_manager *tmpBddm; invariant(numExceptions == nextException); defState = p; tmpBddm = bdd_new_manager(100, 10); /* large enough to avoid rehashing??? */ /* COULD AN ASSERTION CHECK THAT REHASHING DOES NOT OCCUR???????? */ /* insert default state as leaf */ def = bdd_find_leaf_hashed_add_root(tmpBddm, defState); /* insert paths for exceptions */ for (exp = 0; exp < numExceptions; exp++) { for (n = 0; n < numOffs; n++) sortedPath[n] = exception[exp].path[sortedIndex[n]]; bddPath[exp] = makePath(tmpBddm, exception[exp].value); } /* unite path roots */ if (numExceptions == 0) united = def; else if (numExceptions == 1) united = bddPath[0]; else united = unitePaths(tmpBddm); /* insert into result BDD manager */ bdd_prepare_apply1(tmpBddm); bdd_apply1(tmpBddm, united, gta->ss[s].bddm, &fn_identity); bdd_kill_manager(tmpBddm); /* set behaviour entry */ BEH(gta->ss[s], left, right) = BDD_LAST_HANDLE(gta->ss[s].bddm); } void gtaBuildDelta(State initial) { gta->ss[s].initial = initial; /* this could be moved to gtaSetupDelta!! */ } GTA *gtaBuild(char *final) { int n; invariant(strlen(final) == gta->ss[0].size); /* set final status */ gta->final = (int *) mem_alloc(sizeof(int)*gta->ss[0].size); for (n = 0; n < gta->ss[0].size; n++) gta->final[n] = (final[n] == '-') ? -1 : (final[n] == '+' ? 1 : 0); return gtaReachable(gta); } mona-1.4/GTA/minimize.c0000644000414100000240000002434611015334261011624 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "../Mem/mem.h" #include "gta.h" static SsId s, lSs, rSs; /* current, left and right state spaces; s is the state space that has been split, lSs and rSs, the successors of s, are the candidates for further splitting */ static GTA *orig, *res; /* original and resulting automata */ static unsigned **block; /* block[s][i] is the block number (discriminator) of state i in state space s; block numbers are consecutive, starting at 0 */ static unsigned *numBlocks; /* numBlocks[s] is the size of the partition for state space s, i.e. highest block number + 1 */ static bdd_ptr *matrix, *transposed; /* normal and transposed behaviour matrix, note: contains bdd_ptrs not bdd_handles to obtain fewer cache misses during compare */ static enum Candidate { cNEVER, cHASBEEN, cYES } *candidate; /* candidate[s]==cYES: if state space s has been split, which entails that s's left and right successor spaces, not s itself (unless s has itself as a successor), are candidates for further refinement candidate[s]==cNEVER: if s never has been split candidate[s]==cHASBEEN: if s has been refined at least once (s could still have just one block) */ /* sorting */ static bdd_ptr **sorted; /* invariant: sorted[i][j] == qm[original[i]*maxSize + j] in fact, sorted[i] == &qm[original[i]*maxSize] */ static unsigned *original; /* original[i] = the original number of a row in sorted order */ static bdd_ptr *qm; /* matrix to be sorted, for storage allocation purposes, row length is assume to be maxSize; actual rowlength is given by qcols; also maxSize rows are allocated */ static unsigned qcols, maxSize; /* used and allocated number of columns in matrix qm */ static unsigned *qb; /* qb[i] = block[s][original[i]] */ int compare(unsigned i, unsigned j) { int n; /* we compare block numbers first, so that all rows in new ordering that are in the same old block are consecutive */ if (qb[i] > qb[j]) return 1; else if (qb[i] < qb[j]) return -1; /* compare wrt. matrix rows and previous block assignments */ for (n = 0; n < qcols; n++) if (sorted[i][n] > sorted[j][n]) return 1; else if (sorted[i][n] < sorted[j][n]) return -1; /* i and j belong to the same old block and they have the same behavior across the row */ return 0; } void swap(unsigned i, unsigned j) { bdd_ptr *tp; unsigned tb, to; /* swap 'block' and 'original' along with 'sorted' */ tp = sorted[i]; to = original[i]; tb = qb[i]; sorted[i] = sorted[j]; original[i] = original[j]; qb[i] = qb[j]; sorted[j] = tp; original[j] = to; qb[j] = tb; } void quicksort(int from, int to) /*** IMPROVE SORTING?!?!? ***/ /* yes, cryptic */ { if (from < to) { int i = from, j = to, v = to; do { while (i < to && compare(i, v) < 0) i++; while (j > from && compare(j, v) > 0) j--; if (i <= j) { swap(i, j); if (v == i) v = j; else if (v == j) v = i; i++; j--; } } while (i <= j); quicksort(from, j); quicksort(i, to); } } void sort(bdd_ptr *m, unsigned *b, unsigned rows, unsigned cols) { int i; qm = m; qcols = cols; /* initialize unsorted */ for (i = 0; i < rows; i++) { sorted[i] = &m[i*maxSize]; original[i] = i; qb[i] = b[i]; } /* sort rows in m */ quicksort(0, rows-1); /************ printf("SORT\n"); for (i = 0; i < rows; i++) { for (j = 0; j < cols; j++) printf("%-3u ", sorted[i][j]); printf(" %-3u\n", b[i]); } printf("SORTDONE\n"); *********/ } /* leaf function */ unsigned fn_block(unsigned p) { return block[s][p]; } /* main function */ GTA *gtaMinimize(GTA *g) { int done; State i, j; unsigned p; /* initialize */ orig = g; res = gtaMake(); maxSize = 0; block = (unsigned **) mem_alloc(sizeof(unsigned *)*guide.numSs); numBlocks = (unsigned *) mem_alloc(sizeof(unsigned)*guide.numSs); candidate = (enum Candidate *) mem_alloc(sizeof(enum Candidate)*guide.numSs); for (s = 0; s < guide.numSs; s++) { block[s] = (unsigned *) mem_alloc(sizeof(unsigned)*orig->ss[s].size); if (orig->ss[s].size > maxSize) maxSize = orig->ss[s].size; /* set up initial partitions and candidates */ if (s > 0) { candidate[s] = cNEVER; /* never processed yet */ for (i = 0; i < orig->ss[s].size; i++) block[s][i] = 0; numBlocks[s] = 1; } else { int anyAccept = 0, anyReject = 0, anyDontcare = 0; numBlocks[0] = 0; for (i = 0; i < orig->ss[0].size; i++) { invariant(orig->final[i] >= -1 && orig->final[i] <= 1); if (orig->final[i] == -1) anyReject = 1; if (orig->final[i] == 1) anyAccept = 1; if (orig->final[i] == 0) anyDontcare = 1; } if (anyReject) anyReject = numBlocks[0]++; if (anyAccept) anyAccept = numBlocks[0]++; if (anyDontcare) anyDontcare = numBlocks[0]++; /* AnyX is the index of the block containing all AnyX states (if any) */ for (i = 0; i < orig->ss[0].size; i++) block[0][i] = (orig->final[i] == -1) ? anyReject : (orig->final[i] == 1)? anyAccept : anyDontcare; if (numBlocks[0] == 1) candidate[0] = cNEVER; /* only one block */ else candidate[0] = cYES; /* initial s.s. is a candidate for splitting */ } } /*....optimize case when numBlocks[0]==1...*/ sorted = (bdd_ptr **) mem_alloc(sizeof(bdd_ptr*)*maxSize); matrix = (bdd_ptr *) mem_alloc(sizeof(bdd_ptr)*maxSize*maxSize); transposed = (bdd_ptr *) mem_alloc(sizeof(bdd_ptr)*maxSize*maxSize); original = (unsigned *) mem_alloc(sizeof(unsigned)*maxSize); qb = (unsigned *) mem_alloc(sizeof(unsigned)*maxSize); /* refine partitions until fixed point reached */ do { done = 1; for (s = 0; s < guide.numSs; s++) if (candidate[s] == cYES) { candidate[s] = cHASBEEN; lSs = guide.muLeft[s]; rSs = guide.muRight[s]; /* find behaviour wrt. current partition */ bdd_prepare_apply1(orig->ss[s].bddm); if (res->ss[s].bddm) bdd_kill_manager(res->ss[s].bddm); res->ss[s].bddm = bdd_new_manager(orig->ss[s].bddm->table_elements, 0); for (i = 0; i < orig->ss[lSs].size; i++) for (j = 0; j < orig->ss[rSs].size; j++) matrix[i*maxSize + j] = transposed[j*maxSize + i] = bdd_apply1(orig->ss[s].bddm, BDD_ROOT(orig->ss[s].bddm,BEH(orig->ss[s], i, j)), res->ss[s].bddm, fn_block); /* refine left state space */ sort(matrix, block[lSs], orig->ss[lSs].size, orig->ss[rSs].size); p = 0; for (i = 0; i < orig->ss[lSs].size - 1; i++) { invariant(compare(i, i+1) <= 0); if (compare(i, i+1) != 0) block[lSs][original[i]] = p++; else block[lSs][original[i]] = p; } block[lSs][original[i]] = p++; invariant(p >= numBlocks[lSs]); if (p > numBlocks[lSs]) { candidate[lSs] = cYES; done = 0; numBlocks[lSs] = p; } /* refine right state space */ sort(transposed, block[rSs], orig->ss[rSs].size, orig->ss[lSs].size); p = 0; for (i = 0; i < orig->ss[rSs].size - 1; i++) { invariant(compare(i, i+1) <= 0); if (compare(i, i+1) != 0) block[rSs][original[i]] = p++; else block[rSs][original[i]] = p; } block[rSs][original[i]] = p++; invariant(p >= numBlocks[rSs]); if (p > numBlocks[rSs]) { candidate[rSs] = cYES; done = 0; numBlocks[rSs] = p; } } } while (!done); /* build result automaton */ for (s = 0; s < guide.numSs; s++) { lSs = guide.muLeft[s]; rSs = guide.muRight[s]; if (candidate[lSs] == cNEVER) res->ss[s].ls = 1; else res->ss[s].ls = numBlocks[lSs]; if (candidate[rSs] == cNEVER) res->ss[s].rs = 1; else res->ss[s].rs = numBlocks[rSs]; res->ss[s].behaviour = (bdd_handle *) mem_alloc(sizeof(bdd_handle)*res->ss[s].ls*res->ss[s].rs); if (candidate[s] == cNEVER) { /* make trivial transition functions for untouched state spaces */ res->ss[s].bddm = bdd_new_manager(1, 0); bdd_handle_find_leaf_hashed_add_root(res->ss[s].bddm, 0); /* handle 0 contains root of BDD leaf 0 */ for (i = 0; i < res->ss[s].ls; i++) for (j = 0; j < res->ss[s].rs; j++) BEH(res->ss[s], i, j) = 0; } else { int org_size = bdd_size(orig->ss[s].bddm); int new_size = bdd_size(res->ss[s].bddm); int new_size_after; /* make final transition functions for the processed state spaces */ bdd_prepare_apply1(orig->ss[s].bddm); for (i = 0; i < orig->ss[lSs].size; i++) for (j = 0; j < orig->ss[rSs].size; j++) { bdd_apply1(orig->ss[s].bddm, BDD_ROOT(orig->ss[s].bddm, BEH(orig->ss[s], i, j)), res->ss[s].bddm, fn_block); BEH(res->ss[s], block[lSs][i], block[rSs][j]) = BDD_LAST_HANDLE(res->ss[s].bddm); } new_size_after = bdd_size(res->ss[s].bddm); invariant(org_size >= new_size); invariant(new_size_after == new_size); } /* set size and initial */ res->ss[s].size = numBlocks[s]; res->ss[s].initial = block[s][orig->ss[s].initial]; } /* set final status */ res->final = (int *) mem_alloc(sizeof(int)*res->ss[0].size); for (i = 0; i < orig->ss[0].size; i++) res->final[block[0][i]] = orig->final[i]; /* clean up */ for (s = 0; s < guide.numSs; s++) mem_free(block[s]); mem_free(block); mem_free(transposed); mem_free(numBlocks); mem_free(candidate); mem_free(sorted); mem_free(original); mem_free(qb); mem_free(matrix); return res; } mona-1.4/GTA/negation.c0000644000414100000240000000161010756504321011603 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "gta.h" void gtaNegation(GTA *g) { unsigned i; for (i = 0; i < g->ss[0].size; i++) g->final[i] = -(g->final[i]); } mona-1.4/GTA/pairhash.c0000644000414100000240000000730210756504321011602 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "pairhash.h" #include "../Mem/mem.h" #include "gta.h" extern long primes[]; /* defined in ../BDD/hash.c */ #define hashPHT(size, p, q) ((((p)*46349 + (q)) * 67108859) % size) void initPHT(PairHashTable *t, unsigned prime) { int i; t->prime = prime; t->size = primes[prime]; t->overflows = 0; t->t = (PairHashTableEntry *) mem_alloc(sizeof(PairHashTableEntry)*t->size); for (i = 0; i < t->size; i++) { t->t[i].p = -1; /* free mark */ t->t[i].overflow = 0; } } void freePHT(PairHashTable *t) { int i; for (i = 0; i < t->size; i++) { PairHashTableEntry *e = t->t[i].overflow, *w; while (e) { w = e->overflow; mem_free(e); e = w; } } mem_free(t->t); } int lookupPHT(PairHashTable *t, unsigned p, unsigned q, unsigned *n) { PairHashTableEntry *e = &t->t[hashPHT(t->size, p, q)]; do { if (e->p == p && e->q == q) { *n = e->n; return 1; } e = e->overflow; } while (e); return 0; } void insertPHT(PairHashTable *t, unsigned p, unsigned q, unsigned n) { PairHashTableEntry *e = &t->t[hashPHT(t->size, p, q)]; if (e->p != -1) { /* no room at front? */ if (t->overflows > t->size*2) { /* too many overflows, rehash */ unsigned newsize = primes[++(t->prime)]; PairHashTableEntry *r = (PairHashTableEntry *) mem_alloc(sizeof(PairHashTableEntry)*newsize); int i; t->overflows = 0; for (i = 0; i < newsize; i++) { /* clear all */ r[i].p = -1; r[i].overflow = 0; } for (i = 0; i < t->size; i++) { /* rehash */ PairHashTableEntry *w = &t->t[i]; if (w->p != -1) while (w) { PairHashTableEntry *s = &r[hashPHT(newsize, w->p, w->q)]; if (s->p != -1) { /* find back of list */ while (s->overflow) s = s->overflow; s->overflow = (PairHashTableEntry *) mem_alloc(sizeof(PairHashTableEntry)); s = s->overflow; t->overflows++; } s->p = w->p; s->q = w->q; s->n = w->n; s->overflow = 0; w = w->overflow; } } for (i = 0; i < t->size; i++) { /* free */ PairHashTableEntry *e = t->t[i].overflow, *w; while (e) { w = e->overflow; mem_free(e); e = w; } } mem_free(t->t); t->t = r; t->size = newsize; e = &t->t[hashPHT(t->size, p, q)]; } if (e->p != -1) { /* still no room at front? */ while (e->overflow) /* place at back of list */ e = e->overflow; e->overflow = (PairHashTableEntry *) mem_alloc(sizeof(PairHashTableEntry)); e = e->overflow; t->overflows++; } } e->p = p; e->q = q; e->n = n; e->overflow = 0; } #ifndef NDEBUG void dumpPHT(PairHashTable *t) { int i; printf("\n<--contents of pair-table at 0x%x\n", (int) t); for (i = 0; i < t->size; i++) { PairHashTableEntry *e = &t->t[i]; while (e) { if (e->p != -1) printf("(%d,%d,%d)[%d] ", e->p, e->q, e->n, i); e = e->overflow; } } printf("\n--->\n"); } #endif mona-1.4/GTA/pairhash.h0000644000414100000240000000245110756504270011612 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* hash tables for mapping from state pairs to new states */ typedef struct PairHashTableEntry { unsigned p, q, n; struct PairHashTableEntry *overflow; } PairHashTableEntry; typedef struct { PairHashTableEntry *t; unsigned size, overflows, prime; } PairHashTable; void initPHT(PairHashTable *t, unsigned prime); void freePHT(PairHashTable *t); int lookupPHT(PairHashTable *t, unsigned p, unsigned q, unsigned *n); void insertPHT(PairHashTable *t, unsigned p, unsigned q, unsigned n); #ifndef NDEBUG void dumpPHT(PairHashTable *t); #endif mona-1.4/GTA/printgta.c0000644000414100000240000001227710756504321011642 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "gta.h" void gtaPrintVerbose(GTA* P) { unsigned lp,rp,p,a = 0; printf("Resulting GTA:\n" "Accepting states: "); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == 1) printf("%d ", p); printf("\nRejecting states: "); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == -1) printf("%d ", p); printf("\nDon't-care states: "); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == 0) { a = 1; break; } if (a) { for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == 0) printf("%d ", p); printf("\n"); } for(p = 0; p < guide.numSs; p++) { printf("\nState space %d '%s' (size %d):\n", p, guide.ssName[p], P->ss[p].size); printf("Initial state: %d\n", P->ss[p].initial); printf("Transitions:\n"); #ifdef DUMP_RAW for(lp = 0; lp < P->ss[guide.muLeft[p]].size; lp++) for(rp = 0; rp < P->ss[guide.muRight[p]].size; rp++) printf("(%d,%d) node: %d\n", lp, rp, BDD_ROOT(P->ss[p].bddm, BEH(P->ss[p], lp, rp))); printf("BDD nodes:\n"); bddDump(P->ss[p].bddm); #else for(lp = 0; lp < P->ss[guide.muLeft[p]].size; lp++) for(rp = 0; rp < P->ss[guide.muRight[p]].size; rp++) print_bddpaths_verbose(lp, rp, P->ss[p].bddm, BDD_ROOT(P->ss[p].bddm, BEH(P->ss[p], lp, rp))); #endif } printf("\n"); } void gtaPrint(GTA* P, unsigned *offs, unsigned no_offs, char **free_vars, int inherited_acceptance) { unsigned lp, rp, p, any = 0; boolean ***inheritedAcceptance = 0; if (inherited_acceptance) inheritedAcceptance = gtaCalcInheritedAcceptance(P); printf("GTA for formula with free variables: "); for (p = 0; p < no_offs; p++) printf ("%s ", free_vars[p]); printf("\nAccepting states: "); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == 1) printf("%d ", p); printf("\nRejecting states: "); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == -1) printf("%d ", p); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == 0) { any = 1; break; } if (any) { printf("\nDon't-care states: "); for (p = 0; p < P->ss[0].size; p++) if (P->final[p] == 0) printf("%d ", p); } printf("\n"); for (p = 0; p < guide.numSs; p++) { printf("\nState space %d '%s' (size %d):\n",p, guide.ssName[p], P->ss[p].size); printf("Initial state: %d\n", P->ss[p].initial); printf("Transitions:\n"); for (lp = 0; lp < P->ss[guide.muLeft[p]].size; lp++) { for (rp = 0; rp < P->ss[guide.muRight[p]].size; rp++) print_bddpaths(lp, rp, P->ss[p].bddm, BDD_ROOT(P->ss[p].bddm, BEH(P->ss[p], lp, rp)), no_offs, offs); } if (inherited_acceptance) { int s, k; printf("Inherited-acceptance:\n"); for (k = 1; k <= 7; k++) { for (s = 0; s < P->ss[p].size; s++) if (inheritedAcceptance[p][s][-1] + inheritedAcceptance[p][s][0]*2 + inheritedAcceptance[p][s][1]*4 == k) break; if (s < P->ss[p].size) { char *kind[] = { "reject", "don't care", "don't care or reject", "accept", "accept or reject", "accept or don't care", "anything" }; printf("States leading to %s: ", kind[k-1]); for (s = 0; s < P->ss[p].size; s++) if (inheritedAcceptance[p][s][-1] + inheritedAcceptance[p][s][0]*2 + inheritedAcceptance[p][s][1]*4 == k) printf("%d ", s); printf("\n"); } } } } if (inherited_acceptance) gtaFreeInheritedAcceptance(inheritedAcceptance); } void gtaPrintVitals(GTA* a) { unsigned d; unsigned total_statespace_size = 0; unsigned total_BDD_size = 0; for (d = 0; d < guide.numSs; d++) { printf("State space %d '%s': %d state%s, %d BDD node%s\n", d, guide.ssName[d], a->ss[d].size, a->ss[d].size>1?"s":"", bdd_size(a->ss[d].bddm), bdd_size(a->ss[d].bddm)>1?"s":""); total_statespace_size += a->ss[d].size; total_BDD_size += bdd_size(a->ss[d].bddm); } printf("Total: %d state%s, %d BDD node%s\n", total_statespace_size, total_statespace_size>1?"s":"", total_BDD_size, total_BDD_size>1?"s":""); } void gtaPrintTotalSize(GTA *a) { unsigned d; unsigned total_statespace_size = 0; unsigned total_BDD_size = 0; for (d = 0; d < guide.numSs; d++) { total_statespace_size += a->ss[d].size; total_BDD_size += bdd_size(a->ss[d].bddm); } printf("\nAutomaton has %d state%s and %d BDD node%s\n", total_statespace_size, total_statespace_size>1?"s":"", total_BDD_size, total_BDD_size>1?"s":""); } mona-1.4/GTA/product.c0000644000414100000240000001177511015334303011462 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "../Mem/mem.h" #include "gta.h" #include "dyn.h" /* PairArray, BehaviourMatrix */ #include "pairhash.h" /* PairHashTable */ #define STATUS_TO_BOOL(s) ((s == -1) ? 0 : 1) #define BOOL_TO_STATUS(s) ((s == 0) ? -1 : 1) static BehaviourMatrix *b; /* extendable matrices */ static PairArray *pairs; /* map states to pairs of states */ static PairHashTable *inverse; /* inverses for 'pairs' */ static GTA *aa1, *aa2, *res; /* automata */ static SsId s, lSs, rSs; /* current, left and right state spaces */ static unsigned fn_pair(unsigned p, unsigned q) { unsigned n; /* is the pair new for this state space? */ if (!lookupPHT(&inverse[s], p, q, &n)) { SsId i; /* make new state for the pair */ n = paSize(pairs[s]); insertPHT(&inverse[s], p, q, n); paInsert(&pairs[s], p, q); /* extend matrices */ for (i = 0; i < guide.numHitsLeft[s]; i++) extendLeftBM(&b[guide.hitsLeft[s][i]]); for (i = 0; i < guide.numHitsRight[s]; i++) extendRightBM(&b[guide.hitsRight[s][i]]); } return n; } void makeProductBehaviour(State i, State j) { bdd_apply2_sequential (aa1->ss[s].bddm, BDD_ROOT(aa1->ss[s].bddm, BEH(aa1->ss[s], paLeft(pairs[lSs], i), paLeft(pairs[rSs], j))), aa2->ss[s].bddm, BDD_ROOT(aa2->ss[s].bddm, BEH(aa2->ss[s], paRight(pairs[lSs], i), paRight(pairs[rSs], j))), res->ss[s].bddm, fn_pair); BM(b[s], i, j) = BDD_LAST_HANDLE(res->ss[s].bddm); } GTA *gtaProduct(GTA *a1, GTA *a2, gtaProductType type) { State i, j; int done; char binfun[4]; res = gtaMake(); aa1 = a1; aa2 = a2; b = (BehaviourMatrix *) mem_alloc(sizeof(BehaviourMatrix)*guide.numSs); pairs = (PairArray *) mem_alloc(sizeof(PairArray)*guide.numSs); inverse = (PairHashTable *) mem_alloc(sizeof(PairHashTable)*guide.numSs); for (s = 0; s < guide.numSs; s++) { /* prepare bdd managers for sequential access (a1 and a2 must be minimal (?)) */ unsigned estimate = 4 + 4 * (bdd_size(a1->ss[s].bddm) > bdd_size(a2->ss[s].bddm) ? bdd_size(a1->ss[s].bddm) : bdd_size(a2->ss[s].bddm)); res->ss[s].bddm = bdd_new_manager(estimate, 0); bdd_make_cache(res->ss[s].bddm, estimate, estimate/8 + 2); /* ??????? */ /* initialize behaviour matrices */ initBM(&b[s]); /* initialize a dynamic array for each state space */ paInit(&pairs[s]); paInsert(&pairs[s], a1->ss[s].initial, a2->ss[s].initial); /* initialize hash tables */ initPHT(&inverse[s], 7); /* 113 is such a nice prime */ insertPHT(&inverse[s], a1->ss[s].initial, a2->ss[s].initial, 0); } /* while some behaviour-matrix needs some filling */ do { done = 1; for (s = 0; s < guide.numSs; s++) { lSs = guide.muLeft[s]; rSs = guide.muRight[s]; if (b[s].lf < b[s].lu) { /* left-direction has been extended */ int lu = b[s].lu, rf = b[s].rf; done = 0; for (i = b[s].lf; i < lu; i++) for (j = 0; j < rf; j++) /* make behaviour for the pairs */ makeProductBehaviour(i, j); b[s].lf = lu; } if (b[s].rf < b[s].ru) { /* right-direction has been extended */ int ru = b[s].ru, lf = b[s].lf; done = 0; for (i = 0; i < lf; i++) for (j = b[s].rf; j < ru; j++) /* make behaviour for the pairs */ makeProductBehaviour(i, j); b[s].rf = ru; } } } while (!done); /* move behaviour matrices */ for (s = 0; s < guide.numSs; s++) { StateSpace *ss = &res->ss[s]; ss->initial = 0; ss->size = paSize(pairs[s]); ss->ls = b[s].ls; ss->rs = b[s].rs; ss->behaviour = b[s].m; } /* set up final-status vector */ binfun[0] = type&1; binfun[1] = (type&2)>>1; binfun[2] = (type&4)>>2; binfun[3] = (type&8)>>3; res->final = (int *) mem_alloc(sizeof(int)*res->ss[0].size); for (i = 0; i < res->ss[0].size; i++) res->final[i] = ((a1->final[paLeft(pairs[0], i)] == 0 || a2->final[paRight(pairs[0], i)] == 0)) ? 0 : BOOL_TO_STATUS(binfun[STATUS_TO_BOOL(a1->final[paLeft(pairs[0], i)])*2 + STATUS_TO_BOOL(a2->final[paRight(pairs[0], i)])]); /* clean up */ for (s = 0; s < guide.numSs; s++) { paFree(&pairs[s]); freePHT(&inverse[s]); bdd_kill_cache(res->ss[s].bddm); } mem_free(inverse); mem_free(pairs); mem_free(b); return res; } mona-1.4/GTA/project.c0000644000414100000240000002362311015334410011442 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "../Mem/mem.h" #include "gta.h" #include "dyn.h" /* BehaviourMatrix */ #include "projset.h" /* StateSet */ #include "subsets.h" /* Subsets */ static GTA *orig, *res; /* original and result GTA */ static SsId s, lSs, rSs; /* current, left and right state spaces */ static StateSet *unproc, *initial; /* for quotient */ static BehaviourMatrix *b; /* extendable behaviour matrix */ static Subsets *sets; /* subset containers */ static State *init; /* initial states */ static int *final; /* final status sequence */ static unsigned finalAllocated; /* allocated size of 'final' */ /* quotient auxiliary functions */ State read0X0(bdd_manager *bddm, bdd_ptr p, unsigned idx, unsigned choice) { if (bdd_is_leaf(bddm, p)) return bdd_leaf_value(bddm, p); else if (bdd_ifindex(bddm, p) == idx) { if (choice) return read0X0(bddm, bdd_then(bddm, p), idx, choice); else return read0X0(bddm, bdd_else(bddm, p), idx, choice); } else return read0X0(bddm, bdd_else(bddm, p), idx, choice); } void zeroPathStates(SsId d, State i, State j, unsigned idx) { State z0, z1; bdd_ptr pp = BDD_ROOT(orig->ss[d].bddm, orig->ss[d].behaviour[i*orig->ss[d].rs + j]); z0 = read0X0(orig->ss[d].bddm, pp, idx, 0); z1 = read0X0(orig->ss[d].bddm, pp, idx, 1); if (!setExists(&initial[d], z0)) { setInsert(&unproc[d], z0); setInsert(&initial[d], z0); } if (z0 != z1 && !setExists(&initial[d], z1)) { setInsert(&unproc[d], z1); setInsert(&initial[d], z1); } } /* project auxiliary functions */ unsigned fn_union(unsigned v1, unsigned v2) { unsigned n; /* make new state for the union set if it's new */ if (!ssLookupAndInsert(&sets[s], v1, v2, &n)) { SsId i; if (s == 0) { /* set final status for new state */ if (n == finalAllocated) { finalAllocated = finalAllocated*2 + 5; final = (int *) mem_resize(final, sizeof(int)*finalAllocated); } final[n] = (final[v1] == 0 && final[v2] == 0) ? 0 : ((final[v1] == 1 || final[v2] == 1) ? 1 : -1); } /* extend matrices */ for (i = 0; i < guide.numHitsLeft[s]; i++) extendLeftBM(&b[guide.hitsLeft[s][i]]); for (i = 0; i < guide.numHitsRight[s]; i++) extendRightBM(&b[guide.hitsRight[s][i]]); } return n; } void makeProjectBehaviour(State i, State j) { if (i >= orig->ss[lSs].size) { if (j >= orig->ss[rSs].size) { /* {i1,i2}x{j1,j2} */ State i1, i2, j1, j2; bdd_handle t1, t2; ssGetComponents(&sets[lSs], i, &i1, &i2); ssGetComponents(&sets[rSs], j, &j1, &j2); bdd_apply2_hashed (res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i1, j1)), res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i1, j2)), res->ss[s].bddm, fn_union); t1 = BDD_LAST_HANDLE(res->ss[s].bddm); bdd_apply2_hashed (res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i2, j1)), res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i2, j2)), res->ss[s].bddm, fn_union); t2 = BDD_LAST_HANDLE(res->ss[s].bddm); bdd_apply2_hashed (res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, t1), res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, t2), res->ss[s].bddm, fn_union); /***this case could be handled differently!!***/ } else { /* {i1,i2}x{j} */ State i1, i2; ssGetComponents(&sets[lSs], i, &i1, &i2); bdd_apply2_hashed (res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i1, j)), res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i2, j)), res->ss[s].bddm, fn_union); } } else { /* {i}x{j1,j2} */ State j1, j2; ssGetComponents(&sets[rSs], j, &j1, &j2); bdd_apply2_hashed (res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i, j1)), res->ss[s].bddm, BDD_ROOT(res->ss[s].bddm, BM(b[s], i, j2)), res->ss[s].bddm, fn_union); } /* ({i}x{j} was filled by bdd_project) */ BM(b[s], i, j) = BDD_LAST_HANDLE(res->ss[s].bddm); } /* main function */ GTA *gtaQuotientAndProject(GTA *g, unsigned idx, int quotient) { unsigned i, j; int done; orig = g; res = gtaMake(); /* QUOTIENT */ /* initialize unprocessed and initial sets */ unproc = (StateSet *) mem_alloc(sizeof(StateSet)*guide.numSs); initial = (StateSet *) mem_alloc(sizeof(StateSet)*guide.numSs); for (s = 0; s < guide.numSs; s++) { setInit(&unproc[s], g->ss[s].size); setInit(&initial[s], g->ss[s].size); setInsert(&unproc[s], g->ss[s].initial); setInsert(&initial[s], g->ss[s].initial); } if (quotient) /* iterate until no more unprocessed */ do { done = 1; for (s = 0; s < guide.numSs; s++) if (!setEmpty(&unproc[s])) { /* pick an unprocessed state q_hat in state space s */ State q_hat = setRemoveOne(&unproc[s]); done = 0; /* for each d that has s as left successor */ for (i = 0; i < guide.numHitsLeft[s]; i++) { SsId d = guide.hitsLeft[s][i]; SsId d2 = guide.muRight[d]; /* for each q2 in initial set of right successor of d */ for (j = 0; j < setSize(&initial[d2]); j++) { State q2 = setRead(&initial[d2], j); /* find zero path states and extend sets */ zeroPathStates(d, q_hat, q2, idx); } } /* for each d that has s as right successor */ for (i = 0; i < guide.numHitsRight[s]; i++) { SsId d = guide.hitsRight[s][i]; SsId d1 = guide.muLeft[d]; /* for each q1 in initial set of left successor of d */ for (j = 0; j < setSize(&initial[d1]); j++) { State q1 = setRead(&initial[d1], j); /* find zero path states and extend sets */ zeroPathStates(d, q1, q_hat, idx); } } } } while (!done); /* PROJECT */ /* initialize */ b = (BehaviourMatrix *) mem_alloc(sizeof(BehaviourMatrix)*guide.numSs); sets = (Subsets *) mem_alloc(sizeof(Subsets)*guide.numSs); final = (int *) mem_alloc(sizeof(int)*g->ss[0].size); finalAllocated = g->ss[0].size; for (i = 0; i < g->ss[0].size; i++) final[i] = g->final[i]; for (s = 0; s < guide.numSs; s++) { unsigned estimate = 2 * bdd_size(g->ss[s].bddm); res->ss[s].bddm = bdd_new_manager(estimate, estimate/8 + 2); bdd_make_cache(res->ss[s].bddm, estimate, estimate/8 + 2); initBMtoSize(&b[s], g->ss[guide.muLeft[s]].size, g->ss[guide.muRight[s]].size); ssInit(&sets[s], g->ss[s].size, 7); } /* make nondeterministic automaton and prepare determinization */ for (s = 0; s < guide.numSs; s++) { for (i = 0; i < g->ss[guide.muLeft[s]].size; i++) for (j = 0; j < g->ss[guide.muRight[s]].size; j++) { bdd_project(g->ss[s].bddm, BDD_ROOT(g->ss[s].bddm, g->ss[s].behaviour[i*g->ss[s].rs+j]), idx, res->ss[s].bddm, fn_union); BM(b[s], i, j) = BDD_LAST_HANDLE(res->ss[s].bddm); } b[s].lf = g->ss[guide.muLeft[s]].size; b[s].rf = g->ss[guide.muRight[s]].size; } /* clear BDD cache */ for (s = 0; s < guide.numSs; s++) { unsigned estimate = 2 * bdd_size(g->ss[s].bddm); bdd_kill_cache(res->ss[s].bddm); bdd_make_cache(res->ss[s].bddm, estimate, estimate/8 + 2); res->ss[s].bddm->cache_erase_on_doubling = TRUE; /* ???? */ bdd_prepare_apply1(res->ss[s].bddm); /* ??????????????????????????????? */ } /* insert initial sets as new states */ init = (State *) mem_alloc(sizeof(State)*guide.numSs); for (s = 0; s < guide.numSs; s++) if (setSize(&initial[s]) >= 2) { /***initial sets could be unfolded better!!!***/ unsigned i, s1, s2; /* make new state for the first two elements */ s1 = fn_union(setRead(&initial[s], 0), setRead(&initial[s], 1)); /* unfold the rest and make new states */ for (i = 2; i < setSize(&initial[s]); i++) { s2 = setRead(&initial[s], i); s1 = fn_union(s1, s2); } init[s] = s1; } else init[s] = setRead(&initial[s], 0); /* determinize by iterating until all new behaviour is filled */ do { done = 1; for (s = 0; s < guide.numSs; s++) { lSs = guide.muLeft[s]; rSs = guide.muRight[s]; if (b[s].lf < b[s].lu) { /* left-direction has been extended */ int lu = b[s].lu, rf = b[s].rf; done = 0; for (i = b[s].lf; i < lu; i++) for (j = 0; j < rf; j++) /* make behaviour for the set */ makeProjectBehaviour(i, j); b[s].lf = lu; } if (b[s].rf < b[s].ru) { /* right-direction has been extended */ int ru = b[s].ru, lf = b[s].lf; done = 0; for (i = 0; i < lf; i++) for (j = b[s].rf; j < ru; j++) /* make behaviour for the set */ makeProjectBehaviour(i, j); b[s].rf = ru; } } } while (!done); /* move behaviour to result automaton */ for (s = 0; s < guide.numSs; s++) { StateSpace *ss = &res->ss[s]; ss->initial = init[s]; ss->size = ssSize(&sets[s]); ss->ls = b[s].ls; ss->rs = b[s].rs; ss->behaviour = b[s].m; } /* set final status */ res->final = (int *) mem_alloc(sizeof(int)*res->ss[0].size); for (i = 0; i < res->ss[0].size; i++) res->final[i] = final[i]; /* clean up */ for (s = 0; s < guide.numSs; s++) { ssFree(&sets[s]); setFree(&unproc[s]); setFree(&initial[s]); } mem_free(sets); mem_free(b); mem_free(final); mem_free(unproc); mem_free(initial); mem_free(init); return gtaReachable(res); } mona-1.4/GTA/projset.c0000644000414100000240000000332010756504321011465 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "../Mem/mem.h" #include "projset.h" void setInit(StateSet *set, unsigned maxSize) { int i; set->used = set->allocated = 0; set->present = (char *) mem_alloc(sizeof(char)*maxSize); set->e = 0; for (i = 0; i < maxSize; i++) set->present[i] = 0; } void setInsert(StateSet *set, State s) { if (set->used == set->allocated) { set->allocated = set->allocated*2+1; set->e = (State *) mem_resize(set->e, sizeof(State)*set->allocated); } set->e[set->used] = s; set->present[s] = 1; set->used++; } int setEmpty(StateSet *set) { return set->used == 0; } State setRemoveOne(StateSet *set) { set->used--; return set->e[set->used]; } State setRead(StateSet *set, unsigned pos) { return set->e[pos]; } unsigned setSize(StateSet *set) { return set->used; } int setExists(StateSet *set, State s) { return set->present[s] == 1; } void setFree(StateSet *set) { mem_free(set->present); mem_free(set->e); } mona-1.4/GTA/projset.h0000644000414100000240000000230510756504270011477 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __PROJSET_H #define __PROJSET_H #include "gta.h" typedef struct { unsigned used, allocated; char *present; State *e; } StateSet; void setInit(StateSet *set, unsigned maxSize); void setInsert(StateSet *set, State s); int setEmpty(StateSet *set); State setRemoveOne(StateSet *set); State setRead(StateSet *set, unsigned pos); unsigned setSize(StateSet *set); int setExists(StateSet *set, State s); void setFree(StateSet *set); #endif mona-1.4/GTA/reachable.c0000644000414100000240000001073611015334424011710 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "../Mem/mem.h" #include "gta.h" #include "dyn.h" static GTA *orig, *res; /* original and result GTA */ static BehaviourMatrix *resbeh; static State **newNumber; /* maps old state numbers to new */ static State **oldNumber; /* inverse of newNumber */ static State *nextNewNumber; /* used size of newNumber */ static SsId s, lSs, rSs; /* current, left and right state spaces */ /* auxiliary functions */ static unsigned fn_reachable(unsigned v) { /* first time reached? */ if (newNumber[s][v] == -1) { SsId i; /* assign new state number and insert into unproc */ newNumber[s][v] = nextNewNumber[s]; oldNumber[s][nextNewNumber[s]] = v; nextNewNumber[s]++; /* extend matrices */ for (i = 0; i < guide.numHitsLeft[s]; i++) extendLeftBM(&resbeh[guide.hitsLeft[s][i]]); for (i = 0; i < guide.numHitsRight[s]; i++) extendRightBM(&resbeh[guide.hitsRight[s][i]]); } return newNumber[s][v]; } static void makeReachableBehaviour(State i, State j) { bdd_apply1(orig->ss[s].bddm, BDD_ROOT(orig->ss[s].bddm, BEH(orig->ss[s], oldNumber[lSs][i], oldNumber[rSs][j])), res->ss[s].bddm, fn_reachable); BM(resbeh[s], i, j) = BDD_LAST_HANDLE(res->ss[s].bddm); } /* main function */ GTA *gtaReachable(GTA *g) { int i, j, done; /* initialize */ orig = g; res = gtaMake(); resbeh = (BehaviourMatrix *) mem_alloc(sizeof(BehaviourMatrix)*guide.numSs); newNumber = (State **) mem_alloc(sizeof(State *)*guide.numSs); oldNumber = (State **) mem_alloc(sizeof(State *)*guide.numSs); nextNewNumber = (unsigned *) mem_alloc(sizeof(unsigned)*guide.numSs); for (s = 0; s < guide.numSs; s++) { unsigned maxSize = orig->ss[s].size; newNumber[s] = (State *) mem_alloc(sizeof(State)*maxSize); oldNumber[s] = (State *) mem_alloc(sizeof(State)*maxSize); for (i = 0; i < maxSize; i++) newNumber[s][i] = -1; /* initialize as unreachable */ nextNewNumber[s] = 1; newNumber[s][orig->ss[s].initial] = 0; /* initial state is reachable, gets number 0 */ oldNumber[s][0] = orig->ss[s].initial; /* inverse of newNumber */ res->ss[s].bddm = bdd_new_manager(bdd_size(orig->ss[s].bddm), bdd_size(orig->ss[s].bddm)/8+2); bdd_prepare_apply1(orig->ss[s].bddm); initBMtoSize(&resbeh[s], 1, 1); } /* iterate until all reachable have been moved */ do { done = 1; for (s = 0; s < guide.numSs; s++) { lSs = guide.muLeft[s]; rSs = guide.muRight[s]; if (resbeh[s].lf < resbeh[s].lu) { /* left-direction has been extended */ int lu = resbeh[s].lu, rf = resbeh[s].rf; done = 0; for (i = resbeh[s].lf; i < lu; i++) for (j = 0; j < rf; j++) makeReachableBehaviour(i, j); resbeh[s].lf = lu; } if (resbeh[s].rf < resbeh[s].ru) { /* right-direction has been extended */ int ru = resbeh[s].ru, lf = resbeh[s].lf; done = 0; for (i = 0; i < lf; i++) for (j = resbeh[s].rf; j < ru; j++) makeReachableBehaviour(i, j); resbeh[s].rf = ru; } } } while (!done); /* move behaviour to result automaton */ for (s = 0; s < guide.numSs; s++) { StateSpace *ss = &res->ss[s]; ss->initial = 0; ss->size = nextNewNumber[s]; ss->ls = resbeh[s].ls; ss->rs = resbeh[s].rs; ss->behaviour = resbeh[s].m; } /* set final status */ res->final = (int *) mem_alloc(sizeof(int)*res->ss[0].size); for (i = 0; i < res->ss[0].size; i++) res->final[i] = orig->final[oldNumber[0][i]]; /* clean up */ for (s = 0; s < guide.numSs; s++) { mem_free(newNumber[s]); mem_free(oldNumber[s]); } mem_free(newNumber); mem_free(oldNumber); mem_free(nextNewNumber); mem_free(resbeh); gtaFree(orig); /* notice: original is freed!! */ return res; } mona-1.4/GTA/replace_indices.c0000644000414100000240000000227510756504321013120 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "gta.h" void gtaReplaceIndices(GTA *P, unsigned map[]) { unsigned i,p1,p2; for (i = 0; i < guide.numSs; i++) { unsigned rs = P->ss[guide.muRight[i]].size; unsigned ls = P->ss[guide.muLeft[i]].size; bdd_prepare_apply1(P->ss[i].bddm); for (p1 = 0; p1 < ls; p1++) for (p2 = 0; p2 < rs; p2++) bdd_replace_indices( P->ss[i].bddm, BDD_ROOT(P->ss[i].bddm, BEH(P->ss[i], p1, p2)), map); } } mona-1.4/GTA/restrict.c0000644000414100000240000000216010756504321011637 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "gta.h" void gtaRestrict(GTA *g) { int i; for (i = 0; i < g->ss[0].size; i++) if (g->final[i] == -1) g->final[i] = 0; /* turn rejects into don't-cares */ } void gtaUnrestrict(GTA *g) { int i; for (i = 0; i < g->ss[0].size; i++) if (g->final[i] == 0) g->final[i] = -1; /* turn don't-cares into rejects */ } mona-1.4/GTA/subsets.c0000644000414100000240000001423010756504321011471 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include /* for ssDump */ #include #include "../Mem/mem.h" #include "subsets.h" extern long primes[]; /* defined in ../BDD/hash.c */ unsigned ssHash(unsigned *set, unsigned len, unsigned size) { unsigned hash = 0; while (len--) hash = (hash << 1) + *set++ + 42; return hash % size; } void ssInit(Subsets *s, unsigned singletons, unsigned initialCapacity) { int i; s->prime = initialCapacity; s->size = primes[s->prime]; s->overflows = 0; s->inverse = 0; s->inverseAllocated = 0; s->num = 0; s->singletons = singletons; s->t = (SubsetsEntry *) mem_alloc(sizeof(SubsetsEntry)*s->size); for (i = 0; i < s->size; i++) { s->t[i].length = 0; /* free mark */ s->t[i].overflow = 0; } } void ssFree(Subsets *s) { int i; for (i = 0; i < s->size; i++) { SubsetsEntry *e = s->t[i].overflow, *w; while (e) { w = e->overflow; mem_free(e->elements); invariant(s->inverse[e->n - s->singletons] = e); mem_free(e); e = w; } if (s->t[i].length != 0) mem_free(s->t[i].elements); } mem_free(s->t); mem_free(s->inverse); } int ssLookupAndInsert(Subsets *s, unsigned c1, unsigned c2, unsigned *n) { unsigned t, len = 0, i1 = 0, i2 = 0; unsigned *unionSet; SubsetsEntry *e, *ee, *eee; SubsetsEntry *e1, *e2; if (c1 == c2) { /* same set, trivial union */ *n = c1; return 1; } /* ensure that c1singletons) { /* both c1 and c2 are singletons */ unionSet = (unsigned *) mem_alloc(sizeof(unsigned)*2); unionSet[len++] = c1; unionSet[len++] = c2; } else if (c1 >= s->singletons) { /* both c1 and c2 are non-singletons, merge the element arrays */ e1 = s->inverse[c1 - s->singletons]; e2 = s->inverse[c2 - s->singletons]; unionSet = (unsigned *) mem_alloc(sizeof(unsigned)*(e1->length + e2->length)); while (i1 < e1->length && i2 < e2->length) if (e1->elements[i1] < e2->elements[i2]) unionSet[len++] = e1->elements[i1++]; else if (e1->elements[i1] >= e2->elements[i2]) { unionSet[len++] = e2->elements[i2++]; if (e1->elements[i1] == e2->elements[i2-1]) i1++; } while (i1 < e1->length) unionSet[len++] = e1->elements[i1++]; while (i2 < e2->length) unionSet[len++] = e2->elements[i2++]; } else { /* c1 is singleton, c2 is non-singleton */ e2 = s->inverse[c2 - s->singletons]; unionSet = (unsigned *) mem_alloc(sizeof(unsigned)*(e2->length+1)); while (i2 < e2->length && c1 > e2->elements[i2]) unionSet[len++] = e2->elements[i2++]; if (i2 == e2->length || c1 != e2->elements[i2]) unionSet[len++] = c1; while (i2 < e2->length) unionSet[len++] = e2->elements[i2++]; } /* SEARCH FOR THE UNION SET */ e = ee = &s->t[ssHash(unionSet, len, s->size)]; do { if (e->length == len && memcmp(e->elements, unionSet, sizeof(unsigned)*len) == 0) { /* found it */ *n = e->n; mem_free(unionSet); return 1; } eee = e; e = e->overflow; } while (e); /* NOT FOUND, INSERT IT */ if (ee->length != 0) { /* main entry occupied? */ ee = (SubsetsEntry *) mem_alloc(sizeof(SubsetsEntry)); eee->overflow = ee; s->overflows++; } /* ee is now the new entry */ /* insert into inverse table */ if (s->num == s->inverseAllocated) { s->inverseAllocated = s->inverseAllocated*2 + 5; s->inverse = (SubsetsEntry **) mem_resize(s->inverse, sizeof(SubsetsEntry *)*s->inverseAllocated); } s->inverse[s->num] = ee; /* assign it a number (successively) */ *n = s->singletons + s->num++; /* fill entry */ ee->elements = unionSet; ee->length = len; ee->n = *n; ee->c1 = c1; ee->c2 = c2; ee->overflow = 0; if (s->overflows > s->size*2) { /* TOO MANY OVERFLOWS, REHASH */ unsigned newsize = primes[++(s->prime)]; SubsetsEntry *r = (SubsetsEntry *) mem_alloc(sizeof(SubsetsEntry)*newsize); int i; s->overflows = 0; /* clear new array */ for (i = 0; i < newsize; i++) { r[i].length = 0; r[i].overflow = 0; } /* rehash */ for (i = 0; i < s->size; i++) { SubsetsEntry *w = &s->t[i], *ww; if (w->length != 0) while (w) { SubsetsEntry *d = &r[ssHash(w->elements, w->length, newsize)]; /* find back of list */ if (d->length != 0) { while (d->overflow) d = d->overflow; d->overflow = (SubsetsEntry *) mem_alloc(sizeof(SubsetsEntry)); d = d->overflow; s->overflows++; } d->elements = w->elements; d->length = w->length; d->n = w->n; d->c1 = w->c1; d->c2 = w->c2; d->overflow = 0; s->inverse[d->n - s->singletons] = d; ww = w; w = w->overflow; if (ww != &s->t[i]) mem_free(ww); } } mem_free(s->t); s->t = r; s->size = newsize; } return 0; } unsigned ssSize(Subsets *s) { return s->singletons + s->num; } void ssGetComponents(Subsets *s, unsigned n, unsigned *c1, unsigned *c2) { SubsetsEntry *e = s->inverse[n - s->singletons]; *c1 = e->c1; *c2 = e->c2; } #ifndef NDEBUG void ssDump(Subsets *s) { int i, j; printf("DUMP:\n"); for (i = 0; i < s->num; i++) { SubsetsEntry *e = s->inverse[i]; printf("%i = {", i + s->singletons); for (j = 0; j < e->length; j++) printf("%s%i", j==0 ? "" : ", ", e->elements[j]); printf("}\n"); } } #endif mona-1.4/GTA/subsets.h0000644000414100000240000000331410756504270011502 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __SUBSETS_H #define __SUBSETS_H #include "gta.h" typedef struct SubsetsEntry { unsigned n; /* invariant: n > elements, c1 and c2 */ unsigned c1, c2; /* immediate constituents */ unsigned *elements; /* sorted array */ unsigned length; /* number of elements */ struct SubsetsEntry *overflow; } SubsetsEntry; typedef struct { SubsetsEntry *t; /* map from elements to n */ SubsetsEntry **inverse; /* map from n to elements */ unsigned size, overflows, prime; unsigned inverseAllocated; unsigned num; /* number of subsets excluding singletons */ unsigned singletons; /* number of singleton sets */ } Subsets; void ssInit(Subsets *s, unsigned singletons, unsigned initialCapacity); void ssFree(Subsets *s); int ssLookupAndInsert(Subsets *s, unsigned c1, unsigned c2, unsigned *n); unsigned ssSize(Subsets *s); void ssGetComponents(Subsets *s, unsigned n, unsigned *c1, unsigned *c2); #ifndef NDEBUG void ssDump(Subsets *s); #endif #endif mona-1.4/GTA/types.c0000644000414100000240000003414311015334625011147 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "gta.h" #include "../Mem/mem.h" gtaType *treetypes = 0; int num_types = 0; static int currentType = -1, currentVariant, currentComponent; static void printTypePositions(Tree *tree, unsigned index, int *first, int begin, int all, char path[], int type); static Tree *printTreeRoot(Tree *tree, unsigned index, int type, char *path); /* TREE TYPE INITIALIZATION */ void initTreetypes(int num) { num_types = num; treetypes = (gtaType *) mem_alloc(sizeof(gtaType)*num_types); } int initTreetype(char *name, int numVariants) { currentType++; treetypes[currentType].name = name; treetypes[currentType].numVariants = numVariants; treetypes[currentType].variantName = (char **) mem_alloc(sizeof(char *)*numVariants); treetypes[currentType].variantPos = (char **) mem_alloc(sizeof(char *)*numVariants); treetypes[currentType].numComponents = (int *) mem_alloc(sizeof(int)*numVariants); treetypes[currentType].componentName = (char ***) mem_alloc(sizeof(char **)*numVariants); treetypes[currentType].componentPos = (char ***) mem_alloc(sizeof(char **)*numVariants); treetypes[currentType].ct = (char ***) mem_alloc(sizeof(char **)*numVariants); treetypes[currentType].componentType = (int **) mem_alloc(sizeof(int *)*numVariants); currentVariant = -1; return currentType; } void initTreetypeVariant(char *name, int numComponents) { currentVariant++; treetypes[currentType].variantName[currentVariant] = name; treetypes[currentType].numComponents[currentVariant] = numComponents; treetypes[currentType].componentName[currentVariant] = (char **) mem_alloc(sizeof(char *)*numComponents); treetypes[currentType].componentPos[currentVariant] = (char **) mem_alloc(sizeof(char *)*numComponents); treetypes[currentType].componentType[currentVariant] = (int *) mem_alloc(sizeof(int)*numComponents); treetypes[currentType].ct[currentVariant] = (char **) mem_alloc(sizeof(char *)*numComponents); currentComponent = -1; } void setTreetypeComponent(char *name, char *type) { currentComponent++; treetypes[currentType].componentName[currentVariant][currentComponent] = name; treetypes[currentType].ct[currentVariant][currentComponent] = type; } void setVariantPos(int type, int var, char *pos) { treetypes[type].variantPos[var] = pos; } void setComponentPos(int type, int var, int comp, char *pos) { treetypes[type].componentPos[var][comp] = pos; } void setComponentTypes() { int t, v, c, u; for (t = 0; t < num_types; t++) { for (v = 0; v < treetypes[t].numVariants; v++) for (c = 0; c < treetypes[t].numComponents[v]; c++) { int found = 0; for (u = 0; u < num_types && !found; u++) if (treetypes[t].ct[v][c] == treetypes[u].name) { treetypes[t].componentType[v][c] = u; found = 1; } if (!found) invariant(0); } } } void freeTreetypes() { int t, v; for (t = 0; t < num_types; t++) { for (v = 0; v < treetypes[t].numVariants; v++) { mem_free(treetypes[t].componentType[v]); mem_free(treetypes[t].componentName[v]); mem_free(treetypes[t].componentPos[v]); if (treetypes[t].ct) mem_free(treetypes[t].ct[v]); } mem_free(treetypes[t].componentType); mem_free(treetypes[t].componentName); mem_free(treetypes[t].componentPos); mem_free(treetypes[t].variantName); mem_free(treetypes[t].variantPos); if (treetypes[t].ct) mem_free(treetypes[t].ct); mem_free(treetypes[t].numComponents); } mem_free(treetypes); } /* PRINT TYPED TREE */ static int findVariant(Tree *tree, int num, int idx, Tree **node, unsigned index) { /* find the (unique) leaf node with a 1 */ int v = -1; if (tree && !tree->empty) { if (num > 1) { /* search the variant-tree */ v = findVariant(tree->left, (num+1)/2, idx, node, index); if (v == -1) v = findVariant(tree->right, num/2, idx+(num+1)/2, node, index); } else { trace_descr t, p = find_one_path(tree->bddm, bdd_roots(tree->bddm)[tree->behavior_handle], tree->state); t = p; while (t && (t->index != index)) t = t->next; if (t && t->value) /* read a 1? */ v = idx; /* found the variant */ kill_trace(p); *node = tree; /* remember the node */ } } return v; } static Tree *findComponent(Tree *tree, int num, int c) { /* find the c'th leaf node in tree with num leaves */ while (num > 1) { if (tree->empty) return 0; if (c < (num+1)/2) { tree = tree->left; num = (num+1)/2; } else { tree = tree->right; c = c - (num+1)/2; num = num/2; } } return tree; } static void printTypedTree(int type, Tree *tree, unsigned index) { int v, c; Tree *node; int numComp; if (!tree) { printf("?"); return; } invariant(type != -1); invariant(guide.ssUniv[tree->d] >= 0); v = findVariant(tree, treetypes[type].numVariants, 0, &node, index); if (v == -1) { printf("?"); return; } printf(treetypes[type].variantName[v]); numComp = treetypes[type].numComponents[v]; if (numComp > 0) { printf("("); if (numComp > 1) { for (c = 0; c < numComp; c++) { if (c != 0) printf(","); printTypedTree(treetypes[type].componentType[v][c], findComponent(node, numComp, c), index); } } else /* only one component, dummy on right */ printTypedTree(treetypes[type].componentType[v][0], node->left, index); printf(")"); } } /* FOLLOW PATH */ static Tree *findNode(Tree *tree, char *pos, int i) { while (tree && pos[i]) { switch (pos[i]) { case '0': tree = tree->left; break; case '1': tree = tree->right; break; } i++; } return tree; } /* PRINT TREE ROOT */ static Tree *printTreeRootComps(Tree *tree, int num, int idx, unsigned index, char path[], int type, int variant) { Tree *res = 0; if (tree && !tree->empty) { if (num > 1) { res = printTreeRootComps(tree->left, (num+1)/2, idx, index, path, type, variant); if (!res) res = printTreeRootComps(tree->right, num/2, idx+(num+1)/2, index, path, type, variant); } else if (num == 1) { char *component = treetypes[type].componentName[variant][idx]; char *newpath = (char *) mem_alloc(strlen(path)+strlen(component)+2); sprintf(newpath, "%s%s.", path, component); res = printTreeRoot(tree, index, treetypes[type].componentType[variant][idx], newpath); mem_free(newpath); } } return res; } static Tree *printTreeRootVariants(Tree *tree, int num, int idx, unsigned index, char path[], int type) { Tree *res = 0; if (tree && !tree->empty) { if (num > 1) { res = printTreeRootVariants(tree->left, (num+1)/2, idx, index, path, type); if (!res) res = printTreeRootVariants(tree->right, num/2, idx+(num+1)/2, index, path, type); } else { int n = treetypes[type].numComponents[idx]; char *variant = treetypes[type].variantName[idx]; char *newpath = (char *) mem_alloc(strlen(path)+strlen(variant)+2); sprintf(newpath, "%s%s.", path, variant); res = printTreeRootComps(tree->left, (n+1)/2, 0, index, newpath, type, idx); if (!res) res = printTreeRootComps(tree->right, n/2, (n+1)/2, index, newpath, type, idx); mem_free(newpath); } } return res; } static Tree *printTreeRoot(Tree *tree, unsigned index, int type, char *path) { Tree *res = 0; if (tree && !tree->empty) { trace_descr t, p = find_one_path(tree->bddm, bdd_roots(tree->bddm)[tree->behavior_handle], tree->state); t = p; while (t && (t->index != index)) t = t->next; if (t && t->value) { /* read a 1? */ printf(path); res = tree; } kill_trace(p); if (!res) res = printTreeRootVariants(tree, treetypes[type].numVariants, 0, index, path, type); } return res; } /* PRINT POSITION(S) */ static void printTypePosComps(Tree *tree, int num, int idx, unsigned index, int *first, int begin, int all, char path[], int type, int variant) { if (tree && !tree->empty) { if (num > 1) { printTypePosComps(tree->left, (num+1)/2, idx, index, first, begin, all, path, type, variant); printTypePosComps(tree->right, num/2, idx+(num+1)/2, index, first, begin, all, path, type, variant); } else if (num == 1) { char *component = treetypes[type].componentName[variant][idx]; char *newpath = (char *) mem_alloc(strlen(path)+strlen(component)+2); sprintf(newpath, "%s%s%s", path, begin ? "" : ".", component); printTypePositions(tree, index, first, 0, all, newpath, treetypes[type].componentType[variant][idx]); mem_free(newpath); } } } static void printTypePosVariants(Tree *tree, int num, int idx, unsigned index, int *first, int begin, int all, char path[], int type) { if (tree && !tree->empty) { if (num > 1) { printTypePosVariants(tree->left, (num+1)/2, idx, index, first, begin, all, path, type); printTypePosVariants(tree->right, num/2, idx+(num+1)/2, index, first, begin, all, path, type); } else { int n = treetypes[type].numComponents[idx]; char *variant = treetypes[type].variantName[idx]; char *newpath = (char *) mem_alloc(strlen(path)+strlen(variant)+2); sprintf(newpath, "%s%s%s", path, begin ? "" : ".", variant); printTypePosComps(tree->left, (n+1)/2, 0, index, first, 0, all, newpath, type, idx); printTypePosComps(tree->right, n/2, (n+1)/2, index, first, 0, all, newpath, type, idx); mem_free(newpath); } } } static void printTypePositions(Tree *tree, unsigned index, int *first, int begin, int all, char path[], int type) { if (tree && !tree->empty) { trace_descr t, p = find_one_path(tree->bddm, bdd_roots(tree->bddm)[tree->behavior_handle], tree->state); t = p; while (t && (t->index != index)) t = t->next; if (t && t->value) { /* read a 1? */ if (!*first) printf(","); printf(path); *first = 0; } kill_trace(p); if (all || *first) printTypePosVariants(tree, treetypes[type].numVariants, 0, index, first, begin, all, path, type); } } /* PRINT EXAMPLE */ static void printTypeExample(Tree *example, unsigned num, char *names[], char orders[], unsigned indices[], int *univs[], int trees[]) { trace_descr bools; int i; bools = find_one_path(example->bddm, BDD_ROOT(example->bddm, example->behavior_handle), example->state); for (i = 0; i < num; i++) { printf(" %s = ", names[i]); switch (orders[i]) { case 0: /* Boolean variable */ { trace_descr t = bools; while (t && (t->index != indices[i])) t = t->next; if (t && t->value) printf("true\n"); else printf("false\n"); break; } case 1: /* first-order variable */ { int j, first = 1, any = 0; for (j = 0; univs[i][j] != -1; j++) { int u = univs[i][j]; Tree *t = findNode(example, guide.univPos[u], 0); if (t) { char *univname = guide.univName[u]; char *path = (char *) mem_alloc(strlen(univname)+2); sprintf(path, "%s:", univname); printTypePositions(t, indices[i], &first, 1, 0, path, guide.ssType[t->d]); if (!first) any = 1; mem_free(path); } } if (!any) printf("?"); printf("\n"); break; } case 2: /* second-order variable */ { if (trees[i]) { /* print as typed tree */ int j, any = 0; for (j = 0; univs[i][j] != -1 && !any; j++) { int u = univs[i][j]; Tree *t = findNode(example, guide.univPos[u], 0); if (t) { char *univname = guide.univName[u]; char *path = (char *) mem_alloc(strlen(univname)+2); sprintf(path, "%s:", univname); t = printTreeRoot(t, indices[i], guide.ssType[t->d], path); mem_free(path); if (t) { printTypedTree(guide.ssType[t->d], t, indices[i]); any = 1; } } } if (!any) printf("?"); printf("\n"); } else { /* print as set of positions */ int j, first = 1; printf("{"); for (j = 0; univs[i][j] != -1; j++) { int u = univs[i][j]; Tree *t = findNode(example, guide.univPos[u], 0); if (t) { char *univname = guide.univName[u]; char *path = (char *) mem_alloc(strlen(univname)+2); sprintf(path, "%s:", univname); printTypePositions(t, indices[i], &first, 1, 1, path, guide.ssType[t->d]); mem_free(path); } } printf("}\n"); } break; } } } kill_trace(bools); } /* ANALYZE WITH TYPES */ void gtaTypeAnalyze(GTA *a, unsigned num, char *names[], char orders[], unsigned indices[], int *univs[], int trees[]) { Tree *counterexample, *satisfyingexample; counterexample = gtaMakeExample(a, -1); satisfyingexample = gtaMakeExample(a, 1); if (!counterexample && satisfyingexample) printf("Formula is valid\n"); else if (!satisfyingexample) printf("Formula is unsatisfiable\n"); if (counterexample) { printf("A counter-example is:\n"); printTypeExample(counterexample, num, names, orders, indices, univs, trees); } if (satisfyingexample) { if (counterexample) printf("\n"); printf("A satisfying example is:\n"); printTypeExample(satisfyingexample, num, names, orders, indices, univs, trees); } gtaFreeTrees(); } mona-1.4/Front/0000777000414100000240000000000011045777453010410 500000000000000mona-1.4/Front/makefile.am0000644000414100000240000000127510764207701012414 00000000000000MAINTAINERCLEANFILES = makefile.in makefile BUILT_SOURCES = parser.h AM_LFLAGS = -l AM_YFLAGS = -d bin_PROGRAMS = mona mona_SOURCES = ast.cpp astdump.cpp ast.h code.cpp codedump.cpp code.h \ codesubst.cpp codetable.cpp codetable.h deque.h env.h freevars.cpp \ ident.cpp ident.h lib.cpp lib.h makeguide.cpp mona.cpp offsets.cpp \ offsets.h parser.ypp predlib.cpp predlib.h printline.cpp printline.h \ reduce.cpp scanner.lpp signature.cpp signature.h st_dfa.cpp st_dfa.h \ st_gta.cpp st_gta.h str.h symboltable.cpp symboltable.h timer.cpp \ timer.h untyped.cpp untyped.h mona_CPPFLAGS = -I ../BDD mona_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la ../DFA/libmonadfa.la \ ../GTA/libmonagta.la mona-1.4/Front/makefile.in0000644000414100000240000016503311045777401012432 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = mona$(EXEEXT) subdir = Front DIST_COMMON = $(srcdir)/makefile.am $(srcdir)/makefile.in parser.cpp \ parser.h scanner.cpp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_mona_OBJECTS = mona-ast.$(OBJEXT) mona-astdump.$(OBJEXT) \ mona-code.$(OBJEXT) mona-codedump.$(OBJEXT) \ mona-codesubst.$(OBJEXT) mona-codetable.$(OBJEXT) \ mona-freevars.$(OBJEXT) mona-ident.$(OBJEXT) \ mona-lib.$(OBJEXT) mona-makeguide.$(OBJEXT) \ mona-mona.$(OBJEXT) mona-offsets.$(OBJEXT) \ mona-parser.$(OBJEXT) mona-predlib.$(OBJEXT) \ mona-printline.$(OBJEXT) mona-reduce.$(OBJEXT) \ mona-scanner.$(OBJEXT) mona-signature.$(OBJEXT) \ mona-st_dfa.$(OBJEXT) mona-st_gta.$(OBJEXT) \ mona-symboltable.$(OBJEXT) mona-timer.$(OBJEXT) \ mona-untyped.$(OBJEXT) mona_OBJECTS = $(am_mona_OBJECTS) mona_DEPENDENCIES = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../DFA/libmonadfa.la ../GTA/libmonagta.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ $(AM_YFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(mona_SOURCES) DIST_SOURCES = $(mona_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile BUILT_SOURCES = parser.h AM_LFLAGS = -l AM_YFLAGS = -d mona_SOURCES = ast.cpp astdump.cpp ast.h code.cpp codedump.cpp code.h \ codesubst.cpp codetable.cpp codetable.h deque.h env.h freevars.cpp \ ident.cpp ident.h lib.cpp lib.h makeguide.cpp mona.cpp offsets.cpp \ offsets.h parser.ypp predlib.cpp predlib.h printline.cpp printline.h \ reduce.cpp scanner.lpp signature.cpp signature.h st_dfa.cpp st_dfa.h \ st_gta.cpp st_gta.h str.h symboltable.cpp symboltable.h timer.cpp \ timer.h untyped.cpp untyped.h mona_CPPFLAGS = -I ../BDD mona_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la ../DFA/libmonadfa.la \ ../GTA/libmonagta.la all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cpp .lo .lpp .o .obj .ypp $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Front/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Front/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done parser.h: parser.cpp @if test ! -f $@; then \ rm -f parser.cpp; \ $(MAKE) parser.cpp; \ else :; fi mona$(EXEEXT): $(mona_OBJECTS) $(mona_DEPENDENCIES) @rm -f mona$(EXEEXT) $(CXXLINK) $(mona_LDFLAGS) $(mona_OBJECTS) $(mona_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-ast.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-astdump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-codedump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-codesubst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-codetable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-freevars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-ident.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-lib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-makeguide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-mona.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-offsets.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-predlib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-printline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-reduce.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-scanner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-signature.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-st_dfa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-st_gta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-symboltable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mona-untyped.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mona-ast.o: ast.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-ast.o -MD -MP -MF "$(DEPDIR)/mona-ast.Tpo" -c -o mona-ast.o `test -f 'ast.cpp' || echo '$(srcdir)/'`ast.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-ast.Tpo" "$(DEPDIR)/mona-ast.Po"; else rm -f "$(DEPDIR)/mona-ast.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ast.cpp' object='mona-ast.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-ast.o `test -f 'ast.cpp' || echo '$(srcdir)/'`ast.cpp mona-ast.obj: ast.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-ast.obj -MD -MP -MF "$(DEPDIR)/mona-ast.Tpo" -c -o mona-ast.obj `if test -f 'ast.cpp'; then $(CYGPATH_W) 'ast.cpp'; else $(CYGPATH_W) '$(srcdir)/ast.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-ast.Tpo" "$(DEPDIR)/mona-ast.Po"; else rm -f "$(DEPDIR)/mona-ast.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ast.cpp' object='mona-ast.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-ast.obj `if test -f 'ast.cpp'; then $(CYGPATH_W) 'ast.cpp'; else $(CYGPATH_W) '$(srcdir)/ast.cpp'; fi` mona-astdump.o: astdump.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-astdump.o -MD -MP -MF "$(DEPDIR)/mona-astdump.Tpo" -c -o mona-astdump.o `test -f 'astdump.cpp' || echo '$(srcdir)/'`astdump.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-astdump.Tpo" "$(DEPDIR)/mona-astdump.Po"; else rm -f "$(DEPDIR)/mona-astdump.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='astdump.cpp' object='mona-astdump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-astdump.o `test -f 'astdump.cpp' || echo '$(srcdir)/'`astdump.cpp mona-astdump.obj: astdump.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-astdump.obj -MD -MP -MF "$(DEPDIR)/mona-astdump.Tpo" -c -o mona-astdump.obj `if test -f 'astdump.cpp'; then $(CYGPATH_W) 'astdump.cpp'; else $(CYGPATH_W) '$(srcdir)/astdump.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-astdump.Tpo" "$(DEPDIR)/mona-astdump.Po"; else rm -f "$(DEPDIR)/mona-astdump.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='astdump.cpp' object='mona-astdump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-astdump.obj `if test -f 'astdump.cpp'; then $(CYGPATH_W) 'astdump.cpp'; else $(CYGPATH_W) '$(srcdir)/astdump.cpp'; fi` mona-code.o: code.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-code.o -MD -MP -MF "$(DEPDIR)/mona-code.Tpo" -c -o mona-code.o `test -f 'code.cpp' || echo '$(srcdir)/'`code.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-code.Tpo" "$(DEPDIR)/mona-code.Po"; else rm -f "$(DEPDIR)/mona-code.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='code.cpp' object='mona-code.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-code.o `test -f 'code.cpp' || echo '$(srcdir)/'`code.cpp mona-code.obj: code.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-code.obj -MD -MP -MF "$(DEPDIR)/mona-code.Tpo" -c -o mona-code.obj `if test -f 'code.cpp'; then $(CYGPATH_W) 'code.cpp'; else $(CYGPATH_W) '$(srcdir)/code.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-code.Tpo" "$(DEPDIR)/mona-code.Po"; else rm -f "$(DEPDIR)/mona-code.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='code.cpp' object='mona-code.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-code.obj `if test -f 'code.cpp'; then $(CYGPATH_W) 'code.cpp'; else $(CYGPATH_W) '$(srcdir)/code.cpp'; fi` mona-codedump.o: codedump.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-codedump.o -MD -MP -MF "$(DEPDIR)/mona-codedump.Tpo" -c -o mona-codedump.o `test -f 'codedump.cpp' || echo '$(srcdir)/'`codedump.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-codedump.Tpo" "$(DEPDIR)/mona-codedump.Po"; else rm -f "$(DEPDIR)/mona-codedump.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='codedump.cpp' object='mona-codedump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-codedump.o `test -f 'codedump.cpp' || echo '$(srcdir)/'`codedump.cpp mona-codedump.obj: codedump.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-codedump.obj -MD -MP -MF "$(DEPDIR)/mona-codedump.Tpo" -c -o mona-codedump.obj `if test -f 'codedump.cpp'; then $(CYGPATH_W) 'codedump.cpp'; else $(CYGPATH_W) '$(srcdir)/codedump.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-codedump.Tpo" "$(DEPDIR)/mona-codedump.Po"; else rm -f "$(DEPDIR)/mona-codedump.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='codedump.cpp' object='mona-codedump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-codedump.obj `if test -f 'codedump.cpp'; then $(CYGPATH_W) 'codedump.cpp'; else $(CYGPATH_W) '$(srcdir)/codedump.cpp'; fi` mona-codesubst.o: codesubst.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-codesubst.o -MD -MP -MF "$(DEPDIR)/mona-codesubst.Tpo" -c -o mona-codesubst.o `test -f 'codesubst.cpp' || echo '$(srcdir)/'`codesubst.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-codesubst.Tpo" "$(DEPDIR)/mona-codesubst.Po"; else rm -f "$(DEPDIR)/mona-codesubst.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='codesubst.cpp' object='mona-codesubst.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-codesubst.o `test -f 'codesubst.cpp' || echo '$(srcdir)/'`codesubst.cpp mona-codesubst.obj: codesubst.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-codesubst.obj -MD -MP -MF "$(DEPDIR)/mona-codesubst.Tpo" -c -o mona-codesubst.obj `if test -f 'codesubst.cpp'; then $(CYGPATH_W) 'codesubst.cpp'; else $(CYGPATH_W) '$(srcdir)/codesubst.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-codesubst.Tpo" "$(DEPDIR)/mona-codesubst.Po"; else rm -f "$(DEPDIR)/mona-codesubst.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='codesubst.cpp' object='mona-codesubst.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-codesubst.obj `if test -f 'codesubst.cpp'; then $(CYGPATH_W) 'codesubst.cpp'; else $(CYGPATH_W) '$(srcdir)/codesubst.cpp'; fi` mona-codetable.o: codetable.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-codetable.o -MD -MP -MF "$(DEPDIR)/mona-codetable.Tpo" -c -o mona-codetable.o `test -f 'codetable.cpp' || echo '$(srcdir)/'`codetable.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-codetable.Tpo" "$(DEPDIR)/mona-codetable.Po"; else rm -f "$(DEPDIR)/mona-codetable.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='codetable.cpp' object='mona-codetable.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-codetable.o `test -f 'codetable.cpp' || echo '$(srcdir)/'`codetable.cpp mona-codetable.obj: codetable.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-codetable.obj -MD -MP -MF "$(DEPDIR)/mona-codetable.Tpo" -c -o mona-codetable.obj `if test -f 'codetable.cpp'; then $(CYGPATH_W) 'codetable.cpp'; else $(CYGPATH_W) '$(srcdir)/codetable.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-codetable.Tpo" "$(DEPDIR)/mona-codetable.Po"; else rm -f "$(DEPDIR)/mona-codetable.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='codetable.cpp' object='mona-codetable.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-codetable.obj `if test -f 'codetable.cpp'; then $(CYGPATH_W) 'codetable.cpp'; else $(CYGPATH_W) '$(srcdir)/codetable.cpp'; fi` mona-freevars.o: freevars.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-freevars.o -MD -MP -MF "$(DEPDIR)/mona-freevars.Tpo" -c -o mona-freevars.o `test -f 'freevars.cpp' || echo '$(srcdir)/'`freevars.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-freevars.Tpo" "$(DEPDIR)/mona-freevars.Po"; else rm -f "$(DEPDIR)/mona-freevars.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='freevars.cpp' object='mona-freevars.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-freevars.o `test -f 'freevars.cpp' || echo '$(srcdir)/'`freevars.cpp mona-freevars.obj: freevars.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-freevars.obj -MD -MP -MF "$(DEPDIR)/mona-freevars.Tpo" -c -o mona-freevars.obj `if test -f 'freevars.cpp'; then $(CYGPATH_W) 'freevars.cpp'; else $(CYGPATH_W) '$(srcdir)/freevars.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-freevars.Tpo" "$(DEPDIR)/mona-freevars.Po"; else rm -f "$(DEPDIR)/mona-freevars.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='freevars.cpp' object='mona-freevars.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-freevars.obj `if test -f 'freevars.cpp'; then $(CYGPATH_W) 'freevars.cpp'; else $(CYGPATH_W) '$(srcdir)/freevars.cpp'; fi` mona-ident.o: ident.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-ident.o -MD -MP -MF "$(DEPDIR)/mona-ident.Tpo" -c -o mona-ident.o `test -f 'ident.cpp' || echo '$(srcdir)/'`ident.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-ident.Tpo" "$(DEPDIR)/mona-ident.Po"; else rm -f "$(DEPDIR)/mona-ident.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ident.cpp' object='mona-ident.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-ident.o `test -f 'ident.cpp' || echo '$(srcdir)/'`ident.cpp mona-ident.obj: ident.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-ident.obj -MD -MP -MF "$(DEPDIR)/mona-ident.Tpo" -c -o mona-ident.obj `if test -f 'ident.cpp'; then $(CYGPATH_W) 'ident.cpp'; else $(CYGPATH_W) '$(srcdir)/ident.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-ident.Tpo" "$(DEPDIR)/mona-ident.Po"; else rm -f "$(DEPDIR)/mona-ident.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ident.cpp' object='mona-ident.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-ident.obj `if test -f 'ident.cpp'; then $(CYGPATH_W) 'ident.cpp'; else $(CYGPATH_W) '$(srcdir)/ident.cpp'; fi` mona-lib.o: lib.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-lib.o -MD -MP -MF "$(DEPDIR)/mona-lib.Tpo" -c -o mona-lib.o `test -f 'lib.cpp' || echo '$(srcdir)/'`lib.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-lib.Tpo" "$(DEPDIR)/mona-lib.Po"; else rm -f "$(DEPDIR)/mona-lib.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib.cpp' object='mona-lib.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-lib.o `test -f 'lib.cpp' || echo '$(srcdir)/'`lib.cpp mona-lib.obj: lib.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-lib.obj -MD -MP -MF "$(DEPDIR)/mona-lib.Tpo" -c -o mona-lib.obj `if test -f 'lib.cpp'; then $(CYGPATH_W) 'lib.cpp'; else $(CYGPATH_W) '$(srcdir)/lib.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-lib.Tpo" "$(DEPDIR)/mona-lib.Po"; else rm -f "$(DEPDIR)/mona-lib.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='lib.cpp' object='mona-lib.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-lib.obj `if test -f 'lib.cpp'; then $(CYGPATH_W) 'lib.cpp'; else $(CYGPATH_W) '$(srcdir)/lib.cpp'; fi` mona-makeguide.o: makeguide.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-makeguide.o -MD -MP -MF "$(DEPDIR)/mona-makeguide.Tpo" -c -o mona-makeguide.o `test -f 'makeguide.cpp' || echo '$(srcdir)/'`makeguide.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-makeguide.Tpo" "$(DEPDIR)/mona-makeguide.Po"; else rm -f "$(DEPDIR)/mona-makeguide.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='makeguide.cpp' object='mona-makeguide.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-makeguide.o `test -f 'makeguide.cpp' || echo '$(srcdir)/'`makeguide.cpp mona-makeguide.obj: makeguide.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-makeguide.obj -MD -MP -MF "$(DEPDIR)/mona-makeguide.Tpo" -c -o mona-makeguide.obj `if test -f 'makeguide.cpp'; then $(CYGPATH_W) 'makeguide.cpp'; else $(CYGPATH_W) '$(srcdir)/makeguide.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-makeguide.Tpo" "$(DEPDIR)/mona-makeguide.Po"; else rm -f "$(DEPDIR)/mona-makeguide.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='makeguide.cpp' object='mona-makeguide.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-makeguide.obj `if test -f 'makeguide.cpp'; then $(CYGPATH_W) 'makeguide.cpp'; else $(CYGPATH_W) '$(srcdir)/makeguide.cpp'; fi` mona-mona.o: mona.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-mona.o -MD -MP -MF "$(DEPDIR)/mona-mona.Tpo" -c -o mona-mona.o `test -f 'mona.cpp' || echo '$(srcdir)/'`mona.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-mona.Tpo" "$(DEPDIR)/mona-mona.Po"; else rm -f "$(DEPDIR)/mona-mona.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mona.cpp' object='mona-mona.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-mona.o `test -f 'mona.cpp' || echo '$(srcdir)/'`mona.cpp mona-mona.obj: mona.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-mona.obj -MD -MP -MF "$(DEPDIR)/mona-mona.Tpo" -c -o mona-mona.obj `if test -f 'mona.cpp'; then $(CYGPATH_W) 'mona.cpp'; else $(CYGPATH_W) '$(srcdir)/mona.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-mona.Tpo" "$(DEPDIR)/mona-mona.Po"; else rm -f "$(DEPDIR)/mona-mona.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mona.cpp' object='mona-mona.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-mona.obj `if test -f 'mona.cpp'; then $(CYGPATH_W) 'mona.cpp'; else $(CYGPATH_W) '$(srcdir)/mona.cpp'; fi` mona-offsets.o: offsets.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-offsets.o -MD -MP -MF "$(DEPDIR)/mona-offsets.Tpo" -c -o mona-offsets.o `test -f 'offsets.cpp' || echo '$(srcdir)/'`offsets.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-offsets.Tpo" "$(DEPDIR)/mona-offsets.Po"; else rm -f "$(DEPDIR)/mona-offsets.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='offsets.cpp' object='mona-offsets.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-offsets.o `test -f 'offsets.cpp' || echo '$(srcdir)/'`offsets.cpp mona-offsets.obj: offsets.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-offsets.obj -MD -MP -MF "$(DEPDIR)/mona-offsets.Tpo" -c -o mona-offsets.obj `if test -f 'offsets.cpp'; then $(CYGPATH_W) 'offsets.cpp'; else $(CYGPATH_W) '$(srcdir)/offsets.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-offsets.Tpo" "$(DEPDIR)/mona-offsets.Po"; else rm -f "$(DEPDIR)/mona-offsets.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='offsets.cpp' object='mona-offsets.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-offsets.obj `if test -f 'offsets.cpp'; then $(CYGPATH_W) 'offsets.cpp'; else $(CYGPATH_W) '$(srcdir)/offsets.cpp'; fi` mona-parser.o: parser.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-parser.o -MD -MP -MF "$(DEPDIR)/mona-parser.Tpo" -c -o mona-parser.o `test -f 'parser.cpp' || echo '$(srcdir)/'`parser.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-parser.Tpo" "$(DEPDIR)/mona-parser.Po"; else rm -f "$(DEPDIR)/mona-parser.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='parser.cpp' object='mona-parser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-parser.o `test -f 'parser.cpp' || echo '$(srcdir)/'`parser.cpp mona-parser.obj: parser.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-parser.obj -MD -MP -MF "$(DEPDIR)/mona-parser.Tpo" -c -o mona-parser.obj `if test -f 'parser.cpp'; then $(CYGPATH_W) 'parser.cpp'; else $(CYGPATH_W) '$(srcdir)/parser.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-parser.Tpo" "$(DEPDIR)/mona-parser.Po"; else rm -f "$(DEPDIR)/mona-parser.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='parser.cpp' object='mona-parser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-parser.obj `if test -f 'parser.cpp'; then $(CYGPATH_W) 'parser.cpp'; else $(CYGPATH_W) '$(srcdir)/parser.cpp'; fi` mona-predlib.o: predlib.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-predlib.o -MD -MP -MF "$(DEPDIR)/mona-predlib.Tpo" -c -o mona-predlib.o `test -f 'predlib.cpp' || echo '$(srcdir)/'`predlib.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-predlib.Tpo" "$(DEPDIR)/mona-predlib.Po"; else rm -f "$(DEPDIR)/mona-predlib.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='predlib.cpp' object='mona-predlib.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-predlib.o `test -f 'predlib.cpp' || echo '$(srcdir)/'`predlib.cpp mona-predlib.obj: predlib.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-predlib.obj -MD -MP -MF "$(DEPDIR)/mona-predlib.Tpo" -c -o mona-predlib.obj `if test -f 'predlib.cpp'; then $(CYGPATH_W) 'predlib.cpp'; else $(CYGPATH_W) '$(srcdir)/predlib.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-predlib.Tpo" "$(DEPDIR)/mona-predlib.Po"; else rm -f "$(DEPDIR)/mona-predlib.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='predlib.cpp' object='mona-predlib.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-predlib.obj `if test -f 'predlib.cpp'; then $(CYGPATH_W) 'predlib.cpp'; else $(CYGPATH_W) '$(srcdir)/predlib.cpp'; fi` mona-printline.o: printline.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-printline.o -MD -MP -MF "$(DEPDIR)/mona-printline.Tpo" -c -o mona-printline.o `test -f 'printline.cpp' || echo '$(srcdir)/'`printline.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-printline.Tpo" "$(DEPDIR)/mona-printline.Po"; else rm -f "$(DEPDIR)/mona-printline.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='printline.cpp' object='mona-printline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-printline.o `test -f 'printline.cpp' || echo '$(srcdir)/'`printline.cpp mona-printline.obj: printline.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-printline.obj -MD -MP -MF "$(DEPDIR)/mona-printline.Tpo" -c -o mona-printline.obj `if test -f 'printline.cpp'; then $(CYGPATH_W) 'printline.cpp'; else $(CYGPATH_W) '$(srcdir)/printline.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-printline.Tpo" "$(DEPDIR)/mona-printline.Po"; else rm -f "$(DEPDIR)/mona-printline.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='printline.cpp' object='mona-printline.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-printline.obj `if test -f 'printline.cpp'; then $(CYGPATH_W) 'printline.cpp'; else $(CYGPATH_W) '$(srcdir)/printline.cpp'; fi` mona-reduce.o: reduce.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-reduce.o -MD -MP -MF "$(DEPDIR)/mona-reduce.Tpo" -c -o mona-reduce.o `test -f 'reduce.cpp' || echo '$(srcdir)/'`reduce.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-reduce.Tpo" "$(DEPDIR)/mona-reduce.Po"; else rm -f "$(DEPDIR)/mona-reduce.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='reduce.cpp' object='mona-reduce.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-reduce.o `test -f 'reduce.cpp' || echo '$(srcdir)/'`reduce.cpp mona-reduce.obj: reduce.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-reduce.obj -MD -MP -MF "$(DEPDIR)/mona-reduce.Tpo" -c -o mona-reduce.obj `if test -f 'reduce.cpp'; then $(CYGPATH_W) 'reduce.cpp'; else $(CYGPATH_W) '$(srcdir)/reduce.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-reduce.Tpo" "$(DEPDIR)/mona-reduce.Po"; else rm -f "$(DEPDIR)/mona-reduce.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='reduce.cpp' object='mona-reduce.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-reduce.obj `if test -f 'reduce.cpp'; then $(CYGPATH_W) 'reduce.cpp'; else $(CYGPATH_W) '$(srcdir)/reduce.cpp'; fi` mona-scanner.o: scanner.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-scanner.o -MD -MP -MF "$(DEPDIR)/mona-scanner.Tpo" -c -o mona-scanner.o `test -f 'scanner.cpp' || echo '$(srcdir)/'`scanner.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-scanner.Tpo" "$(DEPDIR)/mona-scanner.Po"; else rm -f "$(DEPDIR)/mona-scanner.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scanner.cpp' object='mona-scanner.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-scanner.o `test -f 'scanner.cpp' || echo '$(srcdir)/'`scanner.cpp mona-scanner.obj: scanner.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-scanner.obj -MD -MP -MF "$(DEPDIR)/mona-scanner.Tpo" -c -o mona-scanner.obj `if test -f 'scanner.cpp'; then $(CYGPATH_W) 'scanner.cpp'; else $(CYGPATH_W) '$(srcdir)/scanner.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-scanner.Tpo" "$(DEPDIR)/mona-scanner.Po"; else rm -f "$(DEPDIR)/mona-scanner.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='scanner.cpp' object='mona-scanner.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-scanner.obj `if test -f 'scanner.cpp'; then $(CYGPATH_W) 'scanner.cpp'; else $(CYGPATH_W) '$(srcdir)/scanner.cpp'; fi` mona-signature.o: signature.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-signature.o -MD -MP -MF "$(DEPDIR)/mona-signature.Tpo" -c -o mona-signature.o `test -f 'signature.cpp' || echo '$(srcdir)/'`signature.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-signature.Tpo" "$(DEPDIR)/mona-signature.Po"; else rm -f "$(DEPDIR)/mona-signature.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='signature.cpp' object='mona-signature.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-signature.o `test -f 'signature.cpp' || echo '$(srcdir)/'`signature.cpp mona-signature.obj: signature.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-signature.obj -MD -MP -MF "$(DEPDIR)/mona-signature.Tpo" -c -o mona-signature.obj `if test -f 'signature.cpp'; then $(CYGPATH_W) 'signature.cpp'; else $(CYGPATH_W) '$(srcdir)/signature.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-signature.Tpo" "$(DEPDIR)/mona-signature.Po"; else rm -f "$(DEPDIR)/mona-signature.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='signature.cpp' object='mona-signature.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-signature.obj `if test -f 'signature.cpp'; then $(CYGPATH_W) 'signature.cpp'; else $(CYGPATH_W) '$(srcdir)/signature.cpp'; fi` mona-st_dfa.o: st_dfa.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-st_dfa.o -MD -MP -MF "$(DEPDIR)/mona-st_dfa.Tpo" -c -o mona-st_dfa.o `test -f 'st_dfa.cpp' || echo '$(srcdir)/'`st_dfa.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-st_dfa.Tpo" "$(DEPDIR)/mona-st_dfa.Po"; else rm -f "$(DEPDIR)/mona-st_dfa.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='st_dfa.cpp' object='mona-st_dfa.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-st_dfa.o `test -f 'st_dfa.cpp' || echo '$(srcdir)/'`st_dfa.cpp mona-st_dfa.obj: st_dfa.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-st_dfa.obj -MD -MP -MF "$(DEPDIR)/mona-st_dfa.Tpo" -c -o mona-st_dfa.obj `if test -f 'st_dfa.cpp'; then $(CYGPATH_W) 'st_dfa.cpp'; else $(CYGPATH_W) '$(srcdir)/st_dfa.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-st_dfa.Tpo" "$(DEPDIR)/mona-st_dfa.Po"; else rm -f "$(DEPDIR)/mona-st_dfa.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='st_dfa.cpp' object='mona-st_dfa.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-st_dfa.obj `if test -f 'st_dfa.cpp'; then $(CYGPATH_W) 'st_dfa.cpp'; else $(CYGPATH_W) '$(srcdir)/st_dfa.cpp'; fi` mona-st_gta.o: st_gta.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-st_gta.o -MD -MP -MF "$(DEPDIR)/mona-st_gta.Tpo" -c -o mona-st_gta.o `test -f 'st_gta.cpp' || echo '$(srcdir)/'`st_gta.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-st_gta.Tpo" "$(DEPDIR)/mona-st_gta.Po"; else rm -f "$(DEPDIR)/mona-st_gta.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='st_gta.cpp' object='mona-st_gta.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-st_gta.o `test -f 'st_gta.cpp' || echo '$(srcdir)/'`st_gta.cpp mona-st_gta.obj: st_gta.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-st_gta.obj -MD -MP -MF "$(DEPDIR)/mona-st_gta.Tpo" -c -o mona-st_gta.obj `if test -f 'st_gta.cpp'; then $(CYGPATH_W) 'st_gta.cpp'; else $(CYGPATH_W) '$(srcdir)/st_gta.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-st_gta.Tpo" "$(DEPDIR)/mona-st_gta.Po"; else rm -f "$(DEPDIR)/mona-st_gta.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='st_gta.cpp' object='mona-st_gta.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-st_gta.obj `if test -f 'st_gta.cpp'; then $(CYGPATH_W) 'st_gta.cpp'; else $(CYGPATH_W) '$(srcdir)/st_gta.cpp'; fi` mona-symboltable.o: symboltable.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-symboltable.o -MD -MP -MF "$(DEPDIR)/mona-symboltable.Tpo" -c -o mona-symboltable.o `test -f 'symboltable.cpp' || echo '$(srcdir)/'`symboltable.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-symboltable.Tpo" "$(DEPDIR)/mona-symboltable.Po"; else rm -f "$(DEPDIR)/mona-symboltable.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='symboltable.cpp' object='mona-symboltable.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-symboltable.o `test -f 'symboltable.cpp' || echo '$(srcdir)/'`symboltable.cpp mona-symboltable.obj: symboltable.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-symboltable.obj -MD -MP -MF "$(DEPDIR)/mona-symboltable.Tpo" -c -o mona-symboltable.obj `if test -f 'symboltable.cpp'; then $(CYGPATH_W) 'symboltable.cpp'; else $(CYGPATH_W) '$(srcdir)/symboltable.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-symboltable.Tpo" "$(DEPDIR)/mona-symboltable.Po"; else rm -f "$(DEPDIR)/mona-symboltable.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='symboltable.cpp' object='mona-symboltable.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-symboltable.obj `if test -f 'symboltable.cpp'; then $(CYGPATH_W) 'symboltable.cpp'; else $(CYGPATH_W) '$(srcdir)/symboltable.cpp'; fi` mona-timer.o: timer.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-timer.o -MD -MP -MF "$(DEPDIR)/mona-timer.Tpo" -c -o mona-timer.o `test -f 'timer.cpp' || echo '$(srcdir)/'`timer.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-timer.Tpo" "$(DEPDIR)/mona-timer.Po"; else rm -f "$(DEPDIR)/mona-timer.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='timer.cpp' object='mona-timer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-timer.o `test -f 'timer.cpp' || echo '$(srcdir)/'`timer.cpp mona-timer.obj: timer.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-timer.obj -MD -MP -MF "$(DEPDIR)/mona-timer.Tpo" -c -o mona-timer.obj `if test -f 'timer.cpp'; then $(CYGPATH_W) 'timer.cpp'; else $(CYGPATH_W) '$(srcdir)/timer.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-timer.Tpo" "$(DEPDIR)/mona-timer.Po"; else rm -f "$(DEPDIR)/mona-timer.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='timer.cpp' object='mona-timer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-timer.obj `if test -f 'timer.cpp'; then $(CYGPATH_W) 'timer.cpp'; else $(CYGPATH_W) '$(srcdir)/timer.cpp'; fi` mona-untyped.o: untyped.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-untyped.o -MD -MP -MF "$(DEPDIR)/mona-untyped.Tpo" -c -o mona-untyped.o `test -f 'untyped.cpp' || echo '$(srcdir)/'`untyped.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-untyped.Tpo" "$(DEPDIR)/mona-untyped.Po"; else rm -f "$(DEPDIR)/mona-untyped.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='untyped.cpp' object='mona-untyped.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-untyped.o `test -f 'untyped.cpp' || echo '$(srcdir)/'`untyped.cpp mona-untyped.obj: untyped.cpp @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mona-untyped.obj -MD -MP -MF "$(DEPDIR)/mona-untyped.Tpo" -c -o mona-untyped.obj `if test -f 'untyped.cpp'; then $(CYGPATH_W) 'untyped.cpp'; else $(CYGPATH_W) '$(srcdir)/untyped.cpp'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/mona-untyped.Tpo" "$(DEPDIR)/mona-untyped.Po"; else rm -f "$(DEPDIR)/mona-untyped.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='untyped.cpp' object='mona-untyped.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mona_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mona-untyped.obj `if test -f 'untyped.cpp'; then $(CYGPATH_W) 'untyped.cpp'; else $(CYGPATH_W) '$(srcdir)/untyped.cpp'; fi` .lpp.cpp: $(LEXCOMPILE) $< sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ rm -f $(LEX_OUTPUT_ROOT).c .ypp.cpp: $(YACCCOMPILE) $< if test -f y.tab.h; then \ to=`echo "$*_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \ y.tab.h >$*.ht; \ rm -f y.tab.h; \ if cmp -s $*.ht $*.h; then \ rm -f $*.ht ;\ else \ mv $*.ht $*.h; \ fi; \ fi if test -f y.output; then \ mv y.output $*.output; \ fi sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@ rm -f y.tab.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f parser.cpp -rm -f parser.h -rm -f scanner.cpp -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/Front/parser.cpp0000644000414100000240000036625010764214572012333 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 1 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { tokALL0 = 258, tokALL1 = 259, tokALL2 = 260, tokAND = 261, tokARROW = 262, tokASSERT = 263, tokBIIMPL = 264, tokCOLON = 265, tokCOMMA = 266, tokCONST = 267, tokDEFAULT1 = 268, tokDEFAULT2 = 269, tokDOT = 270, tokEMPTY = 271, tokEQUAL = 272, tokEX0 = 273, tokEX1 = 274, tokEX2 = 275, tokFALSE = 276, tokGREATER = 277, tokGREATEREQ = 278, tokGUIDE = 279, tokIMPL = 280, tokIN = 281, tokINTER = 282, tokINTERVAL = 283, tokLBRACE = 284, tokLBRACKET = 285, tokLESS = 286, tokLESSEQ = 287, tokLET0 = 288, tokLET1 = 289, tokLET2 = 290, tokLPAREN = 291, tokMACRO = 292, tokMAX = 293, tokMIN = 294, tokMINUS = 295, tokMODULO = 296, tokNOT = 297, tokNOTEQUAL = 298, tokNOTIN = 299, tokOR = 300, tokPLUS = 301, tokPRED = 302, tokRBRACE = 303, tokRESTRICT = 304, tokRBRACKET = 305, tokUNIVROOT = 306, tokRPAREN = 307, tokSEMICOLON = 308, tokSETMINUS = 309, tokSLASH = 310, tokSTAR = 311, tokVERIFY = 312, tokSUB = 313, tokTREE = 314, tokTRUE = 315, tokUNION = 316, tokUNIVERSE = 317, tokUP = 318, tokVAR0 = 319, tokVAR1 = 320, tokVAR2 = 321, tokWHERE = 322, tokINCLUDE = 323, tokIMPORT = 324, tokEXPORT = 325, tokPREFIX = 326, tokM2LSTR = 327, tokM2LTREE = 328, tokLASTPOS = 329, tokINSTATESPACE = 330, tokEXECUTE = 331, tokTYPE = 332, tokSOMETYPE = 333, tokVARIANT = 334, tokSUCC = 335, tokWS1S = 336, tokWS2S = 337, tokTREEROOT = 338, tokCONSTTREE = 339, tokALLPOS = 340, tokINT = 341, tokNAME = 342, tokSTRING = 343, LOW = 344 }; #endif /* Tokens. */ #define tokALL0 258 #define tokALL1 259 #define tokALL2 260 #define tokAND 261 #define tokARROW 262 #define tokASSERT 263 #define tokBIIMPL 264 #define tokCOLON 265 #define tokCOMMA 266 #define tokCONST 267 #define tokDEFAULT1 268 #define tokDEFAULT2 269 #define tokDOT 270 #define tokEMPTY 271 #define tokEQUAL 272 #define tokEX0 273 #define tokEX1 274 #define tokEX2 275 #define tokFALSE 276 #define tokGREATER 277 #define tokGREATEREQ 278 #define tokGUIDE 279 #define tokIMPL 280 #define tokIN 281 #define tokINTER 282 #define tokINTERVAL 283 #define tokLBRACE 284 #define tokLBRACKET 285 #define tokLESS 286 #define tokLESSEQ 287 #define tokLET0 288 #define tokLET1 289 #define tokLET2 290 #define tokLPAREN 291 #define tokMACRO 292 #define tokMAX 293 #define tokMIN 294 #define tokMINUS 295 #define tokMODULO 296 #define tokNOT 297 #define tokNOTEQUAL 298 #define tokNOTIN 299 #define tokOR 300 #define tokPLUS 301 #define tokPRED 302 #define tokRBRACE 303 #define tokRESTRICT 304 #define tokRBRACKET 305 #define tokUNIVROOT 306 #define tokRPAREN 307 #define tokSEMICOLON 308 #define tokSETMINUS 309 #define tokSLASH 310 #define tokSTAR 311 #define tokVERIFY 312 #define tokSUB 313 #define tokTREE 314 #define tokTRUE 315 #define tokUNION 316 #define tokUNIVERSE 317 #define tokUP 318 #define tokVAR0 319 #define tokVAR1 320 #define tokVAR2 321 #define tokWHERE 322 #define tokINCLUDE 323 #define tokIMPORT 324 #define tokEXPORT 325 #define tokPREFIX 326 #define tokM2LSTR 327 #define tokM2LTREE 328 #define tokLASTPOS 329 #define tokINSTATESPACE 330 #define tokEXECUTE 331 #define tokTYPE 332 #define tokSOMETYPE 333 #define tokVARIANT 334 #define tokSUCC 335 #define tokWS1S 336 #define tokWS2S 337 #define tokTREEROOT 338 #define tokCONSTTREE 339 #define tokALLPOS 340 #define tokINT 341 #define tokNAME 342 #define tokSTRING 343 #define LOW 344 /* Copy the first part of user declarations. */ #line 21 "parser.ypp" #include #include #include "untyped.h" #include "env.h" extern MonaUntypedAST *untypedAST; extern Options options; extern char *file; extern bool anyUniverses; extern void loadFile(char *); extern void yyerror(const char *); extern int yylex(); #define POS(p) Pos(p.first_line, p.first_column, file) void check_bits(char *s) { int i; for (i = 0; s[i] != '\0'; i++) if (s[i] != '0' && s[i] != '1') yyerror("parse error"); } /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 51 "parser.ypp" { char *string; int integer; MonaUntypedAST *monaUntypedAST; DeclarationList *declarationList; Declaration *declaration; UntypedExp *untypedExp; ArithExp *arithExp; ParDeclList *parDeclList; BindExpList *bindExpList; BindExp *bindExp; UntypedExpList *untypedExpList; NameList *nameList; Name *name; VarDeclList *varDeclList; GuideFuncList *guideFuncList; GuideFunc *guideFunc; UnivList *univList; Univ *univ; ImportMapList *mapList; VariantList *variantList; ComponentList *componentList; ConstNode *constNode; ConstNodeList *constNodeList; } /* Line 187 of yacc.c. */ #line 327 "parser.cpp" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #line 352 "parser.cpp" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; YYLTYPE yyls; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 11 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 2158 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 90 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 29 /* YYNRULES -- Number of rules. */ #define YYNRULES 157 /* YYNRULES -- Number of states. */ #define YYNSTATES 414 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 344 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 6, 9, 12, 15, 18, 19, 22, 24, 28, 32, 36, 44, 52, 58, 62, 67, 72, 77, 86, 92, 100, 109, 115, 123, 126, 131, 135, 139, 143, 147, 153, 155, 159, 163, 167, 171, 174, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 220, 225, 227, 231, 234, 239, 245, 251, 256, 262, 268, 273, 278, 283, 288, 290, 292, 299, 304, 310, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 358, 365, 370, 377, 388, 399, 404, 411, 416, 425, 430, 435, 439, 443, 447, 451, 454, 456, 458, 462, 467, 473, 479, 484, 489, 492, 496, 500, 503, 506, 510, 512, 516, 518, 519, 523, 527, 529, 531, 533, 534, 538, 540, 544, 545, 547, 551, 553, 558, 561, 565, 567, 575, 579, 581, 585, 589, 591, 594, 595, 601, 602, 609, 615, 619, 624, 628, 630, 636, 640, 645, 649, 651, 655, 657, 659 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 91, 0, -1, 92, 93, -1, 81, 53, -1, 82, 53, -1, 72, 53, -1, 73, 53, -1, -1, 94, 93, -1, 94, -1, 8, 95, 53, -1, 24, 108, 53, -1, 62, 110, 53, -1, 13, 36, 105, 52, 17, 95, 53, -1, 14, 36, 105, 52, 17, 95, 53, -1, 12, 105, 17, 96, 53, -1, 64, 107, 53, -1, 65, 104, 107, 53, -1, 66, 104, 107, 53, -1, 59, 104, 107, 53, -1, 47, 105, 36, 97, 52, 17, 95, 53, -1, 47, 105, 17, 95, 53, -1, 47, 105, 36, 52, 17, 95, 53, -1, 37, 105, 36, 97, 52, 17, 95, 53, -1, 37, 105, 17, 95, 53, -1, 37, 105, 36, 52, 17, 95, 53, -1, 95, 53, -1, 57, 118, 95, 53, -1, 76, 95, 53, -1, 68, 88, 53, -1, 74, 105, 53, -1, 85, 105, 53, -1, 77, 105, 17, 114, 53, -1, 105, -1, 36, 95, 52, -1, 95, 58, 95, -1, 95, 26, 95, -1, 95, 44, 95, -1, 39, 95, -1, 38, 95, -1, 95, 31, 95, -1, 95, 32, 95, -1, 95, 23, 95, -1, 95, 22, 95, -1, 95, 17, 95, -1, 95, 43, 95, -1, 95, 25, 95, -1, 95, 9, 95, -1, 95, 6, 95, -1, 95, 45, 95, -1, 42, 95, -1, 51, 36, 105, 52, -1, 51, -1, 95, 15, 86, -1, 95, 63, -1, 18, 107, 10, 95, -1, 19, 104, 107, 10, 95, -1, 20, 104, 107, 10, 95, -1, 3, 107, 10, 95, -1, 4, 104, 107, 10, 95, -1, 5, 104, 107, 10, 95, -1, 33, 98, 26, 95, -1, 34, 98, 26, 95, -1, 35, 98, 26, 95, -1, 105, 36, 102, 52, -1, 60, -1, 21, -1, 51, 36, 95, 11, 104, 52, -1, 16, 36, 95, 52, -1, 95, 46, 96, 41, 95, -1, 95, 40, 96, 41, 95, -1, 95, 46, 96, -1, 95, 40, 96, -1, 95, 56, 96, -1, 95, 55, 96, -1, 86, -1, 16, -1, 29, 100, 48, -1, 95, 61, 95, -1, 95, 27, 95, -1, 95, 54, 95, -1, 69, 36, 88, 113, 52, -1, 70, 36, 88, 11, 95, 52, -1, 71, 36, 95, 52, -1, 75, 36, 95, 11, 106, 52, -1, 79, 36, 95, 11, 95, 11, 105, 11, 105, 52, -1, 80, 36, 95, 11, 105, 11, 105, 11, 105, 52, -1, 59, 36, 95, 52, -1, 77, 36, 95, 11, 105, 52, -1, 78, 36, 95, 52, -1, 84, 36, 95, 11, 105, 10, 116, 52, -1, 83, 36, 95, 52, -1, 49, 36, 95, 52, -1, 96, 46, 96, -1, 96, 40, 96, -1, 96, 56, 96, -1, 96, 55, 96, -1, 40, 96, -1, 86, -1, 105, -1, 36, 96, 52, -1, 64, 105, 11, 97, -1, 65, 105, 112, 11, 97, -1, 66, 105, 112, 11, 97, -1, 62, 105, 11, 97, -1, 105, 112, 11, 97, -1, 64, 105, -1, 65, 105, 112, -1, 66, 105, 112, -1, 62, 105, -1, 105, 112, -1, 99, 11, 98, -1, 99, -1, 105, 17, 95, -1, 101, -1, -1, 95, 11, 101, -1, 28, 11, 101, -1, 95, -1, 28, -1, 103, -1, -1, 95, 11, 103, -1, 95, -1, 30, 106, 50, -1, -1, 87, -1, 105, 11, 106, -1, 105, -1, 105, 112, 11, 107, -1, 105, 112, -1, 109, 11, 108, -1, 109, -1, 105, 7, 36, 105, 11, 105, 52, -1, 111, 11, 110, -1, 111, -1, 105, 10, 86, -1, 105, 10, 105, -1, 105, -1, 67, 95, -1, -1, 11, 105, 7, 105, 113, -1, -1, 105, 36, 115, 52, 11, 114, -1, 105, 36, 52, 11, 114, -1, 105, 11, 114, -1, 105, 36, 115, 52, -1, 105, 36, 52, -1, 105, -1, 105, 10, 105, 11, 115, -1, 105, 10, 105, -1, 105, 36, 117, 52, -1, 105, 36, 52, -1, 105, -1, 116, 11, 117, -1, 116, -1, 88, -1, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 147, 147, 151, 153, 155, 157, 160, 163, 165, 170, 172, 174, 177, 179, 181, 183, 185, 187, 189, 191, 193, 196, 199, 201, 204, 207, 209, 211, 213, 215, 217, 219, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, 323, 325, 327, 329, 332, 335, 337, 339, 341, 344, 346, 350, 352, 354, 356, 358, 361, 363, 365, 369, 372, 375, 378, 381, 384, 387, 390, 393, 396, 401, 404, 409, 413, 416, 419, 422, 425, 428, 433, 436, 439, 442, 447, 450, 453, 457, 460, 465, 468, 473, 476, 481, 485, 488, 493, 496, 498, 502, 505, 508, 512, 515, 518, 521, 524, 527, 530, 535, 538, 543, 545, 547, 551, 553, 558, 561 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "tokALL0", "tokALL1", "tokALL2", "tokAND", "tokARROW", "tokASSERT", "tokBIIMPL", "tokCOLON", "tokCOMMA", "tokCONST", "tokDEFAULT1", "tokDEFAULT2", "tokDOT", "tokEMPTY", "tokEQUAL", "tokEX0", "tokEX1", "tokEX2", "tokFALSE", "tokGREATER", "tokGREATEREQ", "tokGUIDE", "tokIMPL", "tokIN", "tokINTER", "tokINTERVAL", "tokLBRACE", "tokLBRACKET", "tokLESS", "tokLESSEQ", "tokLET0", "tokLET1", "tokLET2", "tokLPAREN", "tokMACRO", "tokMAX", "tokMIN", "tokMINUS", "tokMODULO", "tokNOT", "tokNOTEQUAL", "tokNOTIN", "tokOR", "tokPLUS", "tokPRED", "tokRBRACE", "tokRESTRICT", "tokRBRACKET", "tokUNIVROOT", "tokRPAREN", "tokSEMICOLON", "tokSETMINUS", "tokSLASH", "tokSTAR", "tokVERIFY", "tokSUB", "tokTREE", "tokTRUE", "tokUNION", "tokUNIVERSE", "tokUP", "tokVAR0", "tokVAR1", "tokVAR2", "tokWHERE", "tokINCLUDE", "tokIMPORT", "tokEXPORT", "tokPREFIX", "tokM2LSTR", "tokM2LTREE", "tokLASTPOS", "tokINSTATESPACE", "tokEXECUTE", "tokTYPE", "tokSOMETYPE", "tokVARIANT", "tokSUCC", "tokWS1S", "tokWS2S", "tokTREEROOT", "tokCONSTTREE", "tokALLPOS", "tokINT", "tokNAME", "tokSTRING", "LOW", "$accept", "start", "header", "declarations", "declaration", "exp", "arith_exp", "par_list", "defs", "def", "set_body", "non_empty_set_body", "exp_list", "non_empty_exp_list", "universe", "name", "name_list", "name_where_list", "func_list", "func", "univs", "univ", "where", "map_list", "variant_list", "component_list", "constnode", "constnode_list", "optstring", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 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 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 90, 91, 92, 92, 92, 92, 92, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 99, 100, 100, 101, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 106, 106, 107, 107, 108, 108, 109, 110, 110, 111, 111, 111, 112, 112, 113, 113, 114, 114, 114, 114, 114, 114, 115, 115, 116, 116, 116, 117, 117, 118, 118 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 2, 2, 2, 2, 0, 2, 1, 3, 3, 3, 7, 7, 5, 3, 4, 4, 4, 8, 5, 7, 8, 5, 7, 2, 4, 3, 3, 3, 3, 5, 1, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 4, 1, 3, 2, 4, 5, 5, 4, 5, 5, 4, 4, 4, 4, 1, 1, 6, 4, 5, 5, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 5, 6, 4, 6, 10, 10, 4, 6, 4, 8, 4, 4, 3, 3, 3, 3, 2, 1, 1, 3, 4, 5, 5, 4, 4, 2, 3, 3, 2, 2, 3, 1, 3, 1, 0, 3, 3, 1, 1, 1, 0, 3, 1, 3, 0, 1, 3, 1, 4, 2, 3, 1, 7, 3, 1, 3, 3, 1, 2, 0, 5, 0, 6, 5, 3, 4, 3, 1, 5, 3, 4, 3, 1, 3, 1, 1, 0 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 7, 0, 0, 0, 0, 0, 0, 5, 6, 3, 4, 1, 0, 125, 125, 0, 0, 0, 0, 76, 0, 125, 125, 66, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 157, 125, 65, 0, 0, 125, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 126, 2, 9, 0, 33, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 119, 118, 0, 114, 0, 112, 0, 0, 0, 0, 0, 39, 38, 50, 0, 0, 0, 156, 0, 0, 0, 138, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 54, 121, 0, 130, 0, 128, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 77, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 12, 0, 16, 0, 0, 29, 142, 0, 0, 30, 0, 28, 0, 0, 0, 0, 0, 0, 0, 31, 48, 47, 53, 44, 43, 42, 46, 36, 79, 40, 41, 0, 0, 98, 72, 99, 45, 37, 49, 71, 80, 74, 73, 35, 78, 123, 0, 120, 139, 0, 58, 0, 124, 0, 0, 0, 0, 0, 68, 55, 0, 0, 0, 131, 117, 116, 61, 111, 113, 62, 63, 0, 0, 0, 0, 0, 0, 0, 140, 0, 0, 0, 92, 125, 51, 27, 87, 19, 136, 137, 134, 17, 18, 0, 0, 0, 83, 0, 0, 148, 0, 89, 0, 0, 91, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 64, 129, 127, 59, 60, 15, 0, 0, 56, 57, 0, 24, 0, 109, 106, 140, 140, 0, 110, 21, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 32, 0, 0, 0, 100, 94, 70, 93, 96, 95, 69, 122, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 0, 0, 67, 0, 82, 84, 88, 145, 147, 0, 0, 0, 0, 0, 13, 14, 0, 25, 104, 101, 0, 0, 0, 105, 22, 0, 142, 0, 0, 146, 0, 0, 153, 0, 133, 102, 103, 23, 20, 141, 144, 150, 0, 0, 0, 0, 90, 0, 143, 0, 0, 152, 155, 0, 149, 85, 86, 0, 151, 154 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 5, 6, 60, 61, 83, 221, 264, 86, 87, 84, 85, 233, 234, 67, 63, 153, 65, 80, 81, 104, 105, 150, 281, 287, 364, 406, 407, 100 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -324 static const yytype_int16 yypact[] = { 2, -28, -10, -3, 27, 30, 581, -324, -324, -324, -324, -324, -40, 55, 55, 666, -40, 21, 51, 57, -40, 55, 55, -324, -40, 465, -40, -40, -40, 666, -40, 666, 666, 666, -40, 61, 63, 23, 12, -324, -40, -40, 55, 55, 28, 68, 86, 94, -40, 104, 666, -34, 111, 116, 130, 132, 133, -40, -324, -324, -324, 581, 742, 136, 34, 172, -40, -40, -40, 148, 150, 784, 170, -40, -40, 666, 180, -40, -40, 187, 146, 189, 192, 835, 157, -324, 183, 205, 201, 194, 199, 877, 4, 158, 158, 2053, 16, 666, 666, -324, 666, 666, -40, 218, 176, 219, 181, -40, -40, 182, 145, 151, 666, 185, 666, 919, 666, 224, 666, 666, 666, 666, 666, 191, -324, 666, 666, 156, 666, 666, 666, 666, 666, 666, 666, 666, -27, 666, 666, 666, -27, -324, 666, -27, -27, 666, 666, -324, 666, 666, 234, 666, 236, 202, 243, 247, -324, -27, 206, 208, 961, 666, 252, 255, 230, -324, -40, 465, 465, -324, 666, -40, 666, 666, 666, -324, 666, 91, 666, 96, 1003, 1045, -17, 1087, 1129, 214, -23, -324, -40, -324, 217, 221, -324, 260, 264, 1171, -324, 1213, -324, 1255, -40, 1297, 1339, 1381, 1423, 1465, -324, 2053, 1969, -324, 200, 200, 200, 419, 2095, 79, 200, 200, -27, -27, -324, 62, -324, 200, 2095, 83, 95, 254, -324, -324, 2095, 249, 1507, 225, -324, 1969, -40, 1969, -40, -324, 666, 666, 155, 262, 265, -324, 1969, 666, 666, -40, -324, -324, -324, 1969, -324, 2011, 1969, 1969, 1549, 267, -40, -40, -40, -40, 229, 34, 1591, 273, 239, -324, 55, -324, -324, -324, -324, -324, -324, -324, -324, -324, -40, 240, 666, -324, -40, -40, 13, 245, -324, 666, -40, -324, -40, 36, 65, -27, 666, -27, -27, -27, 666, 666, -324, -324, -324, 1969, 1969, -324, 666, 666, 1969, 1969, 285, -324, 666, 288, 290, 34, 34, 276, 291, -324, 666, 289, 256, 300, -324, 1633, 268, 269, -40, -8, -324, 1675, 305, 312, -324, 65, 8, 65, -324, -324, 8, -324, 1717, 1759, -40, 1801, 115, 115, 313, 314, 666, 115, 1843, 666, -324, -40, -324, -324, -324, -324, 315, 317, 271, -40, -40, -40, -324, -324, 277, -324, -324, -324, 115, 115, 1885, -324, -324, 1927, 260, -40, -40, 319, 320, 322, 292, 283, -324, -324, -324, -324, -324, -324, -324, 327, -40, -40, -40, -6, -324, -40, -324, 287, 294, -324, 329, 295, -324, -324, -324, -40, -324, -324 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -324, -324, -324, 281, -324, 282, -106, -178, -22, -324, -324, -4, -324, 43, -11, -12, -212, 0, 184, -324, 160, -324, -248, -31, -323, -50, -15, -55, -324 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_int16 yytable[] = { 64, 268, 116, 68, 72, 89, 90, 361, 64, 218, 77, 78, 79, 219, 88, 88, 88, 320, 92, 148, 76, 176, 96, 127, 330, 7, 304, 102, 103, 64, 11, 107, 108, 178, 226, 271, 113, 228, 229, 117, 177, 106, 66, 8, 362, 123, 405, 59, 101, 331, 9, 242, 179, 59, 152, 64, 64, 73, 394, 220, 59, 158, 159, 275, 59, 64, 64, 154, 155, 350, 351, 147, 328, 402, 1, 2, 295, 162, 163, 59, 10, 59, 297, 3, 4, 66, 182, 74, 336, 125, 64, 298, 299, 75, 127, 64, 64, 97, 127, 98, 128, 149, 185, 296, 110, 129, 130, 190, 191, 132, 133, 99, 293, 294, 134, 135, 109, 298, 299, 136, 298, 299, 111, 136, 222, 140, 137, 138, 222, 140, 112, 222, 222, 142, 143, 144, 300, 142, 143, 144, 114, 145, 147, 259, 146, 222, 147, 118, 267, 254, 298, 299, 119, 260, 79, 261, 262, 263, 260, 88, 261, 262, 263, 251, 252, 265, 120, 265, 121, 122, 372, 373, 148, 127, 276, 377, 103, 260, 59, 261, 262, 263, 151, 59, 101, 133, 116, 157, 286, 337, 161, 339, 340, 341, 164, 295, 389, 390, 136, 165, 166, 297, 59, 167, 140, 169, 222, 222, 307, 170, 298, 299, 142, 143, 144, 127, 171, -1, 172, 146, 173, 147, -1, -1, 64, 174, 152, 133, 186, 187, 188, -1, -1, 193, 189, 192, 303, 312, 196, 194, 136, 200, 209, -1, 206, 236, 140, 238, 315, 316, 317, 318, 239, 240, 142, 143, 144, 241, 243, 324, 244, 146, 247, 147, 127, 248, 249, 274, 325, 127, 278, 280, 152, 329, 279, 282, 133, 302, 334, 308, 335, 319, 309, 222, 314, 222, 222, 222, 62, 136, 322, 323, 326, 352, 136, 140, 346, 71, 332, 348, 140, 349, 353, 142, 143, 144, 355, 357, 356, 143, 144, 91, 147, 93, 94, 95, 366, 147, 286, 363, 359, 360, 367, 383, 374, 375, 381, 382, 399, 388, 396, 397, 115, 398, 370, 400, 265, 265, 401, 409, 411, 265, 124, 62, 343, 380, 410, 412, 277, 393, 250, 408, 387, 384, 385, 386, 413, 160, 0, 0, 0, 0, 265, 265, 0, 0, 0, 0, 0, 286, 395, 0, 0, 0, 0, 0, 0, 0, 0, 180, 181, 0, 183, 184, 286, 403, 404, 386, 0, 363, 0, 0, 0, 0, 195, 0, 197, 0, 199, 386, 201, 202, 203, 204, 205, 0, 0, 207, 208, 0, 210, 211, 212, 213, 214, 215, 216, 217, 0, 223, 224, 225, 0, 0, 227, 125, 0, 230, 231, 0, 232, 235, 0, 237, 127, 0, 128, 0, 0, 0, 0, 129, 130, 246, 131, 132, 133, 0, 0, 0, 134, 135, 253, 0, 255, 256, 257, 0, 258, 136, 266, 0, 137, 138, 139, 140, 0, 0, 12, 13, 14, 0, 0, 142, 143, 144, 0, 145, 0, 0, 146, 19, 147, 20, 21, 22, 23, 0, 0, 0, 0, 0, 0, 82, 25, 0, 0, 0, 26, 27, 28, 29, 0, 31, 32, 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, 36, 0, 0, 0, 0, 0, 305, 306, 69, 39, 0, 0, 0, 310, 311, 0, 0, 0, 45, 46, 47, 0, 0, 0, 49, 0, 70, 52, 53, 54, 0, 0, 55, 56, 0, 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 338, 0, 0, 0, 342, 232, 12, 13, 14, 0, 0, 15, 344, 345, 0, 16, 17, 18, 347, 19, 0, 20, 21, 22, 23, 0, 354, 24, 0, 0, 0, 0, 25, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 0, 0, 33, 0, 0, 0, 0, 34, 0, 35, 0, 36, 0, 376, 0, 0, 379, 37, 0, 38, 39, 0, 40, 0, 41, 42, 43, 0, 44, 45, 46, 47, 0, 0, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 58, 59, 12, 13, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 20, 21, 22, 23, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 26, 27, 28, 29, 0, 31, 32, 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, 36, 0, 0, 0, 0, 0, 0, 0, 69, 39, 0, 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, 0, 0, 0, 49, 0, 70, 52, 53, 54, 0, 125, 55, 56, 126, 58, 59, 0, 0, 0, 127, 0, 128, 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 141, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, 156, 142, 143, 144, 125, 145, 0, 126, 146, 168, 147, 0, 0, 127, 0, 128, 0, 0, 0, 0, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 175, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 198, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 245, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 269, 270, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 272, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 273, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 283, 284, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 285, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 288, 289, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 290, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 291, 292, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 301, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 313, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 321, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 358, 365, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 368, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 369, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 371, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 378, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 391, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 392, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 125, 0, 0, 126, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 131, 0, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 139, 140, 0, 0, 0, 0, 0, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 0, 132, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, 138, 0, 140, 0, 0, 0, 0, 0, 0, 0, 142, 143, 144, 127, 145, 128, 0, 146, 0, 147, 129, 130, 0, 0, -1, 133, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 136, 0, 0, 137, -1, 0, 140, 0, 0, 0, 0, 0, 0, 0, 142, 143, 144, 0, -1, 0, 0, 146, 0, 147 }; static const yytype_int16 yycheck[] = { 12, 179, 36, 14, 16, 27, 28, 330, 20, 36, 21, 22, 24, 40, 26, 27, 28, 265, 30, 36, 20, 17, 34, 15, 11, 53, 238, 38, 40, 41, 0, 42, 43, 17, 140, 52, 48, 143, 144, 51, 36, 41, 30, 53, 52, 57, 52, 87, 36, 36, 53, 157, 36, 87, 66, 67, 68, 36, 381, 86, 87, 73, 74, 86, 87, 77, 78, 67, 68, 317, 318, 63, 284, 396, 72, 73, 40, 77, 78, 87, 53, 87, 46, 81, 82, 30, 98, 36, 52, 6, 102, 55, 56, 36, 15, 107, 108, 36, 15, 36, 17, 67, 102, 41, 36, 22, 23, 107, 108, 26, 27, 88, 218, 219, 31, 32, 88, 55, 56, 40, 55, 56, 36, 40, 136, 46, 43, 44, 140, 46, 36, 143, 144, 54, 55, 56, 41, 54, 55, 56, 36, 58, 63, 52, 61, 157, 63, 36, 52, 171, 55, 56, 36, 62, 166, 64, 65, 66, 62, 171, 64, 65, 66, 167, 168, 177, 36, 179, 36, 36, 348, 349, 36, 15, 186, 353, 188, 62, 87, 64, 65, 66, 10, 87, 36, 27, 36, 17, 200, 295, 10, 297, 298, 299, 7, 40, 374, 375, 40, 53, 11, 46, 87, 11, 46, 48, 218, 219, 53, 26, 55, 56, 54, 55, 56, 15, 11, 17, 17, 61, 26, 63, 22, 23, 236, 26, 238, 27, 10, 53, 11, 31, 32, 88, 53, 53, 236, 249, 53, 88, 40, 17, 86, 43, 53, 11, 46, 11, 260, 261, 262, 263, 50, 10, 54, 55, 56, 10, 52, 270, 52, 61, 10, 63, 15, 10, 36, 53, 280, 15, 53, 11, 284, 285, 53, 11, 27, 52, 290, 17, 292, 52, 17, 295, 17, 297, 298, 299, 6, 40, 17, 52, 52, 17, 40, 46, 11, 15, 53, 11, 46, 11, 11, 54, 55, 56, 17, 7, 52, 55, 56, 29, 63, 31, 32, 33, 11, 63, 330, 331, 52, 52, 10, 52, 11, 11, 11, 10, 36, 52, 11, 11, 50, 11, 346, 52, 348, 349, 11, 52, 11, 353, 61, 61, 301, 357, 52, 52, 188, 380, 166, 401, 367, 365, 366, 367, 411, 75, -1, -1, -1, -1, 374, 375, -1, -1, -1, -1, -1, 381, 382, -1, -1, -1, -1, -1, -1, -1, -1, 97, 98, -1, 100, 101, 396, 397, 398, 399, -1, 401, -1, -1, -1, -1, 112, -1, 114, -1, 116, 411, 118, 119, 120, 121, 122, -1, -1, 125, 126, -1, 128, 129, 130, 131, 132, 133, 134, 135, -1, 137, 138, 139, -1, -1, 142, 6, -1, 145, 146, -1, 148, 149, -1, 151, 15, -1, 17, -1, -1, -1, -1, 22, 23, 161, 25, 26, 27, -1, -1, -1, 31, 32, 170, -1, 172, 173, 174, -1, 176, 40, 178, -1, 43, 44, 45, 46, -1, -1, 3, 4, 5, -1, -1, 54, 55, 56, -1, 58, -1, -1, 61, 16, 63, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, 28, 29, -1, -1, -1, 33, 34, 35, 36, -1, 38, 39, -1, -1, 42, -1, -1, -1, -1, -1, -1, 49, -1, 51, -1, -1, -1, -1, -1, 240, 241, 59, 60, -1, -1, -1, 247, 248, -1, -1, -1, 69, 70, 71, -1, -1, -1, 75, -1, 77, 78, 79, 80, -1, -1, 83, 84, -1, 86, 87, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 282, -1, -1, -1, -1, -1, -1, 289, -1, -1, -1, -1, -1, -1, 296, -1, -1, -1, 300, 301, 3, 4, 5, -1, -1, 8, 308, 309, -1, 12, 13, 14, 314, 16, -1, 18, 19, 20, 21, -1, 322, 24, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, -1, -1, 42, -1, -1, -1, -1, 47, -1, 49, -1, 51, -1, 352, -1, -1, 355, 57, -1, 59, 60, -1, 62, -1, 64, 65, 66, -1, 68, 69, 70, 71, -1, -1, 74, 75, 76, 77, 78, 79, 80, -1, -1, 83, 84, 85, 86, 87, 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, 35, 36, -1, 38, 39, -1, -1, 42, -1, -1, -1, -1, -1, -1, 49, -1, 51, -1, -1, -1, -1, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, -1, -1, -1, 69, 70, 71, -1, -1, -1, 75, -1, 77, 78, 79, 80, -1, 6, 83, 84, 9, 86, 87, -1, -1, -1, 15, -1, 17, -1, -1, -1, -1, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, -1, -1, -1, -1, -1, 53, 54, 55, 56, 6, 58, -1, 9, 61, 11, 63, -1, -1, 15, -1, 17, -1, -1, -1, -1, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, 52, 11, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, 53, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, 6, -1, -1, 9, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, 25, -1, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, 45, 46, -1, -1, -1, -1, -1, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, -1, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, -1, 46, -1, -1, -1, -1, -1, -1, -1, 54, 55, 56, 15, 58, 17, -1, 61, -1, 63, 22, 23, -1, -1, 26, 27, -1, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, 44, -1, 46, -1, -1, -1, -1, -1, -1, -1, 54, 55, 56, -1, 58, -1, -1, 61, -1, 63 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 72, 73, 81, 82, 91, 92, 53, 53, 53, 53, 0, 3, 4, 5, 8, 12, 13, 14, 16, 18, 19, 20, 21, 24, 29, 33, 34, 35, 36, 37, 38, 39, 42, 47, 49, 51, 57, 59, 60, 62, 64, 65, 66, 68, 69, 70, 71, 74, 75, 76, 77, 78, 79, 80, 83, 84, 85, 86, 87, 93, 94, 95, 105, 105, 107, 30, 104, 104, 59, 77, 95, 105, 36, 36, 36, 107, 104, 104, 105, 108, 109, 28, 95, 100, 101, 98, 99, 105, 98, 98, 95, 105, 95, 95, 95, 105, 36, 36, 88, 118, 36, 104, 105, 110, 111, 107, 104, 104, 88, 36, 36, 36, 105, 36, 95, 36, 105, 36, 36, 36, 36, 36, 105, 93, 6, 9, 15, 17, 22, 23, 25, 26, 27, 31, 32, 40, 43, 44, 45, 46, 53, 54, 55, 56, 58, 61, 63, 36, 67, 112, 10, 105, 106, 107, 107, 53, 17, 105, 105, 95, 10, 107, 107, 7, 53, 11, 11, 11, 48, 26, 11, 17, 26, 26, 52, 17, 36, 17, 36, 95, 95, 105, 95, 95, 107, 10, 53, 11, 53, 107, 107, 53, 88, 88, 95, 53, 95, 53, 95, 17, 95, 95, 95, 95, 95, 53, 95, 95, 86, 95, 95, 95, 95, 95, 95, 95, 95, 36, 40, 86, 96, 105, 95, 95, 95, 96, 95, 96, 96, 95, 95, 95, 102, 103, 95, 11, 95, 11, 50, 10, 10, 96, 52, 52, 52, 95, 10, 10, 36, 108, 101, 101, 95, 98, 95, 95, 95, 95, 52, 62, 64, 65, 66, 97, 105, 95, 52, 97, 52, 11, 52, 53, 52, 53, 86, 105, 110, 53, 53, 11, 113, 11, 52, 11, 11, 105, 114, 52, 11, 11, 52, 11, 96, 96, 40, 41, 46, 55, 56, 41, 11, 52, 107, 106, 95, 95, 53, 17, 17, 95, 95, 105, 53, 17, 105, 105, 105, 105, 52, 112, 53, 17, 52, 104, 105, 52, 95, 106, 105, 11, 36, 53, 95, 105, 105, 52, 96, 95, 96, 96, 96, 95, 103, 95, 95, 11, 95, 11, 11, 112, 112, 17, 11, 95, 17, 52, 7, 52, 52, 52, 114, 52, 105, 115, 11, 11, 10, 53, 53, 105, 53, 97, 97, 11, 11, 95, 97, 53, 95, 105, 11, 10, 52, 105, 105, 105, 116, 52, 97, 97, 53, 53, 113, 114, 105, 11, 11, 11, 36, 52, 11, 114, 105, 105, 52, 116, 117, 115, 52, 52, 11, 52, 117 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, Location); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; #endif { if (!yyvaluep) return; YYUSE (yylocationp); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; YYLTYPE const * const yylocationp; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); YY_LOCATION_PRINT (yyoutput, *yylocationp); YYFPRINTF (yyoutput, ": "); yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) #else static void yy_reduce_print (yyvsp, yylsp, yyrule) YYSTYPE *yyvsp; YYLTYPE *yylsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, yylsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) #else static void yydestruct (yymsg, yytype, yyvaluep, yylocationp) const char *yymsg; int yytype; YYSTYPE *yyvaluep; YYLTYPE *yylocationp; #endif { YYUSE (yyvaluep); YYUSE (yylocationp); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /* Location data for the look-ahead symbol. */ YYLTYPE yylloc; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[2]; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; yylsp = yyls; #if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 0; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; YYLTYPE *yyls1 = yyls; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; *++yylsp = yylloc; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 148 "parser.ypp" {untypedAST = new MonaUntypedAST((yyvsp[(2) - (2)].declarationList));} break; case 3: #line 152 "parser.ypp" {options.m2l = false; options.mode = LINEAR;} break; case 4: #line 154 "parser.ypp" {options.m2l = false; options.mode = TREE;} break; case 5: #line 156 "parser.ypp" {options.m2l = true; options.mode = LINEAR;} break; case 6: #line 158 "parser.ypp" {options.m2l = true; options.mode = TREE;} break; case 7: #line 160 "parser.ypp" {options.m2l = false; options.mode = LINEAR;} break; case 8: #line 164 "parser.ypp" {if ((yyvsp[(1) - (2)].declaration)) (yyvsp[(2) - (2)].declarationList)->push_front((yyvsp[(1) - (2)].declaration)); (yyval.declarationList) = (yyvsp[(2) - (2)].declarationList);} break; case 9: #line 166 "parser.ypp" {(yyval.declarationList) = new DeclarationList(); if ((yyvsp[(1) - (1)].declaration)) (yyval.declarationList)->push_front((yyvsp[(1) - (1)].declaration));} break; case 10: #line 171 "parser.ypp" {(yyval.declaration) = new Assertion_Declaration((yyvsp[(2) - (3)].untypedExp), POS((yylsp[(1) - (3)])));} break; case 11: #line 173 "parser.ypp" {(yyval.declaration) = new Guide_Declaration((yyvsp[(2) - (3)].guideFuncList), POS((yylsp[(1) - (3)])));} break; case 12: #line 175 "parser.ypp" {(yyval.declaration) = new Universe_Declaration((yyvsp[(2) - (3)].univList), POS((yylsp[(1) - (3)]))); anyUniverses = true;} break; case 13: #line 178 "parser.ypp" {(yyval.declaration) = new Default_Declaration(vVar1, (yyvsp[(3) - (7)].name), (yyvsp[(6) - (7)].untypedExp), POS((yylsp[(1) - (7)])));} break; case 14: #line 180 "parser.ypp" {(yyval.declaration) = new Default_Declaration(vVar2, (yyvsp[(3) - (7)].name), (yyvsp[(6) - (7)].untypedExp), POS((yylsp[(1) - (7)])));} break; case 15: #line 182 "parser.ypp" {(yyval.declaration) = new Constant_Declaration((yyvsp[(2) - (5)].name), (yyvsp[(4) - (5)].arithExp), POS((yylsp[(1) - (5)])));} break; case 16: #line 184 "parser.ypp" {(yyval.declaration) = new Variable_Declaration(vVar0, NULL, (yyvsp[(2) - (3)].varDeclList), POS((yylsp[(1) - (3)])));} break; case 17: #line 186 "parser.ypp" {(yyval.declaration) = new Variable_Declaration(vVar1, (yyvsp[(2) - (4)].nameList), (yyvsp[(3) - (4)].varDeclList), POS((yylsp[(1) - (4)])));} break; case 18: #line 188 "parser.ypp" {(yyval.declaration) = new Variable_Declaration(vVar2, (yyvsp[(2) - (4)].nameList), (yyvsp[(3) - (4)].varDeclList), POS((yylsp[(1) - (4)])));} break; case 19: #line 190 "parser.ypp" {(yyval.declaration) = new Variable_Declaration(vTree, (yyvsp[(2) - (4)].nameList), (yyvsp[(3) - (4)].varDeclList), POS((yylsp[(1) - (4)])));} break; case 20: #line 192 "parser.ypp" {(yyval.declaration) = new Predicate_Declaration((yyvsp[(2) - (8)].name), (yyvsp[(4) - (8)].parDeclList), (yyvsp[(7) - (8)].untypedExp), POS((yylsp[(1) - (8)])));} break; case 21: #line 194 "parser.ypp" {(yyval.declaration) = new Predicate_Declaration((yyvsp[(2) - (5)].name), new ParDeclList(), (yyvsp[(4) - (5)].untypedExp), POS((yylsp[(1) - (5)])));} break; case 22: #line 197 "parser.ypp" {(yyval.declaration) = new Predicate_Declaration((yyvsp[(2) - (7)].name), new ParDeclList(), (yyvsp[(6) - (7)].untypedExp), POS((yylsp[(1) - (7)])));} break; case 23: #line 200 "parser.ypp" {(yyval.declaration) = new Macro_Declaration((yyvsp[(2) - (8)].name), (yyvsp[(4) - (8)].parDeclList), (yyvsp[(7) - (8)].untypedExp), POS((yylsp[(1) - (8)])));} break; case 24: #line 202 "parser.ypp" {(yyval.declaration) = new Macro_Declaration((yyvsp[(2) - (5)].name), new ParDeclList(), (yyvsp[(4) - (5)].untypedExp), POS((yylsp[(1) - (5)])));} break; case 25: #line 205 "parser.ypp" {(yyval.declaration) = new Macro_Declaration((yyvsp[(2) - (7)].name), new ParDeclList(), (yyvsp[(6) - (7)].untypedExp), POS((yylsp[(1) - (7)])));} break; case 26: #line 208 "parser.ypp" {(yyval.declaration) = new Expression_Declaration((yyvsp[(1) - (2)].untypedExp), POS((yylsp[(1) - (2)])));} break; case 27: #line 210 "parser.ypp" {(yyval.declaration) = new Verify_Declaration((yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 28: #line 212 "parser.ypp" {(yyval.declaration) = new Execute_Declaration((yyvsp[(2) - (3)].untypedExp), POS((yylsp[(1) - (3)])));} break; case 29: #line 214 "parser.ypp" {loadFile((yyvsp[(2) - (3)].string)+1); (yyval.declaration) = 0;} break; case 30: #line 216 "parser.ypp" {(yyval.declaration) = new LastPos_Declaration((yyvsp[(2) - (3)].name), POS((yylsp[(1) - (3)])));} break; case 31: #line 218 "parser.ypp" {(yyval.declaration) = new AllPos_Declaration((yyvsp[(2) - (3)].name), POS((yylsp[(1) - (3)])));} break; case 32: #line 220 "parser.ypp" {(yyval.declaration) = new Type_Declaration((yyvsp[(2) - (5)].name), (yyvsp[(4) - (5)].variantList), POS((yylsp[(1) - (5)])));} break; case 33: #line 224 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Name((yyvsp[(1) - (1)].name), POS((yylsp[(1) - (1)])));} break; case 34: #line 226 "parser.ypp" {(yyval.untypedExp) = (yyvsp[(2) - (3)].untypedExp);} break; case 35: #line 228 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Sub((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 36: #line 230 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_In((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 37: #line 232 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_NotIn((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 38: #line 234 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Min((yyvsp[(2) - (2)].untypedExp), POS((yylsp[(1) - (2)])));} break; case 39: #line 236 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Max((yyvsp[(2) - (2)].untypedExp), POS((yylsp[(1) - (2)])));} break; case 40: #line 238 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Less((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 41: #line 240 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_LessEq((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 42: #line 242 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_GreaterEq((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 43: #line 244 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Greater((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 44: #line 246 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Equal((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 45: #line 248 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_NotEqual((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 46: #line 250 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Impl((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 47: #line 252 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Biimpl((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 48: #line 254 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_And((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 49: #line 256 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Or((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 50: #line 258 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Not((yyvsp[(2) - (2)].untypedExp), POS((yylsp[(1) - (2)])));} break; case 51: #line 260 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Root((yyvsp[(3) - (4)].name), POS((yylsp[(1) - (4)])));} break; case 52: #line 262 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Root(NULL, POS((yylsp[(1) - (1)])));} break; case 53: #line 264 "parser.ypp" {check_bits((yyvsp[(3) - (3)].string)); (yyval.untypedExp) = new UntypedExp_Dot((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].string), POS((yylsp[(2) - (3)])));} break; case 54: #line 267 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Up((yyvsp[(1) - (2)].untypedExp), POS((yylsp[(2) - (2)])));} break; case 55: #line 269 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Ex0((yyvsp[(2) - (4)].varDeclList), (yyvsp[(4) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 56: #line 271 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Ex1((yyvsp[(2) - (5)].nameList), (yyvsp[(3) - (5)].varDeclList), (yyvsp[(5) - (5)].untypedExp), POS((yylsp[(1) - (5)])));} break; case 57: #line 273 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Ex2((yyvsp[(2) - (5)].nameList), (yyvsp[(3) - (5)].varDeclList), (yyvsp[(5) - (5)].untypedExp), POS((yylsp[(1) - (5)])));} break; case 58: #line 275 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_All0((yyvsp[(2) - (4)].varDeclList), (yyvsp[(4) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 59: #line 277 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_All1((yyvsp[(2) - (5)].nameList), (yyvsp[(3) - (5)].varDeclList), (yyvsp[(5) - (5)].untypedExp), POS((yylsp[(1) - (5)])));} break; case 60: #line 279 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_All2((yyvsp[(2) - (5)].nameList), (yyvsp[(3) - (5)].varDeclList), (yyvsp[(5) - (5)].untypedExp), POS((yylsp[(1) - (5)])));} break; case 61: #line 281 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Let0((yyvsp[(2) - (4)].bindExpList), (yyvsp[(4) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 62: #line 283 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Let1((yyvsp[(2) - (4)].bindExpList), (yyvsp[(4) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 63: #line 285 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Let2((yyvsp[(2) - (4)].bindExpList), (yyvsp[(4) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 64: #line 287 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Call((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].untypedExpList), POS((yylsp[(1) - (4)])));} break; case 65: #line 289 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_True(POS((yylsp[(1) - (1)])));} break; case 66: #line 291 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_False(POS((yylsp[(1) - (1)])));} break; case 67: #line 293 "parser.ypp" {if (!(yyvsp[(5) - (6)].nameList)) yyerror("parse error"); (yyval.untypedExp) = new UntypedExp_RootPred((yyvsp[(3) - (6)].untypedExp), (yyvsp[(5) - (6)].nameList), POS((yylsp[(1) - (6)])));} break; case 68: #line 296 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_EmptyPred((yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 69: #line 298 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_PlusModulo((yyvsp[(1) - (5)].untypedExp), (yyvsp[(3) - (5)].arithExp), (yyvsp[(5) - (5)].untypedExp), POS((yylsp[(4) - (5)])));} break; case 70: #line 300 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_MinusModulo((yyvsp[(1) - (5)].untypedExp), (yyvsp[(3) - (5)].arithExp), (yyvsp[(5) - (5)].untypedExp), POS((yylsp[(4) - (5)])));} break; case 71: #line 302 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Plus((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 72: #line 304 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Minus((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 73: #line 306 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Mult((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 74: #line 308 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Div((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 75: #line 310 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Int(atoi((yyvsp[(1) - (1)].string)), POS((yylsp[(1) - (1)])));} break; case 76: #line 312 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Empty(POS((yylsp[(1) - (1)])));} break; case 77: #line 314 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Set((yyvsp[(2) - (3)].untypedExpList), POS((yylsp[(1) - (3)])));} break; case 78: #line 316 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Union((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 79: #line 318 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Inter((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 80: #line 320 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Setminus((yyvsp[(1) - (3)].untypedExp), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 81: #line 322 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Import((yyvsp[(3) - (5)].string)+1, (yyvsp[(4) - (5)].mapList), POS((yylsp[(1) - (5)])));} break; case 82: #line 324 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Export((yyvsp[(3) - (6)].string)+1, (yyvsp[(5) - (6)].untypedExp), POS((yylsp[(1) - (6)])));} break; case 83: #line 326 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Prefix((yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 84: #line 328 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_InStateSpace((yyvsp[(3) - (6)].untypedExp), (yyvsp[(5) - (6)].nameList), POS((yylsp[(1) - (6)])));} break; case 85: #line 331 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Variant((yyvsp[(3) - (10)].untypedExp), (yyvsp[(5) - (10)].untypedExp), (yyvsp[(7) - (10)].name), (yyvsp[(9) - (10)].name), POS((yylsp[(1) - (10)])));} break; case 86: #line 334 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Succ((yyvsp[(3) - (10)].untypedExp), (yyvsp[(5) - (10)].name), (yyvsp[(7) - (10)].name), (yyvsp[(9) - (10)].name), POS((yylsp[(1) - (10)])));} break; case 87: #line 336 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_WellFormedTree((yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 88: #line 338 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Type((yyvsp[(3) - (6)].untypedExp), (yyvsp[(5) - (6)].name), POS((yylsp[(1) - (6)])));} break; case 89: #line 340 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_SomeType((yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 90: #line 343 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_ConstTree((yyvsp[(3) - (8)].untypedExp), (yyvsp[(5) - (8)].name), (yyvsp[(7) - (8)].constNode), POS((yylsp[(1) - (8)])));} break; case 91: #line 345 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_TreeRoot((yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 92: #line 347 "parser.ypp" {(yyval.untypedExp) = new UntypedExp_Restrict((yyvsp[(3) - (4)].untypedExp), POS((yylsp[(1) - (4)])));} break; case 93: #line 351 "parser.ypp" {(yyval.arithExp) = new ArithExp_Add((yyvsp[(1) - (3)].arithExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 94: #line 353 "parser.ypp" {(yyval.arithExp) = new ArithExp_Subtr((yyvsp[(1) - (3)].arithExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 95: #line 355 "parser.ypp" {(yyval.arithExp) = new ArithExp_Mult((yyvsp[(1) - (3)].arithExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 96: #line 357 "parser.ypp" {(yyval.arithExp) = new ArithExp_Div((yyvsp[(1) - (3)].arithExp), (yyvsp[(3) - (3)].arithExp), POS((yylsp[(2) - (3)])));} break; case 97: #line 359 "parser.ypp" {(yyval.arithExp) = new ArithExp_Subtr(new ArithExp_Integer(0, POS((yylsp[(1) - (2)]))), (yyvsp[(2) - (2)].arithExp), POS((yylsp[(2) - (2)])));} break; case 98: #line 362 "parser.ypp" {(yyval.arithExp) = new ArithExp_Integer(atoi((yyvsp[(1) - (1)].string)), POS((yylsp[(1) - (1)])));} break; case 99: #line 364 "parser.ypp" {(yyval.arithExp) = new ArithExp_Const((yyvsp[(1) - (1)].name), POS((yylsp[(1) - (1)])));} break; case 100: #line 366 "parser.ypp" {(yyval.arithExp) = (yyvsp[(2) - (3)].arithExp);} break; case 101: #line 370 "parser.ypp" {(yyvsp[(4) - (4)].parDeclList)->push_front(new ParDecl(pPar0, (yyvsp[(2) - (4)].name), NULL, POS((yylsp[(2) - (4)])))); (yyval.parDeclList) = (yyvsp[(4) - (4)].parDeclList);} break; case 102: #line 373 "parser.ypp" {(yyvsp[(5) - (5)].parDeclList)->push_front(new ParDecl(pPar1, (yyvsp[(2) - (5)].name), (yyvsp[(3) - (5)].untypedExp), POS((yylsp[(2) - (5)])))); (yyval.parDeclList) = (yyvsp[(5) - (5)].parDeclList);} break; case 103: #line 376 "parser.ypp" {(yyvsp[(5) - (5)].parDeclList)->push_front(new ParDecl(pPar2, (yyvsp[(2) - (5)].name), (yyvsp[(3) - (5)].untypedExp), POS((yylsp[(2) - (5)])))); (yyval.parDeclList) = (yyvsp[(5) - (5)].parDeclList);} break; case 104: #line 379 "parser.ypp" {(yyvsp[(4) - (4)].parDeclList)->push_front(new ParDecl(pParU, (yyvsp[(2) - (4)].name), NULL, POS((yylsp[(2) - (4)])))); (yyval.parDeclList) = (yyvsp[(4) - (4)].parDeclList);} break; case 105: #line 382 "parser.ypp" {(yyvsp[(4) - (4)].parDeclList)->push_front(new ParDecl(pPar, (yyvsp[(1) - (4)].name), (yyvsp[(2) - (4)].untypedExp), POS((yylsp[(1) - (4)])))); (yyval.parDeclList) = (yyvsp[(4) - (4)].parDeclList);} break; case 106: #line 385 "parser.ypp" {(yyval.parDeclList) = new ParDeclList(); (yyval.parDeclList)->push_front(new ParDecl(pPar0, (yyvsp[(2) - (2)].name), NULL, POS((yylsp[(2) - (2)]))));} break; case 107: #line 388 "parser.ypp" {(yyval.parDeclList) = new ParDeclList(); (yyval.parDeclList)->push_front(new ParDecl(pPar1, (yyvsp[(2) - (3)].name), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)]))));} break; case 108: #line 391 "parser.ypp" {(yyval.parDeclList) = new ParDeclList(); (yyval.parDeclList)->push_front(new ParDecl(pPar2, (yyvsp[(2) - (3)].name), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)]))));} break; case 109: #line 394 "parser.ypp" {(yyval.parDeclList) = new ParDeclList(); (yyval.parDeclList)->push_front(new ParDecl(pParU, (yyvsp[(2) - (2)].name), NULL, POS((yylsp[(2) - (2)]))));} break; case 110: #line 397 "parser.ypp" {(yyval.parDeclList) = new ParDeclList(); (yyval.parDeclList)->push_front(new ParDecl(pPar, (yyvsp[(1) - (2)].name), (yyvsp[(2) - (2)].untypedExp), POS((yylsp[(1) - (2)]))));} break; case 111: #line 402 "parser.ypp" {(yyvsp[(3) - (3)].bindExpList)->push_front((yyvsp[(1) - (3)].bindExp)); (yyval.bindExpList) = (yyvsp[(3) - (3)].bindExpList);} break; case 112: #line 405 "parser.ypp" {(yyval.bindExpList) = new BindExpList(); (yyval.bindExpList)->push_front((yyvsp[(1) - (1)].bindExp));} break; case 113: #line 410 "parser.ypp" {(yyval.bindExp) = new BindExp((yyvsp[(1) - (3)].name), (yyvsp[(3) - (3)].untypedExp), POS((yylsp[(2) - (3)])));} break; case 114: #line 414 "parser.ypp" {(yyval.untypedExpList) = (yyvsp[(1) - (1)].untypedExpList);} break; case 115: #line 416 "parser.ypp" {(yyval.untypedExpList) = new UntypedExpList();} break; case 116: #line 420 "parser.ypp" {(yyvsp[(3) - (3)].untypedExpList)->push_front((yyvsp[(1) - (3)].untypedExp)); (yyval.untypedExpList) = (yyvsp[(3) - (3)].untypedExpList);} break; case 117: #line 423 "parser.ypp" {(yyvsp[(3) - (3)].untypedExpList)->push_front(new UntypedExp_Interval(POS((yylsp[(1) - (3)])))); (yyval.untypedExpList) = (yyvsp[(3) - (3)].untypedExpList);} break; case 118: #line 426 "parser.ypp" {(yyval.untypedExpList) = new UntypedExpList(); (yyval.untypedExpList)->push_front((yyvsp[(1) - (1)].untypedExp));} break; case 119: #line 429 "parser.ypp" {(yyval.untypedExpList) = new UntypedExpList(); (yyval.untypedExpList)->push_front(new UntypedExp_Interval(POS((yylsp[(1) - (1)]))));} break; case 120: #line 434 "parser.ypp" {(yyval.untypedExpList) = (yyvsp[(1) - (1)].untypedExpList);} break; case 121: #line 436 "parser.ypp" {(yyval.untypedExpList) = NULL;} break; case 122: #line 440 "parser.ypp" {(yyvsp[(3) - (3)].untypedExpList)->push_front((yyvsp[(1) - (3)].untypedExp)); (yyval.untypedExpList) = (yyvsp[(3) - (3)].untypedExpList);} break; case 123: #line 443 "parser.ypp" {(yyval.untypedExpList) = new UntypedExpList; (yyval.untypedExpList)->push_front((yyvsp[(1) - (1)].untypedExp));} break; case 124: #line 448 "parser.ypp" {(yyval.nameList) = (yyvsp[(2) - (3)].nameList);} break; case 125: #line 450 "parser.ypp" {(yyval.nameList) = NULL;} break; case 126: #line 454 "parser.ypp" {(yyval.name) = new Name((yyvsp[(1) - (1)].string), POS((yylsp[(1) - (1)])));} break; case 127: #line 458 "parser.ypp" {(yyvsp[(3) - (3)].nameList)->push_front((yyvsp[(1) - (3)].name)); (yyval.nameList) = (yyvsp[(3) - (3)].nameList);} break; case 128: #line 461 "parser.ypp" {(yyval.nameList) = new NameList(); (yyval.nameList)->push_front((yyvsp[(1) - (1)].name));} break; case 129: #line 466 "parser.ypp" {(yyvsp[(4) - (4)].varDeclList)->push_front(new VarDecl((yyvsp[(1) - (4)].name), (yyvsp[(2) - (4)].untypedExp), POS((yylsp[(1) - (4)])))); (yyval.varDeclList) = (yyvsp[(4) - (4)].varDeclList);} break; case 130: #line 469 "parser.ypp" {(yyval.varDeclList) = new VarDeclList(); (yyval.varDeclList)->push_front(new VarDecl((yyvsp[(1) - (2)].name), (yyvsp[(2) - (2)].untypedExp), POS((yylsp[(1) - (2)]))));} break; case 131: #line 474 "parser.ypp" {(yyvsp[(3) - (3)].guideFuncList)->push_front((yyvsp[(1) - (3)].guideFunc)); (yyval.guideFuncList) = (yyvsp[(3) - (3)].guideFuncList);} break; case 132: #line 477 "parser.ypp" {(yyval.guideFuncList) = new GuideFuncList(); (yyval.guideFuncList)->push_front((yyvsp[(1) - (1)].guideFunc));} break; case 133: #line 482 "parser.ypp" {(yyval.guideFunc) = new GuideFunc((yyvsp[(1) - (7)].name), (yyvsp[(4) - (7)].name), (yyvsp[(6) - (7)].name));} break; case 134: #line 486 "parser.ypp" {(yyvsp[(3) - (3)].univList)->push_front((yyvsp[(1) - (3)].univ)); (yyval.univList) = (yyvsp[(3) - (3)].univList);} break; case 135: #line 489 "parser.ypp" {(yyval.univList) = new UnivList(); (yyval.univList)->push_front((yyvsp[(1) - (1)].univ));} break; case 136: #line 494 "parser.ypp" {check_bits((yyvsp[(3) - (3)].string)); (yyval.univ) = new Univ((yyvsp[(1) - (3)].name), (yyvsp[(3) - (3)].string), strlen((yyvsp[(3) - (3)].string)));} break; case 137: #line 497 "parser.ypp" {(yyval.univ) = new Univ((yyvsp[(1) - (3)].name), (yyvsp[(3) - (3)].name));} break; case 138: #line 499 "parser.ypp" {(yyval.univ) = new Univ((yyvsp[(1) - (1)].name));} break; case 139: #line 503 "parser.ypp" {(yyval.untypedExp) = (yyvsp[(2) - (2)].untypedExp);} break; case 140: #line 505 "parser.ypp" {(yyval.untypedExp) = NULL;} break; case 141: #line 509 "parser.ypp" {(yyvsp[(5) - (5)].mapList)->push_front(new ImportMap((yyvsp[(2) - (5)].name), (yyvsp[(4) - (5)].name), POS((yylsp[(3) - (5)])))); (yyval.mapList) = (yyvsp[(5) - (5)].mapList);} break; case 142: #line 512 "parser.ypp" {(yyval.mapList) = new ImportMapList();} break; case 143: #line 516 "parser.ypp" {(yyvsp[(6) - (6)].variantList)->push_front(new Variant((yyvsp[(1) - (6)].name), (yyvsp[(3) - (6)].componentList), POS((yylsp[(1) - (6)])))); (yyval.variantList) = (yyvsp[(6) - (6)].variantList);} break; case 144: #line 519 "parser.ypp" {(yyvsp[(5) - (5)].variantList)->push_front(new Variant((yyvsp[(1) - (5)].name), NULL, POS((yylsp[(1) - (5)])))); (yyval.variantList) = (yyvsp[(5) - (5)].variantList);} break; case 145: #line 522 "parser.ypp" {(yyvsp[(3) - (3)].variantList)->push_front(new Variant((yyvsp[(1) - (3)].name), NULL, POS((yylsp[(1) - (3)])))); (yyval.variantList) = (yyvsp[(3) - (3)].variantList);} break; case 146: #line 525 "parser.ypp" {(yyval.variantList) = new VariantList(); (yyval.variantList)->push_front(new Variant((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].componentList), POS((yylsp[(1) - (4)]))));} break; case 147: #line 528 "parser.ypp" {(yyval.variantList) = new VariantList(); (yyval.variantList)->push_front(new Variant((yyvsp[(1) - (3)].name), NULL, POS((yylsp[(1) - (3)]))));} break; case 148: #line 531 "parser.ypp" {(yyval.variantList) = new VariantList(); (yyval.variantList)->push_front(new Variant((yyvsp[(1) - (1)].name), NULL, POS((yylsp[(1) - (1)]))));} break; case 149: #line 536 "parser.ypp" {(yyvsp[(5) - (5)].componentList)->push_front(new Component((yyvsp[(1) - (5)].name), (yyvsp[(3) - (5)].name), POS((yylsp[(1) - (5)])))); (yyval.componentList) = (yyvsp[(5) - (5)].componentList);} break; case 150: #line 539 "parser.ypp" {(yyval.componentList) = new ComponentList(); (yyval.componentList)->push_front(new Component((yyvsp[(1) - (3)].name), (yyvsp[(3) - (3)].name), POS((yylsp[(1) - (3)]))));} break; case 151: #line 544 "parser.ypp" {(yyval.constNode) = new ConstNode((yyvsp[(1) - (4)].name), (yyvsp[(3) - (4)].constNodeList), POS((yylsp[(1) - (4)])));} break; case 152: #line 546 "parser.ypp" {(yyval.constNode) = new ConstNode((yyvsp[(1) - (3)].name), NULL, POS((yylsp[(1) - (3)])));} break; case 153: #line 548 "parser.ypp" {(yyval.constNode) = new ConstNode((yyvsp[(1) - (1)].name), NULL, POS((yylsp[(1) - (1)])));} break; case 154: #line 552 "parser.ypp" {(yyvsp[(3) - (3)].constNodeList)->push_front((yyvsp[(1) - (3)].constNode)); (yyval.constNodeList) = (yyvsp[(3) - (3)].constNodeList);} break; case 155: #line 554 "parser.ypp" {(yyval.constNodeList) = new ConstNodeList; (yyval.constNodeList)->push_front((yyvsp[(1) - (1)].constNode));} break; case 156: #line 559 "parser.ypp" {(yyval.string) = (yyvsp[(1) - (1)].string)+1;} break; case 157: #line 561 "parser.ypp" {(yyval.string) = 0;} break; /* Line 1267 of yacc.c. */ #line 3100 "parser.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } yyerror_range[0] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the look-ahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, yylsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } mona-1.4/Front/parser.h0000644000414100000240000001515010764214571011765 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { tokALL0 = 258, tokALL1 = 259, tokALL2 = 260, tokAND = 261, tokARROW = 262, tokASSERT = 263, tokBIIMPL = 264, tokCOLON = 265, tokCOMMA = 266, tokCONST = 267, tokDEFAULT1 = 268, tokDEFAULT2 = 269, tokDOT = 270, tokEMPTY = 271, tokEQUAL = 272, tokEX0 = 273, tokEX1 = 274, tokEX2 = 275, tokFALSE = 276, tokGREATER = 277, tokGREATEREQ = 278, tokGUIDE = 279, tokIMPL = 280, tokIN = 281, tokINTER = 282, tokINTERVAL = 283, tokLBRACE = 284, tokLBRACKET = 285, tokLESS = 286, tokLESSEQ = 287, tokLET0 = 288, tokLET1 = 289, tokLET2 = 290, tokLPAREN = 291, tokMACRO = 292, tokMAX = 293, tokMIN = 294, tokMINUS = 295, tokMODULO = 296, tokNOT = 297, tokNOTEQUAL = 298, tokNOTIN = 299, tokOR = 300, tokPLUS = 301, tokPRED = 302, tokRBRACE = 303, tokRESTRICT = 304, tokRBRACKET = 305, tokUNIVROOT = 306, tokRPAREN = 307, tokSEMICOLON = 308, tokSETMINUS = 309, tokSLASH = 310, tokSTAR = 311, tokVERIFY = 312, tokSUB = 313, tokTREE = 314, tokTRUE = 315, tokUNION = 316, tokUNIVERSE = 317, tokUP = 318, tokVAR0 = 319, tokVAR1 = 320, tokVAR2 = 321, tokWHERE = 322, tokINCLUDE = 323, tokIMPORT = 324, tokEXPORT = 325, tokPREFIX = 326, tokM2LSTR = 327, tokM2LTREE = 328, tokLASTPOS = 329, tokINSTATESPACE = 330, tokEXECUTE = 331, tokTYPE = 332, tokSOMETYPE = 333, tokVARIANT = 334, tokSUCC = 335, tokWS1S = 336, tokWS2S = 337, tokTREEROOT = 338, tokCONSTTREE = 339, tokALLPOS = 340, tokINT = 341, tokNAME = 342, tokSTRING = 343, LOW = 344 }; #endif /* Tokens. */ #define tokALL0 258 #define tokALL1 259 #define tokALL2 260 #define tokAND 261 #define tokARROW 262 #define tokASSERT 263 #define tokBIIMPL 264 #define tokCOLON 265 #define tokCOMMA 266 #define tokCONST 267 #define tokDEFAULT1 268 #define tokDEFAULT2 269 #define tokDOT 270 #define tokEMPTY 271 #define tokEQUAL 272 #define tokEX0 273 #define tokEX1 274 #define tokEX2 275 #define tokFALSE 276 #define tokGREATER 277 #define tokGREATEREQ 278 #define tokGUIDE 279 #define tokIMPL 280 #define tokIN 281 #define tokINTER 282 #define tokINTERVAL 283 #define tokLBRACE 284 #define tokLBRACKET 285 #define tokLESS 286 #define tokLESSEQ 287 #define tokLET0 288 #define tokLET1 289 #define tokLET2 290 #define tokLPAREN 291 #define tokMACRO 292 #define tokMAX 293 #define tokMIN 294 #define tokMINUS 295 #define tokMODULO 296 #define tokNOT 297 #define tokNOTEQUAL 298 #define tokNOTIN 299 #define tokOR 300 #define tokPLUS 301 #define tokPRED 302 #define tokRBRACE 303 #define tokRESTRICT 304 #define tokRBRACKET 305 #define tokUNIVROOT 306 #define tokRPAREN 307 #define tokSEMICOLON 308 #define tokSETMINUS 309 #define tokSLASH 310 #define tokSTAR 311 #define tokVERIFY 312 #define tokSUB 313 #define tokTREE 314 #define tokTRUE 315 #define tokUNION 316 #define tokUNIVERSE 317 #define tokUP 318 #define tokVAR0 319 #define tokVAR1 320 #define tokVAR2 321 #define tokWHERE 322 #define tokINCLUDE 323 #define tokIMPORT 324 #define tokEXPORT 325 #define tokPREFIX 326 #define tokM2LSTR 327 #define tokM2LTREE 328 #define tokLASTPOS 329 #define tokINSTATESPACE 330 #define tokEXECUTE 331 #define tokTYPE 332 #define tokSOMETYPE 333 #define tokVARIANT 334 #define tokSUCC 335 #define tokWS1S 336 #define tokWS2S 337 #define tokTREEROOT 338 #define tokCONSTTREE 339 #define tokALLPOS 340 #define tokINT 341 #define tokNAME 342 #define tokSTRING 343 #define LOW 344 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 51 "parser.ypp" { char *string; int integer; MonaUntypedAST *monaUntypedAST; DeclarationList *declarationList; Declaration *declaration; UntypedExp *untypedExp; ArithExp *arithExp; ParDeclList *parDeclList; BindExpList *bindExpList; BindExp *bindExp; UntypedExpList *untypedExpList; NameList *nameList; Name *name; VarDeclList *varDeclList; GuideFuncList *guideFuncList; GuideFunc *guideFunc; UnivList *univList; Univ *univ; ImportMapList *mapList; VariantList *variantList; ComponentList *componentList; ConstNode *constNode; ConstNodeList *constNodeList; } /* Line 1489 of yacc.c. */ #line 253 "parser.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; } YYLTYPE; # define yyltype YYLTYPE /* obsolescent; will be withdrawn */ # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif extern YYLTYPE yylloc; mona-1.4/Front/scanner.cpp0000644000414100000240000017505510764214572012471 00000000000000/* A lexical scanner generated by flex*/ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* Some routines like yy_flex_realloc() are emitted as static but are not called by all lexers. This generates warnings in some compilers, notably GCC. Arrange to suppress these. */ #ifdef __GNUC__ #define YY_MAY_BE_UNUSED __attribute__((unused)) #else #define YY_MAY_BE_UNUSED #endif /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define YY_USES_REJECT typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; #define YY_FLEX_LEX_COMPAT extern int yylineno; int yylineno = 1; extern char yytext[]; static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ if ( yyleng + yy_more_offset >= YYLMAX ) \ YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \ yyleng += yy_more_offset; \ yy_prev_more_offset = yy_more_offset; \ yy_more_offset = 0; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 95 #define YY_END_OF_BUFFER 96 static yyconst short int yy_acclist[402] = { 0, 2, 2, 96, 94, 95, 92, 94, 95, 92, 95, 94, 95, 93, 94, 95, 91, 94, 95, 6, 94, 95, 7, 94, 95, 8, 94, 95, 9, 94, 95, 10, 94, 95, 11, 94, 95, 12, 94, 95, 13, 94, 95, 15, 94, 95, 17, 94, 95, 90, 91, 94, 95, 18, 94, 95, 19, 94, 95, 20, 94, 95, 23, 94, 95, 25, 94, 95, 27, 94, 95, 28, 94, 95, 29, 94, 95, 30, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 91, 94, 95, 31, 94, 95, 32, 94, 95, 33, 94, 95, 34, 94, 95, 2, 95, 4, 95, 3, 95, 92, 89, 93, 91, 14, 1, 90, 91, 21, 24, 26, 91, 91, 91, 91, 91, 91, 91, 91, 91, 44, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 35, 2, 3, 3, 5, 16, 22, 91, 91, 91, 91, 91, 48, 91, 50, 91, 52, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 69, 91, 68, 91, 91, 91, 91, 91, 91, 46, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 47, 91, 49, 91, 51, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 56, 91, 57, 91, 58, 91, 91, 91, 61, 91, 91, 91, 64, 91, 91, 84, 91, 65, 91, 42, 91, 81, 91, 91, 91, 53, 91, 54, 91, 55, 91, 91, 91, 91, 66, 91, 67, 91, 91, 91, 60, 91, 91, 38, 91, 91, 91, 43, 91, 59, 91, 91, 91, 91, 41, 91, 91, 62, 91, 45, 91, 91, 91, 91, 91, 40, 91, 91, 91, 91, 70, 91, 80, 91, 63, 91, 91, 91, 91, 75, 91, 74, 91, 91, 91, 91, 76, 91, 91, 91, 91, 91, 91, 88, 91, 91, 91, 78, 91, 91, 73, 91, 79, 91, 36, 91, 91, 91, 91, 83, 91, 91, 91, 91, 37, 87, 91, 82, 91, 91, 39, 91, 91, 91, 91, 86, 91, 85, 91, 91, 91, 91, 91, 91, 91, 71, 91, 72, 91, 91, 77, 91 } ; static yyconst short int yy_accept[267] = { 0, 1, 1, 1, 2, 3, 4, 6, 9, 11, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 145, 147, 149, 150, 150, 151, 152, 153, 154, 154, 155, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 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, 203, 205, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 221, 223, 224, 225, 226, 227, 228, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 242, 244, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 262, 264, 266, 266, 267, 268, 270, 271, 272, 274, 275, 277, 279, 281, 283, 284, 285, 287, 289, 291, 292, 293, 294, 296, 298, 299, 300, 302, 303, 305, 306, 307, 309, 311, 312, 313, 314, 316, 317, 317, 317, 319, 321, 322, 323, 324, 325, 327, 328, 329, 330, 332, 334, 336, 337, 338, 339, 341, 343, 344, 345, 346, 346, 346, 348, 349, 350, 351, 352, 353, 355, 356, 357, 359, 360, 362, 364, 365, 365, 366, 367, 368, 369, 371, 372, 373, 374, 375, 377, 379, 380, 382, 383, 384, 385, 387, 389, 390, 391, 392, 393, 394, 395, 397, 399, 400, 402, 402 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 7, 8, 9, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 27, 28, 29, 30, 31, 1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 7, 7, 41, 42, 43, 44, 45, 7, 46, 47, 48, 49, 50, 51, 52, 53, 7, 54, 55, 56, 57, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[58] = { 0, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1 } ; static yyconst short int yy_base[272] = { 0, 0, 0, 55, 57, 307, 308, 60, 68, 301, 0, 0, 308, 308, 308, 308, 308, 308, 308, 279, 288, 291, 55, 308, 308, 277, 275, 275, 308, 308, 308, 308, 36, 255, 262, 26, 265, 247, 23, 48, 59, 251, 248, 45, 38, 39, 250, 54, 49, 308, 308, 308, 267, 0, 308, 81, 98, 286, 308, 0, 0, 308, 274, 308, 85, 263, 308, 308, 247, 240, 243, 248, 239, 89, 242, 242, 236, 63, 233, 231, 237, 61, 234, 228, 239, 227, 229, 230, 81, 74, 226, 230, 223, 222, 231, 97, 308, 0, 107, 109, 308, 308, 308, 109, 230, 218, 232, 215, 0, 0, 0, 228, 217, 213, 224, 214, 210, 215, 219, 206, 112, 238, 206, 0, 0, 211, 83, 202, 201, 212, 0, 213, 210, 209, 208, 89, 117, 203, 196, 194, 193, 0, 0, 0, 195, 192, 189, 187, 182, 185, 187, 196, 195, 184, 181, 179, 181, 181, 0, 0, 0, 93, 181, 181, 0, 183, 176, 0, 173, 0, 189, 0, 0, 176, 182, 0, 0, 0, 185, 179, 179, 0, 0, 167, 165, 181, 170, 0, 162, 161, 0, 0, 160, 175, 171, 0, 161, 156, 157, 0, 0, 150, 161, 147, 153, 0, 152, 154, 143, 0, 0, 0, 147, 146, 157, 0, 0, 144, 155, 143, 143, 152, 0, 153, 141, 141, 137, 135, 0, 136, 128, 0, 142, 0, 0, 308, 139, 126, 133, 120, 120, 0, 119, 114, 121, 308, 0, 0, 103, 0, 114, 113, 101, 0, 0, 101, 101, 109, 112, 123, 104, 0, 0, 86, 0, 308, 157, 162, 167, 108, 172, 176 } ; static yyconst short int yy_def[272] = { 0, 265, 1, 266, 266, 265, 265, 265, 265, 267, 268, 269, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 269, 265, 265, 265, 265, 265, 265, 265, 265, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 265, 265, 265, 265, 270, 265, 271, 265, 267, 265, 268, 269, 265, 265, 265, 269, 265, 265, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 265, 270, 271, 271, 265, 265, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 265, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 265, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 265, 265, 269, 269, 269, 269, 269, 269, 269, 269, 265, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 0, 265, 265, 265, 265, 265, 265 } ; static yyconst short int yy_nxt[366] = { 0, 6, 7, 8, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 22, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 11, 32, 11, 33, 34, 35, 36, 37, 11, 38, 39, 40, 41, 11, 42, 43, 44, 45, 46, 47, 48, 11, 11, 49, 50, 51, 52, 54, 54, 54, 54, 56, 56, 56, 76, 77, 55, 72, 55, 56, 56, 56, 64, 64, 64, 64, 68, 73, 80, 78, 85, 87, 69, 79, 89, 92, 88, 94, 86, 93, 81, 90, 99, 116, 122, 95, 117, 100, 82, 56, 56, 56, 64, 64, 64, 64, 108, 109, 110, 132, 118, 60, 123, 130, 131, 139, 140, 164, 265, 165, 99, 264, 133, 265, 111, 100, 141, 142, 143, 158, 159, 160, 173, 112, 175, 176, 177, 263, 174, 197, 198, 261, 262, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 144, 250, 249, 178, 53, 53, 53, 53, 53, 57, 248, 57, 57, 57, 59, 247, 59, 59, 59, 97, 246, 245, 97, 98, 244, 243, 98, 98, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 172, 171, 170, 169, 168, 167, 166, 163, 162, 161, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 138, 137, 136, 135, 134, 129, 128, 127, 126, 125, 124, 121, 120, 119, 115, 114, 113, 107, 106, 105, 104, 103, 102, 101, 58, 96, 91, 84, 83, 75, 74, 71, 70, 67, 66, 65, 63, 62, 61, 58, 265, 5, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265 } ; static yyconst short int yy_chk[366] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 7, 7, 7, 38, 38, 3, 35, 4, 8, 8, 8, 22, 22, 22, 22, 32, 35, 40, 39, 43, 44, 32, 39, 45, 47, 44, 48, 43, 47, 40, 45, 55, 77, 81, 48, 77, 55, 40, 56, 56, 56, 64, 64, 64, 64, 73, 73, 73, 89, 77, 269, 81, 88, 88, 95, 95, 126, 98, 126, 99, 263, 89, 98, 73, 99, 103, 103, 103, 120, 120, 120, 135, 73, 136, 136, 136, 260, 135, 161, 161, 259, 259, 258, 257, 256, 255, 252, 251, 250, 248, 244, 243, 103, 242, 240, 136, 266, 266, 266, 266, 266, 267, 239, 267, 267, 267, 268, 238, 268, 268, 268, 270, 237, 236, 270, 271, 232, 230, 271, 271, 229, 227, 226, 225, 224, 223, 221, 220, 219, 218, 217, 214, 213, 212, 208, 207, 206, 204, 203, 202, 201, 198, 197, 196, 194, 193, 192, 189, 188, 186, 185, 184, 183, 180, 179, 178, 174, 173, 170, 168, 166, 165, 163, 162, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 140, 139, 138, 137, 134, 133, 132, 131, 129, 128, 127, 125, 122, 121, 119, 118, 117, 116, 115, 114, 113, 112, 111, 107, 106, 105, 104, 94, 93, 92, 91, 90, 87, 86, 85, 84, 83, 82, 80, 79, 78, 76, 75, 74, 72, 71, 70, 69, 68, 65, 62, 57, 52, 46, 42, 41, 37, 36, 34, 33, 27, 26, 25, 21, 20, 19, 9, 5, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; static char *yy_full_match; static int yy_lp; #define REJECT \ { \ *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ yy_cp = yy_full_match; /* restore poss. backed-over text */ \ ++yy_lp; \ goto find_rule; \ } static int yy_more_offset = 0; static int yy_prev_more_offset = 0; #define yymore() (yy_more_offset = yy_flex_strlen( yytext )) #define YY_NEED_STRLEN #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET \ { \ yy_more_offset = yy_prev_more_offset; \ yyleng -= yy_more_offset; \ } #ifndef YYLMAX #define YYLMAX 8192 #endif char yytext[YYLMAX]; char *yytext_ptr; #line 1 "scanner.lpp" #define INITIAL 0 /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #define YY_NO_UNPUT 1 #define YY_NEVER_INTERACTIVE 1 #line 28 "scanner.lpp" #include #include #include "untyped.h" #include "parser.h" #include "deque.h" #include "lib.h" #include "printline.h" #include "env.h" #include "../BDD/bdd.h" using std::cout; extern SymbolTable symbolTable; extern AutLib lib; extern Options options; extern YYLTYPE yylloc; void copyString(char*); int get_next_char(char*); void loadFile(char *s); void yyerror(const char *s); #define MYBUFFER_SIZE 1024 class FileInfo { public: unsigned lineno; /* linenumber */ unsigned pos; /* position in line number lineno */ int prevnl; /* previous char was '\n' */ char *filename; /* name of the file */ unsigned number; /* number of the file in the include-chain */ unsigned next; /* pointer into inputbuffer - where to read next char */ unsigned bufferused; /* number of chars read into inputbuffer */ char inputbuffer[MYBUFFER_SIZE]; /* buffer containing inputfile blocks */ FILE *handle; /* file handle */ }; Deque loadStack; /* stack of file info */ Deque *> dependencies; /* list of dependencies */ Deque source; /* list of source-file text */ Deque fileNames; /* list of file names */ Deque currentLine; /* contains the current line being parsed */ Deque currentDir; char *file = ""; unsigned pos = 0; int prevnl = 0; int filenumber = 0; char mybuffer[MYBUFFER_SIZE]; /* input buffer used in YY_INPUT */ int next = 0; int bufferused = 0; #define SETPOS(p) \ yylloc.first_line = yylineno; yylloc.first_column = pos-yyleng-p+1 #define YY_INPUT(buf,result,max_size) result = get_next_char(buf) /* Definitions */ /* Rules */ #define CCOMMENT 1 #line 700 "scanner.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; #line 99 "scanner.lpp" #line 854 "scanner.cpp" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_state_ptr = yy_state_buf; *yy_state_ptr++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 266 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 308 ); yy_find_action: yy_current_state = *--yy_state_ptr; yy_lp = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[yy_lp]; { yy_full_match = yy_cp; break; } } --yy_cp; yy_current_state = *--yy_state_ptr; yy_lp = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; if ( yy_act != YY_END_OF_BUFFER ) { int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) ++yylineno; } do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: YY_RULE_SETUP #line 101 "scanner.lpp" BEGIN(CCOMMENT); YY_BREAK case 2: YY_RULE_SETUP #line 103 "scanner.lpp" /* ignore */ YY_BREAK case 3: YY_RULE_SETUP #line 104 "scanner.lpp" /* ignore */ YY_BREAK case 4: YY_RULE_SETUP #line 105 "scanner.lpp" /* ignore */ YY_BREAK case YY_STATE_EOF(CCOMMENT): #line 106 "scanner.lpp" yyerror("end-of-file in comment\n"); YY_BREAK case 5: YY_RULE_SETUP #line 107 "scanner.lpp" BEGIN(INITIAL); YY_BREAK case 6: YY_RULE_SETUP #line 110 "scanner.lpp" SETPOS(0); return tokMODULO; YY_BREAK case 7: YY_RULE_SETUP #line 111 "scanner.lpp" SETPOS(0); return tokAND; YY_BREAK case 8: YY_RULE_SETUP #line 112 "scanner.lpp" SETPOS(0); return tokLPAREN; YY_BREAK case 9: YY_RULE_SETUP #line 113 "scanner.lpp" SETPOS(0); return tokRPAREN; YY_BREAK case 10: YY_RULE_SETUP #line 114 "scanner.lpp" SETPOS(0); return tokSTAR; YY_BREAK case 11: YY_RULE_SETUP #line 115 "scanner.lpp" SETPOS(0); return tokPLUS; YY_BREAK case 12: YY_RULE_SETUP #line 116 "scanner.lpp" SETPOS(0); return tokCOMMA; YY_BREAK case 13: YY_RULE_SETUP #line 117 "scanner.lpp" SETPOS(1); return tokMINUS; YY_BREAK case 14: YY_RULE_SETUP #line 118 "scanner.lpp" SETPOS(0); return tokARROW; YY_BREAK case 15: YY_RULE_SETUP #line 119 "scanner.lpp" SETPOS(1); return tokDOT; YY_BREAK case 16: YY_RULE_SETUP #line 120 "scanner.lpp" SETPOS(0); return tokINTERVAL; YY_BREAK case 17: YY_RULE_SETUP #line 121 "scanner.lpp" SETPOS(1); return tokSLASH; YY_BREAK case 18: YY_RULE_SETUP #line 122 "scanner.lpp" SETPOS(0); return tokCOLON; YY_BREAK case 19: YY_RULE_SETUP #line 123 "scanner.lpp" SETPOS(0); return tokSEMICOLON; YY_BREAK case 20: YY_RULE_SETUP #line 124 "scanner.lpp" SETPOS(1); return tokLESS; YY_BREAK case 21: YY_RULE_SETUP #line 125 "scanner.lpp" SETPOS(1); return tokLESSEQ; YY_BREAK case 22: YY_RULE_SETUP #line 126 "scanner.lpp" SETPOS(0); return tokBIIMPL; YY_BREAK case 23: YY_RULE_SETUP #line 127 "scanner.lpp" SETPOS(1); return tokEQUAL; YY_BREAK case 24: YY_RULE_SETUP #line 128 "scanner.lpp" SETPOS(0); return tokIMPL; YY_BREAK case 25: YY_RULE_SETUP #line 129 "scanner.lpp" SETPOS(1); return tokGREATER; YY_BREAK case 26: YY_RULE_SETUP #line 130 "scanner.lpp" SETPOS(0); return tokGREATEREQ; YY_BREAK case 27: YY_RULE_SETUP #line 131 "scanner.lpp" SETPOS(0); return tokLBRACKET; YY_BREAK case 28: YY_RULE_SETUP #line 132 "scanner.lpp" SETPOS(0); return tokSETMINUS; YY_BREAK case 29: YY_RULE_SETUP #line 133 "scanner.lpp" SETPOS(0); return tokRBRACKET; YY_BREAK case 30: YY_RULE_SETUP #line 134 "scanner.lpp" SETPOS(0); return tokUP; YY_BREAK case 31: YY_RULE_SETUP #line 135 "scanner.lpp" SETPOS(0); return tokLBRACE; YY_BREAK case 32: YY_RULE_SETUP #line 136 "scanner.lpp" SETPOS(0); return tokOR; YY_BREAK case 33: YY_RULE_SETUP #line 137 "scanner.lpp" SETPOS(0); return tokRBRACE; YY_BREAK case 34: YY_RULE_SETUP #line 138 "scanner.lpp" SETPOS(1); return tokNOT; YY_BREAK case 35: YY_RULE_SETUP #line 139 "scanner.lpp" SETPOS(0); return tokNOTEQUAL; YY_BREAK case 36: YY_RULE_SETUP #line 140 "scanner.lpp" SETPOS(0); return tokM2LSTR; YY_BREAK case 37: YY_RULE_SETUP #line 141 "scanner.lpp" SETPOS(0); return tokM2LTREE; YY_BREAK case 38: YY_RULE_SETUP #line 142 "scanner.lpp" SETPOS(1); return tokEMPTY; YY_BREAK case 39: YY_RULE_SETUP #line 143 "scanner.lpp" SETPOS(1); return tokUNIVERSE; YY_BREAK case 40: YY_RULE_SETUP #line 144 "scanner.lpp" SETPOS(1); return tokUNION; YY_BREAK case 41: YY_RULE_SETUP #line 145 "scanner.lpp" SETPOS(1); return tokINTER; YY_BREAK case 42: YY_RULE_SETUP #line 146 "scanner.lpp" SETPOS(1); return tokTRUE; YY_BREAK case 43: YY_RULE_SETUP #line 147 "scanner.lpp" SETPOS(1); return tokFALSE; YY_BREAK case 44: YY_RULE_SETUP #line 148 "scanner.lpp" SETPOS(1); return tokIN; YY_BREAK case 45: YY_RULE_SETUP #line 149 "scanner.lpp" SETPOS(1); return tokNOTIN; YY_BREAK case 46: YY_RULE_SETUP #line 150 "scanner.lpp" SETPOS(1); return tokSUB; YY_BREAK case 47: YY_RULE_SETUP #line 151 "scanner.lpp" SETPOS(1); return tokALL0; YY_BREAK case 48: YY_RULE_SETUP #line 152 "scanner.lpp" SETPOS(1); return tokEX0; YY_BREAK case 49: YY_RULE_SETUP #line 153 "scanner.lpp" SETPOS(1); return tokALL1; YY_BREAK case 50: YY_RULE_SETUP #line 154 "scanner.lpp" SETPOS(1); return tokEX1; YY_BREAK case 51: YY_RULE_SETUP #line 155 "scanner.lpp" SETPOS(1); return tokALL2; YY_BREAK case 52: YY_RULE_SETUP #line 156 "scanner.lpp" SETPOS(1); return tokEX2; YY_BREAK case 53: YY_RULE_SETUP #line 157 "scanner.lpp" SETPOS(1); return tokVAR0; YY_BREAK case 54: YY_RULE_SETUP #line 158 "scanner.lpp" SETPOS(1); return tokVAR1; YY_BREAK case 55: YY_RULE_SETUP #line 159 "scanner.lpp" SETPOS(1); return tokVAR2; YY_BREAK case 56: YY_RULE_SETUP #line 160 "scanner.lpp" SETPOS(1); return tokLET0; YY_BREAK case 57: YY_RULE_SETUP #line 161 "scanner.lpp" SETPOS(1); return tokLET1; YY_BREAK case 58: YY_RULE_SETUP #line 162 "scanner.lpp" SETPOS(1); return tokLET2; YY_BREAK case 59: YY_RULE_SETUP #line 163 "scanner.lpp" SETPOS(1); return tokGUIDE; YY_BREAK case 60: YY_RULE_SETUP #line 164 "scanner.lpp" SETPOS(1); return tokCONST; YY_BREAK case 61: YY_RULE_SETUP #line 165 "scanner.lpp" SETPOS(1); return tokPRED; YY_BREAK case 62: YY_RULE_SETUP #line 166 "scanner.lpp" SETPOS(1); return tokMACRO; YY_BREAK case 63: YY_RULE_SETUP #line 167 "scanner.lpp" SETPOS(1); return tokASSERT; YY_BREAK case 64: YY_RULE_SETUP #line 168 "scanner.lpp" SETPOS(1); return tokUNIVROOT; YY_BREAK case 65: YY_RULE_SETUP #line 169 "scanner.lpp" SETPOS(1); return tokTREE; YY_BREAK case 66: YY_RULE_SETUP #line 170 "scanner.lpp" SETPOS(1); return tokWS1S; YY_BREAK case 67: YY_RULE_SETUP #line 171 "scanner.lpp" SETPOS(1); return tokWS2S; YY_BREAK case 68: YY_RULE_SETUP #line 172 "scanner.lpp" SETPOS(1); return tokMIN; YY_BREAK case 69: YY_RULE_SETUP #line 173 "scanner.lpp" SETPOS(1); return tokMAX; YY_BREAK case 70: YY_RULE_SETUP #line 174 "scanner.lpp" SETPOS(1); return tokWHERE; YY_BREAK case 71: YY_RULE_SETUP #line 175 "scanner.lpp" SETPOS(1); return tokDEFAULT1; YY_BREAK case 72: YY_RULE_SETUP #line 176 "scanner.lpp" SETPOS(1); return tokDEFAULT2; YY_BREAK case 73: YY_RULE_SETUP #line 177 "scanner.lpp" SETPOS(1); return tokINCLUDE; YY_BREAK case 74: YY_RULE_SETUP #line 178 "scanner.lpp" SETPOS(1); return tokIMPORT; YY_BREAK case 75: YY_RULE_SETUP #line 179 "scanner.lpp" SETPOS(1); return tokEXPORT; YY_BREAK case 76: YY_RULE_SETUP #line 180 "scanner.lpp" SETPOS(1); return tokPREFIX; YY_BREAK case 77: YY_RULE_SETUP #line 181 "scanner.lpp" SETPOS(1); return tokINSTATESPACE; YY_BREAK case 78: YY_RULE_SETUP #line 182 "scanner.lpp" SETPOS(1); return tokEXECUTE; YY_BREAK case 79: YY_RULE_SETUP #line 183 "scanner.lpp" SETPOS(1); return tokLASTPOS; YY_BREAK case 80: YY_RULE_SETUP #line 184 "scanner.lpp" SETPOS(1); return tokALLPOS; YY_BREAK case 81: YY_RULE_SETUP #line 185 "scanner.lpp" SETPOS(1); return tokTYPE; YY_BREAK case 82: YY_RULE_SETUP #line 186 "scanner.lpp" SETPOS(1); return tokSOMETYPE; YY_BREAK case 83: YY_RULE_SETUP #line 187 "scanner.lpp" SETPOS(1); return tokVARIANT; YY_BREAK case 84: YY_RULE_SETUP #line 188 "scanner.lpp" SETPOS(1); return tokSUCC; YY_BREAK case 85: YY_RULE_SETUP #line 189 "scanner.lpp" SETPOS(1); return tokCONSTTREE; YY_BREAK case 86: YY_RULE_SETUP #line 190 "scanner.lpp" SETPOS(1); return tokTREEROOT; YY_BREAK case 87: YY_RULE_SETUP #line 191 "scanner.lpp" SETPOS(1); return tokRESTRICT; YY_BREAK case 88: YY_RULE_SETUP #line 192 "scanner.lpp" SETPOS(1); return tokVERIFY; YY_BREAK case 89: YY_RULE_SETUP #line 193 "scanner.lpp" {SETPOS(1); yytext[strlen(yytext)-1] = 0; copyString(yytext); return tokSTRING;} YY_BREAK case 90: YY_RULE_SETUP #line 195 "scanner.lpp" SETPOS(1); copyString(yytext); return tokINT; YY_BREAK case 91: YY_RULE_SETUP #line 196 "scanner.lpp" SETPOS(1); copyString(yytext); return tokNAME; YY_BREAK case 92: YY_RULE_SETUP #line 197 "scanner.lpp" /* ignore */ YY_BREAK case 93: YY_RULE_SETUP #line 198 "scanner.lpp" /* ignore */ YY_BREAK case 94: YY_RULE_SETUP #line 199 "scanner.lpp" yyerror("illegal character"); YY_BREAK case 95: YY_RULE_SETUP #line 201 "scanner.lpp" ECHO; YY_BREAK #line 1427 "scanner.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; yy_state_ptr = yy_state_buf; *yy_state_ptr++ = yy_current_state; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 266 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 266 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 265); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; if ( c == '\n' ) --yylineno; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; if ( c == '\n' ) ++yylineno; return c; } #endif /* YY_NO_INPUT */ #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 201 "scanner.lpp" /* Subroutines */ void copyString(char *s) { char *str = new char[strlen(s)+1]; strcpy(str, s); str = symbolTable.insertString(str); yylval.string = str; } void yyerror(const char *s) { cout << "Error in file '" << file << "' near line " << yylineno << ": " << s << "\n" << "Execution aborted\n"; exit(-1); } int yywrap() { unsigned i; /* pop current directory */ delete[] currentDir.pop_back(); /* dependency info */ if (options.separateCompilation) { Deque *d = dependencies.pop_back(); lib.openDir(file, d); delete d; } /* close file */ fclose(yyin); /* done? */ if (loadStack.size() == 0) return -1; /* return to previous file */ FileInfo f = loadStack.pop_back(); yylineno = f.lineno; pos = f.pos; prevnl = f.prevnl; file = f.filename; filenumber = f.number; next = f.next; bufferused = f.bufferused; strncpy(mybuffer, f.inputbuffer, MYBUFFER_SIZE); yyin = f.handle; /* get currentline contents */ currentLine.reset(); for (i = 0; i < strlen(source.get(filenumber-1)->top()); i++) currentLine.push_back((source.get(filenumber-1)->top())[i]); delete[] source.get(filenumber-1)->pop_back(); return 0; } void loadFile(char *s) { unsigned i,n; char *line; char *ss; /* find current directory */ if (!currentDir.empty() && s[0] != '/') { ss = new char[strlen(currentDir.top())+strlen(s)+1]; strcpy(ss, currentDir.top()); } else { ss = new char[strlen(s)+1]; ss[0] = 0; } strcat(ss, s); unsigned t = strlen(ss); while (t > 0 && ss[t-1] != '/') t--; char *cd = new char[t+1]; strncpy(cd, ss, t); cd[t] = 0; currentDir.push_back(cd); if (filenumber > 0) { /* save status for current file on stack */ FileInfo f; f.lineno = yylineno; f.pos = pos; f.prevnl = prevnl; f.filename = file; f.number = filenumber; f.next = next; f.bufferused = bufferused; strncpy(f.inputbuffer, mybuffer, MYBUFFER_SIZE); f.handle = yyin; loadStack.push_back(f); /* store current line source */ line = new char[sizeof(char)*currentLine.size()+1]; line[currentLine.size()] = '\0'; for (n = 0; n < currentLine.size(); n++) line[n] = currentLine.get(n); source.get(filenumber-1)->push_back(line); } /* store info on new file in list */ file = new char[strlen(ss)+1]; strcpy(file, ss); delete[] ss; file = symbolTable.insertString(file); fileNames.push_back(file); source.push_back(new FileSource); /* open file */ for (i = 0; i+1 < loadStack.size(); i++) if (strcmp(loadStack.get(i).filename, file) == 0) yyerror("cyclic include"); if (!(yyin = fopen(file, "r"))) { cout << "Unable to open file '" << file << "'\n" << "Execution aborted\n"; exit(-1); } currentLine.reset(); filenumber++; pos = 0; prevnl = 0; yylineno = 1; next = bufferused = 0; /* find dependencies */ if (options.separateCompilation) { dependencies.push_back(new Deque); for (Deque *>::iterator d = dependencies.begin(); d != dependencies.end(); d++) (*d)->push_back(file); } } int get_next_char(char *buf) { char *line; unsigned n; int c; if (next == bufferused) { /* get a new chunk from the file */ bufferused = fread(mybuffer, 1, MYBUFFER_SIZE, yyin); next = 0; } if (next == bufferused || mybuffer[next] == '\n') { /* move to next line */ line = new char[currentLine.size()+1]; line[currentLine.size()] = '\0'; for (n = 0; n < currentLine.size(); n++) line[n] = currentLine.get(n); source.get(filenumber-1)->push_back(line); currentLine.reset(); } if (next < bufferused) { /* end-of-file not reached yet */ c = mybuffer[next++]; if (prevnl) { prevnl = 0; pos = 0; } pos++; if (c == '\n') prevnl = 1; else currentLine.push_back(c); buf[0] = c; return 1; } else { pos++; return YY_NULL; } } mona-1.4/Front/ast.cpp0000644000414100000240000013351310756504335011620 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "ast.h" #include "symboltable.h" #include "predlib.h" #include "lib.h" using std::cout; extern PredicateLib predicateLib; extern SymbolTable symbolTable; extern CodeTable *codeTable; extern AutLib lib; extern Ident lastPosVar; extern Ident allPosVar; extern int numTypes; ////////// Restriction /////////////////////////////////////////////////////// static IdentList restrVars; // variables occuring in current restriction static bool indefault = false; // inside defaultwhere VarCode getRestriction(Ident id, SubstCode *subst) // make restriction for id using subst { Ident formal; VarCode vc; // first-order and tree variables need extra restriction switch (symbolTable.lookupType(id)) { case Varname1: case Parname1: vc = codeTable->insert(new Code_FirstOrder(id, dummyPos)); break; case VarnameTree: vc = codeTable->insert(new Code_WellFormedTree(id, dummyPos)); break; default: vc = codeTable->insert(new Code_True(dummyPos)); break; } /*** // add SomeType to non-trees if types in use if (numTypes > 0 && symbolTable.lookupType(id) != VarnameTree) vc = andList(vc, codeTable->insert(new Code_SomeType(id, dummyPos))); ***/ if (!restrVars.exists(id)) { restrVars.insert(id); // add user defined or default restriction ASTForm *restriction = symbolTable.lookupRestriction(id); if (restriction) { // add user-defined restriction vc = andList(vc, restriction->makeCode(subst)); } else if (!symbolTable.lookupImplicit(id) && !indefault) { // try default if not implicit variable and not in default indefault = true; switch (symbolTable.lookupType(id)) { case Varname1: case Parname1: restriction = symbolTable.getDefault1Restriction(&formal); break; case Varname2: case Parname2: restriction = symbolTable.getDefault2Restriction(&formal); break; default: formal = -1; } if (restriction && formal != -1) { // variable has default restriction, substitute formal parameter subst = new SubstCode[2]; subst[0].formal = formal; subst[0].kind = sIdent; subst[0].ident = id; subst[1].formal = -1; vc = andList(vc, restriction->makeCode(subst)); delete[] subst; } indefault = false; } restrVars.remove(id); } return vc; } ////////// State Space Shifting ////////////////////////////////////////////// IdentList * shiftStatespaces(IdentList *univs, int dir) { IdentList *res = NULL; if (univs) { res = new IdentList; for (Ident *id = univs->begin(); id != univs->end(); id++) if (symbolTable.lookupType(*id)==Statespacename) { unsigned i, n; switch (dir) { case 0: res->push_back(symbolTable.lookupStatespaceId (guide.muLeft[symbolTable.lookupNumber(*id)])); break; case 1: res->push_back(symbolTable.lookupStatespaceId (guide.muRight[symbolTable.lookupNumber(*id)])); break; case -1: n = symbolTable.lookupNumber(*id); for (i = 0; i < guide.numSs; i++) if (guide.muLeft[i]==n || guide.muRight[i]==n) res->push_back(symbolTable.lookupStatespaceId(i)); break; } } else res->push_back(*id); } return res; } /*#warning NEW: STATESPACE SHIFTING*/ ////////// Substitution ////////////////////////////////////////////////////// SubstCode* lookupSubst(SubstCode *subst, Ident var) { if (subst) { unsigned i = 0; // search for var in subst list while (subst[i].formal != -1) { // array is terminated with .formal=-1 if (subst[i].formal == var) return &subst[i]; i++; } } return 0; } ASTTermCode* substitute12UCode(SubstCode *subst, Ident var) // substitute var1/var2/tree/univ-Ident with ASTTermCode according to subst { SubstCode *s = lookupSubst(subst, var); if (s) { if (s->kind == sTermCode) { ASTTermCode *t = s->termCode; ASTTermCode *res = new ASTTermCode(t); res->code.code->refs++; res->code.vars = res->code.vars ? (IdentList *) res->code.vars->copy() : 0; return res; } else { invariant(s->kind == sIdent); // must be sIdent var = s->ident; // substitute } } if (symbolTable.lookupType(var) == Univname || symbolTable.lookupType(var) == Statespacename) // convert universe name to variable with that universe return new ASTTermCode (symbolTable.insertFresh(Varname2, new IdentList(var)), true, codeTable->insert(new Code_True(dummyPos))); else { VarCode r = getRestriction(var, subst); // restrict if not trivial restriction if (r.code->kind != cTrue) r = codeTable->insert(new Code_Restrict(r, r.code->pos)); return new ASTTermCode(var, false, r); } } VarCode substitute0Code(SubstCode *subst, Ident var) // substitute var0-Ident with VarCode according to subst { if (subst) { unsigned i = 0; while (subst[i].formal != -1) { // array is terminated with .formal=-1 if (subst[i].formal == var) { if (subst[i].kind == sVarCode) { VarCode res = *subst[i].varCode; res.code->refs++; res.vars = res.vars ? (IdentList *) res.vars->copy() : 0; return res; } else { invariant(subst[i].kind == sIdent); // must be sIdent var = subst[i].ident; // substitute break; } } i++; } } /*#warning NEW: BUGFIX AT VAR0*/ VarCode r = getRestriction(var, subst); // restrict if not trivial restriction if (r.code->kind != cTrue) r = codeTable->insert(new Code_Restrict(r, r.code->pos)); // need to make new VarCode return andList(codeTable->insert(new Code_BoolVar(var, dummyPos)), r); } IdentList* substituteUnivs(SubstCode *subst, IdentList *ul) // substitute idents in universe list according to subst, // inherit universes from variables // sort resulting list { if (!ul || ul->empty()) return NULL; IdentList *univs = new IdentList; for (Ident *u = ul->begin(); u != ul->end(); u++) { unsigned i = 0; while (subst && subst[i].formal != -1) { // array is terminated with .formal=-1 if (subst[i].formal == *u) { // found it, do substitution IdentList *varunivs = NULL; switch (subst[i].kind) { case sIdent: switch (symbolTable.lookupType(subst[i].ident)) { case Varname1: case Varname2: case Parname1: case Parname2: case VarnameTree: varunivs = symbolTable.lookupUnivs(subst[i].ident); break; case Univname: case Statespacename: univs->push_back(subst[i].ident); break; default: // not possible invariant(false); } break; case sTermCode: varunivs = symbolTable.lookupUnivs(subst[i].termCode->var); break; default: // illegal, caught by type checker invariant(false); } if (varunivs) univs->insert(varunivs); // (inefficient) break; } i++; } if (!subst || subst[i].formal == -1) { // no substitution of this ident in subst switch (symbolTable.lookupType(*u)) { case Univname: case Statespacename: univs->push_back(*u); // no inheritance break; case Varname1: case Varname2: case Parname1: case Parname2: case VarnameTree: // inherit universes from the variable { IdentList *varunivs = symbolTable.lookupUnivs(*u); if (varunivs) univs->insert(varunivs); // (inefficient) break; } default: // not possible invariant(false); } } } univs->sort(); return univs; } int substCodeLen(SubstCode *sc) { int i = 0; while (sc && sc[i].formal!=-1) i++; return i; } ////////// BitList /////////////////////////////////////////////////////////// BitList::BitList(char *str) { for (; *str; str++) if (*str == '0') push_back(Zero); else push_back(One); } ////////// makeCode() //////////////////////////////////////////////////////// ASTTermCode* ASTTerm1_Var1::makeCode(SubstCode *subst) { return substitute12UCode(subst, n); } ASTTermCode* ASTTerm1_Dot::makeCode(SubstCode *subst) { ASTTermCode *res = t->makeCode(subst); BitList::iterator i; for (i = bits->begin(); i != bits->end(); i++) { Ident tmpVar; if ((*i) == Zero) { IdentList *univs = shiftStatespaces(symbolTable.lookupUnivs(res->var), 0); tmpVar = symbolTable.insertFresh(Varname1, univs); res->code = project(andList(codeTable->insert (new Code_EqDot0(tmpVar, res->var, pos)), res->code), res, pos); } else { IdentList *univs = shiftStatespaces(symbolTable.lookupUnivs(res->var), 1); tmpVar = symbolTable.insertFresh(Varname1, univs); res->code = project(andList(codeTable->insert (new Code_EqDot1(tmpVar, res->var, pos)), res->code), res, pos); } res->var = tmpVar; res->fresh = true; } return res; } ASTTermCode* ASTTerm1_Up::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); IdentList *univs = shiftStatespaces(symbolTable.lookupUnivs(ct->var), -1); Ident var = symbolTable.insertFresh(Varname1, univs); ASTTermCode *res = new ASTTermCode (var, true, project(andList(codeTable->insert(new Code_EqUp(var, ct->var, pos)), ct->code), ct, pos)); delete ct; return res; } ASTTermCode* ASTTerm1_Root::makeCode(SubstCode *subst) { if (univ == -1) { IdentList *univs = symbolTable.allUnivs(); univ = univs->get(0); delete univs; } IdentList d1(univ); IdentList *d2 = substituteUnivs(subst, &d1); if (d2->size() != 1) { cout << "Error:"; pos.printsource(); cout << "\n'root' applied onto multiple universes\n" << "Execution aborted\n"; exit(-1); } univ = d2->get(0); if (symbolTable.lookupType(univ)!=Univname && symbolTable.lookupType(univ)!=Statespacename) { cout << "Error:"; pos.printsource(); cout << "\nIllegal argument to 'root'\n" << "Execution aborted\n"; exit(-1); } delete d2; Ident var = symbolTable.insertFresh(Varname1, new IdentList(univ)); return new ASTTermCode (var, true, andList(codeTable->insert(new Code_EqRoot(var, new IdentList(univ), pos)), codeTable->insert(new Code_FirstOrder(var, pos)))); } int ASTTerm1_Int::value() { return n; } ASTTermCode* ASTTerm1_Int::makeCode(SubstCode *) { if (n < 0) { // difficult to detect during type checking cout << "Error:"; pos.printsource(); cout << "\nNegative integer encountered\n" << "Execution aborted\n"; exit(-1); } Ident var = symbolTable.insertFresh(Varname1); return new ASTTermCode (var, true, codeTable->insert(new Code_EqConst(var, n, pos))); } ASTTermCode* ASTTerm1_Plus::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); Ident var = symbolTable.insertFresh(Varname1, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *res = new ASTTermCode (var, true, project(andList (codeTable->insert(new Code_EqPlus1(var, ct->var, n, pos)), ct->code), ct, pos)); delete ct; return res; } ASTTermCode* ASTTerm1_Minus::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); Ident var = symbolTable.insertFresh(Varname1, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *res = new ASTTermCode (var, true, project(andList(unfold(var, ct->var, n, subst, pos), ct->code), ct, pos)); delete ct; return res; } VarCode ASTTerm1_Minus::unfold(int v1, int v2, int n, SubstCode *subst, Pos pos) { if (n == 0) return codeTable->insert(new Code_Eq1(v1, v2, pos)); else { int v = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(v2))); return codeTable->insert (new Code_Project (v, andList(unfold(v, v2, n-1, subst, pos), codeTable->insert(new Code_EqMinus1(v1, v, pos))), pos)); } } ASTTermCode* ASTTerm1_PlusModulo::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); Ident var = symbolTable.insertFresh(Varname1); ASTTermCode *res = new ASTTermCode (var, true, project(project(andList(unfold(var, ct1->var, n, ct2->var, subst, pos), ct1->code, ct2->code), ct1, pos), ct2, pos)); delete ct1; delete ct2; return res; } VarCode ASTTerm1_PlusModulo::unfold(int v1, int v2, int n, int v3, SubstCode *subst, Pos pos) { if (n == 0) return codeTable->insert(new Code_Eq1(v1, v2, pos)); else { int v = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(v2))); return codeTable->insert (new Code_Project (v, andList(unfold(v, v2, n-1, v3, subst, pos), codeTable->insert(new Code_EqPlusModulo(v1, v, v3, pos))), pos)); } } ASTTermCode* ASTTerm1_MinusModulo::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); Ident var = symbolTable.insertFresh(Varname1); ASTTermCode *res = new ASTTermCode (var, true, project(project(andList(unfold(var, ct1->var, n, ct2->var, subst, pos), ct1->code, ct2->code), ct1, pos), ct2, pos)); delete ct1; delete ct2; return res; } VarCode ASTTerm1_MinusModulo::unfold(int v1, int v2, int n, int v3, SubstCode *subst, Pos pos) { if (n == 0) return codeTable->insert(new Code_Eq1(v1, v2, pos)); else { int v = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(v2))); return codeTable->insert (new Code_Project (v, andList(unfold(v, v2, n-1, v3, subst, pos), codeTable->insert(new Code_EqMinusModulo(v1, v, v3, pos))), pos)); } } ASTTermCode* ASTTerm1_Min::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); Ident var = symbolTable.insertFresh(Varname1, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *res = new ASTTermCode (var, true, project(andList (codeTable->insert(new Code_EqMin(var, ct->var, pos)), ct->code), ct, pos)); delete ct; return res; } ASTTermCode* ASTTerm1_Max::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); Ident var = symbolTable.insertFresh(Varname1, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *res = new ASTTermCode (var, true, project(andList (codeTable->insert(new Code_EqMax(var, ct->var, pos)), ct->code), ct, pos)); delete ct; return res; } ASTTermCode* ASTTerm1_TreeRoot::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); ASTTermCode *ct2 = T->makeCode(subst); // treeroot(T) --> [T] p: p in T & // ~ex1 [T] t: t in T & t

var))); Ident t = symbolTable.insertFresh(Varname1, copy(symbolTable.lookupUnivs(ct->var))); VarCode c1 = codeTable->insert(new Code_In(var, ct->var, pos)); VarCode c2a = project(andList(codeTable->insert(new Code_In(t, ct2->var, pos)), ct2->code), ct2, pos); VarCode c2b = codeTable->insert(new Code_Less1(t, var, pos)); VarCode c2c = codeTable->insert(new Code_FirstOrder(var, pos)); c2c = codeTable->insert(new Code_Restrict(c2c, pos)); VarCode c2d = codeTable->insert(new Code_FirstOrder(t, pos)); c2d = codeTable->insert(new Code_Restrict(c2d, pos)); VarCode c2 = codeTable->insert(new Code_And(c2a, c2b, pos)); c2 = codeTable->insert(new Code_And(c2c, c2, pos)); c2 = codeTable->insert(new Code_And(c2d, c2, pos)); c2 = codeTable->insert(new Code_Project(t, c2, pos)); c2 = codeTable->insert(new Code_Negate(c2, pos)); ASTTermCode *res = new ASTTermCode (var, true, project(andList (codeTable->insert(new Code_And(c1, c2, pos)), ct->code), ct, pos)); delete ct; delete ct2; return res; } ASTTermCode* ASTTerm2_Var2::makeCode(SubstCode *subst) { return substitute12UCode(subst, n); } ASTTermCode* ASTTerm2_VarTree::makeCode(SubstCode *subst) { return substitute12UCode(subst, n); } ASTTermCode* ASTTerm2_Dot::makeCode(SubstCode *subst) { ASTTermCode *res = T->makeCode(subst); BitList::iterator i; for (i = bits->begin(); i != bits->end(); i++) { Ident tmpVar; if ((*i) == Zero) { IdentList *univs = shiftStatespaces(symbolTable.lookupUnivs(res->var), 0); tmpVar = symbolTable.insertFresh(Varname1, univs); res->code = project(andList (codeTable->insert(new Code_EqDot0(tmpVar, res->var, pos)), res->code), res, pos); } else { IdentList *univs = shiftStatespaces(symbolTable.lookupUnivs(res->var), 1); tmpVar = symbolTable.insertFresh(Varname1, univs); res->code = project(andList (codeTable->insert(new Code_EqDot1(tmpVar, res->var, pos)), res->code), res, pos); } res->var = tmpVar; res->fresh = true; } return res; } ASTTermCode* ASTTerm2_Up::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); IdentList *univs = shiftStatespaces(symbolTable.lookupUnivs(ct->var), -1); Ident var = symbolTable.insertFresh(Varname2, univs); ASTTermCode *res = new ASTTermCode (var, true, project(andList(codeTable->insert(new Code_EqUp(var, ct->var, pos)), ct->code), ct, pos)); delete ct; return res; } ASTTermCode* ASTTerm2_Empty::makeCode(SubstCode *) { Ident var = symbolTable.insertFresh(Varname2); return new ASTTermCode (var, true, codeTable->insert(new Code_EqEmpty(var, pos))); } ASTTermCode* ASTTerm2_Union::makeCode(SubstCode *subst) { ASTTermCode *ct1 = T1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); IdentList *univs = ident_union(symbolTable.lookupUnivs(ct1->var), symbolTable.lookupUnivs(ct2->var)); Ident var = symbolTable.insertFresh(Varname2, univs); ASTTermCode *res = new ASTTermCode (var, true, project(project(andList(codeTable->insert (new Code_EqUnion(var, ct1->var, ct2->var, pos)), ct1->code, ct2->code), ct1, pos), ct2, pos)); delete ct1; delete ct2; return res; } ASTTermCode* ASTTerm2_Inter::makeCode(SubstCode *subst) { ASTTermCode *ct1 = T1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); IdentList *univs = ident_union(symbolTable.lookupUnivs(ct1->var), symbolTable.lookupUnivs(ct2->var)); /*#warning CHANGED TO UNION (BECAUSE OF STATESPACES AS UNIVS)*/ Ident var = symbolTable.insertFresh(Varname2, univs); ASTTermCode *res = new ASTTermCode (var, true, project(project(andList(codeTable->insert (new Code_EqInter(var, ct1->var, ct2->var, pos)), ct1->code, ct2->code), ct1, pos), ct2, pos)); delete ct1; delete ct2; return res; } ASTTermCode* ASTTerm2_Setminus::makeCode(SubstCode *subst) { ASTTermCode *ct1 = T1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); IdentList *univs = copy(symbolTable.lookupUnivs(ct1->var)); Ident var = symbolTable.insertFresh(Varname2, univs); ASTTermCode *res = new ASTTermCode (var, true, project(project(andList(codeTable->insert (new Code_EqSetMinus(var, ct1->var, ct2->var, pos)), ct1->code, ct2->code), ct1, pos), ct2, pos)); delete ct1; delete ct2; return res; } ASTTermCode* ASTTerm2_Set::makeCode(SubstCode *subst) { Ident var = symbolTable.insertFresh(Varname2); if (elements->empty()) return new ASTTermCode(var, true, codeTable->insert(new Code_EqEmpty(var, pos))); ASTTermCode *res = NULL; ASTList::iterator i; for (i = elements->begin(); i != elements->end(); i++) { ASTTermCode *ct; if ((*i)->kind == aInterval) ct = ((ASTTerm2 *) *i)->makeCode(subst); else { // if not an interval, element must be first-order ct = ((ASTTerm1 *) *i)->makeCode(subst); Ident t = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *ct2 = new ASTTermCode (t, true, project(andList(codeTable->insert(new Code_Singleton(t, pos)), codeTable->insert(new Code_In(ct->var, t, pos)), ct->code), ct, pos)); delete ct; ct = ct2; } ASTTermCode *nextres; if (res == NULL) nextres = ct; else { IdentList *univs = ident_union(symbolTable.lookupUnivs(ct->var), symbolTable.lookupUnivs(res->var)); Ident var = symbolTable.insertFresh(Varname2, univs); nextres = new ASTTermCode (var, true, project(project(andList(codeTable->insert(new Code_EqUnion(var, res->var, ct->var, pos)), res->code, ct->code), res, pos), ct, pos)); delete res; } res = nextres; } return res; } ASTTermCode* ASTTerm2_Plus::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); Ident var = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *res = new ASTTermCode (var, true, project(andList(unfold(var, ct->var, n, subst, pos), ct->code), ct, pos)); delete ct; return res; } VarCode ASTTerm2_Plus::unfold(int v1, int v2, int n, SubstCode *subst, Pos pos) { if (n == 0) return codeTable->insert(new Code_Eq2(v1, v2, pos)); else { int v = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(v2))); return codeTable->insert (new Code_Project (v, andList(unfold(v, v2, n-1, subst, pos), codeTable->insert(new Code_EqPlus2(v1, v, pos))), pos)); } } ASTTermCode* ASTTerm2_Minus::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); Ident var = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(ct->var))); ASTTermCode *res = new ASTTermCode (var, true, project(andList(unfold(var, ct->var, n, subst, pos), ct->code), ct, pos)); delete ct; return res; } VarCode ASTTerm2_Minus::unfold(int v1, int v2, int n, SubstCode *subst, Pos pos) { if (n == 0) return codeTable->insert(new Code_Eq2(v1, v2, pos)); else { int v = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(v2))); return codeTable->insert (new Code_Project (v, andList(unfold(v, v2, n-1, subst, pos), codeTable->insert(new Code_EqMinus2(v1, v, pos))), pos)); } } ASTTermCode* ASTTerm2_Interval::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); VarCode code; IdentList *univs = ident_union(symbolTable.lookupUnivs(ct1->var), symbolTable.lookupUnivs(ct2->var)); Ident var = symbolTable.insertFresh(Varname2, copy(univs)); Ident v = symbolTable.insertFresh(Varname1, univs); code = project(project(andList (codeTable->insert(new Code_LessEq1(ct1->var, v, pos)), codeTable->insert(new Code_LessEq1(v, ct2->var, pos)), ct1->code, ct2->code), ct1, pos), ct2, pos); code = andList(codeTable->insert(new Code_FirstOrder(v, pos)), codeTable->insert (new Code_Negate (codeTable->insert (new Code_Biimpl (codeTable->insert(new Code_In(v, var, pos)), code, pos)), pos))); ASTTermCode *res = new ASTTermCode (var, true, codeTable->insert(new Code_Negate (codeTable->insert (new Code_Project(v, code, pos)), pos))); delete ct1; delete ct2; return res; } ASTTermCode* ASTTerm2_PresbConst::makeCode(SubstCode *subst) { Ident var = symbolTable.insertFresh(Varname2, NULL); return new ASTTermCode (var, true, codeTable->insert(new Code_EqPresbConst(var, value, pos))); } ASTTermCode* ASTTerm2_Formula::makeCode(SubstCode *subst) { return new ASTTermCode(fresh, true, f->makeCode(subst)); } VarCode ASTForm_Var0::makeCode(SubstCode *subst) { return substitute0Code(subst, n); } VarCode ASTForm_True::makeCode(SubstCode *) { return codeTable->insert(new Code_True(pos)); } VarCode ASTForm_False::makeCode(SubstCode *) { return codeTable->insert(new Code_False(pos)); } VarCode ASTForm_In::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_In(ct1->var, ct2->var, pos)), ct2->code); VarCode res = project(project(code, ct1, pos), ct2, pos); delete ct1; delete ct2; return res; } VarCode ASTForm_Notin::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_In(ct1->var, ct2->var, pos)), ct2->code); VarCode res = codeTable->insert(new Code_Negate(project(project(code, ct1, pos), ct2, pos), pos)); delete ct1; delete ct2; return res; } VarCode ASTForm_RootPred::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); IdentList *univs = substituteUnivs(subst, ul); VarCode res = project(andList(codeTable->insert(new Code_EqRoot(ct->var, univs, pos)), ct->code), ct, pos); delete ct; return res; } VarCode ASTForm_EmptyPred::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); VarCode code = andList(codeTable->insert(new Code_EqEmpty(ct->var, pos)), ct->code); VarCode res = project(code, ct, pos); delete ct; return res; } VarCode ASTForm_FirstOrder::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); // nothing to do, makeCode handles restriction VarCode res = project(ct->code, ct, pos); delete ct; return res; } VarCode ASTForm_Sub::makeCode(SubstCode *subst) { ASTTermCode *ct1 = T1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_Sub2(ct1->var, ct2->var, pos)), ct2->code); VarCode res = project(project(code, ct1, pos), ct2, pos); delete ct1; delete ct2; return res; } VarCode ASTForm_Equal1::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_Eq1(ct1->var, ct2->var, pos)), ct2->code); VarCode res = project(project(code, ct1, pos), ct2, pos); delete ct1; delete ct2; return res; } VarCode ASTForm_Equal2::makeCode(SubstCode *subst) { ASTTermCode *ct1 = T1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_Eq2(ct1->var, ct2->var, pos)), ct2->code); VarCode res = project(project(code, ct1, pos), ct2, pos); delete ct1; delete ct2; return res; } VarCode ASTForm_NotEqual1::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_Eq1(ct1->var, ct2->var, pos)), ct2->code); VarCode res = codeTable->insert(new Code_Negate(project(project(code, ct1, pos), ct2, pos), pos)); delete ct1; delete ct2; return res; } VarCode ASTForm_NotEqual2::makeCode(SubstCode *subst) { ASTTermCode *ct1 = T1->makeCode(subst); ASTTermCode *ct2 = T2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_Eq2(ct1->var, ct2->var, pos)), ct2->code); VarCode res = codeTable->insert(new Code_Negate(project(project(code, ct1, pos), ct2, pos), pos)); delete ct1; delete ct2; return res; } VarCode ASTForm_Less::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_Less1(ct1->var, ct2->var, pos)), ct2->code); VarCode res = project(project(code, ct1, pos), ct2, pos); delete ct1; delete ct2; return res; } VarCode ASTForm_LessEq::makeCode(SubstCode *subst) { ASTTermCode *ct1 = t1->makeCode(subst); ASTTermCode *ct2 = t2->makeCode(subst); VarCode code = andList(ct1->code, codeTable->insert(new Code_LessEq1(ct1->var, ct2->var, pos)), ct2->code); VarCode res = project(project(code, ct1, pos), ct2, pos); delete ct1; delete ct2; return res; } VarCode ASTForm_WellFormedTree::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); VarCode code = andList(ct->code, codeTable->insert(new Code_WellFormedTree(ct->var, pos))); VarCode res = project(code, ct, pos); delete ct; return res; } VarCode ASTForm_Impl::makeCode(SubstCode *subst) { VarCode c1 = f1->makeCode(subst); VarCode c2 = f2->makeCode(subst); return codeTable->insert(new Code_Impl(c1, c2, pos)); } VarCode ASTForm_Biimpl::makeCode(SubstCode *subst) { VarCode c1 = f1->makeCode(subst); VarCode c2 = f2->makeCode(subst); return codeTable->insert(new Code_Biimpl(c1, c2, pos)); } VarCode ASTForm_And::makeCode(SubstCode *subst) { VarCode c1 = f1->makeCode(subst); VarCode c2 = f2->makeCode(subst); return codeTable->insert(new Code_And(c1, c2, pos)); } VarCode ASTForm_IdLeft::makeCode(SubstCode *subst) { VarCode c1 = f1->makeCode(subst); VarCode c2 = f2->makeCode(subst); return codeTable->insert(new Code_IdLeft(c1, c2, pos)); } VarCode ASTForm_Or::makeCode(SubstCode *subst) { VarCode c1 = f1->makeCode(subst); VarCode c2 = f2->makeCode(subst); return codeTable->insert(new Code_Or(c1, c2, pos)); } VarCode ASTForm_Not::makeCode(SubstCode *subst) { VarCode c = f->makeCode(subst); return codeTable->insert(new Code_Negate(c, pos)); } VarCode ASTForm_Ex0::makeCode(SubstCode *subst) { return projectList(f->makeCode(subst), vl, pos); } VarCode ASTForm_Ex1::makeCode(SubstCode *subst) { IdentList *univs = substituteUnivs(subst, ul); int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+vl->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList vl2; IdentList::iterator i; int j; for (i = vl->begin(), j = len; i != vl->end(); i++, j++) { Ident id = symbolTable.insertFresh(Varname1, copy(univs), false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[j].formal = *i; newsubst[j].kind = sIdent; newsubst[j].ident = id; vl2.push_back(id); } newsubst[j].formal = -1; VarCode res = projectList(f->makeCode(newsubst), &vl2, pos); for (i = vl2.begin(); i != vl2.end(); i++) symbolTable.updateRestriction(*i, NULL); delete[] newsubst; delete univs; return res; } VarCode ASTForm_Ex2::makeCode(SubstCode *subst) { IdentList *univs = substituteUnivs(subst, ul); int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+vl->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList vl2; IdentList::iterator i; int j; for (i = vl->begin(), j = len; i != vl->end(); i++, j++) { Ident id = symbolTable.insertFresh(Varname2, copy(univs), false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[j].formal = *i; newsubst[j].kind = sIdent; newsubst[j].ident = id; vl2.push_back(id); } newsubst[j].formal = -1; VarCode res = projectList(f->makeCode(newsubst), &vl2, pos); for (i = vl2.begin(); i != vl2.end(); i++) symbolTable.updateRestriction(*i, NULL); delete[] newsubst; delete univs; return res; } VarCode ASTForm_All0::makeCode(SubstCode *subst) { VarCode c = codeTable->insert(new Code_Negate(f->makeCode(subst), pos)); return codeTable->insert(new Code_Negate(projectList(c, vl, pos), pos)); } VarCode ASTForm_All1::makeCode(SubstCode *subst) { IdentList *univs = substituteUnivs(subst, ul); int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+vl->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList vl2; IdentList::iterator i; int j; for (i = vl->begin(), j = len; i != vl->end(); i++, j++) { Ident id = symbolTable.insertFresh(Varname1, copy(univs), false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[j].formal = *i; newsubst[j].kind = sIdent; newsubst[j].ident = id; vl2.push_back(id); } newsubst[j].formal = -1; VarCode res = codeTable->insert(new Code_Negate(f->makeCode(newsubst), pos)); res = codeTable->insert(new Code_Negate(projectList(res, &vl2, pos), pos)); for (i = vl2.begin(); i != vl2.end(); i++) symbolTable.updateRestriction(*i, NULL); delete[] newsubst; delete univs; return res; } VarCode ASTForm_All2::makeCode(SubstCode *subst) { IdentList *univs = substituteUnivs(subst, ul); int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+vl->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList vl2; IdentList::iterator i; int j; for (i = vl->begin(), j = len; i != vl->end(); i++, j++) { Ident id = symbolTable.insertFresh(Varname2, copy(univs), false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[j].formal = *i; newsubst[j].kind = sIdent; newsubst[j].ident = id; vl2.push_back(id); } newsubst[j].formal = -1; VarCode res = codeTable->insert(new Code_Negate(f->makeCode(newsubst), pos)); res = codeTable->insert(new Code_Negate(projectList(res, &vl2, pos), pos)); for (i = vl2.begin(); i != vl2.end(); i++) symbolTable.updateRestriction(*i, NULL); delete[] newsubst; delete univs; return res; } /*#warning LET0/1/2 REWRITTEN*/ VarCode ASTForm_Let0::makeCode(SubstCode *subst) { int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+defIdents->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList idents; Deque vcs; int k; IdentList::iterator i; FormList::iterator j; for (i = defIdents->begin(), j = defForms->begin(), k = 0; i != defIdents->end(); i++, j++, k++) { VarCode vc = (*j)->makeCode(subst); Ident id = symbolTable.insertFresh(Varname0, NULL, false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[len+k].formal = *i; newsubst[len+k].kind = sIdent; newsubst[len+k].ident = id; idents.push_back(id); vcs.push_back(vc); } newsubst[len+k].formal = -1; VarCode res = f->makeCode(newsubst); Deque::iterator m; for (i = idents.begin(), m = vcs.begin(); i != idents.end(); i++, m++) { res = codeTable->insert(new Code_Biimpl(*m, codeTable->insert(new Code_BoolVar(*i, pos)), pos)); res = codeTable->insert(new Code_Project(*i, res, pos)); symbolTable.updateRestriction(*i, NULL); } delete[] newsubst; return res; } VarCode ASTForm_Let1::makeCode(SubstCode *subst) { int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+defIdents->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList idents; Deque cts; int k; IdentList::iterator i; Term1List::iterator j; for (i = defIdents->begin(), j = defTerms->begin(), k = 0; i != defIdents->end(); i++, j++, k++) { ASTTermCode *ct = (*j)->makeCode(subst); Ident id = symbolTable.insertFresh(Varname1, copy(symbolTable.lookupUnivs(ct->var)), false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[len+k].formal = *i; newsubst[len+k].kind = sIdent; newsubst[len+k].ident = id; idents.push_back(id); cts.push_back(ct); } newsubst[len+k].formal = -1; VarCode res = f->makeCode(newsubst); Deque::iterator m; for (i = idents.begin(), m = cts.begin(); i != idents.end(); i++, m++) { res = project(andList(res, codeTable->insert(new Code_Eq1((*m)->var, *i, pos)), (*m)->code), *m, pos); res = codeTable->insert(new Code_Project(*i, res, pos)); symbolTable.updateRestriction(*i, NULL); } delete[] newsubst; return res; } VarCode ASTForm_Let2::makeCode(SubstCode *subst) { int len = substCodeLen(subst); SubstCode *newsubst = new SubstCode[len+defIdents->size()+1]; memcpy(newsubst, subst, sizeof(SubstCode)*len); IdentList idents; Deque cts; int k; IdentList::iterator i; Term2List::iterator j; for (i = defIdents->begin(), j = defTerms->begin(), k = 0; i != defIdents->end(); i++, j++, k++) { ASTTermCode *ct = (*j)->makeCode(subst); Ident id = symbolTable.insertFresh(Varname2, copy(symbolTable.lookupUnivs(ct->var)), false); symbolTable.updateRestriction(id, symbolTable.lookupRestriction(*i)); newsubst[len+k].formal = *i; newsubst[len+k].kind = sIdent; newsubst[len+k].ident = id; idents.push_back(id); cts.push_back(ct); } newsubst[len+k].formal = -1; VarCode res = f->makeCode(newsubst); Deque::iterator m; for (i = idents.begin(), m = cts.begin(); i != idents.end(); i++, m++) { res = project(andList(res, codeTable->insert(new Code_Eq2((*m)->var, *i, pos)), (*m)->code), *m, pos); res = codeTable->insert(new Code_Project(*i, res, pos)); symbolTable.updateRestriction(*i, NULL); } delete[] newsubst; return res; } /*#warning BUGFIX: REMOVED UPDATEUNIVS*/ VarCode ASTForm_Call::makeCode(SubstCode *subst) { PredLibEntry *p = predicateLib.lookup(n); if (p->isMacro) { // macro expansion // make new substitution list SubstCode *newsubst = new SubstCode[p->formals->size() + 1]; ASTList::iterator actual; IdentList::iterator formal; Deque oldRestrictions; Deque oldIdents; unsigned k; IdentList actuals; for (actual = args->begin(), formal = p->formals->begin(), k = 0; actual != args->end(); actual++, formal++, k++) { newsubst[k].formal = *formal; switch ((*actual)->order) { case oTerm1: case oTerm2: { newsubst[k].kind = sTermCode; newsubst[k].termCode = ((ASTTerm *) (*actual))->makeCode(subst); Ident var = newsubst[k].termCode->var; oldRestrictions.push_back(symbolTable.lookupRestriction(var)); oldIdents.push_back(var); symbolTable.updateRestriction (var, symbolTable.lookupRestriction(*formal)); actuals.push_back(var); break; } case oForm: newsubst[k].kind = sVarCode; newsubst[k].varCode = new VarCode; *newsubst[k].varCode = ((ASTForm *) (*actual))->makeCode(subst); break; // we don't have restrictions on var0's (yet?) case oUniv: newsubst[k].kind = sTermCode; newsubst[k].termCode = substitute12UCode(subst, ((ASTUniv *) (*actual))->u); break; default: invariant(false); } } newsubst[k].formal = -1; // end of array // expand macro body using new substitution list VarCode res = p->ast->makeCode(newsubst); // restore restrictions Deque::iterator f; Deque::iterator id; for (id = oldIdents.begin(), f = oldRestrictions.begin(); id != oldIdents.end(); id++, f++) symbolTable.updateRestriction(*id, *f); // cleanup newsubst for (k = 0; newsubst[k].formal != -1; k++) switch (newsubst[k].kind) { case sTermCode: newsubst[k].termCode->code.remove(); delete newsubst[k].termCode; break; case sVarCode: newsubst[k].varCode->remove(); delete newsubst[k].varCode; break; case sIdent: break; } delete[] newsubst; return res; } else { // predicate call IdentList actuals; return fold(args->begin(), actuals, subst); } } VarCode ASTForm_Call::fold(ASTList::iterator iter, IdentList &actuals, SubstCode *subst) { VarCode res; if (iter == args->end()) { // end of recursion PredLibEntry *p = predicateLib.lookup(n); // make dummy node VarCode dummyvc(NULL, NULL); Code_PredCall *dummy = new Code_PredCall(n, dummyvc, actuals, p->frees, p->source, pos); if (codeTable->exists(*dummy)) { // equivalent node already in DAG res = codeTable->insert(dummy); } else { // need to make code delete dummy; // make new substitution list SubstCode *newsubst = new SubstCode[p->formals->size() + 1]; IdentList::iterator i, j; unsigned k; for (i = actuals.begin(), j = p->formals->begin(), k = 0; i != actuals.end(); i++, j++, k++) { newsubst[k].formal = *j; newsubst[k].kind = sIdent; newsubst[k].ident = *i; } newsubst[k].formal = -1; // end of array // set parameter restrictions Deque oldRestrictions; IdentList::iterator formal, actual; for (formal = p->formals->begin(), actual = actuals.begin(); formal != p->formals->end(); formal++, actual++) { // store the restriction for the actual parameter oldRestrictions.push_back(symbolTable.lookupRestriction(*actual)); // use the restriction for the formal parameter symbolTable.updateRestriction (*actual, symbolTable.lookupRestriction(*formal)); } // make code for body VarCode vc = p->ast->makeCode(newsubst); delete[] newsubst; // insert code res = codeTable->insert(new Code_PredCall(n, vc, actuals, p->frees, p->source, pos)); // restore the restrictions for the actuals Deque::iterator f; for (actual = actuals.begin(), f = oldRestrictions.begin(); actual != actuals.end(); actual++, f++) symbolTable.updateRestriction(*actual, *f); } } else switch ((*iter)->order) { case oTerm1: case oTerm2: { ASTTermCode *ct = ((ASTTerm *) (*iter))->makeCode(subst); actuals.push_back(ct->var); res = project(andList(fold(++iter, actuals, subst), ct->code), ct, pos); delete ct; break; } case oForm: { VarCode vc = ((ASTForm *) (*iter))->makeCode(subst); if (vc.code->kind == cBoolVar) { Ident id = *(vc.vars->begin()); actuals.push_back(id); vc.remove(); res = fold(++iter, actuals, subst); } else { Ident id = symbolTable.insertFresh(Varname0); IdentList idl = IdentList(id); actuals.push_back(id); res = projectList (andList(fold(++iter, actuals, subst), codeTable->insert(new Code_Biimpl (codeTable->insert(new Code_BoolVar (id, pos)), vc, pos))), &idl, pos); } break; } case oUniv: { ASTTermCode *ct = substitute12UCode(subst, ((ASTUniv *) (*iter))->u); actuals.push_back(ct->var); res = project(andList(fold(++iter, actuals, subst), ct->code), ct, pos); delete ct; break; } default: invariant(false); } return res; } VarCode ASTForm_Import::makeCode(SubstCode *subst) { IdentList::iterator i; IdentList *actuals = new IdentList; for (i = idents->begin(); i != idents->end(); i++) { SubstCode *s = lookupSubst(subst, *i); if (s) { switch (s->kind) { case sTermCode: actuals->push_back(s->termCode->var); break; case sVarCode: cout << "Error:"; pos.printsource(); cout << "\nIllegal to substitute Boolean expression through macro " << "at import\n" << "Execution aborted\n"; exit(-1); // (can't do that since macro arguments are code-generated // before macro expansion) case sIdent: actuals->push_back(s->ident); break; } } else actuals->push_back(*i); // no substitution } return codeTable->insert(new Code_Import(file, fileVars, actuals, pos)); } VarCode ASTForm_Export::makeCode(SubstCode *subst) { VarCode c = f->makeCode(subst); return codeTable->insert(new Code_Export(c, file, c.vars, pos)); } VarCode ASTForm_Prefix::makeCode(SubstCode *subst) { VarCode c = f->makeCode(subst); return codeTable->insert(new Code_Prefix(c, pos)); } VarCode ASTForm_Restrict::makeCode(SubstCode *subst) { VarCode c = f->makeCode(subst); return codeTable->insert(new Code_Restrict(c, pos)); } VarCode ASTForm_InStateSpace1::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); VarCode res = project(andList (codeTable->insert(new Code_InStateSpace(ct->var, new IdentList(*ss), pos)), ct->code), ct, pos); delete ct; return res; } VarCode ASTForm_InStateSpace2::makeCode(SubstCode *subst) { ASTTermCode *ct = T->makeCode(subst); VarCode res = project(andList (codeTable->insert(new Code_InStateSpace(ct->var, new IdentList(*ss), pos)), ct->code), ct, pos); delete ct; return res; } VarCode ASTForm_SomeType::makeCode(SubstCode *subst) { ASTTermCode *ct = t->makeCode(subst); VarCode res = project(andList(codeTable->insert(new Code_SomeType(ct->var, pos)), ct->code), ct, pos); delete ct; return res; } ////////// Auxiliary functions /////////////////////////////////////////////// VarCode projectList(VarCode vc, IdentList *projList, Pos p) { IdentList::iterator iter; if (projList->size() == 0) return vc; iter = projList->end(); iter--; do vc = codeTable->insert(new Code_Project(*iter, vc, p)); while (iter-- != projList->begin()); return vc; } VarCode andList(VarCode vc1, VarCode vc2) { if (vc1.code->kind == cTrue) { vc1.remove(); return vc2; } else if (vc2.code->kind == cTrue) { vc2.remove(); return vc1; } return codeTable->insert(new Code_And(vc1, vc2, vc1.code->pos)); } VarCode andList(VarCode vc1, VarCode vc2, VarCode vc3) { return andList(vc1, andList(vc2, vc3)); } VarCode andList(VarCode vc1, VarCode vc2, VarCode vc3, VarCode vc4) { return andList(vc1, andList(vc2, vc3, vc4)); } VarCode project(VarCode vc, ASTTermCode *t, Pos p) { if (t->fresh) return codeTable->insert(new Code_Project(t->var, vc, p)); else return vc; } mona-1.4/Front/astdump.cpp0000644000414100000240000002253310756504335012505 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "ast.h" #include "symboltable.h" using std::cout; extern SymbolTable symbolTable; void ASTComponent::dump() { cout << name; if (path) path->dump(); else cout << "[?]"; cout << ":" << type; } void ASTComponentList::dump() { for (iterator i = begin(); i != end(); i++) { if (i != begin()) cout << ","; (*i)->dump(); } } void ASTVariant::dump() { cout << name; if (path) path->dump(); else cout << "[?]"; cout << "("; if (components) components->dump(); cout << ")"; } void ASTVariantList::dump() { for (iterator i = begin(); i != end(); i++) { if (i != begin()) cout << ","; (*i)->dump(); } } void BitList::dump() { cout << "["; for (iterator i = begin(); i != end(); i++) if (*i == Zero) cout << "0"; else cout << "1"; cout << "]"; } void ASTList::dump() { iterator i; for (i = begin(); i != end(); i++) { cout << ","; (*i)->dump(); } } void ASTUniv::dump() { cout << symbolTable.lookupSymbol(u); } void ASTTerm1_Var1::dump() { cout << "Var1 " << symbolTable.lookupSymbol(n); } void ASTTerm1_Dot::dump() { cout << "Dot("; t->dump(); cout << ","; BitList::iterator i; for (i = bits->begin(); i != bits->end(); i++) if (*i == Zero) cout << "0"; else cout << "1"; cout << ")"; } void ASTTerm1_Up::dump() { cout << "Up("; t->dump(); cout << ")"; } void ASTTerm1_Root::dump() { if (univ == -1) cout << "Root"; else cout << "Root(" << symbolTable.lookupSymbol(univ) << ")"; } void ASTTerm1_Int::dump() { cout << "Int " << n; } void ASTTerm1_Plus::dump() { cout << "Plus1("; t->dump(); cout << "," << n << ")"; } void ASTTerm1_Minus::dump() { cout << "Minus1("; t->dump(); cout << "," << n << ")"; } void ASTTerm1_PlusModulo::dump() { cout << "PlusModulo1("; t1->dump(); cout << "," << n << ","; t2->dump(); cout << ")"; } void ASTTerm1_MinusModulo::dump() { cout << "MinusModulo1("; t1->dump(); cout << "," << n << ","; t2->dump(); cout << ")"; } void ASTTerm1_Min::dump() { cout << "Min("; T->dump(); cout << ")"; } void ASTTerm1_Max::dump() { cout << "Max("; T->dump(); cout << ")"; } void ASTTerm1_TreeRoot::dump() { cout << "TreeRoot("; T->dump(); cout << ")"; } void ASTTerm2_Var2::dump() { cout << "Var2 " << symbolTable.lookupSymbol(n); } void ASTTerm2_VarTree::dump() { cout << "Tree " << symbolTable.lookupSymbol(n); } void ASTTerm2_Dot::dump() { cout << "Dot("; T->dump(); cout << ","; BitList::iterator i; for (i = bits->begin(); i != bits->end(); i++) if (*i == Zero) cout << "0"; else cout << "1"; cout << ")"; } void ASTTerm2_Up::dump() { cout << "Up("; T->dump(); cout << ")"; } void ASTTerm2_Empty::dump() { cout << "Empty"; } void ASTTerm2_Union::dump() { cout << "Union("; T1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTTerm2_Inter::dump() { cout << "Inter("; T1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTTerm2_Setminus::dump() { cout << "Setminus("; T1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTTerm2_Set::dump() { ASTList::iterator i; cout << "Set("; for (i = elements->begin(); i != elements->end();) { (*i)->dump(); if (++i != elements->end()) cout << ","; } cout << ")"; } void ASTTerm2_Plus::dump() { cout << "Plus2("; T->dump(); cout << "," << n << ")"; } void ASTTerm2_Minus::dump() { cout << "Minus2("; T->dump(); cout << "," << n << ")"; } void ASTTerm2_Interval::dump() { cout << "Interval("; t1->dump(); cout << ","; t2->dump(); cout << ")"; } void ASTTerm2_PresbConst::dump() { cout << "PresbConst(" << value << ")"; } void ASTTerm2_Formula::dump() { cout << "Term2Formula(" << symbolTable.lookupSymbol(fresh) << ","; f->dump(); cout << ")"; } void ASTForm_Var0::dump() { cout << "Var0 " << symbolTable.lookupSymbol(n); } void ASTForm_True::dump() { cout << "True"; } void ASTForm_False::dump() { cout << "False"; } void ASTForm_In::dump() { cout << "In("; t1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTForm_Notin::dump() { cout << "Notin("; t1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTForm_RootPred::dump() { cout << "Root("; t->dump(); cout << ",["; ul->dump(); cout << ")"; } void ASTForm_EmptyPred::dump() { cout << "EmptyPred("; T->dump(); cout << ")"; } void ASTForm_FirstOrder::dump() { cout << "FirstOrder("; t->dump(); cout << ")"; } void ASTForm_Sub::dump() { cout << "Sub("; T1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTForm_Equal1::dump() { cout << "Equal1("; t1->dump(); cout << ","; t2->dump(); cout << ")"; } void ASTForm_Equal2::dump() { cout << "Equal2("; T1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTForm_NotEqual1::dump() { cout << "NotEqual1("; t1->dump(); cout << ","; t2->dump(); cout << ")"; } void ASTForm_NotEqual2::dump() { cout << "NotEqual2("; T1->dump(); cout << ","; T2->dump(); cout << ")"; } void ASTForm_Less::dump() { cout << "Less("; t1->dump(); cout << ","; t2->dump(); cout << ")"; } void ASTForm_LessEq::dump() { cout << "LessEq("; t1->dump(); cout << ","; t2->dump(); cout << ")"; } void ASTForm_WellFormedTree::dump() { cout << "WellFormedTree("; T->dump(); cout << ")"; } void ASTForm_Impl::dump() { cout << "Impl("; f1->dump(); cout << ","; f2->dump(); cout << ")"; } void ASTForm_Biimpl::dump() { cout << "Biimpl("; f1->dump(); cout << ","; f2->dump(); cout << ")"; } void ASTForm_And::dump() { cout << "And("; f1->dump(); cout << ","; f2->dump(); cout << ")"; } void ASTForm_IdLeft::dump() { cout << "IdLeft("; f1->dump(); cout << ","; f2->dump(); cout << ")"; } void ASTForm_Or::dump() { cout << "Or("; f1->dump(); cout << ","; f2->dump(); cout << ")"; } void ASTForm_Not::dump() { cout << "Not("; f->dump(); cout << ")"; } void ASTForm_Ex0::dump() { cout << "Ex0("; vl->dump(); cout << ","; f->dump(); cout << ")"; } void ASTForm_Ex1::dump() { cout << "Ex1("; vl->dump(); cout << ","; f->dump(); cout << ")"; } void ASTForm_Ex2::dump() { cout << "Ex2("; vl->dump(); cout << ","; f->dump(); cout << ")"; } void ASTForm_All0::dump() { cout << "All0("; vl->dump(); cout << ","; f->dump(); cout << ")"; } void ASTForm_All1::dump() { cout << "All1("; vl->dump(); cout << ","; f->dump(); cout << ")"; } void ASTForm_All2::dump() { cout << "All2("; vl->dump(); cout << ","; f->dump(); cout << ")"; } void ASTForm_Let0::dump() { IdentList::iterator ident; FormList::iterator form; cout << "Let0("; for (ident = defIdents->begin(), form = defForms->begin(); ident != defIdents->end(); ident++, form++) { cout << "(Var0 " << symbolTable.lookupSymbol(*ident) << ","; (*form)->dump(); cout << "),"; } f->dump(); cout << ")"; } void ASTForm_Let1::dump() { IdentList::iterator ident; Term1List::iterator term; cout << "Let1("; for (ident = defIdents->begin(), term = defTerms->begin(); ident != defIdents->end(); ident++, term++) { cout << "(Var1 " << symbolTable.lookupSymbol(*ident) << ","; (*term)->dump(); cout << "),"; } f->dump(); cout << ")"; } void ASTForm_Let2::dump() { IdentList::iterator ident; Term2List::iterator term; cout << "Let2("; for (ident = defIdents->begin(), term = defTerms->begin(); ident != defIdents->end(); ident++, term++) { cout << "(Var2 " << symbolTable.lookupSymbol(*ident) << ","; (*term)->dump(); cout << "),"; } f->dump(); cout << ")"; } void ASTForm_Call::dump() { cout << "Call(" << symbolTable.lookupSymbol(n); args->dump(); cout << ")"; } void ASTForm_Import::dump() { cout << "Import(\"" << file << "\""; Deque::iterator i; IdentList::iterator j; for (i = fileVars->begin(), j = idents->begin(); i != fileVars->end(); i++, j++) cout << ",(" << *i << "," << symbolTable.lookupSymbol(*j) << ")"; cout << ")"; } void ASTForm_Export::dump() { cout << "Export(\"" << file << "\","; f->dump(); cout << ")"; } void ASTForm_Prefix::dump() { cout << "Prefix("; f->dump(); cout << ")"; } void ASTForm_Restrict::dump() { cout << "Restrict("; f->dump(); cout << ")"; } void ASTForm_InStateSpace1::dump() { cout << "InStateSpace1("; t->dump(); cout << ","; ss->dump(); cout << ")"; } void ASTForm_InStateSpace2::dump() { cout << "InStateSpace2("; T->dump(); cout << ","; ss->dump(); cout << ")"; } void ASTForm_SomeType::dump() { cout << "SomeType("; t->dump(); cout << ")"; } mona-1.4/Front/ast.h0000644000414100000240000006351310756504267011273 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __AST_H #define __AST_H #include "ident.h" #include "codetable.h" #include "printline.h" ////////// Bit list /////////////////////////////////////////////////////////// enum Bit { Zero, One }; class BitList: public Deque { public: BitList(char *str); void dump(); }; ////////// ASTTermCode //////////////////////////////////////////////////////// class ASTTermCode { public: ASTTermCode() {} ASTTermCode(Ident v, bool f, VarCode c) : var(v), fresh(f), code(c) {} ASTTermCode(const ASTTermCode *t) : var(t->var), fresh(t->fresh), code(t->code) {} Ident var; // the variable code is bound to bool fresh; // true if var is fresh in code, i.e. needs to be projected away VarCode code; }; ////////// Substitution /////////////////////////////////////////////////////// enum SubstCodeKind {sTermCode, sVarCode, sIdent}; class SubstCode { // a substitution array is terminated with .formal=-1 public: Ident formal; SubstCodeKind kind; union { ASTTermCode *termCode; VarCode *varCode; Ident ident; }; }; ////////// Abstract syntax tree /////////////////////////////////////////////// enum ASTKind { aVar1, aDot1, aUp1, aInt, aPlus1, aMinus1, aPlusModulo1, aMinusModulo1, aPlus2, aMinus2, aMin, aMax, aInterval, aVar2, aEmpty, aUnion, aInter, aSetminus, aSet, aVar0, aTrue, aFalse, aIn, aNotin, aRoot, aEmptyPred, aSub, aEqual1, aEqual2, aNotEqual1, aFirstOrder, aIdLeft, aPresbConst, aNotEqual2, aLess, aLessEq, aImpl, aBiimpl, aAnd, aOr, aNot, aEx0, aEx1, aEx2, aAll0, aAll1, aAll2, aLet0, aLet1, aLet2, aCall, aUniv, aImport, aExport, aPrefix, aDot2, aUp2, aRootPred, aInStateSpace1, aInStateSpace2, aTreeRoot, aWellFormedTree, aTree, aTerm2Formula, aSomeType, aRestrict }; enum ASTOrder {oTerm1, oTerm2, oForm, oUniv}; class AST { public: AST(ASTOrder o, ASTKind k, Pos p) : order(o), kind(k), pos(p) {} virtual ~AST() {}; virtual void freeVars(IdentList*, IdentList*) {}; virtual void dump() {}; ASTOrder order; ASTKind kind; Pos pos; }; class ASTList: public DequeGC { public: void dump(); }; class ASTTerm: public AST { public: ASTTerm(ASTOrder o, ASTKind kind, Pos p) : AST(o, kind, p) {} virtual ASTTermCode *makeCode(SubstCode *subst = NULL) = 0; void dump() = 0; }; class ASTTerm1: public ASTTerm { public: ASTTerm1(ASTKind kind, Pos p) : ASTTerm(oTerm1, kind, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL) = 0; void dump() = 0; }; class Term1List: public DequeGC {}; class ASTTerm2: public ASTTerm { public: ASTTerm2(ASTKind kind, Pos p) : ASTTerm(oTerm2, kind, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL) = 0; void dump() = 0; }; class Term2List: public DequeGC {}; class ASTForm: public AST { public: ASTForm(ASTKind kind, Pos p) : AST(oForm, kind, p) {} virtual VarCode makeCode(SubstCode *subst = NULL) = 0; void dump() = 0; }; class FormList: public DequeGC {}; class ASTUniv: public AST { public: ASTUniv(Ident univ, Pos p) : AST(oUniv, aUniv, p), u(univ) {} void dump(); Ident u; }; class ASTComponent { public: ASTComponent(char *n, char *t, Pos p) : name(n), type(t), pos(p), path(0) {} ~ASTComponent() {delete path;} void dump(); char *name; char *type; Pos pos; BitList *path; }; class ASTComponentList: public DequeGC { public: void dump(); }; class ASTVariant { public: ASTVariant(char *n, ASTComponentList *c, Pos p) : name(n), components(c), pos(p), path(0) {} ~ASTVariant() {delete components; delete path;} void dump(); char *name; ASTComponentList *components; Pos pos; BitList *path; }; class ASTVariantList: public DequeGC { public: void dump(); }; ////////// Abstract classes /////////////////////////////////////////////////// class ASTTerm1_n: public ASTTerm1 { public: ASTTerm1_n(ASTKind kind, int c, Pos p) : ASTTerm1(kind, p), n(c) {} protected: int n; }; class ASTTerm1_T: public ASTTerm1 { public: ASTTerm1_T(ASTKind kind, ASTTerm2 *TT, Pos p) : ASTTerm1(kind, p), T(TT) {} ~ASTTerm1_T() {delete T;} void freeVars(IdentList*, IdentList*); protected: ASTTerm2 *T; }; class ASTTerm1_t: public ASTTerm1 { public: ASTTerm1_t(ASTKind kind, ASTTerm1 *tt, Pos p) : ASTTerm1(kind, p), t(tt) {} ~ASTTerm1_t() {delete t;} void freeVars(IdentList*, IdentList*); protected: ASTTerm1 *t; }; class ASTTerm1_tn: public ASTTerm1 { public: ASTTerm1_tn(ASTKind kind, ASTTerm1 *tt, int nn, Pos p) : ASTTerm1(kind, p), t(tt), n(nn) {} ~ASTTerm1_tn() {delete t;} void freeVars(IdentList*, IdentList*); protected: ASTTerm1 *t; int n; }; class ASTTerm1_tnt: public ASTTerm1 { public: ASTTerm1_tnt(ASTKind kind, ASTTerm1 *tt1, int nn, ASTTerm1 *tt2, Pos p) : ASTTerm1(kind, p), t1(tt1), t2(tt2), n(nn) {} ~ASTTerm1_tnt() {delete t1; delete t2;} void freeVars(IdentList*, IdentList*); protected: ASTTerm1 *t1; ASTTerm1 *t2; int n; }; class ASTTerm2_TT: public ASTTerm2 { public: ASTTerm2_TT(ASTKind kind, ASTTerm2 *TT1, ASTTerm2 *TT2, Pos p) : ASTTerm2(kind, p), T1(TT1), T2(TT2) {} ~ASTTerm2_TT() {delete T1; delete T2;} void freeVars(IdentList*, IdentList*); protected: ASTTerm2 *T1; ASTTerm2 *T2; }; class ASTTerm2_Tn: public ASTTerm2 { public: ASTTerm2_Tn(ASTKind kind, ASTTerm2 *TT, int nn, Pos p) : ASTTerm2(kind, p), T(TT), n(nn) {} ~ASTTerm2_Tn() {delete T;} void freeVars(IdentList*, IdentList*); protected: ASTTerm2 *T; int n; }; class ASTForm_tT: public ASTForm { public: ASTForm_tT(ASTKind kind, ASTTerm1 *tt1, ASTTerm2 *TT2, Pos p) : ASTForm(kind, p), t1(tt1), T2(TT2) {} ~ASTForm_tT() {delete t1; delete T2;} void freeVars(IdentList*, IdentList*); protected: ASTTerm1 *t1; ASTTerm2 *T2; }; class ASTForm_T: public ASTForm { public: ASTForm_T(ASTKind kind, ASTTerm2 *TT, Pos p) : ASTForm(kind, p), T(TT) {} ~ASTForm_T() {delete T;} void freeVars(IdentList*, IdentList*); protected: ASTTerm2 *T; }; class ASTForm_TT: public ASTForm { public: ASTForm_TT(ASTKind kind, ASTTerm2 *TT1, ASTTerm2 *TT2, Pos p) : ASTForm(kind, p), T1(TT1), T2(TT2) {} ~ASTForm_TT() {delete T1; delete T2;} void freeVars(IdentList*, IdentList*); protected: ASTTerm2 *T1; ASTTerm2 *T2; }; class ASTForm_tt: public ASTForm { public: ASTForm_tt(ASTKind kind, ASTTerm1 *tt1, ASTTerm1 *tt2, Pos p) : ASTForm(kind, p), t1(tt1), t2(tt2) {} ~ASTForm_tt() {delete t1; delete t2;} void freeVars(IdentList*, IdentList*); protected: ASTTerm1 *t1; ASTTerm1 *t2; }; class ASTForm_nt: public ASTForm { public: ASTForm_nt(ASTKind kind, int nn, ASTTerm1 *tt, Pos p) : ASTForm(kind, p), n(nn), t(tt) {} ~ASTForm_nt() {delete t;} void freeVars(IdentList*, IdentList*); protected: int n; ASTTerm1 *t; }; class ASTForm_nT: public ASTForm { public: ASTForm_nT(ASTKind kind, int nn, ASTTerm2 *TT, Pos p) : ASTForm(kind, p), n(nn), T(TT) {} ~ASTForm_nT() {delete T;} void freeVars(IdentList*, IdentList*); protected: int n; ASTTerm2 *T; }; class ASTForm_f: public ASTForm { public: ASTForm_f(ASTKind kind, ASTForm *ff, Pos p) : ASTForm(kind, p), f(ff) {} ~ASTForm_f() {delete f;} void freeVars(IdentList*, IdentList*); protected: ASTForm *f; }; class ASTForm_ff: public ASTForm { public: ASTForm_ff(ASTKind kind, ASTForm *ff1, ASTForm *ff2, Pos p) : ASTForm(kind, p), f1(ff1), f2(ff2) {} ~ASTForm_ff() {delete f1; delete f2;} void freeVars(IdentList*, IdentList*); protected: ASTForm *f1; ASTForm *f2; }; class ASTForm_vf: public ASTForm { public: ASTForm_vf(ASTKind kind, IdentList *vll, ASTForm *ff, Pos p) : ASTForm(kind, p), vl(vll), f(ff) {} ~ASTForm_vf() {delete f; delete vl;} void freeVars(IdentList*, IdentList*); protected: IdentList *vl; ASTForm *f; }; class ASTForm_uvf: public ASTForm { public: ASTForm_uvf(ASTKind kind, IdentList *ull, IdentList *vll, ASTForm *ff, Pos p) : ASTForm(kind, p), ul(ull), vl(vll), f(ff) {} ~ASTForm_uvf() {delete ul; delete f; delete vl;} void freeVars(IdentList*, IdentList*); protected: IdentList *ul; IdentList *vl; ASTForm *f; }; ////////// Syntactical categories of ASTTerm1 ///////////////////////////////// class ASTTerm1_Var1: public ASTTerm1_n { public: ASTTerm1_Var1(int n, Pos p) : ASTTerm1_n(aVar1, n, p) {} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm1_Dot: public ASTTerm1_t { public: ASTTerm1_Dot(ASTTerm1 *tt, BitList *bts, Pos p) : ASTTerm1_t(aDot1, tt, p), bits(bts) {} ~ASTTerm1_Dot() {delete bits;} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: BitList *bits; }; class ASTTerm1_Up: public ASTTerm1_t { public: ASTTerm1_Up(ASTTerm1 *tt, Pos p) : ASTTerm1_t(aUp1, tt, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm1_Root: public ASTTerm1 { public: ASTTerm1_Root(Ident u, Pos p) : ASTTerm1(aRoot, p), univ(u) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: Ident univ; }; class ASTTerm1_Int: public ASTTerm1_n { public: ASTTerm1_Int(int n, Pos p) : ASTTerm1_n(aInt, n, p) {} void freeVars(IdentList*, IdentList*) {} int value(); ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm1_Plus: public ASTTerm1_tn { public: ASTTerm1_Plus(ASTTerm1 *t, int n, Pos p) : ASTTerm1_tn(aPlus1, t, n, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm1_Minus: public ASTTerm1_tn { public: ASTTerm1_Minus(ASTTerm1 *t, int n, Pos p) : ASTTerm1_tn(aMinus1, t, n, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); VarCode unfold(int v1, int v2, int n, SubstCode *subst, Pos pos); void dump(); }; class ASTTerm1_PlusModulo: public ASTTerm1_tnt { public: ASTTerm1_PlusModulo(ASTTerm1 *t1, int n, ASTTerm1 *t2, Pos p) : ASTTerm1_tnt(aPlusModulo1, t1, n, t2, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); VarCode unfold(int v1, int v2, int n, int v3, SubstCode *subst, Pos pos); void dump(); }; class ASTTerm1_MinusModulo: public ASTTerm1_tnt { public: ASTTerm1_MinusModulo(ASTTerm1 *t1, int n, ASTTerm1 *t2, Pos p) : ASTTerm1_tnt(aMinusModulo1, t1, n, t2, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); VarCode unfold(int v1, int v2, int n, int v3, SubstCode *subst, Pos pos); void dump(); }; class ASTTerm1_Min: public ASTTerm1_T { public: ASTTerm1_Min(ASTTerm2 *T, Pos p) : ASTTerm1_T(aMin, T, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm1_Max: public ASTTerm1_T { public: ASTTerm1_Max(ASTTerm2 *T, Pos p) : ASTTerm1_T(aMax, T, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm1_TreeRoot: public ASTTerm1_T { public: ASTTerm1_TreeRoot(ASTTerm2 *T, Pos p) : ASTTerm1_T(aTreeRoot, T, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; ////////// Syntactical categories of ASTTerm2 ///////////////////////////////// class ASTTerm2_Var2: public ASTTerm2 { public: ASTTerm2_Var2(int nn, Pos p) : ASTTerm2(aVar2, p), n(nn) {} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); Ident getVar() {return n;}; void dump(); protected: int n; }; class ASTTerm2_VarTree: public ASTTerm2 { public: ASTTerm2_VarTree(int nn, Pos p) : ASTTerm2(aTree, p), n(nn) {} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); Ident getVar() {return n;}; void dump(); protected: int n; }; class ASTTerm2_Dot: public ASTTerm2 { public: ASTTerm2_Dot(ASTTerm2 *TT, BitList *bts, Pos p) : ASTTerm2(aDot2, p), bits(bts), T(TT) {} ~ASTTerm2_Dot() {delete bits; delete T;} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: BitList *bits; ASTTerm2 *T; }; class ASTTerm2_Up: public ASTTerm2 { public: ASTTerm2_Up(ASTTerm2 *TT, Pos p) : ASTTerm2(aUp2, p), T(TT) {} ~ASTTerm2_Up() {delete T;} ASTTermCode *makeCode(SubstCode *subst = NULL); void freeVars(IdentList*, IdentList*); void dump(); protected: ASTTerm2 *T; }; class ASTTerm2_Empty: public ASTTerm2 { public: ASTTerm2_Empty(Pos p) : ASTTerm2(aEmpty, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm2_Union: public ASTTerm2_TT { public: ASTTerm2_Union(ASTTerm2 *T1, ASTTerm2 *T2, Pos p) : ASTTerm2_TT(aUnion, T1, T2, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm2_Inter: public ASTTerm2_TT { public: ASTTerm2_Inter(ASTTerm2 *T1, ASTTerm2 *T2, Pos p) : ASTTerm2_TT(aInter, T1, T2, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm2_Setminus: public ASTTerm2_TT { public: ASTTerm2_Setminus(ASTTerm2 *T1, ASTTerm2 *T2, Pos p) : ASTTerm2_TT(aSetminus, T1, T2, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); }; class ASTTerm2_Set: public ASTTerm2 { public: ASTTerm2_Set(ASTList *elms, Pos p) : ASTTerm2(aSet, p), elements(elms) {} ~ASTTerm2_Set() {delete elements;} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: ASTList *elements; }; class ASTTerm2_Plus: public ASTTerm2_Tn { public: ASTTerm2_Plus(ASTTerm2 *T, int n, Pos p) : ASTTerm2_Tn(aPlus2, T, n, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); VarCode unfold(int v1, int v2, int n, SubstCode *subst, Pos pos); void dump(); }; class ASTTerm2_Minus: public ASTTerm2_Tn { public: ASTTerm2_Minus(ASTTerm2 *T, int n, Pos p) : ASTTerm2_Tn(aMinus2, T, n, p) {} ASTTermCode *makeCode(SubstCode *subst = NULL); VarCode unfold(int v1, int v2, int n, SubstCode *subst, Pos pos); void dump(); }; class ASTTerm2_Interval: public ASTTerm2 { public: ASTTerm2_Interval(ASTTerm1 *tt1, ASTTerm1 *tt2, Pos p) : ASTTerm2(aInterval, p), t1(tt1), t2(tt2) {} ~ASTTerm2_Interval() {delete t1; delete t2;} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: ASTTerm1 *t1; ASTTerm1 *t2; }; class ASTTerm2_PresbConst: public ASTTerm2 { public: ASTTerm2_PresbConst(int v, Pos p) : ASTTerm2(aPresbConst, p), value(v) {} ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: int value; }; class ASTTerm2_Formula: public ASTTerm2 { public: ASTTerm2_Formula(Ident id, ASTForm *ff, Pos p) : ASTTerm2(aTerm2Formula, p), fresh(id), f(ff) {} ~ASTTerm2_Formula() {delete f;} void freeVars(IdentList*, IdentList*); ASTTermCode *makeCode(SubstCode *subst = NULL); void dump(); protected: Ident fresh; ASTForm *f; }; ////////// Syntactical categories of ASTForm ////////////////////////////////// class ASTForm_Var0: public ASTForm { public: ASTForm_Var0(int nn, Pos p) : ASTForm(aVar0, p), n(nn) {} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: int n; }; class ASTForm_True: public ASTForm { public: ASTForm_True(Pos p) : ASTForm(aTrue, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_False: public ASTForm { public: ASTForm_False(Pos p) : ASTForm(aFalse, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_In: public ASTForm_tT { public: ASTForm_In(ASTTerm1 *t1, ASTTerm2 *T2, Pos p) : ASTForm_tT(aIn, t1, T2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Notin: public ASTForm_tT { public: ASTForm_Notin(ASTTerm1 *t1, ASTTerm2 *T2, Pos p) : ASTForm_tT(aNotin, t1, T2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_RootPred: public ASTForm { public: ASTForm_RootPred(ASTTerm1 *tt, IdentList *ull, Pos p) : ASTForm(aRootPred, p), ul(ull), t(tt) {} ~ASTForm_RootPred() {delete t; delete ul;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: IdentList *ul; ASTTerm1 *t; }; class ASTForm_EmptyPred: public ASTForm_T { public: ASTForm_EmptyPred(ASTTerm2 *T, Pos p) : ASTForm_T(aEmptyPred, T, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_FirstOrder: public ASTForm { public: ASTForm_FirstOrder(ASTTerm1 *tt, Pos p) : ASTForm(aFirstOrder, p), t(tt) {} ~ASTForm_FirstOrder() {delete t;} VarCode makeCode(SubstCode *subst = NULL); void freeVars(IdentList*, IdentList*); void dump(); protected: ASTTerm1 *t; }; class ASTForm_Sub: public ASTForm_TT { public: ASTForm_Sub(ASTTerm2 *T1, ASTTerm2 *T2, Pos p) : ASTForm_TT(aSub, T1, T2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Equal1: public ASTForm_tt { public: ASTForm_Equal1(ASTTerm1 *t1, ASTTerm1 *t2, Pos p) : ASTForm_tt(aEqual1, t1, t2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Equal2: public ASTForm_TT { public: ASTForm_Equal2(ASTTerm2 *T1, ASTTerm2 *T2, Pos p) : ASTForm_TT(aEqual2, T1, T2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_NotEqual1: public ASTForm_tt { public: ASTForm_NotEqual1(ASTTerm1 *t1, ASTTerm1 *t2, Pos p) : ASTForm_tt(aNotEqual1, t1, t2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_NotEqual2: public ASTForm_TT { public: ASTForm_NotEqual2(ASTTerm2 *T1, ASTTerm2 *T2, Pos p) : ASTForm_TT(aNotEqual2, T1, T2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Less: public ASTForm_tt { public: ASTForm_Less(ASTTerm1 *t1, ASTTerm1 *t2, Pos p) : ASTForm_tt(aLess, t1, t2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_LessEq: public ASTForm_tt { public: ASTForm_LessEq(ASTTerm1 *t1, ASTTerm1 *t2, Pos p) : ASTForm_tt(aLessEq, t1, t2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_WellFormedTree: public ASTForm_T { public: ASTForm_WellFormedTree(ASTTerm2 *t, Pos p) : ASTForm_T(aWellFormedTree, t, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Impl: public ASTForm_ff { public: ASTForm_Impl(ASTForm *f1, ASTForm *f2, Pos p) : ASTForm_ff(aImpl, f1, f2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Biimpl: public ASTForm_ff { public: ASTForm_Biimpl(ASTForm *f1, ASTForm *f2, Pos p) : ASTForm_ff(aBiimpl, f1, f2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_And: public ASTForm_ff { public: ASTForm_And(ASTForm *f1, ASTForm *f2, Pos p) : ASTForm_ff(aAnd, f1, f2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_IdLeft: public ASTForm_ff { public: ASTForm_IdLeft(ASTForm *f1, ASTForm *f2, Pos p) : ASTForm_ff(aIdLeft, f1, f2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Or: public ASTForm_ff { public: ASTForm_Or(ASTForm *f1, ASTForm *f2, Pos p) : ASTForm_ff(aOr, f1, f2, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Not: public ASTForm { public: ASTForm_Not(ASTForm *ff, Pos p) : ASTForm(aNot, p), f(ff) {} ~ASTForm_Not() {delete f;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: ASTForm *f; }; class ASTForm_Ex0: public ASTForm_vf { public: ASTForm_Ex0(IdentList *vl, ASTForm *f, Pos p) : ASTForm_vf(aEx0, vl, f, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Ex1: public ASTForm_uvf { public: ASTForm_Ex1(IdentList *ul, IdentList *vl, ASTForm *f, Pos p) : ASTForm_uvf(aEx1, ul, vl, f, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Ex2: public ASTForm_uvf { public: ASTForm_Ex2(IdentList *ul, IdentList *vl, ASTForm *f, Pos p) : ASTForm_uvf(aEx2, ul, vl, f, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_All0: public ASTForm_vf { public: ASTForm_All0(IdentList *vl, ASTForm *f, Pos p) : ASTForm_vf(aAll0, vl, f, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_All1: public ASTForm_uvf { public: ASTForm_All1(IdentList *ul, IdentList *vl, ASTForm *f, Pos p) : ASTForm_uvf(aAll1, ul, vl, f, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_All2: public ASTForm_uvf { public: ASTForm_All2(IdentList *ul, IdentList *vl, ASTForm *f, Pos p) : ASTForm_uvf(aAll2, ul, vl, f, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Let0: public ASTForm { public: ASTForm_Let0(IdentList *ids, FormList *fs, ASTForm *ff, Pos p) : ASTForm(aLet0, p), defIdents(ids), defForms(fs), f(ff) {} ~ASTForm_Let0() {delete f;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: IdentList *defIdents; FormList *defForms; ASTForm *f; }; class ASTForm_Let1: public ASTForm { public: ASTForm_Let1(IdentList *ids, Term1List *ts, ASTForm *ff, Pos p) : ASTForm(aLet1, p), defIdents(ids), defTerms(ts), f(ff) {} ~ASTForm_Let1() {delete f;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: IdentList *defIdents; Term1List *defTerms; ASTForm *f; }; class ASTForm_Let2: public ASTForm { public: ASTForm_Let2(IdentList *ids, Term2List *ts, ASTForm *ff, Pos p) : ASTForm(aLet2, p), defIdents(ids), defTerms(ts), f(ff) {} ~ASTForm_Let2() {delete f;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: IdentList *defIdents; Term2List *defTerms; ASTForm *f; }; class ASTForm_Call: public ASTForm { public: ASTForm_Call(int nn, ASTList *alist, Pos p) : ASTForm(aCall, p), args(alist), n(nn) {} ~ASTForm_Call() {delete args;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: ASTList *args; int n; VarCode fold(ASTList::iterator iter, IdentList &actuals, SubstCode *subst = NULL); }; class ASTForm_Import: public ASTForm { public: ASTForm_Import(char* fil, Deque *fv, IdentList *ids, Pos p) : ASTForm(aImport, p), file(fil), fileVars(fv), idents(ids) {} ~ASTForm_Import() {delete idents;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: char *file; Deque *fileVars; IdentList *idents; }; class ASTForm_Export: public ASTForm_f { public: ASTForm_Export(ASTForm *ff, char* fil, Pos p) : ASTForm_f(aExport, ff, p), file(fil) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: char *file; }; class ASTForm_Prefix: public ASTForm_f { public: ASTForm_Prefix(ASTForm *ff, Pos p) : ASTForm_f(aPrefix, ff, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_Restrict: public ASTForm_f { public: ASTForm_Restrict(ASTForm *ff, Pos p) : ASTForm_f(aRestrict, ff, p) {} VarCode makeCode(SubstCode *subst = NULL); void dump(); }; class ASTForm_InStateSpace1: public ASTForm { public: ASTForm_InStateSpace1(ASTTerm1 *tt, IdentList *s, Pos p) : ASTForm(aInStateSpace1, p), t(tt), ss(s) {} ~ASTForm_InStateSpace1() {delete t; delete ss;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: ASTTerm1 *t; IdentList *ss; }; class ASTForm_InStateSpace2: public ASTForm { public: ASTForm_InStateSpace2(ASTTerm2 *TT, IdentList *s, Pos p) : ASTForm(aInStateSpace2, p), T(TT), ss(s) {} ~ASTForm_InStateSpace2() {delete T; delete ss;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: ASTTerm2 *T; IdentList *ss; }; class ASTForm_SomeType: public ASTForm { public: ASTForm_SomeType(ASTTerm *tt, Pos p) : ASTForm(aSomeType, p), t(tt) {} ~ASTForm_SomeType() {delete t;} void freeVars(IdentList*, IdentList*); VarCode makeCode(SubstCode *subst = NULL); void dump(); protected: ASTTerm *t; }; ////////// MonaAST //////////////////////////////////////////////////////////// class MonaAST { public: MonaAST(ASTForm *f, ASTForm *a) : formula(f), assertion(a), lastPosVar(-1), allPosVar(-1) {} ~MonaAST() {delete formula; delete assertion;} ASTForm *formula; ASTForm *assertion; DequeGC verifyformlist; Deque verifytitlelist; IdentList globals; // all globally declared variables Ident lastPosVar; // lastpos variable Ident allPosVar; // allpos variable }; ////////// Auxiliary functions //////////////////////////////////////////////// VarCode getRestriction(Ident id, SubstCode *subst); VarCode project(VarCode vc, ASTTermCode *t, Pos p); VarCode projectList(VarCode vc, IdentList *projList, Pos p); VarCode andList(VarCode vc1, VarCode vc2); VarCode andList(VarCode vc1, VarCode vc2, VarCode vc3); VarCode andList(VarCode vc1, VarCode vc2, VarCode vc3, VarCode vc4); #endif mona-1.4/Front/code.cpp0000644000414100000240000007155610756504335011753 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "codetable.h" #include "offsets.h" #include "predlib.h" #include "symboltable.h" #include "env.h" #include "lib.h" using std::cout; extern "C" { #include "../Mem/mem.h" } extern Options options; extern Offsets offsets; extern PredicateLib predicateLib; extern SymbolTable symbolTable; extern CodeTable *codeTable; extern AutLib lib; Ident lastPosVar, allPosVar; /////////// stateSpaces /////////////////////////////////////////////////////// SSSet stateSpaces(IdentList *univs) // find state spaces for univs { SSSet set = (SSSet) mem_alloc(guide.numSs); for (unsigned i = 0; i < guide.numSs; i++) set[i] = 0; // clear all if (univs) for (Ident *id = univs->begin(); id != univs->end(); id++) { switch (symbolTable.lookupType(*id)) { case Univname: { int u = symbolTable.lookupUnivNumber(*id); for (unsigned i = 0; i < guide.numUnivSS[u]; i++) set[guide.univSS[u][i]] = 1; break; } case Statespacename: set[symbolTable.lookupNumber(*id)] = 1; break; case Varname1: case Varname2: case Parname1: case Parname2: case VarnameTree: // inherit universes from the variable { SSSet s = stateSpaces(*id); for (unsigned i = 0; i < guide.numSs; i++) set[i] = set[i] | s[i]; mem_free(s); break; } default: invariant(0); } } return set; } SSSet stateSpaces(Ident id) // find state spaces for id { return stateSpaces(symbolTable.lookupUnivs(id)); } /////////// VarCode /////////////////////////////////////////////////////////// DFA* VarCode::DFATranslate() { if (!code->dfa) { invariant(!code->mark); if (options.intermediate) code->show(); code->makeDFA(); code->mark = true; invariant(code->dfa); codeTable->print_progress(); } DFA *a = code->dfa; if (code->refs > 1) a = st_dfa_copy(a); else code->dfa = NULL; st_dfa_replace_indices(a, vars, &code->vars); return a; } GTA* VarCode::GTATranslate() { if (!code->gta) { invariant(!code->mark); if (options.intermediate) code->show(); code->makeGTA(); code->mark = true; invariant(code->gta); codeTable->print_progress(); } GTA *g = code->gta; if (code->refs > 1) g = st_gta_copy(g); else code->gta = NULL; st_gta_replace_indices(g, vars, &code->vars); return g; } void VarCode::remove() { if (code) { if (vars != &code->vars) delete vars; code->remove(); code = NULL; } } VarCodeList::~VarCodeList() { iterator i; for (i = begin(); i != end(); i++) delete (*i).vars; } void VarCodeList::insert(IdentList *v, Code *c) { VarCodeList::iterator i; for (i = begin(); i != end(); i++) if ((*i).code == c && equal((*i).vars, v)) { delete v; return; } push_back(VarCode(v, c)); } void VarCodeList::insert(VarCodeList *l) { // move all elements from l to this VarCodeList::iterator i; for (i = l->begin(); i != l->end(); i++) insert((*i).vars, (*i).code); l->reset(); } bool VarCodeList::sub(VarCodeList *l1, VarCodeList *l2) { // check this subset of l1 union l2 VarCodeList::iterator i, j = 0; for (i = begin(); i != end(); i++) { if (l1) for (j = l1->begin(); j != l1->end(); j++) if ((*i).code == (*j).code && equal((*i).vars, (*j).vars)) break; if (!l1 || j == l1->end()) { if (l2) for (j = l2->begin(); j != l2->end(); j++) if ((*i).code == (*j).code && equal((*i).vars, (*j).vars)) break; if (!l2 || j == l2->end()) return false; } } return true; } /////////// Code ////////////////////////////////////////////////////////////// bool Code::equiv(Code &c) { return kind == c.kind; } unsigned Code::hash() { return kind; } void Code::remove() // remove one reference to this node { invariant(refs > 0); if (--refs == 0) { if (!mark) // node skipped due to sep. comp. codeTable->makes++; if (dfa) dfaFree(dfa); if (gta) gtaFree(gta); if (conj) delete conj; if (restrconj) delete restrconj; codeTable->remove(this); forwarded.remove(); delete this; } } void Code::error(String str) { cout << "\nError:"; pos.printsource(); cout << "\n" << str << "\n" << "Execution aborted\n"; exit(-1); } ////////// Code_n ///////////////////////////////////////////////////////////// Code_n::Code_n(CodeKind knd, Ident i, Pos p) : Code(knd, p), id(i) { vars.push_back(id); } bool Code_n::equiv(Code &c) { return kind == c.kind && sameUnivs(id, ((Code_n&) c).id); } unsigned Code_n::hash() { return kind; } ////////// Code_ni //////////////////////////////////////////////////////////// Code_ni::Code_ni(CodeKind knd, Ident i, int n, Pos p) : Code_n(knd, i, p) { val = n; } bool Code_ni::equiv(Code &c) { return kind == c.kind && val == ((Code_ni&) c).val && sameUnivs(id, ((Code_ni&) c).id); // signatures trivially identical } unsigned Code_ni::hash() { return kind + val*128; } ////////// Code_nn //////////////////////////////////////////////////////////// Code_nn::Code_nn(CodeKind knd, Ident i, Ident j, Pos p) : Code(knd, p), id1(i), id2(j) { if ((kind==cEq1 || kind==cEq2) & id1 > id2) { // exploit relation symmetry Ident t = id1; id1 = id2; id2 = t; } vars.push_back(id1); vars.push_back(id2); sign.make(vars); vars.compress(); } bool Code_nn::equiv(Code &c) { return kind == c.kind && sign == ((Code_nn&) c).sign && sameUnivs(id1, ((Code_nn&) c).id1) && sameUnivs(id2, ((Code_nn&) c).id2); } unsigned Code_nn::hash() { return kind + sign.hashvalue*3; } ////////// Code_nni /////////////////////////////////////////////////////////// Code_nni::Code_nni(CodeKind knd, Ident i, Ident j, int n, Pos p) : Code_nn(knd, i, j, p) { val = n; } bool Code_nni::equiv(Code &c) { return kind == c.kind && sign == ((Code_nni&) c).sign && val == ((Code_nni&) c).val && sameUnivs(id1, ((Code_nni&) c).id1) && sameUnivs(id2, ((Code_nni&) c).id2); } unsigned Code_nni::hash() { return kind + sign.hashvalue*3 + val*128; } ////////// Code_nnn /////////////////////////////////////////////////////////// Code_nnn::Code_nnn(CodeKind knd, Ident i, Ident j, Ident k, Pos p) : Code(knd, p), id1(i), id2(j), id3(k) { if ((kind==cEqUnion || kind==cEqInter) & id2 > id3) { // exploit symmetry Ident t = id2; id2 = id3; id3 = t; } vars.push_back(id1); vars.push_back(id2); vars.push_back(id3); sign.make(vars); vars.compress(); } bool Code_nnn::equiv(Code &c) { return kind == c.kind && sign == ((Code_nnn&) c).sign && sameUnivs(id1, ((Code_nnn&) c).id1) && sameUnivs(id2, ((Code_nnn&) c).id2) && sameUnivs(id3, ((Code_nnn&) c).id3); } unsigned Code_nnn::hash() { return kind + sign.hashvalue*3; } ////////// Code_c ///////////////////////////////////////////////////////////// Code_c::Code_c(CodeKind knd, VarCode c, Pos p, bool skipinit) : Code(knd, p), vc(c) { if (!skipinit) { vars.append(vc.vars); sign.make(vars); vars.compress(); } if (vc.code) depth = vc.code->depth+1; } bool Code_c::equiv(Code &c) { return kind == c.kind && vc.code == ((Code_c&) c).vc.code && sign == ((Code_c&) c).sign; } unsigned Code_c::hash() { return kind + ((long) vc.code)*128; } ////////// Code_cc //////////////////////////////////////////////////////////// Code_cc::Code_cc(CodeKind knd, VarCode c1, VarCode c2, Pos p): Code(knd, p), vc1(c1), vc2(c2) { if (kind==cAnd || kind==cOr || kind==cBiimpl) // exploit symmetry if (vc1.code < vc2.code) { VarCode t = vc1; vc1 = vc2; vc2 = t; } vars.append(vc1.vars); vars.append(vc2.vars); sign.make(vars); vars.compress(); if (vc1.code->depth>vc2.code->depth) depth = vc1.code->depth+1; else depth = vc2.code->depth+1; } bool Code_cc::equiv(Code &c) { return kind == c.kind && vc1.code == ((Code_cc&) c).vc1.code && vc2.code == ((Code_cc&) c).vc2.code && sign == ((Code_cc&) c).sign; } unsigned Code_cc::hash() { return kind*2 + ((long) vc1.code)*5 + ((long) vc2.code)*7; } void Code_cc::makeDFA() { /* #warning NEW: heuristic choice through DAG - 1-15% lower max-aut. */ if (vc1.code->refs==1 || (vc2.code->refs>1 && vc1.code->depth<=vc2.code->depth)) { a1 = vc1.DFATranslate(); vc1.remove(); a2 = vc2.DFATranslate(); vc2.remove(); } else { a2 = vc2.DFATranslate(); vc2.remove(); a1 = vc1.DFATranslate(); vc1.remove(); } } void Code_cc::makeGTA() { if (vc1.code->refs==1 || (vc2.code->refs>1 && vc1.code->depth<=vc2.code->depth)) { g1 = vc1.GTATranslate(); vc1.remove(); g2 = vc2.GTATranslate(); vc2.remove(); } else { g2 = vc2.GTATranslate(); vc2.remove(); g1 = vc1.GTATranslate(); vc1.remove(); } } /** ////////// Code_clist ///////////////////////////////////////////////////////// Code_clist::Code_clist(CodeKind knd, Deque c, Pos p): Code(knd, p), vcl(c) { Deque::iterator i; int d = 0; / * REQUIRE SIZE>0 * / if (kind==cAnd || kind==cOr || kind==cBiimpl) // exploit symmetry / * SORT! if (vc1.code < vc2.code) { VarCode t = vc1; vc1 = vc2; vc2 = t; }* /; for (i = vcl.begin(); i != vcl.end(); i++) { vars.append(i->vars); if (i->code->depth > d) d = i->code->depth+1; } sign.make(vars); vars.compress(); } bool Code_clist::equiv(Code &c) { Deque::iterator i, j; if (kind != c.kind || !(sign == ((Code_clist&) c).sign) || vcl.size() != ((Code_clist&) c).vcl.size()) return 0; for (i = vcl.begin(), j = ((Code_clist&) c).vcl.begin(); i != vcl.end(); i++, j++) if (!(i->code == j->code)) return 0; return 1; } unsigned Code_clist::hash() { return kind*2 + vcl.size()*7; } void Code_clist::makeDFA() { Deque::iterator i; for (i = vcl.begin(); i != vcl.end(); i++) { al.push_back(i->DFATranslate()); i->remove(); } } void Code_clist::makeGTA() { Deque::iterator i; for (i = vcl.begin(); i != vcl.end(); i++) { gl.push_back(i->GTATranslate()); i->remove(); } } **/ ////////// Atomic formulas //////////////////////////////////////////////////// void Code_True::makeDFA() { dfa = dfaTrue(); } void Code_True::makeGTA() { gta = gtaTrue(); } void Code_False::makeDFA() { dfa = dfaFalse(); } void Code_False::makeGTA() { gta = gtaFalse(); } void Code_EqEmpty::makeDFA() { dfa = dfaEmpty(offsets.off(id)); } void Code_EqEmpty::makeGTA() { gta = gtaEmpty(offsets.off(id), stateSpaces(id)); } bool Code_EqRoot::equiv(Code &c) { return kind == c.kind && sameUnivs(id, ((Code_n&) c).id)&& equal(universes, ((Code_EqRoot&) c).universes); } void Code_EqRoot::makeGTA() { SSSet u = stateSpaces(universes); for (unsigned i = 0; i < guide.numSs; i++) if (!guide.ssUnivRoot[i]) u[i] = 0; // remove non-roots gta = gtaRoot(offsets.off(id), stateSpaces(id), u); } void Code_FirstOrder::makeDFA() { dfa = dfaFirstOrder(offsets.off(id)); } void Code_FirstOrder::makeGTA() { gta = gtaFirstOrder(offsets.off(id), stateSpaces(id)); } void Code_EqConst::makeDFA() { dfa = dfaConst(val, offsets.off(id)); } void Code_Singleton::makeDFA() { dfa = dfaSingleton(offsets.off(id)); } void Code_Singleton::makeGTA() { gta = gtaSingleton(offsets.off(id), stateSpaces(id)); } void Code_BoolVar::makeDFA() { dfa = dfaBoolvar(offsets.off(id)); } void Code_BoolVar::makeGTA() { gta = gtaBoolvar(offsets.off(id)); } bool Code_InStateSpace::equiv(Code &c) { return kind == c.kind && equal(ss, ((Code_InStateSpace&) c).ss) && sameUnivs(id, ((Code_InStateSpace&) c).id); // sign. trivially identical } unsigned Code_InStateSpace::hash() { return kind + ss->hash(); } void Code_InStateSpace::makeGTA() { SSSet set = (SSSet) mem_alloc(guide.numSs); for (unsigned i = 0; i < guide.numSs; i++) set[i] = 0; for (Ident *s = ss->begin(); s != ss->end(); s++) set[symbolTable.lookupNumber(*s)] = 1; gta = gtaInStateSpace(offsets.off(id), set, stateSpaces(id)); } void Code_SomeType::makeGTA() { gta = gtaSomeType(offsets.off(id), stateSpaces(id)); } void Code_In::makeDFA() { dfa = dfaIn(offsets.off(id1), offsets.off(id2)); } void Code_In::makeGTA() { gta = gtaIn(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_Eq1::makeDFA() { dfa = dfaEq1(offsets.off(id1), offsets.off(id2)); } void Code_Eq1::makeGTA() { gta = gtaEq1(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_Eq2::makeDFA() { dfa = dfaEq2(offsets.off(id1), offsets.off(id2)); } void Code_Eq2::makeGTA() { gta = gtaEq2(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_Sub2::makeDFA() { dfa = dfaSubset(offsets.off(id1), offsets.off(id2)); } void Code_Sub2::makeGTA() { gta = gtaSub(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_Less1::makeDFA() { dfa = dfaLess(offsets.off(id1), offsets.off(id2)); } void Code_Less1::makeGTA() { gta = gtaLess(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_LessEq1::makeDFA() { dfa = dfaLesseq(offsets.off(id1), offsets.off(id2)); } void Code_LessEq1::makeGTA() { gta = gtaLesseq(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_EqDot0::makeGTA() { gta = gtaDot0(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_EqDot1::makeGTA() { gta = gtaDot1(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_EqUp::makeGTA() { gta = gtaUp(offsets.off(id1), offsets.off(id2), stateSpaces(id1), stateSpaces(id2)); } void Code_EqPlus2::makeDFA() { dfa = dfaPlus2(offsets.off(id1), offsets.off(id2)); } void Code_EqMinus2::makeDFA() { dfa = dfaMinus2(offsets.off(id1), offsets.off(id2)); } void Code_EqMin::makeDFA() { dfa = dfaMin(offsets.off(id1), offsets.off(id2)); } void Code_EqMax::makeDFA() { dfa = dfaMax(offsets.off(id1), offsets.off(id2)); } void Code_EqPlus1::makeDFA() { dfa = dfaPlus1(offsets.off(id1), offsets.off(id2), val); } void Code_EqMinus1::makeDFA() { dfa = dfaMinus1(offsets.off(id1), offsets.off(id2)); } void Code_EqUnion::makeDFA() { dfa = dfaUnion(offsets.off(id1), offsets.off(id2), offsets.off(id3)); } void Code_EqUnion::makeGTA() { gta = gtaUnion(offsets.off(id1), offsets.off(id2), offsets.off(id3), stateSpaces(id1), stateSpaces(id2), stateSpaces(id3)); } void Code_EqInter::makeDFA() { dfa = dfaInter(offsets.off(id1), offsets.off(id2), offsets.off(id3)); } void Code_EqInter::makeGTA() { gta = gtaInter(offsets.off(id1), offsets.off(id2), offsets.off(id3), stateSpaces(id1), stateSpaces(id2), stateSpaces(id3)); } void Code_EqSetMinus::makeDFA() { dfa = dfaSetminus(offsets.off(id1), offsets.off(id2), offsets.off(id3)); } void Code_EqSetMinus::makeGTA() { gta = gtaSetminus(offsets.off(id1), offsets.off(id2), offsets.off(id3), stateSpaces(id1), stateSpaces(id2), stateSpaces(id3)); } void Code_EqPlusModulo::makeDFA() { dfa = dfaPlusModulo1(offsets.off(id1), offsets.off(id2), offsets.off(id3)); } void Code_EqMinusModulo::makeDFA() { dfa = dfaMinusModulo1(offsets.off(id1), offsets.off(id2), offsets.off(id3)); } void Code_EqPresbConst::makeDFA() { dfa = dfaPresbConst(offsets.off(id), val); } void Code_WellFormedTree::makeGTA() { gta = gtaWellFormedTree(offsets.off(id), stateSpaces(id)); } ////////// Code_Restrict ////////////////////////////////////////////////////// void Code_Restrict::makeDFA() { dfa = st_dfa_minimization(st_dfa_restrict(vc.DFATranslate(), pos)); vc.remove(); } void Code_Restrict::makeGTA() { gta = st_gta_minimization(st_gta_restrict(vc.GTATranslate(), pos)); vc.remove(); } ////////// Code_Project /////////////////////////////////////////////////////// Code_Project::Code_Project(Ident n, VarCode c, Pos p) : Code_c(cProject, c, p, true), var(n) { IdentList::iterator i; varpos = 0; for (i = vc.vars->begin(); i != vc.vars->end(); i++) { if (offsets.off(*i) < offsets.off(var)) varpos++; // find relative offset of var if (*i != var) vars.push_back(*i); } sign.make(vars); vars.compress(); } bool Code_Project::equiv(Code &c) { return kind == c.kind && varpos == ((Code_Project&) c).varpos && // same relative var offset pos. vc.code == ((Code_Project&) c).vc.code && sign == ((Code_Project&) c).sign && sameUnivs(var, ((Code_Project&) c).var); } void Code_Project::makeDFA() { dfa = st_dfa_minimization(st_dfa_project (vc.DFATranslate(), var, pos)); vc.remove(); } void Code_Project::makeGTA() { gta = st_gta_minimization(st_gta_project (vc.GTATranslate(), var, pos)); vc.remove(); } ////////// Code_Negate //////////////////////////////////////////////////////// void Code_Negate::makeDFA() { dfa = st_dfa_negation(vc.DFATranslate(), pos); vc.remove(); } void Code_Negate::makeGTA() { gta = st_gta_negation(vc.GTATranslate(), pos); vc.remove(); } ////////// Code_Prefix //////////////////////////////////////////////////////// void Code_Prefix::makeDFA() { dfa = st_dfa_minimization(st_dfa_prefix(vc.DFATranslate(), pos)); vc.remove(); } ////////// Code_And /////////////////////////////////////////////////////////// void Code_And::makeDFA() { Code_cc::makeDFA(); dfa = st_dfa_minimization(st_dfa_product(a1, a2, dfaAND, pos)); } void Code_And::makeGTA() { Code_cc::makeGTA(); gta = st_gta_minimization(st_gta_product(g1, g2, gtaAND, pos)); } ////////// Code_IdLeft //////////////////////////////////////////////////////// void Code_IdLeft::makeDFA() { Code_cc::makeDFA(); dfaFree(a2); dfa = a1; } void Code_IdLeft::makeGTA() { Code_cc::makeGTA(); gtaFree(g2); gta = g1; } ////////// Code_Or //////////////////////////////////////////////////////////// void Code_Or::makeDFA() { Code_cc::makeDFA(); dfa = st_dfa_minimization(st_dfa_product(a1, a2, dfaOR, pos)); } void Code_Or::makeGTA() { Code_cc::makeGTA(); gta = st_gta_minimization(st_gta_product(g1, g2, gtaOR, pos)); } ////////// Code_Impl ////////////////////////////////////////////////////////// void Code_Impl::makeDFA() { Code_cc::makeDFA(); dfa = st_dfa_minimization(st_dfa_product(a1, a2, dfaIMPL, pos)); } void Code_Impl::makeGTA() { Code_cc::makeGTA(); gta = st_gta_minimization(st_gta_product(g1, g2, gtaIMPL, pos)); } ////////// Code_Biimpl //////////////////////////////////////////////////////// void Code_Biimpl::makeDFA() { Code_cc::makeDFA(); dfa = st_dfa_minimization(st_dfa_product(a1, a2, dfaBIIMPL, pos)); } void Code_Biimpl::makeGTA() { Code_cc::makeGTA(); gta = st_gta_minimization(st_gta_product(g1, g2, gtaBIIMPL, pos)); } ////////// Code_PredCall ////////////////////////////////////////////////////// Code_PredCall::Code_PredCall(Ident n, VarCode c, IdentList &acts, IdentList *frs, char *source, Pos p) : Code_c(cPredCall, c, p, true), name(n), sourcefile(source) { actuals.append(&acts); frees.append(frs); // predcalls are always using signature equivalence // based on the actuals+frees, // all occuring variables must be in the substitution list vars.append(&acts); vars.append(frs); sign.make(vars); vars.compress(); // note: all vars might not occur! // make shadow of vars for (Ident i = 0; (unsigned) i < vars.size(); i++) s.push_back(i); // get names and orders unsigned i; names = new char*[vars.size()]; orders = new char[vars.size()]; for (i = 0; i < vars.size(); i++) { names[i] = symbolTable.lookupSymbol(vars.get(i)); orders[i] = (char) symbolTable.lookupOrder(vars.get(i)); } // get separate compilation file name if (options.separateCompilation) { Deque statespaces; IdentList::iterator i; for (i = vars.begin(); i != vars.end(); i++) statespaces.push_back(stateSpaces(*i)); filename = lib.getFileName(symbolTable.lookupSymbol(name), sourcefile, &sign, &statespaces); Deque::iterator j; for (j = statespaces.begin(); j != statespaces.end(); j++) mem_free(*j); } else filename = NULL; } bool Code_PredCall::equiv(Code &c) { if (!(kind == c.kind && name == ((Code_PredCall&) c).name && sign == ((Code_PredCall&) c).sign && vars.size() == ((Code_PredCall&) c).vars.size())) return false; for (IdentList::iterator i = vars.begin(), j = ((Code_PredCall&) c).vars.begin(); i != vars.end(); i++, j++) if (!sameUnivs(*i, *j)) // check variable state spaces return false; return true; } unsigned Code_PredCall::hash() { return kind + sign.hashvalue*3 + name*128; } void Code_PredCall::makeDFA() { if (options.separateCompilation && lib.fileExists(filename)) { // found on disk if (options.statistics) cout << "-- Importing '" << filename << "' --\n"; dfa = dfaImport(filename, NULL, NULL); if (!dfa) error((String) "Error reading file '" + filename + "'"); st_dfa_replace_indices(dfa, &vars, &s, true, false); } else { // need to make automaton if (options.statistics) cout << "-- Entering predicate '" << symbolTable.lookupSymbol(name) << "' --\n"; dfa = vc.DFATranslate(); st_dfa_replace_indices(dfa, &s, &vars, false, true); if (options.separateCompilation) { if (options.statistics) cout << "-- Exporting '" << filename << "' --\n"; if (!dfaExport(dfa, filename, vars.size(), names, orders)) error("Unable to write file"); } st_dfa_replace_indices(dfa, &vars, &s, true, false); if (options.statistics) cout << "-- Leaving predicate '" << symbolTable.lookupSymbol(name) << "' (states: " << dfa->ns << ") --\n"; } vc.remove(); } void Code_PredCall::makeGTA() { if (options.separateCompilation && lib.fileExists(filename)) { // found on disk if (options.statistics) cout << "-- Importing '" << filename << "' --\n"; gta = gtaImport(filename, NULL, NULL, NULL, false); if (!gta) error((String) "Error reading file '" + filename + "'"); st_gta_replace_indices(gta, &vars, &s, true, false); } else { // need to make automaton if (options.statistics) cout << "-- Entering predicate '" << symbolTable.lookupSymbol(name) << "' --\n"; gta = vc.GTATranslate(); st_gta_replace_indices(gta, &s, &vars, false, true); if (options.separateCompilation) { SSSet *statespaces = new SSSet[vars.size()]; for (unsigned i = 0; i < vars.size(); i++) statespaces[i] = stateSpaces(vars.get(i)); if (options.statistics) cout << "-- Exporting '" << filename << "' --\n"; if (!gtaExport(gta, filename, vars.size(), names, orders, statespaces, false)) error("Unable to write file"); for (unsigned i = 0; i < vars.size(); i++) if (statespaces[i]) { mem_free(statespaces[i]); statespaces[i] = 0; } delete[] statespaces; } st_gta_replace_indices(gta, &vars, &s, true, false); if (options.statistics) { unsigned i, n = 0; for (i = 0; i < guide.numSs; i++) n += gta->ss[i].size; cout << "-- Leaving predicate '" << symbolTable.lookupSymbol(name) << "' (states: " << n << ") --\n"; } } vc.remove(); } ////////// Code_Import //////////////////////////////////////////////////////// Code_Import::Code_Import(char *filename, Deque *forms, IdentList *acts, Pos p) : Code(cImport, p), file(filename), formals(forms), actuals(acts) { vars.insert(actuals); } bool Code_Import::equiv(Code &c) { return &c == this; // always fresh node } unsigned Code_Import::hash() { return kind + (long) file; } void Code_Import::makeDFA() { if (options.statistics) cout << "-- Importing '" << file << "' --\n"; char **fileVars; // null terminated array of names in index order int *fileOrders; // corresponding array of orders dfa = dfaImport(file, &fileVars, &fileOrders); if (!dfa) error((String) "Error reading file '" + file + "'"); IdentList *off = getOffsets(fileVars, fileOrders, NULL); st_dfa_replace_indices(dfa, actuals, off, true, false); for (int i = 0; fileVars[i]; i++) mem_free(fileVars[i]); mem_free(fileVars); mem_free(fileOrders); delete off; } void Code_Import::makeGTA() { if (options.statistics) cout << "-- Importing '" << file << "' --\n"; char **fileVars; // null terminated array of names in index order int *fileOrders; // corresponding array of orders SSSet *fileSS; // corresponding array of state-space sets gta = gtaImport(file, &fileVars, &fileOrders, &fileSS, false); if (!gta) error((String) "Error reading file '" + file + "'"); IdentList *off = getOffsets(fileVars, fileOrders, fileSS); st_gta_replace_indices(gta, actuals, off, true, false); for (int i = 0; fileVars[i]; i++) { mem_free(fileVars[i]); mem_free(fileSS[i]); } mem_free(fileVars); mem_free(fileOrders); mem_free(fileSS); delete off; } IdentList * Code_Import::getOffsets(char **fileVars, int *fileOrders, SSSet *fileSS) { // make offset array IdentList *off = new IdentList; // really an offset list, but who cares int i = 0; while (fileVars[i] != 0) i++; if ((unsigned) i != actuals->size()) error("Wrong number of parameters"); IdentList::iterator j; Deque::iterator k; for (j = actuals->begin(), k = formals->begin(); j != actuals->end(); j++, k++) { for (i = 0; fileVars[i] != 0; i++) if (strcmp(fileVars[i], *k) == 0) { off->push_back(i); if (symbolTable.lookupOrder(*j) != fileOrders[i]) error("Orders of variables do not match"); if (fileSS) { SSSet ss = stateSpaces(*j); if (memcmp(ss, fileSS[i], guide.numSs)) error("Variable state-spaces do not match"); mem_free(ss); } break; } if (fileVars[i] == 0) error((String) "Formal '" + *k + "' not found in file"); } // check signature Signature s(*actuals); for (i = 0; (unsigned) i < s.size; i++) if (s.sign[i] != off->get(i)) error("Variable ordering does not match"); return off; } ////////// Code_Export //////////////////////////////////////////////////////// Code_Export::Code_Export(VarCode c, char *fileName, IdentList *fv, Pos p) : Code_c(cExport, c, p), file(fileName) { // find free vars, names, and orders unsigned i, j; names = new char*[fv->size()]; orders = new char[fv->size()]; for (i = 0, j = 0; i < fv->size(); i++) { Ident id = fv->get(i); if (id != lastPosVar && id != allPosVar) { freevars.push_back(id); // free vars s.push_back(j); // shadow of free vars names[j] = symbolTable.lookupSymbol(id); orders[j] = (char) symbolTable.lookupOrder(id); j++; } } num = j; } bool Code_Export::equiv(Code &c) { return &c == this; // always fresh node } unsigned Code_Export::hash() { return kind + (long) file; } void Code_Export::makeDFA() { dfa = vc.DFATranslate(); if (options.statistics) cout << "-- Exporting '" << file << "' --\n"; DFA *dfa2 = dfaCopy(dfa); if (lastPosVar != -1) dfa2 = st_dfa_lastpos(dfa2, offsets.off(lastPosVar)); if (allPosVar != -1) dfa2 = st_dfa_allpos(dfa2, offsets.off(allPosVar)); if (options.unrestrict) { dfaUnrestrict(dfa2); DFA *t = dfa2; dfa2 = dfaMinimize(dfa2); dfaFree(t); } st_dfa_replace_indices(dfa2, &s, &freevars, false, true); if (!dfaExport(dfa2, file, num, names, orders)) error("Unable to write file"); dfaFree(dfa2); vc.remove(); } void Code_Export::makeGTA() { gta = vc.GTATranslate(); if (options.statistics) cout << "-- Exporting '" << file << "' --\n"; SSSet *statespaces = new SSSet[freevars.size()]; for (unsigned i = 0; i < freevars.size(); i++) statespaces[i] = stateSpaces(freevars.get(i)); GTA *gta2 = gtaCopy(gta); if (allPosVar != -1) gta2 = st_gta_allpos(gta2, offsets.off(allPosVar)); if (options.unrestrict) { gtaUnrestrict(gta2); GTA *t = gta2; gta2 = gtaMinimize(gta2); gtaFree(t); } st_gta_replace_indices(gta2, &s, &freevars, false, true); if (!gtaExport(gta2, file, num, names, orders, statespaces, options.inheritedAcceptance)) error("Unable to write file"); gtaFree(gta2); for (unsigned i = 0; i < freevars.size(); i++) mem_free(statespaces[i]); delete[] statespaces; vc.remove(); } mona-1.4/Front/codedump.cpp0000644000414100000240000002051710756504335012630 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "code.h" #include "offsets.h" #include "symboltable.h" #include "env.h" extern "C" { #include "../Mem/mem.h" } using std::cout; extern Options options; extern SymbolTable symbolTable; ////////// stateSpaces //////////////////////////////////////////////////////// void dumpStateSpaces(SSSet set) { unsigned i, j = 0; cout << "["; for (i = 0; i < guide.numSs; i++) if (set[i]) j++; if (j > 5) cout << "..."; else { for (i = 0; i < guide.numSs; i++) if (set[i]) { cout << i; break; } for (i++; i < guide.numSs; i++) if (set[i]) cout << "," << i; } cout << "]"; mem_free(set); } void dumpStateSpaces(Ident id) { if (options.mode != TREE) return; dumpStateSpaces(stateSpaces(id)); } /////////// VarCode /////////////////////////////////////////////////////////// void VarCode::dump(bool rec) { code->dump(rec); dumpsubst(); } void VarCode::dumpsubst() { IdentList::iterator i,j; bool first = true, any = false; for (i = code->vars.begin(), j = vars->begin(); i != code->vars.end(); i++, j++) if (*i != *j) any = true; if (any) { cout << "["; for (i = code->vars.begin(), j = vars->begin(); i != code->vars.end(); i++, j++) if (*i != *j) { if (!first) cout << ","; cout << "#" << *i << "->#" << *j; first = false; } cout << "]"; } } void VarCodeList::dump() { cout << "["; for (VarCodeList::iterator i = begin(); i != end(); i++) { if (i != begin()) cout << ","; printf("(%lx,", (unsigned long) (*i).code); if ((*i).vars) (*i).vars->dumplist(); printf(")"); } cout << "]"; } /////////// Code ////////////////////////////////////////////////////////////// void Code::viz() { if (!mark) { printf(" L%lx [label=\"", (unsigned long) this); dump(false); // printf(" {%d}", refs); printf("\"];\n"); mark = true; } } void Code_c::viz() { if (!mark) { vc.code->viz(); Code::viz(); printf(" L%lx -> L%lx [label=\"", (unsigned long) this, (unsigned long) vc.code); vc.dumpsubst(); printf("\"];\n"); mark = true; } } void Code_cc::viz() { if (!mark) { vc1.code->viz(); vc2.code->viz(); Code::viz(); printf(" L%lx -> L%lx [label=\"", (unsigned long) this, (unsigned long) vc1.code); vc1.dumpsubst(); printf("\"];\n"); printf(" L%lx -> L%lx [label=\"", (unsigned long) this, (unsigned long) vc2.code); vc2.dumpsubst(); printf("\"];\n"); mark = true; } } void Code::show() { dump(false); cout << "\n"; } /////////// Code leaves /////////////////////////////////////////////////////// void Code_True::dump(bool rec) { cout << "True()"; } void Code_False::dump(bool rec) { cout << "False()"; } void Code_EqEmpty::dump(bool rec) { cout << "Empty(#" << id << ")"; } void Code_EqRoot::dump(bool rec) { cout << "Root(#" << id << ","; universes->dump(); cout << ")"; } void Code_FirstOrder::dump(bool rec) { cout << "FirstOrder(#" << id << ")"; } void Code_EqConst::dump(bool rec) { cout << "Const(#" << id << "," << val << ")"; } void Code_Singleton::dump(bool rec) { cout << "Singleton(#" << id << ")"; } void Code_BoolVar::dump(bool rec) { cout << "BoolVar(#" << id << ")"; } void Code_InStateSpace::dump(bool rec) { cout << "InStateSpace(#" << id << ",["; if (ss && ss->size() > 5) cout << "..."; else { IdentList::iterator i; for (i = ss->begin(); i != ss->end(); i++) { if (i != ss->begin()) cout << ","; cout << symbolTable.lookupNumber(*i); } } cout << "])"; } void Code_SomeType::dump(bool rec) { cout << "SomeType(#" << id << ")"; } void Code_In::dump(bool rec) { cout << "In(#" << id1 << ",#" << id2 << ")"; } void Code_Eq1::dump(bool rec) { cout << "Eq1(#" << id1 << ",#" << id2 << ")"; } void Code_Eq2::dump(bool rec) { cout << "Eq2(#" << id1 << ",#" << id2 << ")"; } void Code_Sub2::dump(bool rec) { cout << "Sub2(#" << id1 << ",#" << id2 << ")"; } void Code_Less1::dump(bool rec) { cout << "Less1(#" << id1 << ",#" << id2 << ")"; } void Code_LessEq1::dump(bool rec) { cout << "LessEq1(#" << id1 << ",#" << id2 << ")"; } void Code_EqDot0::dump(bool rec) { cout << "Dot0(#" << id1 << ",#" << id2 << ")"; } void Code_EqDot1::dump(bool rec) { cout << "Dot1(#" << id1 << ",#" << id2 << ")"; } void Code_EqUp::dump(bool rec) { cout << "eqUp(#" << id1 << ",#" << id2 << ")"; } void Code_EqPlus2::dump(bool rec) { cout << "EqPlus2(#" << id1 << ",#" << id2 << ")"; } void Code_EqMinus2::dump(bool rec) { cout << "EqMinus2(#" << id1 << ",#" << id2 << ")"; } void Code_EqMin::dump(bool rec) { cout << "EqMin(#" << id1 << ",#" << id2 << ")"; } void Code_EqMax::dump(bool rec) { cout << "EqMax(#" << id1 << ",#" << id2 << ")"; } void Code_EqPlus1::dump(bool rec) { cout << "EqPlus1(#" << id1 << ",#" << id2 << "," << val << ")"; } void Code_EqMinus1::dump(bool rec) { cout << "EqMinus1(#" << id1 << ",#" << id2 << ")"; } void Code_EqUnion::dump(bool rec) { cout << "Union(#" << id1 << ",#" << id2 << ",#" << id3 << ")"; } void Code_EqInter::dump(bool rec) { cout << "Inter(#" << id1 << ",#" << id2 << ",#" << id3 << ")"; } void Code_EqSetMinus::dump(bool rec) { cout << "SetMinus(#" << id1 << ",#" << id2 << ",#" << id3 << ")"; } void Code_EqPlusModulo::dump(bool rec) { cout << "EqPlusModulo(#" << id1 << ",#" << id2 << ",#" << id3 << ")"; } void Code_EqMinusModulo::dump(bool rec) { cout << "EqMinusModulo(#" << id1 << ",#" << id2 << ",#" << id3 << ")"; } void Code_EqPresbConst::dump(bool rec) { cout << "PresbConst(#" << id << "," << val << ")"; } void Code_WellFormedTree::dump(bool rec) { cout << "WellFormedTree(#" << id << ")"; } /////////// Code composite //////////////////////////////////////////////////// void Code_Restrict::dump(bool rec) { cout << "Restrict"; if (rec) { cout << "("; vc.dump(rec); cout << ")"; } } void Code_Project::dump(bool rec) { cout << "Project(#" << var; dumpStateSpaces(var); if (rec) { cout << ","; vc.dump(rec); } cout << ")"; } void Code_Negate::dump(bool rec) { cout << "Negate"; if (rec) { cout << "("; vc.dump(rec); cout << ")"; } } void Code_Prefix::dump(bool rec) { cout << "Prefix"; if (rec) { cout << "("; vc.dump(rec); cout << ")"; } } void Code_And::dump(bool rec) { cout << "And"; if (rec) { cout << "("; vc1.dump(rec); cout << ","; vc2.dump(rec); cout << ")"; } } void Code_IdLeft::dump(bool rec) { cout << "IdLeft"; if (rec) { cout << "("; vc1.dump(rec); cout << ","; vc2.dump(rec); cout << ")"; } } void Code_Or::dump(bool rec) { cout << "Or"; if (rec) { cout << "("; vc1.dump(rec); cout << ","; vc2.dump(rec); cout << ")"; } } void Code_Impl::dump(bool rec) { cout << "Impl"; if (rec) { cout << "("; vc1.dump(rec); cout << ","; vc2.dump(rec); cout << ")"; } } void Code_Biimpl::dump(bool rec) { cout << "Biimpl"; if (rec) { cout << "("; vc1.dump(rec); cout << ","; vc2.dump(rec); cout << ")"; } } void Code_PredCall::dump(bool rec) { cout << "PredCall(" << symbolTable.lookupSymbol(name); if (rec) { cout << ","; vc.dump(rec); } cout << ")"; } void Code_Import::dump(bool rec) { cout << "Import(" << file; Deque::iterator i; IdentList::iterator j; for (i = formals->begin(), j = actuals->begin(); i != formals->end(); i++, j++) cout << "," << *i << "->#" << *j; cout << ")"; } void Code_Export::dump(bool rec) { cout << "Export(" << file; if (rec) { cout << ","; vc.dump(rec); } cout << ")"; } mona-1.4/Front/code.h0000644000414100000240000004466210756504267011422 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __CODE_H #define __CODE_H #include "deque.h" #include "signature.h" #include "st_dfa.h" #include "st_gta.h" #include "printline.h" #include "ident.h" #include "str.h" ////////// StateSpaces //////////////////////////////////////////////////////// SSSet stateSpaces(IdentList *univs); // find state spaces for univs SSSet stateSpaces(Ident id); // find state spaces for id void dumpStateSpaces(Ident id); ////////// Code /////////////////////////////////////////////////////////////// enum CodeKind { cTrue, cFalse, cIn, cEq1, cEq2, cSub2, cLess1, cLessEq1, cEqUnion, cEqInter, cEqSetMinus, cEqEmpty, cEqRoot, cFirstOrder, cEqConst, cSingleton, cBoolVar, cPredCall, cEqDot0, cEqDot1, cEqUp, cEqPlus1, cEqMinus1, cEqPlus2, cEqMinus2, cEqPlusModulo, cEqMinusModulo, cEqMin, cEqMax, cAnd, cOr, cImpl, cBiimpl, cRestrict, cProject, cNegate, cImport, cExport, cPrefix, cInStateSpace, cIdLeft, cEqPresbConst, cWellFormedTree, cSomeType, cAndList }; class Code; class VarCode { public: VarCode(IdentList *v, Code *c) : vars(v), code(c) {} VarCode() : vars(NULL), code(NULL) {} bool operator==(const VarCode &vc) {return vc.vars==vars && vc.code==code;} // generate DFA/GTA DFA *DFATranslate(); GTA *GTATranslate(); // reduction (reduce.cpp) void reduceAll(Deque *vcl); void reduce(); void unmark(); void setmark(int val); // copying (codesubst.cpp) VarCode substCopy(IdentList *formals, IdentList *actuals); // dump subtree contents void dump(bool rec = true); void dumpsubst(); // remove reference void remove(); IdentList *vars; // overriding free variables (can be same as code.vars) Code *code; // code node }; class VarCodeList: public Deque { public: VarCodeList() : Deque() {} ~VarCodeList(); void insert(IdentList *v, Code *c); void insert(VarCodeList *l); bool sub(VarCodeList *l1, VarCodeList *l2 = NULL); void dump(); }; class SubstCopy { public: SubstCopy() : actuals(NULL) {} SubstCopy(IdentList *acts, VarCode c) : actuals(acts), sign(NULL), vc(c) {} bool operator==(const SubstCopy &sc) {return vc==sc.vc && equal(actuals, sc.actuals);} IdentList *actuals; Signature *sign; VarCode vc; }; class Code { public: Code(CodeKind knd, Pos p) : kind(knd), refs(1), pos(p), mark(0), eqlist(NULL), dfa(NULL), gta(NULL), conj(NULL), restrconj(NULL), depth(0)/**, conjhash(0)**/ {} virtual ~Code() {} // determine syntax/signature equivalence virtual bool equiv(Code &c); // hash node contents for CodeTable virtual unsigned hash(); // make DFA/GTA for this node virtual void makeDFA() {} virtual void makeGTA() {} // remove one reference to this node, if last then call recursively void remove(); // dump node/subtree contents virtual void viz(); // graphviz format virtual void dump(bool rec) = 0; // dump recursively/non-recursively virtual void show(); // print one line info for leaves // reduction (reduce.cpp) virtual void reduce1() {} virtual void reduce2(); virtual void setmark(int val); virtual void clearEqlist(); virtual bool checkExport(Ident x); /** void hashconj(); **/ // copying (codesubst.cpp) virtual VarCode substCopy(IdentList *actuals) = 0; // write error message void error(String); IdentList vars; // compressed default free variables Signature sign; // signature of free variables CodeKind kind; // object kind tag int refs; // number of DAG references to this node Pos pos; // source position int mark; // used for traversal VarCode forwarded; // used during reduction, none if .code=NULL unsigned bucket; // entry in codeTable, set when inserted Deque sclist; // used during substCopy (dyn. prog.) IdentList *eqlist; // used during findEquality (dyn. prog.) DFA *dfa; // default DFA, NULL if not generated yet GTA *gta; // default GTA, NULL if not generated yet VarCodeList *conj; // conjuncts (used during red.) VarCodeList *restrconj; // restricted conjuncts (used during red.) int depth; // max number of steps to leaf /** unsigned conjhash; // hashing of conj and restrconj (used during red.) **/ }; ////////// Abstract classes /////////////////////////////////////////////////// class Code_n: public Code { public: Code_n(CodeKind knd, Ident i, Pos p); bool equiv(Code&); unsigned hash(); Ident id; }; class Code_ni: public Code_n { public: Code_ni(CodeKind knd, Ident i, int n, Pos p); bool equiv(Code&); unsigned hash(); int val; }; class Code_nn: public Code { public: Code_nn(CodeKind knd, Ident i, Ident j, Pos p); bool equiv(Code&); unsigned hash(); Ident id1; Ident id2; }; class Code_nni: public Code_nn { public: Code_nni(CodeKind knd, Ident i, Ident j, int n, Pos p); bool equiv(Code&); unsigned hash(); int val; }; class Code_nnn: public Code { public: Code_nnn(CodeKind knd, Ident i, Ident j, Ident k, Pos p); bool equiv(Code&); unsigned hash(); Ident id1; Ident id2; Ident id3; }; class Code_c: public Code { public: Code_c(CodeKind knd, VarCode c, Pos p, bool skipinit=false); ~Code_c() {vc.remove();} bool equiv(Code&); unsigned hash(); void setmark(int val); void viz(); void reduce1(); virtual void reduce2(); void clearEqlist(); virtual bool checkExport(Ident x); void show() {}; VarCode vc; }; class Code_cc: public Code { public: Code_cc(CodeKind knd, VarCode c1, VarCode c2, Pos p); ~Code_cc() {vc1.remove(); vc2.remove();} bool equiv(Code&); unsigned hash(); void setmark(int val); void viz(); void reduce1(); virtual void reduce2(); void clearEqlist(); bool checkExport(Ident x); void show() {}; virtual void makeDFA(); virtual void makeGTA(); VarCode vc1; VarCode vc2; DFA *a1,*a2; GTA *g1,*g2; }; /** class Code_clist: public Code { public: Code_clist(CodeKind knd, Deque c, Pos p); ~Code_clist() {for (Deque::iterator i = vcl.begin(); i != vcl.end(); i++) i->remove();} bool equiv(Code&); unsigned hash(); void setmark(int val); void viz(); void reduce1(); virtual void reduce2(); void clearEqlist(); bool checkExport(Ident x); void show() {}; virtual void makeDFA(); virtual void makeGTA(); Deque vcl; Deque al; Deque gl; }; **/ ////////// Atomic formulas //////////////////////////////////////////////////// class Code_True: public Code { public: Code_True(Pos p) : Code(cTrue, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_False: public Code { public: Code_False(Pos p) : Code(cFalse, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqEmpty: public Code_n { public: Code_EqEmpty(Ident i, Pos p) : Code_n(cEqEmpty, i, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqRoot: public Code_n { public: Code_EqRoot(Ident i, IdentList *univs, Pos p) : Code_n(cEqRoot, i, p), universes(univs) {} ~Code_EqRoot() {delete universes;} bool equiv(Code&); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); IdentList *universes; }; class Code_FirstOrder: public Code_n { public: Code_FirstOrder(Ident i, Pos p) : Code_n(cFirstOrder, i, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqConst: public Code_ni { public: Code_EqConst(Ident i, int n, Pos p) : Code_ni(cEqConst, i, n, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_Singleton: public Code_n { public: Code_Singleton(Ident i, Pos p) : Code_n(cSingleton, i, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_BoolVar: public Code_n { public: Code_BoolVar(Ident i, Pos p) : Code_n(cBoolVar, i, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_InStateSpace: public Code_n { public: Code_InStateSpace(Ident i, IdentList *s, Pos p) : Code_n(cInStateSpace, i, p), ss(s) {} ~Code_InStateSpace() {delete ss;} bool equiv(Code&); unsigned hash(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); IdentList *ss; }; class Code_SomeType: public Code_n { public: Code_SomeType(Ident i, Pos p) : Code_n(cSomeType, i, p) {} void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_In: public Code_nn { public: Code_In(Ident i, Ident j, Pos p) : Code_nn(cIn, i, j, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_Eq1: public Code_nn { public: Code_Eq1(Ident i, Ident j, Pos p) : Code_nn(cEq1, i, j, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); VarCode substCopy(IdentList *actuals); }; class Code_Eq2: public Code_nn { public: Code_Eq2(Ident i, Ident j, Pos p) : Code_nn(cEq2, i, j, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); VarCode substCopy(IdentList *actuals); }; class Code_Sub2: public Code_nn { public: Code_Sub2(Ident i, Ident j, Pos p) : Code_nn(cSub2, i, j, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_Less1: public Code_nn { public: Code_Less1(Ident i, Ident j, Pos p) : Code_nn(cLess1, i, j, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_LessEq1: public Code_nn { public: Code_LessEq1(Ident i, Ident j, Pos p) : Code_nn(cLessEq1, i, j, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqDot0: public Code_nn { public: Code_EqDot0(Ident i, Ident j, Pos p) : Code_nn(cEqDot0, i, j, p) {} void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqDot1: public Code_nn { public: Code_EqDot1(Ident i, Ident j, Pos p) : Code_nn(cEqDot1, i, j, p) {} void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqUp: public Code_nn { public: Code_EqUp(Ident i, Ident j, Pos p) : Code_nn(cEqUp, i, j, p) {} void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqPlus2: public Code_nn { public: Code_EqPlus2(Ident i, Ident j, Pos p) : Code_nn(cEqPlus2, i, j, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqMinus2: public Code_nn { public: Code_EqMinus2(Ident i, Ident j, Pos p) : Code_nn(cEqMinus2, i, j, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqMin: public Code_nn { public: Code_EqMin(Ident i, Ident j, Pos p) : Code_nn(cEqMin, i, j, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqMax: public Code_nn { public: Code_EqMax(Ident i, Ident j, Pos p) : Code_nn(cEqMax, i, j, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqPlus1: public Code_nni { public: Code_EqPlus1(Ident i, Ident j, int n, Pos p) : Code_nni(cEqPlus1, i, j, n, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqMinus1: public Code_nn { public: Code_EqMinus1(Ident i, Ident j, Pos p) : Code_nn(cEqMinus1, i, j, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqUnion: public Code_nnn { public: Code_EqUnion(Ident i, Ident j, Ident k, Pos p) : Code_nnn(cEqUnion, i, j, k, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqInter: public Code_nnn { public: Code_EqInter(Ident i, Ident j, Ident k, Pos p) : Code_nnn(cEqInter, i, j, k, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqSetMinus: public Code_nnn { public: Code_EqSetMinus(Ident i, Ident j, Ident k, Pos p) : Code_nnn(cEqSetMinus, i, j, k, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqPlusModulo: public Code_nnn { public: Code_EqPlusModulo(Ident i, Ident j, Ident k, Pos p) : Code_nnn(cEqPlusModulo, i, j, k, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqMinusModulo: public Code_nnn { public: Code_EqMinusModulo(Ident i, Ident j, Ident k, Pos p) : Code_nnn(cEqMinusModulo, i, j, k, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_EqPresbConst: public Code_ni { public: Code_EqPresbConst(Ident i, int v, Pos p) : Code_ni(cEqPresbConst, i, v, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_WellFormedTree: public Code_n { public: Code_WellFormedTree(Ident i, Pos p) : Code_n(cWellFormedTree, i, p) {} void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; ////////// Composite formulas ///////////////////////////////////////////////// class Code_Restrict: public Code_c { public: Code_Restrict(VarCode vc, Pos p) : Code_c(cRestrict, vc, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce2(); VarCode substCopy(IdentList *actuals); }; class Code_Project: public Code_c { public: Code_Project(Ident n, VarCode c, Pos p); bool equiv(Code&); void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); void reduce2(); Ident findEquality(Ident x, VarCode vc); VarCode substCopy(IdentList *actuals); Ident var; int varpos; }; class Code_Negate: public Code_c { public: Code_Negate(VarCode c, Pos p) : Code_c(cNegate, c, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); void reduce2(); VarCode substCopy(IdentList *actuals); }; class Code_Prefix: public Code_c { public: Code_Prefix(VarCode c, Pos p) : Code_c(cPrefix, c, p) {} void makeDFA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_And: public Code_cc { public: Code_And(VarCode vc1, VarCode vc2, Pos p) : Code_cc(cAnd, vc1, vc2, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); void reduce2(); VarCode substCopy(IdentList *actuals); }; /* class Code_AndList: public Code_cc { public: Code_AndList(Deque c, Pos p) : Code_clist(cAndList, c, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); void reduce2(); VarCode substCopy(IdentList *actuals); }; */ class Code_IdLeft: public Code_cc { public: Code_IdLeft(VarCode vc1, VarCode vc2, Pos p) : Code_cc(cIdLeft, vc1, vc2, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); }; class Code_Or: public Code_cc { public: Code_Or(VarCode vc1, VarCode vc2, Pos p) : Code_cc(cOr, vc1, vc2, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); VarCode substCopy(IdentList *actuals); }; class Code_Impl: public Code_cc { public: Code_Impl(VarCode vc1, VarCode vc2, Pos p) : Code_cc(cImpl, vc1, vc2, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); VarCode substCopy(IdentList *actuals); }; class Code_Biimpl: public Code_cc { public: Code_Biimpl(VarCode vc1, VarCode vc2, Pos p) : Code_cc(cBiimpl, vc1, vc2, p) {} void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); VarCode substCopy(IdentList *actuals); }; ////////// Special nodes ////////////////////////////////////////////////////// class Code_PredCall: public Code_c { public: Code_PredCall(Ident n, VarCode c, IdentList &acts, IdentList *frs, char *source, Pos p); ~Code_PredCall() {vc.remove(); delete[] names; delete[] orders; delete[] filename;} bool equiv(Code&); unsigned hash(); void makeDFA(); void makeGTA(); void dump(bool rec); void reduce1(); void reduce2(); VarCode substCopy(IdentList *actuals); Ident name; // predicate name char *filename; // filename for separate compilation char *sourcefile; // name of source file char **names; // names of frees+actuals (vars) (NULL terminated) char *orders; // orders of free+actuals (vars) IdentList actuals, frees, s; }; class Code_Import: public Code { public: Code_Import(char *filename, Deque *forms, IdentList *acts, Pos p); ~Code_Import() {delete formals; delete actuals;} bool equiv(Code&); unsigned hash(); void makeDFA(); void makeGTA(); IdentList *getOffsets(char**, int*, SSSet*); void dump(bool rec); VarCode substCopy(IdentList *actuals); char *file; Deque *formals; IdentList *actuals; }; class Code_Export: public Code_c { public: Code_Export(VarCode c, char* filename, IdentList *fv, Pos p); ~Code_Export() {vc.remove(); delete[] names; delete[] orders;} bool equiv(Code&); unsigned hash(); void makeDFA(); void makeGTA(); void dump(bool rec); VarCode substCopy(IdentList *actuals); bool checkExport(Ident x); char *file; // file name char **names; // names of free variables char *orders; // orders of free variables int num; // number of free variables IdentList freevars, s; }; #endif mona-1.4/Front/codesubst.cpp0000644000414100000240000002303510756504335013021 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "codetable.h" extern CodeTable *codeTable; extern bool regenerate; VarCode VarCode::substCopy(IdentList *formals, IdentList *actuals) { // make copy with actuals substituting formals VarCode res; IdentList *newactuals = subst(vars, formals, actuals); if (!regenerate && equal(vars, newactuals)) // nothing to substitute, just copy res = VarCode(newactuals, code); else { // see if substitution already has been made Signature sign(*newactuals); Deque::iterator i; for (i = code->sclist.begin(); i != code->sclist.end(); i++) if (sign == *(*i).sign && sameListUnivs(vars, newactuals)) { // already made, reuse it IdentList *t = (*i).actuals->copy(); t->compress(); newactuals->compress(); res = VarCode(subst((*i).vc.vars, t, newactuals), (*i).vc.code); delete newactuals; delete t; break; } if (!res.code) { // not already made, make it and add to lists res = code->substCopy(newactuals); SubstCopy sc(newactuals, VarCode(res.vars->copy(), res.code)); sc.sign = new Signature(*sc.actuals); code->sclist.push_front(sc); codeTable->addSC(sc); } } res.code->refs++; invariant(res.vars->size() == res.code->vars.size()); return res; } VarCode Code_True::substCopy(IdentList *) { return codeTable->insert(new Code_True(pos)); } VarCode Code_False::substCopy(IdentList *) { return codeTable->insert(new Code_False(pos)); } VarCode Code_EqEmpty::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqEmpty(subst(id, &vars, actuals), pos)); } VarCode Code_EqRoot::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqRoot(subst(id, &vars, actuals), copy(universes), pos)); } VarCode Code_FirstOrder::substCopy(IdentList *actuals) { return codeTable->insert(new Code_FirstOrder(subst(id, &vars, actuals), pos)); } VarCode Code_EqConst::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqConst(subst(id, &vars, actuals), val, pos)); } VarCode Code_Singleton::substCopy(IdentList *actuals) { return codeTable->insert(new Code_Singleton(subst(id, &vars, actuals), pos)); } VarCode Code_BoolVar::substCopy(IdentList *actuals) { return codeTable->insert(new Code_BoolVar(subst(id, &vars, actuals), pos)); } VarCode Code_InStateSpace::substCopy(IdentList *actuals) { return codeTable->insert(new Code_InStateSpace(subst(id, &vars, actuals), copy(ss), pos)); } VarCode Code_SomeType::substCopy(IdentList *actuals) { return codeTable->insert(new Code_SomeType(subst(id, &vars, actuals), pos)); } VarCode Code_In::substCopy(IdentList *actuals) { return codeTable->insert(new Code_In(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_Eq1::substCopy(IdentList *actuals) { return codeTable->insert(new Code_Eq1(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_Eq2::substCopy(IdentList *actuals) { return codeTable->insert(new Code_Eq2(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_Sub2::substCopy(IdentList *actuals) { return codeTable->insert(new Code_Sub2(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_Less1::substCopy(IdentList *actuals) { return codeTable->insert(new Code_Less1(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_LessEq1::substCopy(IdentList *actuals) { return codeTable->insert(new Code_LessEq1(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqDot0::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqDot0(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqDot1::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqDot1(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqUp::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqUp(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqPlus2::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqPlus2(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqMinus2::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqMinus2(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqMin::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqMin(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqMax::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqMax(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqPlus1::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqPlus1(subst(id1, &vars, actuals), subst(id2, &vars, actuals), val, pos)); } VarCode Code_EqMinus1::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqMinus1(subst(id1, &vars, actuals), subst(id2, &vars, actuals), pos)); } VarCode Code_EqUnion::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqUnion(subst(id1, &vars, actuals), subst(id2, &vars, actuals), subst(id3, &vars, actuals), pos)); } VarCode Code_EqInter::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqInter(subst(id1, &vars, actuals), subst(id2, &vars, actuals), subst(id3, &vars, actuals), pos)); } VarCode Code_EqSetMinus::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqSetMinus(subst(id1, &vars, actuals), subst(id2, &vars, actuals), subst(id3, &vars, actuals), pos)); } VarCode Code_EqPlusModulo::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqPlusModulo(subst(id1, &vars, actuals), subst(id2, &vars, actuals), subst(id3, &vars, actuals), pos)); } VarCode Code_EqMinusModulo::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqMinusModulo(subst(id1, &vars, actuals), subst(id2, &vars, actuals), subst(id3, &vars, actuals), pos)); } VarCode Code_EqPresbConst::substCopy(IdentList *actuals) { return codeTable->insert(new Code_EqPresbConst(subst(id, &vars, actuals), val, pos)); } VarCode Code_WellFormedTree::substCopy(IdentList *actuals) { return codeTable->insert(new Code_WellFormedTree(subst(id, &vars, actuals), pos)); } VarCode Code_Restrict::substCopy(IdentList *actuals) { return codeTable->insert(new Code_Restrict(vc.substCopy(&vars, actuals), pos)); } VarCode Code_Project::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Project(var, vc.substCopy(&vars, actuals), pos)); } VarCode Code_Negate::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Negate(vc.substCopy(&vars, actuals), pos)); } VarCode Code_Prefix::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Prefix(vc.substCopy(&vars, actuals), pos)); } VarCode Code_And::substCopy(IdentList *actuals) { return codeTable->insert (new Code_And(vc1.substCopy(&vars, actuals), vc2.substCopy(&vars, actuals), pos)); } VarCode Code_IdLeft::substCopy(IdentList *actuals) { return codeTable->insert (new Code_IdLeft(vc1.substCopy(&vars, actuals), vc2.substCopy(&vars, actuals), pos)); } VarCode Code_Or::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Or(vc1.substCopy(&vars, actuals), vc2.substCopy(&vars, actuals), pos)); } VarCode Code_Impl::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Impl(vc1.substCopy(&vars, actuals), vc2.substCopy(&vars, actuals), pos)); } VarCode Code_Biimpl::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Biimpl(vc1.substCopy(&vars, actuals), vc2.substCopy(&vars, actuals), pos)); } VarCode Code_PredCall::substCopy(IdentList *actuals) { IdentList a, f; IdentList::iterator i; for (i = this->actuals.begin(); i != this->actuals.end(); i++) a.push_back(subst(*i, &vars, actuals)); for (i = frees.begin(); i != frees.end(); i++) f.push_back(subst(*i, &vars, actuals)); return codeTable->insert (new Code_PredCall (name, vc.substCopy(&vars, actuals), a, &f, sourcefile, pos)); } VarCode Code_Import::substCopy(IdentList *actuals) { IdentList *newactuals = new IdentList(); IdentList::iterator i; for (i = this->actuals->begin(); i != this->actuals->end(); i++) newactuals->push_back(subst(*i, &vars, actuals)); return codeTable->insert (new Code_Import(file, formals->copy(), newactuals, pos)); } VarCode Code_Export::substCopy(IdentList *actuals) { return codeTable->insert (new Code_Export(vc.substCopy(&vars, actuals), file, &freevars, pos)); } mona-1.4/Front/codetable.cpp0000644000414100000240000001350010756504335012744 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #define _LANGUAGE_C_PLUS_PLUS #include #include #include #include "codetable.h" #include "env.h" #include "config.h" extern "C" { #include "../Mem/mem.h" } using std::cout; extern Options options; VarCode CodeTable::insert(Code *c) { unsigned hash = c->hash() % CODE_TABLE_SIZE; for (Deque::iterator i = table[hash].begin(); i != table[hash].end(); i++) if ((*i)->equiv(*c)) { stat_hits++; (*i)->refs++; VarCode vc = VarCode(c->vars.copy(), *i); c->forwarded.remove(); delete c; // replace Code-node in VarCode with old node return vc; } table[hash].push_back(c); c->bucket = hash; // update statistics stat_misses++; nodes++; switch (c->kind) { case cProject: num_proj++; break; case cAnd: case cOr: case cImpl: case cBiimpl: num_prod++; break; default: num_other++; break; } return VarCode(&c->vars, c); } bool CodeTable::exists(Code &c) { unsigned hash = c.hash() % CODE_TABLE_SIZE; for (Deque::iterator i = table[hash].begin(); i != table[hash].end(); i++) if ((*i)->equiv(c)) return true; return false; } Code* CodeTable::findEquiv(Code *c) { unsigned hash = c->hash() % CODE_TABLE_SIZE; for (Deque::iterator i = table[hash].begin(); i != table[hash].end(); i++) if (*i != c && (*i)->equiv(*c)) return *i; return NULL; } void CodeTable::remove(Code *c) { unsigned b = c->bucket; Deque::iterator i; int j; for (i = table[b].begin(), j = 0; i != table[b].end(); i++, j++) if (*i == c) { if (i+1 == table[b].end()) table[b].pop_back(); else table[b].set(j, table[b].pop_back()); // update statistics nodes--; switch (c->kind) { case cProject: num_proj--; break; case cAnd: case cOr: case cImpl: case cBiimpl: num_prod--; break; default: num_other--; break; } return; } invariant(false); } void CodeTable::print_statistics() { cout << "DAG hits: " << stat_hits /* << ", misses: " << stat_misses */ << ", nodes: " << nodes << "\n"; } void CodeTable::print_statistics2() { cout << "DAG nodes: " << nodes << "\n"; } void CodeTable::print_reduction_statistics() { cout << "Projections removed: " << red_proj << " (of " << num_proj+red_proj << ")\n" << "Products removed: " << red_prod << " (of " << num_prod+red_prod << ")\n" << "Other nodes removed: " << red_other << " (of " << num_other+red_other << ")\n" << "DAG nodes after reduction: " << nodes << "\n"; } void CodeTable::print_sizes() { unsigned i, j; cout << "\nDAG hash table bucket sizes:\n"; for (i = 0; i < CODE_TABLE_SIZE; i++) if (table[i].size() > 0) { cout << i << ": "; for (j = 0; j < table[i].size(); j++) cout << "*"; cout << "\n"; } } extern CodeTable *codeTable; RETSIGTYPE signal_handler(int sig) { codeTable->update(); signal(SIGALRM, signal_handler); alarm(1); SIGRET; } void CodeTable::init_print_progress() { total_nodes = nodes; makes = 0; signal(SIGALRM, signal_handler); } void CodeTable::begin() { if (options.printProgress) alarm(1); } void CodeTable::done() { if (options.printProgress) alarm(0); } int in_update = 0; void CodeTable::update() { if (in_update++) { in_update--; return; } int part = 100 * makes / total_nodes; long mem = (mem_allocated()+1048575)/1048576; if (options.statistics || options.intermediate) cout << part << "% completed (" << dfa_in_mem+gta_in_mem << " automata in memory, " << mem << "MB memory used)\n"; else { cout << "\r "; cout << "\r" << part << "% completed"; if (part == 100) cout << " \n"; else cout << " (" << dfa_in_mem+gta_in_mem << " automata in memory, " << mem << "MB memory used)"; } flush(cout); if (part<100) in_update--; } void CodeTable::print_progress() { if (options.printProgress) { invariant(total_nodes > 0); makes++; int part = 100 * makes / total_nodes; if (part == 100 || !options.demo) if (part > prev) update(); prev = part; } } void CodeTable::addSC(SubstCopy sc) { sclist.push_back(sc); } void CodeTable::clearSCTable() { Deque::iterator s; for (s = sclist.begin(); s != sclist.end(); s++) { delete (*s).actuals; delete (*s).sign; (*s).vc.remove(); } sclist.reset(); } /** ConjNode * CodeTable::conjLookup(unsigned conjhash, VarCodeList *conj, VarCodeList *restrconj, Code *code) { Deque *t = &conjtable[conjhash % CONJ_TABLE_SIZE]; Deque::iterator i; for (i = t->begin(); i != t->end(); i++) if (conjhash==(*i)->conjhash) { if (code->kind!=(*i)->code->kind) continue; #warning ... return *i; } return 0; } void CodeTable::conjInsert(ConjNode *n) { conjtable[n->conjhash % CONJ_TABLE_SIZE].push_front(n); } **/ mona-1.4/Front/codetable.h0000644000414100000240000000435510756504267012425 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __CODETABLE_H #define __CODETABLE_H #include "code.h" #define CODE_TABLE_SIZE 1019 #define CONJ_TABLE_SIZE 117 /** class ConjNode { public: ConjNode(unsigned h, VarCodeList *c, VarCodeList *r, Code *cc) : conjhash(h), conj(c), restrconj(r), code(cc) {} unsigned conjhash; VarCodeList *conj, *restrconj; Code *code; }; **/ class CodeTable { Deque table[CODE_TABLE_SIZE]; Deque sclist; // used during reduction /** DequeGC conjtable[CONJ_TABLE_SIZE]; // used during reduction **/ public: CodeTable() {stat_hits = stat_misses = nodes = makes = prev = red_proj = red_prod = red_other = num_prod = num_proj = num_other = 0;} VarCode insert(Code*); bool exists(Code&); Code *findEquiv(Code*); void remove(Code*); void print_statistics(); void print_statistics2(); void print_reduction_statistics(); void print_sizes(); void init_print_progress(); void begin(); void update(); void done(); void print_progress(); void addSC(SubstCopy sc); void clearSCTable(); /** ConjNode *conjLookup(unsigned conjhash, VarCodeList *conj, VarCodeList *restrconj, Code *code); void conjInsert(ConjNode *n); **/ int stat_hits, stat_misses, nodes, total_nodes; int red_prod, red_proj, red_other; // number of reductions int num_prod, num_proj, num_other; // number of operations int makes, prev; // number of automata constructed }; #endif mona-1.4/Front/deque.h0000644000414100000240000001101610756504267011576 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __DEQUE_H #define __DEQUE_H #include #include #include template class Deque { unsigned allocated, start, noelems; T *buffer; public: typedef T *iterator; Deque() { allocated = 0; start = 0; noelems = 0; buffer = 0; } Deque(const T &elem) { buffer = new T[1]; buffer[0] = elem; allocated = 1; start = 0; noelems = 1; } Deque(const Deque &d) { buffer = new T[d.size()]; allocated = d.size(); start = 0; noelems = d.size(); for (unsigned i = 0; i < noelems; i++) buffer[i] = d.get(i); } ~Deque() { delete[] buffer; } void push_back(const T &elem) { if (start + noelems >= allocated) { allocated = allocated * 3 / 2 + 2; T *t = new T[allocated]; memcpy(&t[start], &buffer[start], noelems * sizeof(T)); delete[] buffer; buffer = t; } buffer[start + noelems] = elem; noelems++; } T &pop_back() { assert(noelems > 0); noelems--; return buffer[start + noelems]; } void push_front(const T &elem) { if (start == 0) { unsigned n = allocated * 3 / 2 + 2; T *t = new T[n]; memcpy(&t[start + n - allocated], &buffer[start], noelems * sizeof(T)); delete[] buffer; buffer = t; start += n - allocated; allocated = n; } buffer[--start] = elem; noelems++; } void insert(unsigned pos, const T &elem) { assert(pos <= noelems); push_front(elem); for (unsigned i = 0; i < pos; i++) set(i, get(i+1)); set(pos, elem); } T &pop_front() { assert(noelems > 0); noelems--; return buffer[start++]; } void set(unsigned pos, const T &elem) { assert(pos < noelems); buffer[start + pos] = elem; } void set(iterator i, const T &elem) { assert(i >= &buffer[start] && i < &buffer[start+noelems]); *i = elem; } T &get(unsigned pos) const { assert(pos < noelems); return buffer[start + pos]; } T &top() const { return get(noelems-1); } T *begin() const { return &buffer[start]; } T *end() const { return &buffer[start + noelems]; } unsigned size() const { return noelems; } bool empty() const { return noelems == 0; } void reset() { delete[] buffer; allocated = 0; start = 0; noelems = 0; buffer = 0; } void append(Deque *d) { iterator i; if (d) for (i = d->begin(); i != d->end(); i++) push_back(*i); } void prepend(Deque *d) { iterator i; if (d) for (i = d->end()-1; i != d->begin()-1; i--) push_front(*i); } Deque *copy() const { Deque *d = new Deque; iterator i; for (i = begin(); i != end(); i++) d->push_back(*i); return d; } void sort(int (*compar) (const void *, const void *)) { qsort(begin(), noelems, sizeof(T), compar); } const T *search(const T &elem, int (*compar) (const void *, const void *)) { unsigned a = 0, b = size(), c; while (a < b) { c = (b-a)/2 + a; int r = compar(&elem, &buffer[start + c]); if (r == 0) return &buffer[start + c]; if (r > 0) a = c+1; else b = c; } return 0; } bool exists(const T &elem) { iterator i; for (i = begin(); i != end(); i++) if (*i == elem) return true; return false; } }; template class DequeGC: public Deque { // garbage-collected deque public: ~DequeGC() { for (T *i = this->begin(); i != this->end(); i++) delete *i; } }; template class DequeGCA: public Deque { // garbage-collected deque for arrays public: ~DequeGCA() { for (T *i = this->begin(); i != this->end(); i++) delete[] *i; } }; #endif mona-1.4/Front/env.h0000644000414100000240000000337610756504267011275 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __ENV_H #define __ENV_H enum Mode {LINEAR, TREE}; class Options { public: Options() : time(false), whole(false), mode(LINEAR), statistics(false), printProgress(false), analysis(false), separateCompilation(false), dump(false), intermediate(false), treemodeOutput(false), m2l(false), graphvizDFA(false), graphvizDAG(false), graphvizSatisfyingEx(false), graphvizCounterEx(false), externalWhole(false), demo(false), inheritedAcceptance(false), unrestrict(false), alternativeM2LStr(false), reorder(false), optimize(0) {} bool time; bool whole; Mode mode; bool statistics; bool printProgress; bool analysis; bool separateCompilation; bool dump; bool intermediate; bool treemodeOutput; bool m2l; bool graphvizDFA; bool graphvizDAG; bool graphvizSatisfyingEx; bool graphvizCounterEx; bool externalWhole; bool demo; bool inheritedAcceptance; bool unrestrict; bool alternativeM2LStr; bool reorder; unsigned optimize; }; #endif mona-1.4/Front/freevars.cpp0000644000414100000240000001633510756504335012650 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "ast.h" #include "symboltable.h" #include "predlib.h" extern SymbolTable symbolTable; extern PredicateLib predicateLib; static IdentList restrVars2; // variables occuring in current restriction void ASTTerm1_T::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTTerm1_t::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } void ASTTerm1_tn::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } void ASTTerm1_tnt::freeVars(IdentList *free, IdentList *bound) { t1->freeVars(free, bound); t2->freeVars(free, bound); } void ASTTerm2_TT::freeVars(IdentList *free, IdentList *bound) { T1->freeVars(free, bound); T2->freeVars(free, bound); } void ASTTerm2_Tn::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTForm_tT::freeVars(IdentList *free, IdentList *bound) { t1->freeVars(free, bound); T2->freeVars(free, bound); } void ASTForm_T::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTForm_TT::freeVars(IdentList *free, IdentList *bound) { T1->freeVars(free, bound); T2->freeVars(free, bound); } void ASTForm_tt::freeVars(IdentList *free, IdentList *bound) { t1->freeVars(free, bound); t2->freeVars(free, bound); } void ASTForm_nt::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } void ASTForm_nT::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTForm_f::freeVars(IdentList *free, IdentList *bound) { f->freeVars(free, bound); } void ASTForm_ff::freeVars(IdentList *free, IdentList *bound) { f1->freeVars(free, bound); f2->freeVars(free, bound); } void ASTForm_vf::freeVars(IdentList *free, IdentList *bound) { bound->insert(vl); f->freeVars(free, bound); } void ASTForm_uvf::freeVars(IdentList *free, IdentList *bound) { bound->insert(vl); f->freeVars(free, bound); } void ASTTerm1_Var1::freeVars(IdentList *free, IdentList *bound) { if (!bound->exists(n)) free->insert(n); if (!restrVars2.exists(n)) { restrVars2.insert(n); // find free variables of restriction ASTForm *restriction = symbolTable.lookupRestriction(n); if (restriction) restriction->freeVars(free, bound); else { Ident formal; restriction = symbolTable.getDefault1Restriction(&formal); if (restriction) { bound->insert(formal); // bind the default-restriction formal restriction->freeVars(free, bound); } } restrVars2.remove(n); } } void ASTTerm2_Var2::freeVars(IdentList *free, IdentList *bound) { if (!bound->exists(n)) free->insert(n); if (!restrVars2.exists(n)) { restrVars2.insert(n); // find free variables of restriction ASTForm *restriction = symbolTable.lookupRestriction(n); if (restriction) restriction->freeVars(free, bound); else { Ident formal; restriction = symbolTable.getDefault2Restriction(&formal); if (restriction) { bound->insert(formal); // bind the default-restriction formal restriction->freeVars(free, bound); } } restrVars2.remove(n); } } void ASTTerm2_VarTree::freeVars(IdentList *free, IdentList *bound) { if (!bound->exists(n)) free->insert(n); if (!restrVars2.exists(n)) { restrVars2.insert(n); // find free variables of restriction ASTForm *restriction = symbolTable.lookupRestriction(n); if (restriction) restriction->freeVars(free, bound); else { Ident formal; restriction = symbolTable.getDefault2Restriction(&formal); if (restriction) { bound->insert(formal); // bind the default-restriction formal restriction->freeVars(free, bound); } } restrVars2.remove(n); } } void ASTTerm2_Dot::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTTerm2_Up::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTTerm2_Set::freeVars(IdentList *free, IdentList *bound) { ASTList::iterator i; for (i = elements->begin(); i != elements->end(); i++) (*i)->freeVars(free, bound); } void ASTTerm2_Interval::freeVars(IdentList *free, IdentList *bound) { t1->freeVars(free, bound); t2->freeVars(free, bound); } void ASTTerm2_Formula::freeVars(IdentList *free, IdentList *bound) { bound->insert(fresh); f->freeVars(free, bound); } void ASTForm_Var0::freeVars(IdentList *free, IdentList *bound) { if (!bound->exists(n)) free->insert(n); } void ASTForm_RootPred::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } void ASTForm_FirstOrder::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } void ASTForm_Not::freeVars(IdentList *free, IdentList *bound) { f->freeVars(free, bound); } void ASTForm_Let0::freeVars(IdentList *free, IdentList *bound) { IdentList::iterator ident; FormList::iterator form; for (ident = defIdents->begin(), form = defForms->begin() ; ident != defIdents->end(); ident++, form++) { bound->insert(*ident); (*form)->freeVars(free, bound); } f->freeVars(free, bound); } void ASTForm_Let1::freeVars(IdentList *free, IdentList *bound) { IdentList::iterator ident; Term1List::iterator term; for (ident = defIdents->begin(), term = defTerms->begin() ; ident != defIdents->end(); ident++, term++) { bound->insert(*ident); (*term)->freeVars(free, bound); } f->freeVars(free, bound); } void ASTForm_Let2::freeVars(IdentList *free, IdentList *bound) { IdentList::iterator ident; Term2List::iterator term; for (ident = defIdents->begin(), term = defTerms->begin() ; ident != defIdents->end(); ident++, term++) { bound->insert(*ident); (*term)->freeVars(free, bound); } f->freeVars(free, bound); } void ASTForm_Call::freeVars(IdentList *free, IdentList *bound) { ASTList::iterator i; for (i = args->begin(); i != args->end(); i++) if ((*i)->order != oUniv) (*i)->freeVars(free, bound); PredLibEntry *p = predicateLib.lookup(n); bound->insert(p->bound); free->insert(p->frees); } void ASTForm_Import::freeVars(IdentList *free, IdentList *) { free->insert(idents); } void ASTForm_InStateSpace1::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } void ASTForm_InStateSpace2::freeVars(IdentList *free, IdentList *bound) { T->freeVars(free, bound); } void ASTForm_SomeType::freeVars(IdentList *free, IdentList *bound) { t->freeVars(free, bound); } mona-1.4/Front/ident.cpp0000644000414100000240000001333310756504335012131 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "ident.h" #include "offsets.h" #include "symboltable.h" using std::cout; extern SymbolTable symbolTable; extern Offsets offsets; int varcmp(const void *i1, const void *i2) { if (*((Ident *) i1) < *((Ident *) i2)) return -1; else if (*((Ident *) i1) > *((Ident *) i2)) return 1; else return 0; } int varcmp_offsets(const void *i1, const void *i2) { if (offsets.off(*((Ident *) i1)) < offsets.off(*((Ident *) i2))) return -1; else if (offsets.off(*((Ident *) i1)) > offsets.off(*((Ident *) i2))) return 1; else return 0; } void IdentList::insert(Ident id) { for (iterator i = begin(); i != end(); i++) if (*i == id) return; push_back(id); } void IdentList::insert(IdentList *d) { for (iterator i = d->begin(); i != d->end(); i++) insert(*i); } void IdentList::remove(Ident id) { for (iterator i = begin(); i != end(); i++) if (*i == id) { Ident f = pop_front(); if (id != f) set(i, f); return; } } void IdentList::sort() { Deque::sort(varcmp); } void IdentList::dump() { for (iterator i = begin(); i != end();) { cout << symbolTable.lookupSymbol(*i); if (++i != end()) cout << ","; } } void IdentList::dumplist() { cout << "["; iterator i; for (i = begin(); i != end(); i++) { if (i != begin()) cout << ","; cout << *i; } cout << "]"; } unsigned IdentList::hash() { unsigned h = 1; for (iterator i = begin(); i != end(); i++) h = (h << 1) + *i; return h; } void IdentList::compress() { // sort (by offsets!) and remove duplicates Deque::sort(varcmp_offsets); unsigned n = 0; for (iterator i = begin(); i != end(); i++) if (i+1 == end() || *i != *(i+1)) set(n++, *i); while (n < size()) pop_back(); } IdentList * IdentList::copy() { return (IdentList *) Deque::copy(); } bool equal(IdentList *l1, IdentList *l2) { if (l1 == NULL && l2 == NULL) return true; if (l1 == NULL || l2 == NULL) return false; if (l1->size() != l2->size()) return false; for (IdentList::iterator i = l1->begin(), j = l2->begin(); i != l1->end(); i++, j++) if (*i != *j) return false; return true; } IdentList* ident_union(IdentList *i1, IdentList *i2) // merge sorted identlists into union { if ((!i1 || i1->empty()) && (!i2 || i2->empty())) return NULL; if (!i1) return new IdentList(*i2); if (!i2) return new IdentList(*i1); IdentList *r = new IdentList; Ident *id1 = i1->begin(); Ident *id2 = i2->begin(); while (id1 != i1->end() && id2 != i2->end()) { if (*id1 < *id2) { r->push_back(*id1); id1++; } else if (*id1 > *id2) { r->push_back(*id2); id2++; } else { r->push_back(*id1); id1++; id2++; } } while (id1 != i1->end()) { r->push_back(*id1); id1++; } while (id2 != i2->end()) { r->push_back(*id2); id2++; } return r; } IdentList* intersection(IdentList *i1, IdentList *i2) // make sorted intersection of sorted identlists { if (!i1 || !i2) return NULL; IdentList *r = new IdentList; Ident *id1 = i1->begin(); Ident *id2 = i2->begin(); while (id1 != i1->end() && id2 != i2->end()) { if (*id1 < *id2) id1++; else if (*id1 > *id2) id2++; else { r->push_back(*id1); id1++; id2++; } } if (r->empty()) { delete r; r = NULL; } return r; } IdentList* copy(IdentList *l) { if (l) return new IdentList(*l); else return NULL; } Ident subst(Ident id, IdentList *i1, IdentList *i2) { invariant(i1 && i2 && i1->size() == i2->size()); IdentList::iterator p1, p2; for (p1 = i1->begin(), p2 = i2->begin(); p1!=i1->end(); p1++, p2++) if (*p1==id) return *p2; /* unsigned a = 0, b, c = i1->size(); while (a < c) { b = (c+a)/2; Ident t = i1->get(b); if (offsets.off(t) > offsets.off(id)) c = b; else if (offsets.off(t) < offsets.off(id)) a = b+1; else return i2->get(b); } */ return id; } Ident subst(Ident id1, Ident id2, Ident id3) { if (id1 == id2) return id3; return id1; } IdentList * subst(IdentList *i1, IdentList *i2, IdentList *i3, Ident except) { // map i1 using i2->i3 (but leave 'except' unchanged) invariant(i1 && i2 && i3 && i2->size() == i3->size()); IdentList *res = new IdentList; for (IdentList::iterator j1 = i1->begin(); j1 != i1->end(); j1++) if (*j1 == except) res->push_back(*j1); else res->push_back(subst(*j1, i2, i3)); return res; } bool sameUnivs(Ident id1, Ident id2) // test id1's universes same as id2's { return equal(symbolTable.lookupUnivs(id1), symbolTable.lookupUnivs(id2)); } bool sameListUnivs(IdentList *i1, IdentList *i2) { invariant(i1 && i2 && i1->size() == i2->size()); IdentList::iterator j1,j2; for (j1 = i1->begin(), j2 = i2->begin(); j1 != i1->end(); j1++, j2++) if (!sameUnivs(*j1, *j2)) return false; return true; } mona-1.4/Front/ident.h0000644000414100000240000000323210756504267011577 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __IDENT_H #define __IDENT_H #include "deque.h" typedef int Ident; class IdentList: public Deque { public: IdentList() : Deque() {} IdentList(Ident id) : Deque(id) {} void insert(Ident id); void insert(IdentList *d); void remove(Ident id); void sort(); void dump(); void dumplist(); unsigned hash(); void compress(); IdentList *copy(); }; // operations on sorted IdentLists bool equal(IdentList *l1, IdentList *l2); IdentList *ident_union(IdentList *i1, IdentList *i2); IdentList *intersection(IdentList *i1, IdentList *i2); IdentList *copy(IdentList *l); Ident subst(Ident id, IdentList *i1, IdentList *i2); Ident subst(Ident id1, Ident id2, Ident id3); IdentList *subst(IdentList *i1, IdentList *i2, IdentList *i3, Ident except = -1); bool sameUnivs(Ident i1, Ident i2); bool sameListUnivs(IdentList *i1, IdentList *i2); #endif mona-1.4/Front/lib.cpp0000644000414100000240000001476410756504335011605 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include #include #include "lib.h" #include "symboltable.h" #include "env.h" #include "../GTA/gta.h" using std::cout; extern SymbolTable symbolTable; extern Options options; extern Guide guide; int AutLib::Dir::compare(AutLib::Dir::File *a, AutLib::Dir::File *b) { if (a->hashvalue < b->hashvalue) return -1; else if (a->hashvalue > b->hashvalue) return 1; return strcmp(a->descriptor, b->descriptor); } // AUTOMATON FILE AutLib::Dir::File::File(char *name, Signature *sign, Deque *statespaces) { char *x = new char[10000]; char tmp[1000]; unsigned len; // add name and signature to descriptor sprintf(x, "%s^", name); sign->dump(x+strlen(x)); len = strlen(x); if (options.mode == TREE) { // add guide sprintf(tmp, "^%i", guide.numSs); strcpy(x+len, tmp); len += strlen(tmp); for (unsigned i = 0; i < guide.numSs; i++) { sprintf(tmp, "_%i_%i", guide.muLeft[i], guide.muRight[i]); strcpy(x+len, tmp); len += strlen(tmp); } // add universes sprintf(tmp, "^%i", guide.numUnivs); strcpy(x+len, tmp); len += strlen(tmp); for (unsigned i = 0; i < guide.numUnivs; i++) { sprintf(tmp, "_%s_%i", guide.univPos[i], guide.numUnivSS[i]); strcpy(x+len, tmp); len += strlen(tmp); for (unsigned j = 0; j < guide.numUnivSS[i]; j++) { sprintf(tmp, "_%i", guide.univSS[i][j]); strcpy(x+len, tmp); len += strlen(tmp); } } // add state spaces for (Deque::iterator i = statespaces->begin(); i != statespaces->end(); i++) { sprintf(x+(len++), "^"); for (unsigned j = 0; j < guide.numSs; j++) if ((*i)[j]) { sprintf(tmp, "_%d", j); strcpy(x+len, tmp); len += strlen(tmp); } } } // make hash value hashvalue = 0; char *t = x; while (*t) hashvalue = (hashvalue << 1) + *t++; descriptor = new char[len+1]; strcpy(descriptor, x); delete[] x; filenumber = 0; // set later } AutLib::Dir::File::File(std::istream &s) { char x[1000]; s >> x >> filenumber; hashvalue = 0; char *t = x; while (*t) hashvalue = (hashvalue << 1) + *t++; descriptor = new char[strlen(x)+1]; strcpy(descriptor, x); } void AutLib::Dir::File::store(std::ostream &s) { s << descriptor << " " << filenumber << "\n"; } AutLib::Dir::File::~File() { delete[] descriptor; } // DIRECTORY AutLib::Dir::Dir(char *name, char *src, Deque *dependencies) { dirname = name; sourcename = src; libname = new char[strlen(dirname)+5]; sprintf(libname, "%s/LIB", dirname); // make sure directory is created struct stat buf; if (stat(dirname, &buf)) if (mkdir(dirname, S_IWUSR | S_IRUSR | S_IXUSR)) { cout << "Unable to create directory '" << dirname << "'\n" << "Execution aborted\n"; exit(-1); } // if src newer than LIB then remove all files if (stat(libname, &buf) == 0) { struct stat buf2; for (Deque::iterator i = dependencies->begin(); i != dependencies->end(); i++) { stat(*i, &buf2); if (difftime(buf.st_mtime, buf2.st_mtime) <= 0) { char t[500]; sprintf(t, "/bin/rm %s/*%s %s/LIB", dirname, (options.mode == TREE) ? ".gta" : ".dfa", dirname); system(t); break; } } } // read LIB file std::ifstream s(libname); if (s) { unsigned n; s >> nextFilenumber; s >> n; while (n-- && !s.eof()) files.push_back(new File(s)); } else nextFilenumber = 1; } char * AutLib::Dir::getFileName(char *name, Signature *sign, Deque *statespaces) { // find/create filename + number File *a = new File(name, sign, statespaces); Deque::iterator b; for (b = files.begin(); b != files.end(); b++) if (compare(a, *b) == 0) { delete a; a = *b; break; } if (b == files.end()) { files.push_back(a); a->filenumber = nextFilenumber++; } char *t = new char[strlen(dirname)+20]; sprintf(t, "%s/%i%s", dirname, a->filenumber, (options.mode == TREE) ? ".gta" : ".dfa"); return t; } AutLib::Dir::~Dir() { // store to $MONALIB/source/LIB std::ofstream s(libname); s << nextFilenumber << "\n" << files.size() << "\n"; Deque::iterator i; for (i = files.begin(); i != files.end(); i++) { (*i)->store(s); delete *i; } delete[] dirname; delete[] libname; } // AUTOMATON LIBRARY AutLib::AutLib() { char *s = getenv("MONALIB"); if (s) { monalib = new char[strlen(s)+2]; strcpy(monalib, s); } else { monalib = new char[3]; strcpy(monalib, "."); } strcat(monalib, "/"); } AutLib::~AutLib() { // store changes + clean up Deque

::iterator i; for (i = dirs.begin(); i != dirs.end(); i++) delete *i; delete[] monalib; } void AutLib::openDir(char *src, Deque *dependencies) { // read <$MONALIB>/.lib/LIB if not already done Deque::iterator i; for (i = dirs.begin(); i != dirs.end(); i++) if ((*i)->sourcename == src) return; char *s = src + strlen(src); while (s > src && *(s-1) != '/') s--; char *d = new char[strlen(s)+strlen(monalib)+1]; strcpy(d, monalib); strcat(d, s); if (strlen(s) > 5 && strcmp(s+strlen(s)-5, ".mona") == 0) d[strlen(d)-5] = 0; strcat(d, ".lib"); dirs.push_back(new Dir(d, src, dependencies)); } char * AutLib::getFileName(char *name, char *origin, Signature *sign, Deque *statespaces) { // get or make filenumber + create filename Deque::iterator i; for (i = dirs.begin(); i != dirs.end(); i++) if ((*i)->sourcename == origin) return (*i)->getFileName(name, sign, statespaces); invariant(false); return 0; } bool AutLib::fileExists(char *filename) { // check file exists std::ifstream s(filename); return s != 0; } mona-1.4/Front/lib.h0000644000414100000240000000413010756504267011240 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __LIB_H #define __LIB_H #include #include "ident.h" #include "signature.h" #include "symboltable.h" #include "deque.h" class AutLib { class Dir { public: class File { public: char *descriptor; // unique identifier (predname+sign.+guide+univs.) unsigned hashvalue; // hashed descriptor unsigned filenumber; // automaton file number File(char *name, Signature *sign, Deque *statespaces); File(std::istream &s); ~File(); void store(std::ostream &s); }; char *sourcename; // source file name char *dirname; // $MONALIB/source.lib char *libname; // dirname/LIB unsigned nextFilenumber; // next fresh filenumber Deque files; Dir(char *name, char *src, Deque *dependencies); ~Dir(); int compare(AutLib::Dir::File *a, AutLib::Dir::File *b); char *getFileName(char *name, Signature *sign, Deque *statespaces); void remove(unsigned filenumber); }; public: char *monalib; // value of $MONALIB environment variable Deque dirs; AutLib(); ~AutLib(); void openDir(char *src, Deque *dependencies); char *getFileName(char *name, char *origin, Signature *sign, Deque *statespaces); bool fileExists(char *filename); }; #endif mona-1.4/Front/makeguide.cpp0000644000414100000240000002704510756504335012766 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "untyped.h" extern "C" { #include "../Mem/mem.h" } using std::cout; extern SymbolTable symbolTable; extern int numTypes; Guide_Declaration *guide_declaration = 0; // GTA GUIDE CONSTRUCTION void MonaUntypedAST::makeGTAGuide() { IdentList *univs = symbolTable.allUnivs(); if (numTypes > 0) { // convert types to guide if (!univs || univs->empty()) { cout << "Error: Types declared but no universes (or trees)\n" << "Execution aborted\n"; exit(-1); } if (univs->size() == 1) { // boolean and universe state space must be different Name name = Name("", dummyPos); symbolTable.insertUniv(&name, NULL, true); delete univs; univs = symbolTable.allUnivs(); } guide_declaration = new Guide_Declaration(new GuideFuncList, dummyPos); typedUnivs2guide(univs->size(), univs, 0, ""); } if (guide_declaration) { // guide is declared /*#warning NOT REQUIRING UNIVERSES*/ /* if (!univs || univs->empty()) { cout << "Error: Guide declared but no universes\n" << "Execution aborted\n"; exit(-1); } */ // fill tables unsigned numUnivs = univs->size(); char **univPos = (char **) mem_alloc(sizeof(char *)*numUnivs); char **univName = (char **) mem_alloc(sizeof(char *)*numUnivs); IdentList::iterator id; int i; for (id = univs->begin(), i = 0; id != univs->end(); id++, i++) { univName[i] = symbolTable.lookupSymbol(*id); univPos[i] = symbolTable.lookupPos(*id); } unsigned numSs = guide_declaration->funcList->size(); SsId *muLeft = (SsId *) mem_alloc(sizeof(SsId)*numSs); SsId *muRight = (SsId *) mem_alloc(sizeof(SsId)*numSs); char **ssName = (char **) mem_alloc(sizeof(char *)*numSs); SsKind *ssKind = 0; int *ssType = 0; if (numTypes > 0) { ssKind = (SsKind *) mem_alloc(sizeof(SsKind)*numSs); ssType = (int *) mem_alloc(sizeof(int)*numSs); } GuideFuncList::iterator g; for (g = guide_declaration->funcList->begin(), i = 0; g != guide_declaration->funcList->end(); g++, i++) { muLeft[i] = symbolTable.lookupNumber((*g)->name2); muRight[i] = symbolTable.lookupNumber((*g)->name3); ssName[i] = (*g)->name1->str; if (numTypes > 0) { switch((*g)->kind) { case SS_UNIVHAT: ssKind[i] = gtaSSUNIVHAT; break; case SS_ORHAT: ssKind[i] = gtaSSORHAT; break; case SS_ORLEAF: ssKind[i] = gtaSSORLEAF; break; case SS_AND: ssKind[i] = gtaSSAND; break; case SS_DUMMY: ssKind[i] = gtaSSDUMMY; break; default: ; } Ident sstype = symbolTable.lookupSSType(symbolTable.lookupIdent((*g)->name1)); if (sstype != -1) { char *sstypename = symbolTable.lookupSymbol(sstype); int j; for (j = 0; j < numTypes; j++) if (treetypes[j].name == sstypename) { ssType[i] = j; break; } invariant(j < numTypes); } else ssType[i] = -1; } } makeGuide(numSs, muLeft, muRight, ssName, numUnivs, univPos, univName, ssType, ssKind); if (!checkDisjoint()) { cout << "Illegal guide and universe declarations:\n" << "Universes must have disjoint state spaces\n" << "Execution aborted\n"; exit(-1); } if (!checkAllUsed()) { cout << "Illegal guide and universe declarations:\n" << "All state spaces must be reachable\n" << "Execution aborted\n"; exit(-1); } if (!checkAllCovered()) { cout << "Illegal guide and universe declarations:\n" << "Every infinite path in the guide must belong to a universe\n" << "Execution aborted\n"; exit(-1); } } else { // no guide declared, make default if (!univs || univs->empty()) { // make one universe Name name = Name("", dummyPos); symbolTable.insertUniv(&name, (char *) NULL); delete univs; univs = symbolTable.allUnivs(); } if (univs->size() == 1) { // boolean and universe state space must be different Name name = Name("", dummyPos); symbolTable.insertUniv(&name, NULL, true); delete univs; univs = symbolTable.allUnivs(); } // fill name table unsigned numUnivs = univs->size(); char **univName = (char **) mem_alloc(sizeof(char *)*numUnivs); Ident *id; int u; for (id = univs->begin(), u = 0; id != univs->end(); id++, u++) univName[u] = symbolTable.lookupSymbol(*id); makeDefaultGuide(numUnivs, univName); } delete univs; } // RECURSIVE TYPES -> GUIDE char* MonaUntypedAST::typedUnivs2guide(unsigned num, IdentList *univs, unsigned idx, char *pos) { invariant(num>0); char *ssname; if (num > 1) { // branch ssname = new char[strlen(pos)+4]; sprintf(ssname, "ss-%s", pos); // ss-01101 ssname = symbolTable.insertString(ssname); char *leftpos, *rightpos; GuideFunc *g = makeStateSpace(ssname, pos, &leftpos, &rightpos, SS_UNIVHAT); g->name2 = new Name(typedUnivs2guide((num+1)/2, univs, idx, leftpos), dummyPos); g->name3 = new Name(typedUnivs2guide(num/2, univs, idx+(num+1)/2, rightpos), dummyPos); } else { // make type Ident univId = univs->get(idx); char *univ = symbolTable.lookupSymbol(univId); symbolTable.updateUnivPos(univId, pos); if (strcmp(univ, "") == 0) ssname = makeDummySS(univ); else { Ident typeId = symbolTable.lookupUnivType(univId); ASTVariantList *variants = symbolTable.lookupTypeVariants(typeId); IdentList typeSet(typeId); ssname = variants2guide(variants->size(), variants, 0, &typeSet, typeId, univ, symbolTable.lookupSymbol(typeId), ""); symbolTable.addTypeStatespace(typeId, ssname); Name n(ssname, dummyPos); symbolTable.setSSType(symbolTable.lookupIdent(&n), typeId); } } return ssname; } char* MonaUntypedAST::variants2guide(unsigned num, ASTVariantList *variants, unsigned idx, IdentList *typeSet, Ident typeId, char *univ, char *type, char *pos) { char *ssname; invariant(num>0); if (num > 1) { // branch ssname = new char[strlen(univ)+strlen(type)+strlen(pos)+6]; sprintf(ssname, "ss-%s-%s-%s", univ, type, pos); // ss-U-A-01101 ssname = symbolTable.insertString(ssname); char *leftpos, *rightpos; GuideFunc *g = makeStateSpace(ssname, pos, &leftpos, &rightpos, SS_ORHAT); g->name2 = new Name(variants2guide((num+1)/2, variants, idx, typeSet, typeId, univ, type, leftpos), dummyPos); g->name3 = new Name(variants2guide(num/2, variants, idx+(num+1)/2, typeSet, typeId, univ, type, rightpos), dummyPos); } else { // make variant leaf and start component tree ASTVariant *v = variants->get(idx); if (!v->path) { v->path = new BitList(pos); setVariantPos(symbolTable.lookupTypeNumber(typeId), idx, pos); symbolTable.setTypeReachable(typeId); } ssname = new char[strlen(univ)+strlen(type)+strlen(v->name)+7]; sprintf(ssname, "ss-%s-%s-%s-", univ, type, v->name);// ss-U-A-a1- ssname = symbolTable.insertString(ssname); char *leftpos, *rightpos; GuideFunc *g = makeStateSpace(ssname, "", &leftpos, &rightpos, SS_ORLEAF); unsigned size = v->components ? v->components->size() : 0; g->name2 = new Name(components2guide((size+1)/2, v->components, 0, typeSet, typeId, idx, univ, type, v->name, leftpos), dummyPos); g->name3 = new Name(components2guide(size/2, v->components, (size+1)/2, typeSet, typeId, idx, univ, type, v->name, rightpos), dummyPos); } return ssname; } char* MonaUntypedAST::components2guide(unsigned num, ASTComponentList *components, unsigned idx, IdentList *typeSet, Ident typeId, unsigned variantidx, char *univ, char *type, char *variant, char *pos) { char *ssname; if (num > 1) { // branch ssname = new char[strlen(univ)+strlen(type)+strlen(variant)+strlen(pos)+7]; sprintf(ssname, "ss-%s-%s-%s-%s", univ, type, variant, pos);// ss-U-A-a1-01 ssname = symbolTable.insertString(ssname); char *leftpos, *rightpos; GuideFunc *g = makeStateSpace(ssname, pos, &leftpos, &rightpos, SS_AND); g->name2 = new Name(components2guide((num+1)/2, components, idx, typeSet, typeId, variantidx, univ, type, variant, leftpos), dummyPos); g->name3 = new Name(components2guide(num/2, components, idx+(num+1)/2, typeSet, typeId, variantidx, univ, type, variant, rightpos), dummyPos); } else if (num == 1) { // make new or reuse type ASTComponent *c = components->get(idx); if (!c->path) { c->path = new BitList(pos); setComponentPos(symbolTable.lookupTypeNumber(typeId), variantidx, idx, pos); } Name t = Name(c->type, dummyPos); Ident typeId = symbolTable.lookupIdent(&t); if (symbolTable.lookupType(typeId) != Typename) TypeError("Type name expected", c->pos); ASTVariantList *variants = symbolTable.lookupTypeVariants(typeId); if (!typeSet->exists(typeId)) { // make new typeSet->insert(typeId); ssname = variants2guide(variants->size(), variants, 0, typeSet, typeId, univ, c->type, ""); symbolTable.addTypeStatespace(typeId, ssname); Name n(ssname, dummyPos); symbolTable.setSSType(symbolTable.lookupIdent(&n), typeId); } else { // type already in current universe if (variants->size() > 1) { ssname = new char[strlen(univ)+strlen(c->type)+6]; sprintf(ssname, "ss-%s-%s-", univ, c->type); // ss-U-A- } else { ASTVariant *v = variants->get(0); ssname = new char[strlen(univ)+strlen(c->type)+strlen(v->name)+7]; sprintf(ssname, "ss-%s-%s-%s-", univ, c->type, v->name);// ss-U-A-a1- } ssname = symbolTable.insertString(ssname); } } else // need dummy ssname = makeDummySS(univ); return ssname; } GuideFunc* MonaUntypedAST::makeStateSpace(char *ssname, char *pos, char **leftpos, char **rightpos, SSKind kind) { Name n = Name(ssname, dummyPos); symbolTable.insertStatespace(&n); *leftpos = new char[strlen(pos)+2]; sprintf(*leftpos, "%s0", pos); *leftpos = symbolTable.insertString(*leftpos); *rightpos = new char[strlen(pos)+2]; sprintf(*rightpos, "%s1", pos); *rightpos = symbolTable.insertString(*rightpos); GuideFunc *g = new GuideFunc(new Name(ssname, dummyPos), NULL, NULL, kind); guide_declaration->funcList->push_back(g); return g; } char* MonaUntypedAST::makeDummySS(char *univ) { char *ssname = new char[strlen(univ)+7]; sprintf(ssname, "dummy-%s", univ); ssname = symbolTable.insertString(ssname); if (!symbolTable.exists(ssname)) { Name n = Name(ssname, dummyPos); symbolTable.insertStatespace(&n); guide_declaration->funcList->push_back (new GuideFunc(new Name(ssname, dummyPos), new Name(ssname, dummyPos), new Name(ssname, dummyPos), SS_DUMMY)); } return ssname; } mona-1.4/Front/mona.cpp0000644000414100000240000005752410756504335011772 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* #warning NEW: EXPLICIT RESTRICT PREDICATE #warning NEW: SEPARATE VERIFICATION */ #define _LANGUAGE_C_PLUS_PLUS #include #include #include #include #include #include "env.h" #include "untyped.h" #include "predlib.h" #include "ast.h" #include "offsets.h" #include "code.h" #include "st_dfa.h" #include "st_gta.h" #include "timer.h" #include "lib.h" #include "printline.h" #include "config.h" extern "C" { #include "../Mem/mem.h" } using std::cout; Options options; MonaUntypedAST *untypedAST; SymbolTable symbolTable(1019); PredicateLib predicateLib; Offsets offsets; CodeTable *codeTable; Guide guide; AutLib lib; int numTypes = 0; bool regenerate = false; extern int yyparse(void); extern void loadFile(char *filename); extern Deque source; char *inputFileName = NULL; extern Ident lastPosVar, allPosVar; bool ParseArguments(int argc, char *argv[]) { options.printProgress = true; options.analysis = true; options.optimize = 1; options.reorder = false; //true; switch (argc) { case 1: return false; case 2: if (argv[1][0] == '-') return false; default: for (int i = 1; i < argc - 1; i++) { if (argv[i][0] != '-') return false; if (strcmp(argv[i], "-demo") == 0) options.demo = true; else switch (argv[i][1]) { case 'o': if (sscanf(argv[i]+2, "%u", &options.optimize) != 1) return false; break; case 'x': if (argv[i][2] == 'w') { options.printProgress = false; options.externalWhole = true; options.whole = true; options.analysis = false; } else return false; break; case 'g': options.printProgress = false; switch (argv[i][2]) { case 'w': options.graphvizDFA = true; options.whole = true; options.analysis = false; break; case 'd': options.graphvizDAG = true; options.analysis = false; break; case 's': options.graphvizSatisfyingEx = true; options.analysis = true; break; case 'c': options.graphvizCounterEx = true; options.analysis = true; break; default: return false; } break; default: switch (argv[i][1]) { case 'w': options.whole = true; break; case 'n': options.analysis = false; break; case 'd': options.dump = true; break; case 't': options.time = true; break; case 's': options.statistics = true; break; case 'q': options.printProgress = false; break; case 'c': options.analysis = true; break; case 'e': options.separateCompilation = true; break; case 'i': options.intermediate = true; options.statistics = true; break; case 'f': options.treemodeOutput = true; options.analysis = true; break; case 'h': options.inheritedAcceptance = true; break; case 'u': options.unrestrict = true; break; case 'm': options.alternativeM2LStr = true; break; case 'r': options.reorder = false; break; case 'p': break; // ignore for compatibility default: return false; } if (argv[i][2] != 0) return false; break; } } } inputFileName = argv[argc-1]; return true; } void Usage() { cout << "MONA v" << VERSION << "-" << RELEASE << " for WS1S/WS2S\n" << "Copyright (C) 1997-2008 BRICS\n\n" << "Usage: mona [options] \n\n" << "Options:\n" << " -w Output whole automaton\n" << " -n Don't analyze automaton\n\n" << " -t Print elapsed time\n" << " -s Print statistics\n" << " -i Print intermediate automata (implies -s)\n" << " -d Dump AST, symboltable, and code DAG\n" << " -q Quiet, don't print progress\n\n" << " -e Enable separate compilation\n" << " -oN Code optimization level N (0=none, 1=safe, 2=heuristic) (default 1)\n" // << " -r Disable BDD index reordering\n" << " -f Force normal tree-mode output style\n" << " -m Alternative M2L-Str emulation (v1.3 style)\n" << " -h Inherited acceptance analysis\n" << " -u Unrestrict output automata (create conventional automata)\n\n" << " -gw Output whole automaton in Graphviz format (implies -n -q)\n" << " -gs Output satisfying example tree in Graphviz format (implies -q)\n" << " -gc Output counter-example tree in Graphviz format (implies -q)\n" << " -gd Dump code DAG in Graphviz format (implies -n -q)\n\n" << " -xw Output whole automaton in external format (implies -n -q)\n\n" << "Example: mona -w -t -e foo.mona\n\n" << "The environment variable MONALIB defines the\n" << "directory used for separate-compilation automata.\n\n" << "Full documentation is available at http://www.brics.dk/mona\n"; } RETSIGTYPE cpuLimit(int) { cout << "\n\n-----\n" << "Interactive Demo time exceeded, execution stopped.\n"; exit(-1); SIGRET; } int main(int argc, char *argv[]) { std::set_new_handler(&mem_error); if (!ParseArguments(argc, argv)) { Usage(); exit(-1); } // Disable core dump struct rlimit r_core; r_core.rlim_cur = 0; r_core.rlim_max = 0; setrlimit(RLIMIT_CORE, &r_core); // Set demo limits if (options.demo) { struct rlimit r_cpu, r_as; memlimit = true; r_cpu.rlim_cur = 30; // max 30 secs. r_cpu.rlim_max = 30; setrlimit(RLIMIT_CPU, &r_cpu); r_as.rlim_cur = 20971520; // max 20MB r_as.rlim_max = 20971520; setrlimit(RLIMIT_DATA, &r_as); signal(SIGXCPU, &cpuLimit); } initTimer(); Timer timer_total; timer_total.start(); ///////// PARSING //////////////////////////////////////////////////////// if (options.printProgress) cout << "MONA v" << VERSION << "-" << RELEASE << " for WS1S/WS2S\n" "Copyright (C) 1997-2008 BRICS\n\n" "PARSING\n"; Timer timer_parsing; timer_parsing.start(); loadFile(inputFileName); yyparse(); MonaAST *ast = untypedAST->typeCheck(); lastPosVar = ast->lastPosVar; allPosVar = ast->allPosVar; timer_parsing.stop(); if (options.printProgress) { cout << "Time: "; timer_parsing.print(); } delete untypedAST; if (options.dump) { // Dump AST for main formula, verify formulas, and assertion cout << "Main formula:\n"; (ast->formula)->dump(); Deque::iterator vf; Deque::iterator vt; for (vf = ast->verifyformlist.begin(), vt = ast->verifytitlelist.begin(); vf != ast->verifyformlist.end(); vf++, vt++) { cout << "\n\nFormula " << *vt << ":\n"; (*vf)->dump(); } cout << "\n\nAssertions:\n"; (ast->assertion)->dump(); cout << "\n"; if (lastPosVar != -1) cout << "\nLastPos variable: " << symbolTable.lookupSymbol(lastPosVar) << "\n"; if (allPosVar != -1) cout << "\nAllPos variable: " << symbolTable.lookupSymbol(allPosVar) << "\n"; // Dump ASTs for predicates and macros PredLibEntry *pred = predicateLib.first(); while (pred != NULL) { if (pred->isMacro) cout << "\nMacro '"; else cout << "\nPredicate '"; cout << symbolTable.lookupSymbol(pred->name) << "':\n"; (pred->ast)->dump(); cout << "\n"; pred = predicateLib.next(); } // Dump restrictions if (symbolTable.defaultRestriction1) { cout << "\nDefault first-order restriction (" << symbolTable.lookupSymbol(symbolTable.defaultIdent1) << "):\n"; symbolTable.defaultRestriction1->dump(); cout << "\n"; } if (symbolTable.defaultRestriction2) { cout << "\nDefault second-order restriction (" << symbolTable.lookupSymbol(symbolTable.defaultIdent2) << "):\n"; symbolTable.defaultRestriction2->dump(); cout << "\n"; } Ident id; for (id = 0; id < (Ident) symbolTable.noIdents; id++) { Ident t; ASTForm *f = symbolTable.getRestriction(id, &t); if (f) { cout << "\nRestriction for #" << id << " (" << symbolTable.lookupSymbol(id) << "):"; if (t != -1) cout << " default\n"; else { cout << "\n"; f->dump(); cout << "\n"; } } } } if (options.mode != TREE && (options.graphvizSatisfyingEx || options.graphvizCounterEx || options.inheritedAcceptance)) cout << "Warning: options -gc, -gs, and -h are only used in tree mode\n"; if (options.mode == TREE && options.graphvizDFA) cout << "Warning: option -gw is only used in linear mode\n"; if (options.mode == TREE && (options.dump || options.whole) && !options.externalWhole) printGuide(); ///////// CODE GENERATION //////////////////////////////////////////////// if (options.printProgress) cout << "\nCODE GENERATION\n"; Timer timer_gencode; timer_gencode.start(); // Generate code codeTable = new CodeTable; VarCode formulaCode = ast->formula->makeCode(); VarCode assertionCode = ast->assertion->makeCode(); Deque verifyCode; /* #warning NEW: 'VERIFY' */ for (Deque::iterator i = ast->verifyformlist.begin(); i != ast->verifyformlist.end(); i++) verifyCode.push_back((*i)->makeCode()); // Implicitly assert restrictions for all global variables for (IdentList::iterator i = ast->globals.begin(); i != ast->globals.end(); i++) assertionCode = andList(assertionCode, getRestriction(*i, NULL)); // Restrict assertion if not trivial if (assertionCode.code->kind != cTrue) assertionCode = codeTable->insert (new Code_Restrict(assertionCode, assertionCode.code->pos)); // Add assertion to main formula and to all verify formulas for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) { assertionCode.code->refs++; *i = andList(*i, VarCode(copy(assertionCode.vars), assertionCode.code)); } formulaCode = andList(formulaCode, assertionCode); timer_gencode.stop(); if (options.printProgress) { codeTable->print_statistics(); /* if (options.dump && options.statistics) codeTable->print_sizes(); */ cout << "Time: "; timer_gencode.print(); } ///////// REORDER BDD OFFSETS //////////////////////////////////////////// if (options.reorder >= 1) { Timer timer_reorder; timer_reorder.start(); if (options.printProgress) cout << "\nREORDERING\n"; // reorder using heuristics offsets.reorder(); // regenerate DAG in new codetable CodeTable *oldCodeTable = codeTable, *newCodeTable = new CodeTable; IdentList emptylist; codeTable = newCodeTable; regenerate = true; // force making new nodes VarCode newcode = formulaCode.substCopy(&emptylist, &emptylist); Deque newverifycode; for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) newverifycode.push_back((*i).substCopy(&emptylist, &emptylist)); codeTable->clearSCTable(); regenerate = false; codeTable = oldCodeTable; formulaCode.remove(); for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) (*i).remove(); formulaCode = newcode; verifyCode.reset(); for (Deque::iterator i = newverifycode.begin(); i != newverifycode.end(); i++) verifyCode.push_back(*i); delete oldCodeTable; codeTable = newCodeTable; if (options.printProgress) { codeTable->print_statistics2(); cout << "Time: "; timer_reorder.print(); } } ///////// REDUCTION AND CODE DUMPING ///////////////////////////////////// if (options.optimize >= 1) { if (options.printProgress) cout << "\nREDUCTION\n"; Timer timer_reduction; timer_reduction.start(); // Reduce formulaCode.reduceAll(&verifyCode); timer_reduction.stop(); if (options.printProgress) { codeTable->print_reduction_statistics(); /* if (options.dump && options.statistics) codeTable->print_sizes(); */ cout << "Time: "; timer_reduction.print(); } } if (options.dump) { // Dump symboltable symbolTable.dump(); // Dump code cout << "\nMain formula:\n"; formulaCode.dump(); cout << "\n\n"; Deque::iterator i; Deque::iterator j; for (i = verifyCode.begin(), j = ast->verifytitlelist.begin(); i != verifyCode.end(); i++, j++) { cout << "Formula " << *j << ":\n"; (*i).dump(); cout << "\n\n"; } } if (options.graphvizDAG) { printf("digraph MONA_CODE_DAG {\n" " size = \"7.5,10.5\";\n" " main [shape = plaintext];\n" " main -> L%lx;\n", (unsigned long) formulaCode.code); formulaCode.code->viz(); Deque::iterator i; Deque::iterator j; for (i = verifyCode.begin(), j = ast->verifytitlelist.begin(); i != verifyCode.end(); i++, j++) { printf(" \"%s\" [shape = plaintext];\n" " \"%s\" -> L%lx;\n", *j, *j, (unsigned long) (*i).code); (*i).code->viz(); } formulaCode.unmark(); for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) (*i).unmark(); cout << "}\n"; } ///////// AUTOMATON CONSTRUCTION ///////////////////////////////////////// // Make variable lists Deque *verifytitlelist = ast->verifytitlelist.copy(); if (lastPosVar != -1) ast->globals.remove(lastPosVar); if (allPosVar != -1) ast->globals.remove(allPosVar); ast->globals.sort(); // sort by id (= index) int numVars = ast->globals.size(); int ix = 0; char **vnames = new char*[numVars]; unsigned *offs = new unsigned[numVars]; char *types = new char[numVars]; int **univs = new int*[numVars]; int *trees = new int[numVars]; SSSet *statespaces = new SSSet[numVars]; IdentList sign, freeVars; IdentList::iterator id; for (id = ast->globals.begin(); id != ast->globals.end(); id++, ix++) { statespaces[ix] = stateSpaces(*id); vnames[ix] = symbolTable.lookupSymbol(*id); offs[ix] = offsets.off(*id); sign.push_back(ix); freeVars.push_back(*id); switch (symbolTable.lookupType(*id)) { case VarnameTree: trees[ix] = 1; break; default: trees[ix] = 0; } IdentList *uu = symbolTable.lookupUnivs(*id); if (uu) { unsigned j; univs[ix] = new int[uu->size()+1]; for (j = 0; j < uu->size(); j++) univs[ix][j] = symbolTable.lookupUnivNumber(uu->get(j)); univs[ix][j] = -1; } else univs[ix] = 0; switch (symbolTable.lookupType(*id)) { case Varname0: types[ix] = 0; break; case Varname1: types[ix] = 1; break; default: types[ix] = 2; break; } } if (options.printProgress) cout << "\nAUTOMATON CONSTRUCTION\n"; Timer timer_automaton; timer_automaton.start(); DFA *dfa = 0; Deque dfalist; GTA *gta = 0; Deque gtalist; // Initialize bdd_init(); codeTable->init_print_progress(); if (options.mode != TREE) { // Generate DFAs dfa = formulaCode.DFATranslate(); if (lastPosVar != -1) dfa = st_dfa_lastpos(dfa, lastPosVar); if (allPosVar != -1) dfa = st_dfa_allpos(dfa, allPosVar); for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) { DFA *d = (*i).DFATranslate(); if (lastPosVar != -1) d = st_dfa_lastpos(d, lastPosVar); if (allPosVar != -1) d = st_dfa_allpos(d, allPosVar); dfalist.push_back(d); } } else { // Generate GTAs gta = formulaCode.GTATranslate(); if (allPosVar != -1) gta = st_gta_allpos(gta, allPosVar); for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) { GTA *g = (*i).GTATranslate(); if (allPosVar != -1) g = st_gta_allpos(g, allPosVar); gtalist.push_back(g); } } formulaCode.remove(); for (Deque::iterator i = verifyCode.begin(); i != verifyCode.end(); i++) (*i).remove(); timer_automaton.stop(); if (options.printProgress) { if (options.statistics) cout << "Total automaton construction time: "; else cout << "Time: "; timer_automaton.print(); } delete ast; delete codeTable; ///////// PRINT AUTOMATON //////////////////////////////////////////////// DFA *dfa2 = dfa; GTA *gta2 = gta; Deque *dfalist2 = &dfalist; Deque *gtalist2 = >alist; if (options.whole && !options.externalWhole) cout << "\n"; if (options.unrestrict) { // Unrestrict automata if (options.mode != TREE) { DFA *t = dfaCopy(dfa2); dfaUnrestrict(t); dfa2 = dfaMinimize(t); dfaFree(t); dfalist2 = new Deque; for (Deque::iterator i = dfalist.begin(); i != dfalist.end(); i++) { t = dfaCopy(*i); dfaUnrestrict(t); dfalist2->push_back(dfaMinimize(t)); dfaFree(t); } } else { GTA *t = gtaCopy(gta2); gtaUnrestrict(t); gta2 = gtaMinimize(t); gtaFree(t); gtalist2 = new Deque; for (Deque::iterator i = gtalist.begin(); i != gtalist.end(); i++) { t = gtaCopy(*i); gtaUnrestrict(t); gtalist2->push_back(gtaMinimize(t)); gtaFree(t); } } } if (options.whole) // Print whole automaton if (options.mode != TREE) { if (options.externalWhole) { if (!dfalist.empty()) cout << "Main formula:\n"; DFA *t = dfaCopy(dfa2); st_dfa_replace_indices(t, &sign, &freeVars, false, true); dfaExport(t, 0, numVars, vnames, types); dfaFree(t); Deque::iterator i; Deque::iterator j; for (i = dfalist2->begin(), j = verifytitlelist->begin(); i != dfalist2->end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; t = dfaCopy(*i); st_dfa_replace_indices(t, &sign, &freeVars, false, true); dfaExport(t, 0, numVars, vnames, types); dfaFree(t); } } else if (options.graphvizDFA) { dfaPrintGraphviz(dfa2, numVars, offs); for (Deque::iterator i = dfalist2->begin(); i != dfalist2->end(); i++) dfaPrintGraphviz(*i, numVars, offs); } else { if (!dfalist.empty()) cout << "Main formula:\n"; dfaPrint(dfa2, numVars, vnames, offs); Deque::iterator i; Deque::iterator j; for (i = dfalist2->begin(), j = verifytitlelist->begin(); i != dfalist2->end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; dfaPrint(*i, numVars, vnames, offs); } } } else { if (options.externalWhole) { if (!gtalist.empty()) cout << "Main formula:\n"; GTA *t = gtaCopy(gta2); st_gta_replace_indices(t, &sign, &freeVars, false, true); gtaExport(t, 0, numVars, vnames, types, statespaces, options.inheritedAcceptance); gtaFree(t); Deque::iterator i; Deque::iterator j; for (i = gtalist2->begin(), j = verifytitlelist->begin(); i != gtalist2->end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; t = gtaCopy(*i); st_gta_replace_indices(t, &sign, &freeVars, false, true); gtaExport(t, 0, numVars, vnames, types, statespaces, options.inheritedAcceptance); gtaFree(t); } } else { if (!gtalist.empty()) cout << "Main formula:\n"; gtaPrint(gta2, offs, numVars, vnames, options.inheritedAcceptance); Deque::iterator i; Deque::iterator j; for (i = gtalist2->begin(), j = verifytitlelist->begin(); i != gtalist2->end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; gtaPrint(*i, offs, numVars, vnames, options.inheritedAcceptance); } } } else if (options.analysis && !options.graphvizSatisfyingEx && !options.graphvizCounterEx && options.printProgress) { // Print summary only if (options.mode != TREE) { if (!dfalist.empty()) cout << "Main formula:"; dfaPrintVitals(dfa2); Deque::iterator i; Deque::iterator j; for (i = dfalist2->begin(), j = verifytitlelist->begin(); i != dfalist2->end(); i++, j++) { cout << "\nFormula " << *j << ":"; dfaPrintVitals(*i); } } else { if (!gtalist.empty()) cout << "Main formula:"; gtaPrintTotalSize(gta2); Deque::iterator i; Deque::iterator j; for (i = gtalist2->begin(), j = verifytitlelist->begin(); i != gtalist2->end(); i++, j++) { cout << "\nFormula " << *j << ":"; gtaPrintTotalSize(*i); } } } if (dfa2 != dfa) { dfaFree(dfa2); for (Deque::iterator i = dfalist2->begin(); i != dfalist2->end(); i++) dfaFree(*i); delete dfalist2; } if (gta2 != gta) { gtaFree(gta2); for (Deque::iterator i = gtalist2->begin(); i != gtalist2->end(); i++) gtaFree(*i); delete gtalist2; } ///////// AUTOMATON ANALYSIS ///////////////////////////////////////////// if (options.analysis) { if (options.printProgress) cout << "\nANALYSIS\n"; if (options.mode != TREE) { if (!dfalist.empty()) cout << "Main formula:\n"; dfaAnalyze(dfa, numVars, vnames, offs, types, options.treemodeOutput); Deque::iterator i; Deque::iterator j; for (i = dfalist.begin(), j = verifytitlelist->begin(); i != dfalist.end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; dfaAnalyze(*i, numVars, vnames, offs, types, options.treemodeOutput); } } else { if (numTypes == 0 || options.treemodeOutput) { if (!gtalist.empty()) cout << "Main formula:\n"; gtaAnalyze(gta, numVars, vnames, offs, options.graphvizSatisfyingEx, options.graphvizCounterEx); Deque::iterator i; Deque::iterator j; for (i = gtalist.begin(), j = verifytitlelist->begin(); i != gtalist.end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; gtaAnalyze(*i, numVars, vnames, offs, options.graphvizSatisfyingEx, options.graphvizCounterEx); } } else { if (options.graphvizSatisfyingEx || options.graphvizCounterEx) cout << "Graphviz output of typed trees not implemented.\n"; if (!gtalist.empty()) cout << "Main formula:\n"; gtaTypeAnalyze(gta, numVars, vnames, types, offs, univs, trees); Deque::iterator i; Deque::iterator j; for (i = gtalist.begin(), j = verifytitlelist->begin(); i != gtalist.end(); i++, j++) { cout << "\nFormula " << *j << ":\n"; gtaTypeAnalyze(*i, numVars, vnames, types, offs, univs, trees); } } } } ///////// CLEAN UP /////////////////////////////////////////////////////// if (options.mode != TREE) { dfaFree(dfa); for (Deque::iterator i = dfalist.begin(); i != dfalist.end(); i++) dfaFree(*i); } else { gtaFree(gta); for (Deque::iterator i = gtalist.begin(); i != gtalist.end(); i++) gtaFree(*i); freeGuide(); } delete verifytitlelist; Deque::iterator i; for (i = source.begin(); i != source.end(); i++) delete *i; for (ix = 0; ix < numVars; ix++) { delete[] univs[ix]; mem_free(statespaces[ix]); } delete[] statespaces; delete[] vnames; delete[] offs; delete[] types; delete[] univs; delete[] trees; freeTreetypes(); if (options.statistics) print_statistics(); if (options.time) { timer_total.stop(); cout << "\nTotal time: "; timer_total.print(); print_timing(); } else if (options.printProgress) { timer_total.stop(); cout << "\nTotal time: "; timer_total.print(); } #ifdef MAXALLOCATED cout << "Maximum space allocated: " << (maxallocated+524288)/1048576 << " MB\n"; #endif } mona-1.4/Front/offsets.cpp0000644000414100000240000000261610756504335012501 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "offsets.h" #include /*#warning USING RANDOM ORDERING*/ void Offsets::insert() { offsetMap.push_back(offsetMap.size()); max_offset = offsetMap.size(); } void Offsets::reorder() { ////// reorder offsets using BDD heuristics /////// /* #warning USING RANDOM ORDERING ///////////// test ///////// srandom(time(0)); for (unsigned i=0; i #include "deque.h" class Offsets { public: void insert(); void reorder(); int off(unsigned int id) {assert(id<=max_offset); return offsetMap.get(id);} int maxOffset() {return max_offset;}; protected: Deque offsetMap; unsigned max_offset; }; #endif mona-1.4/Front/parser.ypp0000644000414100000240000004426010756504400012344 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ %{ #include #include #include "untyped.h" #include "env.h" extern MonaUntypedAST *untypedAST; extern Options options; extern char *file; extern bool anyUniverses; extern void loadFile(char *); extern void yyerror(const char *); extern int yylex(); #define POS(p) Pos(p.first_line, p.first_column, file) void check_bits(char *s) { int i; for (i = 0; s[i] != '\0'; i++) if (s[i] != '0' && s[i] != '1') yyerror("parse error"); } %} /* Values */ %union { char *string; int integer; MonaUntypedAST *monaUntypedAST; DeclarationList *declarationList; Declaration *declaration; UntypedExp *untypedExp; ArithExp *arithExp; ParDeclList *parDeclList; BindExpList *bindExpList; BindExp *bindExp; UntypedExpList *untypedExpList; NameList *nameList; Name *name; VarDeclList *varDeclList; GuideFuncList *guideFuncList; GuideFunc *guideFunc; UnivList *univList; Univ *univ; ImportMapList *mapList; VariantList *variantList; ComponentList *componentList; ConstNode *constNode; ConstNodeList *constNodeList; } /* Terminals */ %token tokALL0 tokALL1 tokALL2 tokAND tokARROW tokASSERT %token tokBIIMPL tokCOLON tokCOMMA %token tokCONST tokDEFAULT1 tokDEFAULT2 tokDOT tokEMPTY %token tokEQUAL tokEX0 tokEX1 tokEX2 tokFALSE tokGREATER %token tokGREATEREQ tokGUIDE tokIMPL tokIN tokINTER %token tokINTERVAL tokLBRACE tokLBRACKET tokLESS %token tokLESSEQ tokLET0 tokLET1 tokLET2 %token tokLPAREN tokMACRO tokMAX tokMIN tokMINUS %token tokMODULO tokNOT tokNOTEQUAL tokNOTIN tokOR %token tokPLUS tokPRED tokRBRACE tokRESTRICT %token tokRBRACKET tokUNIVROOT tokRPAREN tokSEMICOLON %token tokSETMINUS tokSLASH tokSTAR tokVERIFY %token tokSUB tokTREE tokTRUE tokUNION tokUNIVERSE tokUP %token tokVAR0 tokVAR1 tokVAR2 tokWHERE tokINCLUDE %token tokIMPORT tokEXPORT tokPREFIX tokM2LSTR tokM2LTREE tokLASTPOS %token tokINSTATESPACE tokEXECUTE tokTYPE tokSOMETYPE tokVARIANT tokSUCC %token tokWS1S tokWS2S tokTREEROOT tokCONSTTREE tokALLPOS %token tokINT tokNAME tokSTRING /* Nonterminal types */ %type start; %type declarations; %type declaration; %type exp where; %type arith_exp; %type par_list; %type defs; %type def; %type set_body non_empty_set_body non_empty_exp_list exp_list; %type universe name_list; %type name; %type name_where_list; %type func_list; %type func; %type univs; %type univ; %type map_list; %type variant_list; %type component_list; %type constnode; %type constnode_list; %type optstring; /* Associativity and precedence */ %nonassoc LOW %nonassoc tokCOLON %right tokBIIMPL %right tokIMPL %left tokOR %left tokAND %nonassoc tokNOT %nonassoc tokIN tokNOTIN tokSUB %nonassoc tokEQUAL tokNOTEQUAL tokGREATER tokGREATEREQ tokLESS tokLESSEQ %nonassoc tokMAX tokMIN %left tokUNION %left tokINTER %left tokSETMINUS %left tokPLUS tokMINUS %left tokSTAR tokSLASH tokMODULO %nonassoc tokDOT tokUP /* Rules */ %% start : header declarations {untypedAST = new MonaUntypedAST($2);} ; header : tokWS1S tokSEMICOLON {options.m2l = false; options.mode = LINEAR;} | tokWS2S tokSEMICOLON {options.m2l = false; options.mode = TREE;} | tokM2LSTR tokSEMICOLON {options.m2l = true; options.mode = LINEAR;} | tokM2LTREE tokSEMICOLON {options.m2l = true; options.mode = TREE;} | /* empty */ {options.m2l = false; options.mode = LINEAR;} ; declarations : declaration declarations {if ($1) $2->push_front($1); $$ = $2;} | declaration {$$ = new DeclarationList(); if ($1) $$->push_front($1);} ; declaration : tokASSERT exp tokSEMICOLON {$$ = new Assertion_Declaration($2, POS(@1));} | tokGUIDE func_list tokSEMICOLON {$$ = new Guide_Declaration($2, POS(@1));} | tokUNIVERSE univs tokSEMICOLON {$$ = new Universe_Declaration($2, POS(@1)); anyUniverses = true;} | tokDEFAULT1 tokLPAREN name tokRPAREN tokEQUAL exp tokSEMICOLON {$$ = new Default_Declaration(vVar1, $3, $6, POS(@1));} | tokDEFAULT2 tokLPAREN name tokRPAREN tokEQUAL exp tokSEMICOLON {$$ = new Default_Declaration(vVar2, $3, $6, POS(@1));} | tokCONST name tokEQUAL arith_exp tokSEMICOLON {$$ = new Constant_Declaration($2, $4, POS(@1));} | tokVAR0 name_where_list tokSEMICOLON {$$ = new Variable_Declaration(vVar0, NULL, $2, POS(@1));} | tokVAR1 universe name_where_list tokSEMICOLON {$$ = new Variable_Declaration(vVar1, $2, $3, POS(@1));} | tokVAR2 universe name_where_list tokSEMICOLON {$$ = new Variable_Declaration(vVar2, $2, $3, POS(@1));} | tokTREE universe name_where_list tokSEMICOLON {$$ = new Variable_Declaration(vTree, $2, $3, POS(@1));} | tokPRED name tokLPAREN par_list tokRPAREN tokEQUAL exp tokSEMICOLON {$$ = new Predicate_Declaration($2, $4, $7, POS(@1));} | tokPRED name tokEQUAL exp tokSEMICOLON {$$ = new Predicate_Declaration($2, new ParDeclList(), $4, POS(@1));} | tokPRED name tokLPAREN tokRPAREN tokEQUAL exp tokSEMICOLON {$$ = new Predicate_Declaration($2, new ParDeclList(), $6, POS(@1));} | tokMACRO name tokLPAREN par_list tokRPAREN tokEQUAL exp tokSEMICOLON {$$ = new Macro_Declaration($2, $4, $7, POS(@1));} | tokMACRO name tokEQUAL exp tokSEMICOLON {$$ = new Macro_Declaration($2, new ParDeclList(), $4, POS(@1));} | tokMACRO name tokLPAREN tokRPAREN tokEQUAL exp tokSEMICOLON {$$ = new Macro_Declaration($2, new ParDeclList(), $6, POS(@1));} | exp tokSEMICOLON {$$ = new Expression_Declaration($1, POS(@1));} | tokVERIFY optstring exp tokSEMICOLON {$$ = new Verify_Declaration($2, $3, POS(@1));} | tokEXECUTE exp tokSEMICOLON {$$ = new Execute_Declaration($2, POS(@1));} | tokINCLUDE tokSTRING tokSEMICOLON {loadFile($2+1); $$ = 0;} | tokLASTPOS name tokSEMICOLON {$$ = new LastPos_Declaration($2, POS(@1));} | tokALLPOS name tokSEMICOLON {$$ = new AllPos_Declaration($2, POS(@1));} | tokTYPE name tokEQUAL variant_list tokSEMICOLON {$$ = new Type_Declaration($2, $4, POS(@1));} ; exp : name {$$ = new UntypedExp_Name($1, POS(@1));} | tokLPAREN exp tokRPAREN {$$ = $2;} | exp tokSUB exp {$$ = new UntypedExp_Sub($1, $3, POS(@2));} | exp tokIN exp {$$ = new UntypedExp_In($1, $3, POS(@2));} | exp tokNOTIN exp {$$ = new UntypedExp_NotIn($1, $3, POS(@2));} | tokMIN exp {$$ = new UntypedExp_Min($2, POS(@1));} | tokMAX exp {$$ = new UntypedExp_Max($2, POS(@1));} | exp tokLESS exp {$$ = new UntypedExp_Less($1, $3, POS(@2));} | exp tokLESSEQ exp {$$ = new UntypedExp_LessEq($1, $3, POS(@2));} | exp tokGREATEREQ exp {$$ = new UntypedExp_GreaterEq($1, $3, POS(@2));} | exp tokGREATER exp {$$ = new UntypedExp_Greater($1, $3, POS(@2));} | exp tokEQUAL exp {$$ = new UntypedExp_Equal($1, $3, POS(@2));} | exp tokNOTEQUAL exp {$$ = new UntypedExp_NotEqual($1, $3, POS(@2));} | exp tokIMPL exp {$$ = new UntypedExp_Impl($1, $3, POS(@2));} | exp tokBIIMPL exp {$$ = new UntypedExp_Biimpl($1, $3, POS(@2));} | exp tokAND exp {$$ = new UntypedExp_And($1, $3, POS(@2));} | exp tokOR exp {$$ = new UntypedExp_Or($1, $3, POS(@2));} | tokNOT exp {$$ = new UntypedExp_Not($2, POS(@1));} | tokUNIVROOT tokLPAREN name tokRPAREN {$$ = new UntypedExp_Root($3, POS(@1));} | tokUNIVROOT {$$ = new UntypedExp_Root(NULL, POS(@1));} | exp tokDOT tokINT {check_bits($3); $$ = new UntypedExp_Dot($1, $3, POS(@2));} | exp tokUP {$$ = new UntypedExp_Up($1, POS(@2));} | tokEX0 name_where_list tokCOLON exp {$$ = new UntypedExp_Ex0($2, $4, POS(@1));} | tokEX1 universe name_where_list tokCOLON exp {$$ = new UntypedExp_Ex1($2, $3, $5, POS(@1));} | tokEX2 universe name_where_list tokCOLON exp {$$ = new UntypedExp_Ex2($2, $3, $5, POS(@1));} | tokALL0 name_where_list tokCOLON exp {$$ = new UntypedExp_All0($2, $4, POS(@1));} | tokALL1 universe name_where_list tokCOLON exp {$$ = new UntypedExp_All1($2, $3, $5, POS(@1));} | tokALL2 universe name_where_list tokCOLON exp {$$ = new UntypedExp_All2($2, $3, $5, POS(@1));} | tokLET0 defs tokIN exp %prec LOW {$$ = new UntypedExp_Let0($2, $4, POS(@1));} | tokLET1 defs tokIN exp %prec LOW {$$ = new UntypedExp_Let1($2, $4, POS(@1));} | tokLET2 defs tokIN exp %prec LOW {$$ = new UntypedExp_Let2($2, $4, POS(@1));} | name tokLPAREN exp_list tokRPAREN {$$ = new UntypedExp_Call($1, $3, POS(@1));} | tokTRUE {$$ = new UntypedExp_True(POS(@1));} | tokFALSE {$$ = new UntypedExp_False(POS(@1));} | tokUNIVROOT tokLPAREN exp tokCOMMA universe tokRPAREN {if (!$5) yyerror("parse error"); $$ = new UntypedExp_RootPred($3, $5, POS(@1));} | tokEMPTY tokLPAREN exp tokRPAREN {$$ = new UntypedExp_EmptyPred($3, POS(@1));} | exp tokPLUS arith_exp tokMODULO exp {$$ = new UntypedExp_PlusModulo($1, $3, $5, POS(@4));} | exp tokMINUS arith_exp tokMODULO exp {$$ = new UntypedExp_MinusModulo($1, $3, $5, POS(@4));} | exp tokPLUS arith_exp {$$ = new UntypedExp_Plus($1, $3, POS(@2));} | exp tokMINUS arith_exp {$$ = new UntypedExp_Minus($1, $3, POS(@2));} | exp tokSTAR arith_exp {$$ = new UntypedExp_Mult($1, $3, POS(@2));} | exp tokSLASH arith_exp {$$ = new UntypedExp_Div($1, $3, POS(@2));} | tokINT {$$ = new UntypedExp_Int(atoi($1), POS(@1));} | tokEMPTY {$$ = new UntypedExp_Empty(POS(@1));} | tokLBRACE set_body tokRBRACE {$$ = new UntypedExp_Set($2, POS(@1));} | exp tokUNION exp {$$ = new UntypedExp_Union($1, $3, POS(@2));} | exp tokINTER exp {$$ = new UntypedExp_Inter($1, $3, POS(@2));} | exp tokSETMINUS exp {$$ = new UntypedExp_Setminus($1, $3, POS(@2));} | tokIMPORT tokLPAREN tokSTRING map_list tokRPAREN {$$ = new UntypedExp_Import($3+1, $4, POS(@1));} | tokEXPORT tokLPAREN tokSTRING tokCOMMA exp tokRPAREN {$$ = new UntypedExp_Export($3+1, $5, POS(@1));} | tokPREFIX tokLPAREN exp tokRPAREN {$$ = new UntypedExp_Prefix($3, POS(@1));} | tokINSTATESPACE tokLPAREN exp tokCOMMA name_list tokRPAREN {$$ = new UntypedExp_InStateSpace($3, $5, POS(@1));} | tokVARIANT tokLPAREN exp tokCOMMA exp tokCOMMA name tokCOMMA name tokRPAREN {$$ = new UntypedExp_Variant($3, $5, $7, $9, POS(@1));} | tokSUCC tokLPAREN exp tokCOMMA name tokCOMMA name tokCOMMA name tokRPAREN {$$ = new UntypedExp_Succ($3, $5, $7, $9, POS(@1));} | tokTREE tokLPAREN exp tokRPAREN {$$ = new UntypedExp_WellFormedTree($3, POS(@1));} | tokTYPE tokLPAREN exp tokCOMMA name tokRPAREN {$$ = new UntypedExp_Type($3, $5, POS(@1));} | tokSOMETYPE tokLPAREN exp tokRPAREN {$$ = new UntypedExp_SomeType($3, POS(@1));} | tokCONSTTREE tokLPAREN exp tokCOMMA name tokCOLON constnode tokRPAREN {$$ = new UntypedExp_ConstTree($3, $5, $7, POS(@1));} | tokTREEROOT tokLPAREN exp tokRPAREN {$$ = new UntypedExp_TreeRoot($3, POS(@1));} | tokRESTRICT tokLPAREN exp tokRPAREN {$$ = new UntypedExp_Restrict($3, POS(@1));} ; arith_exp: arith_exp tokPLUS arith_exp {$$ = new ArithExp_Add($1, $3, POS(@2));} | arith_exp tokMINUS arith_exp {$$ = new ArithExp_Subtr($1, $3, POS(@2));} | arith_exp tokSTAR arith_exp {$$ = new ArithExp_Mult($1, $3, POS(@2));} | arith_exp tokSLASH arith_exp {$$ = new ArithExp_Div($1, $3, POS(@2));} | tokMINUS arith_exp {$$ = new ArithExp_Subtr(new ArithExp_Integer(0, POS(@1)), $2, POS(@2));} | tokINT {$$ = new ArithExp_Integer(atoi($1), POS(@1));} | name {$$ = new ArithExp_Const($1, POS(@1));} | tokLPAREN arith_exp tokRPAREN {$$ = $2;} ; par_list: tokVAR0 name tokCOMMA par_list {$4->push_front(new ParDecl(pPar0, $2, NULL, POS(@2))); $$ = $4;} | tokVAR1 name where tokCOMMA par_list {$5->push_front(new ParDecl(pPar1, $2, $3, POS(@2))); $$ = $5;} | tokVAR2 name where tokCOMMA par_list {$5->push_front(new ParDecl(pPar2, $2, $3, POS(@2))); $$ = $5;} | tokUNIVERSE name tokCOMMA par_list {$4->push_front(new ParDecl(pParU, $2, NULL, POS(@2))); $$ = $4;} | name where tokCOMMA par_list {$4->push_front(new ParDecl(pPar, $1, $2, POS(@1))); $$ = $4;} | tokVAR0 name {$$ = new ParDeclList(); $$->push_front(new ParDecl(pPar0, $2, NULL, POS(@2)));} | tokVAR1 name where {$$ = new ParDeclList(); $$->push_front(new ParDecl(pPar1, $2, $3, POS(@2)));} | tokVAR2 name where {$$ = new ParDeclList(); $$->push_front(new ParDecl(pPar2, $2, $3, POS(@2)));} | tokUNIVERSE name {$$ = new ParDeclList(); $$->push_front(new ParDecl(pParU, $2, NULL, POS(@2)));} | name where {$$ = new ParDeclList(); $$->push_front(new ParDecl(pPar, $1, $2, POS(@1)));} ; defs : def tokCOMMA defs {$3->push_front($1); $$ = $3;} | def {$$ = new BindExpList(); $$->push_front($1);} ; def : name tokEQUAL exp {$$ = new BindExp($1, $3, POS(@2));} ; set_body: non_empty_set_body {$$ = $1;} | /* empty */ {$$ = new UntypedExpList();} ; non_empty_set_body: exp tokCOMMA non_empty_set_body {$3->push_front($1); $$ = $3;} | tokINTERVAL tokCOMMA non_empty_set_body {$3->push_front(new UntypedExp_Interval(POS(@1))); $$ = $3;} | exp {$$ = new UntypedExpList(); $$->push_front($1);} | tokINTERVAL {$$ = new UntypedExpList(); $$->push_front(new UntypedExp_Interval(POS(@1)));} ; exp_list: non_empty_exp_list {$$ = $1;} | /* empty */ {$$ = NULL;} ; non_empty_exp_list: exp tokCOMMA non_empty_exp_list {$3->push_front($1); $$ = $3;} | exp {$$ = new UntypedExpList; $$->push_front($1);} ; universe: tokLBRACKET name_list tokRBRACKET {$$ = $2;} | /* empty */ {$$ = NULL;} ; name : tokNAME {$$ = new Name($1, POS(@1));} ; name_list: name tokCOMMA name_list {$3->push_front($1); $$ = $3;} | name {$$ = new NameList(); $$->push_front($1);} ; name_where_list: name where tokCOMMA name_where_list {$4->push_front(new VarDecl($1, $2, POS(@1))); $$ = $4;} | name where {$$ = new VarDeclList(); $$->push_front(new VarDecl($1, $2, POS(@1)));} ; func_list: func tokCOMMA func_list {$3->push_front($1); $$ = $3;} | func {$$ = new GuideFuncList(); $$->push_front($1);} ; func : name tokARROW tokLPAREN name tokCOMMA name tokRPAREN {$$ = new GuideFunc($1, $4, $6);} ; univs : univ tokCOMMA univs {$3->push_front($1); $$ = $3;} | univ {$$ = new UnivList(); $$->push_front($1);} ; univ : name tokCOLON tokINT {check_bits($3); $$ = new Univ($1, $3, strlen($3));} | name tokCOLON name {$$ = new Univ($1, $3);} | name {$$ = new Univ($1);} ; where : tokWHERE exp {$$ = $2;} | /* empty */ {$$ = NULL;} ; map_list: tokCOMMA name tokARROW name map_list {$5->push_front(new ImportMap($2, $4, POS(@3))); $$ = $5;} | /* empty */ {$$ = new ImportMapList();} ; variant_list: name tokLPAREN component_list tokRPAREN tokCOMMA variant_list {$6->push_front(new Variant($1, $3, POS(@1))); $$ = $6;} | name tokLPAREN tokRPAREN tokCOMMA variant_list {$5->push_front(new Variant($1, NULL, POS(@1))); $$ = $5;} | name tokCOMMA variant_list {$3->push_front(new Variant($1, NULL, POS(@1))); $$ = $3;} | name tokLPAREN component_list tokRPAREN {$$ = new VariantList(); $$->push_front(new Variant($1, $3, POS(@1)));} | name tokLPAREN tokRPAREN {$$ = new VariantList(); $$->push_front(new Variant($1, NULL, POS(@1)));} | name {$$ = new VariantList(); $$->push_front(new Variant($1, NULL, POS(@1)));} ; component_list: name tokCOLON name tokCOMMA component_list {$5->push_front(new Component($1, $3, POS(@1))); $$ = $5;} | name tokCOLON name {$$ = new ComponentList(); $$->push_front(new Component($1, $3, POS(@1)));} ; constnode: name tokLPAREN constnode_list tokRPAREN {$$ = new ConstNode($1, $3, POS(@1));} | name tokLPAREN tokRPAREN {$$ = new ConstNode($1, NULL, POS(@1));} | name {$$ = new ConstNode($1, NULL, POS(@1));} ; constnode_list: constnode tokCOMMA constnode_list {$3->push_front($1); $$ = $3;} | constnode {$$ = new ConstNodeList; $$->push_front($1);} ; optstring: tokSTRING {$$ = $1+1;} | /* empty */ {$$ = 0;} ; mona-1.4/Front/predlib.cpp0000644000414100000240000000610410756504336012446 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include "offsets.h" #include "predlib.h" #include "symboltable.h" extern Offsets offsets; extern SymbolTable symbolTable; void PredicateLib::insert(PredLibEntry *p) { unsigned i = p->name % PREDLIB_SIZE; table[i].push_back(p); } PredicateLib::PredicateLib() { table = new Deque[PREDLIB_SIZE]; } PredicateLib::~PredicateLib() { int i; Deque::iterator j; for (i = 0; i < PREDLIB_SIZE; i++) for (j = table[i].begin(); j != table[i].end(); j++) delete *j; delete[] table; } void PredicateLib::insert(IdentList *formals, IdentList *frees, IdentList *bound, ASTForm *formula, bool isMacro, int name, char *source) { insert(new PredLibEntry(formals, frees, bound, formula, isMacro, name, source)); } PredLibEntry * PredicateLib::lookup(Ident id) { unsigned i = id % PREDLIB_SIZE; PredLibEntry **pp; for (pp = table[i].begin(); pp != table[i].end(); pp++) if ((*pp)->name == id) return *pp; invariant(false); return NULL; } TestResult PredicateLib::testTypes(Ident name, ASTList *acts, int *no) { PredLibEntry *entry = lookup(name); if (entry->formals->size() != acts->size()) return tWrongNoParameters; ASTList::iterator a; IdentList::iterator f; int i; for (f = entry->formals->begin(), a = acts->begin(), i = 1; f != entry->formals->end(); f++, a++, i++) { if (no) *no = i; MonaTypeTag t = symbolTable.lookupType(*f); switch ((*a)->order) { case oTerm1: if (t != Parname1 && t != ParnameU) return tWrongParameterType; break; case oTerm2: if (t != Parname2 && t != ParnameU) return tWrongParameterType; break; case oForm: if (t != Parname0) return tWrongParameterType; break; case oUniv: if (t != ParnameU) return tWrongParameterType; break; } } return tOK; } PredLibEntry* PredicateLib::first() { idx = -1; while (++idx < PREDLIB_SIZE) if ((current = table[idx].begin()) != table[idx].end()) return *current; return NULL; } PredLibEntry* PredicateLib::next() { if (++current != table[idx].end()) return *current; while (++idx < PREDLIB_SIZE) if ((current = table[idx].begin()) != table[idx].end()) return *current; return NULL; } mona-1.4/Front/predlib.h0000644000414100000240000000401010756504270012102 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __PREDLIB_H #define __PREDLIB_H #include "ast.h" #include "signature.h" #include "st_dfa.h" #include "st_gta.h" #include "deque.h" class PredLibEntry { public: PredLibEntry(IdentList *eFormals, IdentList *eFrees, IdentList *eBound, ASTForm *eFormula, bool eIsMacro, int eName, char *eSource) : formals(eFormals), frees(eFrees), bound(eBound), ast(eFormula), isMacro(eIsMacro), name(eName), source(eSource) {} ~PredLibEntry() {delete formals; delete frees; delete bound; delete ast;} IdentList *formals; IdentList *frees; IdentList *bound; ASTForm *ast; bool isMacro; Ident name; char *source; }; enum TestResult { tOK, tWrongNoParameters, tWrongParameterType }; #define PREDLIB_SIZE 113 class PredicateLib { Deque *table; // hashtable Ident -> PredLibEntry void insert(PredLibEntry *); int idx; PredLibEntry **current; public: PredicateLib(); ~PredicateLib(); void insert(IdentList *formals, IdentList *frees, IdentList *bound, ASTForm *formula, bool isMacro, int name, char *source); PredLibEntry *lookup(Ident); TestResult testTypes(Ident name, ASTList *acts, int *no = NULL); PredLibEntry *first(); PredLibEntry *next(); }; #endif mona-1.4/Front/printline.cpp0000644000414100000240000000337710756504336013042 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "printline.h" using std::cout; Pos dummyPos; extern Deque source; extern Deque fileNames; void Pos::printsource() { char *str; int c; size_t t; char temp[77]; if (line == -1) return; for (t = 0; t < fileNames.size(); t++) if (fileName == fileNames.get(t)) break; cout << " '" << fileName << "' line " << line << " column " << col << "\n"; str = source.get(t)->get(line-1); c = col; if (strlen(str) >= 73) { if (col > 73) { for (t = 0; t < 77; t++) { if (str[col - 40 + t] != '\0') temp[t] = str[col - 40 + t]; else break; } temp[t] = '\0'; c = 40; } else { strncpy(temp, str, 77); temp[76] = '\0'; } } else strcpy(temp, str); cout << " " << temp << "\n "; if (c < 77) { for (t = 1; t < (size_t)c; t++) if (t < strlen(temp) && temp[t] == '\t') cout << "\t"; else cout << " "; cout << "^"; } } mona-1.4/Front/printline.h0000644000414100000240000000212310756504270012470 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __PRINTLINE_H #define __PRINTLINE_H #include "deque.h" class FileSource: public DequeGCA {}; class Pos { public: Pos() {line = col = -1; fileName = NULL;} Pos(int l, int c, char *f) : line(l), col(c), fileName(f) {} void printsource(); int line, col; char *fileName; }; extern Pos dummyPos; #endif mona-1.4/Front/reduce.cpp0000644000414100000240000004104010756504336012272 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /*#warning ADD HEURISTICS FOR PRODUCT*/ #include "codetable.h" #include "env.h" #define ENABLE_PROJECT #define ENABLE_LOCAL #define ENABLE_AND extern Options options; extern CodeTable *codeTable; // DAG TRAVERSAL static int phase = 0; void VarCode::reduceAll(Deque *vcl) { unmark(); phase = 1; reduce(); for (Deque::iterator i = vcl->begin(); i != vcl->end(); i++) (*i).reduce(); unmark(); for (Deque::iterator i = vcl->begin(); i != vcl->end(); i++) (*i).unmark(); codeTable->clearSCTable(); #ifdef ENABLE_AND phase = 2; reduce(); for (Deque::iterator i = vcl->begin(); i != vcl->end(); i++) (*i).reduce(); unmark(); for (Deque::iterator i = vcl->begin(); i != vcl->end(); i++) (*i).unmark(); #endif } void VarCode::reduce() { if (!code->mark) { // first time at this node? code->mark = true; switch (phase) { // reduce node case 1: code->reduce1(); // local reductions + projection reduction break; case 2: code->reduce2(); // and reduction break; } if (!code->forwarded.code) { // if not already forwarded... Code *c = codeTable->findEquiv(code); if (c) { // ...but isomorphic to some other node c->refs++; // (because sub-nodes have changed) code->forwarded = VarCode(code->vars.copy(), c); // forward to other } } } if (code->forwarded.code) { // redirect if forwarded VarCode old = *this; vars = subst(code->forwarded.vars, &code->vars, vars); // update vars vars->compress(); code = code->forwarded.code; code->refs++; old.remove(); // remove reference to old node reduce(); // again (so that sub-nodes always have been processed) } invariant(vars->size() == code->vars.size()); invariant(!code->forwarded.code); // no successive forwarding } // GENERIC REDUCTION DUMMIES void Code_c::reduce1() { vc.reduce(); depth = vc.code->depth+1; } void Code_cc::reduce1() { vc1.reduce(); vc2.reduce(); if (vc1.code->depth>vc2.code->depth) depth = vc1.code->depth+1; else depth = vc2.code->depth+1; } // LEAF REDUCTIONS void Code_Eq1::reduce1() { #ifdef ENABLE_LOCAL // p = p --> true if (id1 == id2) { forwarded = codeTable->insert(new Code_True(pos)); codeTable->red_other++; } #endif } void Code_Eq2::reduce1() { #ifdef ENABLE_LOCAL // P = P --> true if (id1 == id2) { forwarded = codeTable->insert(new Code_True(pos)); codeTable->red_other++; } #endif } // PROJECTION REDUCTIONS void Code_Project::reduce1() { Code_c::reduce1(); #ifdef ENABLE_PROJECT // ex x: phi --> phi[y/x] if phi = .. & x=y & .. where x!=y // and y already in all affected export-vars Ident y = findEquality(var, vc); vc.code->clearEqlist(); if (y != -1 && !checkExport(var)) y = -1; /* cancel */ clearEqlist(); if (y != -1) { invariant(y != var); IdentList formals(var), actuals(y); forwarded = vc.substCopy(&formals, &actuals); forwarded.reduce(); } // ex x: phi --> phi if x notin FV(phi) else if (!vc.vars->exists(var)) { vc.code->refs++; forwarded = VarCode(vc.vars->copy(), vc.code); } if (forwarded.code) codeTable->red_proj++; #endif } Ident Code_Project::findEquality(Ident x, VarCode vc) { Ident y = -1; if (!vc.vars->exists(x)) return -1; x = subst(x, vc.vars, &vc.code->vars); if (vc.code->eqlist && vc.code->eqlist->exists(x)) return -1; switch (vc.code->kind) { case cAnd: { Code_And *c = (Code_And *) vc.code; y = findEquality(x, c->vc1); if (y == -1) y = findEquality(x, c->vc2); break; } case cProject: case cRestrict: case cPredCall: { Code_c *c = (Code_c *) vc.code; y = findEquality(x, c->vc); break; } case cEq1: case cEq2: { Code_nn *c = (Code_nn *) vc.code; if (c->id1 == x && c->id2 != x && sameUnivs(c->id1, c->id2)) y = c->id2; else if (c->id2 == x && c->id1 != x && sameUnivs(c->id1, c->id2)) y = c->id1; break; } case cBiimpl: { Code_Biimpl *c = (Code_Biimpl *) vc.code; if (c->vc1.code->kind == cBoolVar && c->vc2.code->kind == cBoolVar) { Code_BoolVar *c1 = (Code_BoolVar *) c->vc1.code; Code_BoolVar *c2 = (Code_BoolVar *) c->vc2.code; if (c1->id == x && c2->id != x) y = c2->id; else if (c2->id == x && c1->id != x) y = c1->id; } break; } default: ; // no equality found } if (y != -1) y = subst(y, &vc.code->vars, vc.vars); if (!vc.code->eqlist) vc.code->eqlist = new IdentList; vc.code->eqlist->insert(x); return y; } void Code::clearEqlist() { if (eqlist) { delete eqlist; eqlist = NULL; } } void Code_c::clearEqlist() { if (eqlist) { delete eqlist; eqlist = NULL; vc.code->clearEqlist(); } } void Code_cc::clearEqlist() { if (eqlist) { delete eqlist; eqlist = NULL; vc1.code->clearEqlist(); vc2.code->clearEqlist(); } } bool Code::checkExport(Ident) { return true; } bool Code_c::checkExport(Ident x) { if (eqlist && eqlist->exists(x)) return true; if (!eqlist) eqlist = new IdentList; eqlist->insert(x); return vc.code->checkExport(subst(x, vc.vars, &vc.code->vars)); } bool Code_cc::checkExport(Ident x) { if (eqlist && eqlist->exists(x)) return true; if (!eqlist) eqlist = new IdentList; eqlist->insert(x); return vc1.code->checkExport(subst(x, vc1.vars, &vc1.code->vars)) && vc2.code->checkExport(subst(x, vc2.vars, &vc2.code->vars)); } bool Code_Export::checkExport(Ident x) { if (eqlist && eqlist->exists(x)) return true; if (!eqlist) eqlist = new IdentList; eqlist->insert(x); if (!vc.code->checkExport(subst(x, vc.vars, &vc.code->vars))) return false; IdentList::iterator i; for (i = freevars.begin(); i != freevars.end(); i++) if (*i == x) return false; // reduction would cause export free vars to change return true; } // LOCAL NEGATION REDUCTIONS void Code_Negate::reduce1() { Code_c::reduce1(); #ifdef ENABLE_LOCAL // ~~X --> X if (vc.code->kind == cNegate) { Code_Negate *c = (Code_Negate *) vc.code; c->vc.code->refs++; forwarded = VarCode(subst(c->vc.vars, &c->vars, vc.vars), c->vc.code); // NEW: fixed subst bug } // ~true --> false else if (vc.code->kind == cTrue) forwarded = codeTable->insert(new Code_False(pos)); // ~false --> true else if (vc.code->kind == cFalse) forwarded = codeTable->insert(new Code_True(pos)); if (forwarded.code) codeTable->red_other++; #endif } // PREDCALL REDUCTION void Code_PredCall::reduce1() { Code_c::reduce1(); /*#warning NEW: REMOVE PREDCALL NODE*/ /* HAS BAD EFFECT ON DAGIFICATION #ifdef ENABLE_LOCAL if (!options.separateCompilation) { vc.code->refs++; forwarded = VarCode(vc.vars->copy(), vc.code); codeTable->red_other++; } #endif */ } // LOCAL PRODUCT REDUCTIONS void Code_And::reduce1() { Code_cc::reduce1(); #ifdef ENABLE_LOCAL // true & X --> X if (vc1.code->kind == cTrue) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } // X & true --> X else if (vc2.code->kind == cTrue) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } // X & false --> false else if (vc2.code->kind == cFalse) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } // false & X --> false else if (vc1.code->kind == cFalse) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } // X & X --> X else if (vc1.code == vc2.code && equal(vc1.vars, vc2.vars)) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } if (forwarded.code) codeTable->red_prod++; #endif } void Code_Or::reduce1() { Code_cc::reduce1(); #ifdef ENABLE_LOCAL // false | X --> X if (vc1.code->kind == cFalse) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } // X | false --> X else if (vc2.code->kind == cFalse) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } // X | true --> true else if (vc2.code->kind == cTrue) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } // true | X --> true else if (vc1.code->kind == cTrue) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } // X | X --> X else if (vc1.code == vc2.code && equal(vc1.vars, vc2.vars)) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } if (forwarded.code) codeTable->red_prod++; #endif } void Code_Impl::reduce1() { Code_cc::reduce1(); #ifdef ENABLE_LOCAL // true => X --> X if (vc1.code->kind == cTrue) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } // X => true --> true else if (vc2.code->kind == cTrue) forwarded = codeTable->insert(new Code_True(pos)); // X => false --> ~X else if (vc2.code->kind == cFalse) { vc1.code->refs++; forwarded = codeTable->insert(new Code_Negate (VarCode(vc1.vars->copy(), vc1.code), pos)); } // false => X --> true else if (vc1.code->kind == cFalse) forwarded = codeTable->insert(new Code_True(pos)); // X => X --> true else if (vc1.code == vc2.code && equal(vc1.vars, vc2.vars)) forwarded = codeTable->insert(new Code_True(pos)); if (forwarded.code) codeTable->red_prod++; #endif } void Code_Biimpl::reduce1() { Code_cc::reduce1(); #ifdef ENABLE_LOCAL // true <=> X --> X if (vc1.code->kind == cTrue) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } // X <=> true --> X else if (vc2.code->kind == cTrue) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } // X <=> false --> ~X else if (vc2.code->kind == cFalse) { vc1.code->refs++; forwarded = codeTable->insert(new Code_Negate (VarCode(vc1.vars->copy(), vc1.code), pos)); } // false <=> X --> ~X else if (vc1.code->kind == cFalse) { vc2.code->refs++; forwarded = codeTable->insert(new Code_Negate (VarCode(vc2.vars->copy(), vc2.code), pos)); } // X <=> X --> true else if (vc1.code == vc2.code && equal(vc1.vars, vc2.vars)) forwarded = codeTable->insert(new Code_True(pos)); if (forwarded.code) codeTable->red_prod++; #endif } // DAG (UN)MARKING void VarCode::unmark() { setmark(2); setmark(0); } void VarCode::setmark(int val) { code->setmark(val); code->sclist.reset(); // reset sclists } void Code::setmark(int val) { mark = val; } void Code_c::setmark(int val) { if (mark != val) { mark = val; vc.setmark(val); } } void Code_cc::setmark(int val) { if (mark != val) { mark = val; vc1.setmark(val); vc2.setmark(val); } } // GLOBAL PRODUCT REDUCTIONS /** void Code::hashconj() { VarCodeList::iterator i; conjhash = kind; if (kind==cNegate || kind==cProject) conjhash = (conjhash << 1) + ((Code_c *) this)->vc.code->kind; if (conj) for (i = conj->begin(); i!=conj->end(); i++) conjhash = conjhash + (unsigned) (*i).code; conjhash = ~conjhash; if (restrconj) for (i = restrconj->begin(); i!=restrconj->end(); i++) conjhash = conjhash + (unsigned) (*i).code; conjhash = ~conjhash; #warning OK TO DO NEGATE/PROJECT TRICKS? ConjNode *cn = codeTable->conjLookup(conjhash, conj, restrconj, this); if (cn) { // try to reuse cout << "*\n"; } else codeTable->conjInsert(new ConjNode(conjhash, conj, restrconj, this)); } **/ void Code::reduce2() { conj = new VarCodeList; conj->insert(vars.copy(), this); } void Code_c::reduce2() { Code::reduce2(); vc.reduce(); /** if (kind!=cRestrict && kind!=cPredCall && kind!=cProject && kind!=cNegate) / * done later * / hashconj(); **/ } void Code_cc::reduce2() { Code::reduce2(); vc1.reduce(); vc2.reduce(); /** hashconj(); **/ } void Code_Restrict::reduce2() { vc.reduce(); VarCodeList::iterator i; restrconj = new VarCodeList; if (vc.code->conj) for (i = vc.code->conj->begin(); i != vc.code->conj->end(); i++) restrconj->insert(subst((*i).vars, &vc.code->vars, vc.vars), (*i).code); if (vc.code->restrconj) for (i = vc.code->restrconj->begin(); i != vc.code->restrconj->end(); i++) restrconj->insert(subst((*i).vars, &vc.code->vars, vc.vars), (*i).code); /** hashconj(); **/ } void Code_PredCall::reduce2() { vc.reduce(); VarCodeList::iterator i; conj = new VarCodeList; restrconj = new VarCodeList; if (vc.code->conj) for (i = vc.code->conj->begin(); i != vc.code->conj->end(); i++) conj->insert(subst((*i).vars, &vc.code->vars, vc.vars), (*i).code); if (vc.code->restrconj) for (i = vc.code->restrconj->begin(); i != vc.code->restrconj->end(); i++) restrconj->insert(subst((*i).vars, &vc.code->vars, vc.vars), (*i).code); /** hashconj(); **/ } void Code_Project::reduce2() { Code_c::reduce2(); // for obscure reasons it is safe to add sublists VarCodeList::iterator i; restrconj = new VarCodeList; if (vc.code->conj) for (i = vc.code->conj->begin(); i != vc.code->conj->end(); i++) conj->insert(subst((*i).vars, &vc.code->vars, vc.vars), (*i).code); if (vc.code->restrconj) for (i = vc.code->restrconj->begin(); i != vc.code->restrconj->end(); i++) restrconj->insert(subst((*i).vars, &vc.code->vars, vc.vars), (*i).code); /** hashconj(); **/ } void Code_Negate::reduce2() { Code_c::reduce2(); // for obscure reasons it is safe to add sublists for negate-project-negate if (vc.code->kind==cProject && ((Code_Project *) vc.code)->vc.code->kind==cNegate) { Code_Project *proj = (Code_Project *) vc.code; Code_Negate *neg = (Code_Negate *) proj->vc.code; VarCodeList::iterator i; restrconj = new VarCodeList; if (neg->vc.code->conj) for (i = neg->vc.code->conj->begin(); i != neg->vc.code->conj->end(); i++) { IdentList *t1 = subst((*i).vars, &neg->vc.code->vars, neg->vc.vars); IdentList *t2 = subst(t1, &proj->vc.code->vars, proj->vc.vars); conj->insert(subst(t2, &vc.code->vars, vc.vars), (*i).code); delete t1; delete t2; } if (neg->vc.code->restrconj) for (i = neg->vc.code->restrconj->begin(); i != neg->vc.code->restrconj->end(); i++) { IdentList *t1 = subst((*i).vars, &neg->vc.code->vars, neg->vc.vars); IdentList *t2 = subst(t1, &proj->vc.code->vars, proj->vc.vars); restrconj->insert(subst(t2, &vc.code->vars, vc.vars), (*i).code); delete t1; delete t2; } } /** hashconj(); **/ } void Code_And::reduce2() { vc1.reduce(); vc2.reduce(); VarCodeList::iterator i; conj = new VarCodeList; restrconj = new VarCodeList; VarCodeList t1, t2; if (vc1.code->conj) for (i = vc1.code->conj->begin(); i != vc1.code->conj->end(); i++) conj->insert(subst((*i).vars, &vc1.code->vars, vc1.vars), (*i).code); if (vc1.code->restrconj) for (i = vc1.code->restrconj->begin(); i != vc1.code->restrconj->end(); i++) restrconj->insert(subst((*i).vars, &vc1.code->vars, vc1.vars), (*i).code); if (vc2.code->conj) for (i = vc2.code->conj->begin(); i != vc2.code->conj->end(); i++) t1.insert(subst((*i).vars, &vc2.code->vars, vc2.vars), (*i).code); if (vc2.code->restrconj) for (i = vc2.code->restrconj->begin(); i != vc2.code->restrconj->end(); i++) t2.insert(subst((*i).vars, &vc2.code->vars, vc2.vars), (*i).code); // X & Y --> X iff Y_conj \sub (X_conj \cup X_restrconj) // and Y_restrconj \sub X_restrconj if (t1.sub(conj, restrconj) && t2.sub(restrconj)) { vc1.code->refs++; forwarded = VarCode(vc1.vars->copy(), vc1.code); } // X & Y --> Y iff X_conj \sub (Y_conj \cup Y_restrconj) // and X_restrconj \sub Y_restrconj else if (conj->sub(&t1, &t2) && restrconj->sub(&t2)) { vc2.code->refs++; forwarded = VarCode(vc2.vars->copy(), vc2.code); } conj->insert(&t1); restrconj->insert(&t2); if (forwarded.code) codeTable->red_prod++; /** hashconj(); **/ } mona-1.4/Front/scanner.lpp0000644000414100000240000002525010756504404012466 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ %a 40235 /* size of transitions accepted */ %o 6000 /* size of output slots accepted */ %option nounput %option never-interactive %{ #include #include #include "untyped.h" #include "parser.h" #include "deque.h" #include "lib.h" #include "printline.h" #include "env.h" #include "../BDD/bdd.h" using std::cout; extern SymbolTable symbolTable; extern AutLib lib; extern Options options; extern YYLTYPE yylloc; void copyString(char*); int get_next_char(char*); void loadFile(char *s); void yyerror(const char *s); #define MYBUFFER_SIZE 1024 class FileInfo { public: unsigned lineno; /* linenumber */ unsigned pos; /* position in line number lineno */ int prevnl; /* previous char was '\n' */ char *filename; /* name of the file */ unsigned number; /* number of the file in the include-chain */ unsigned next; /* pointer into inputbuffer - where to read next char */ unsigned bufferused; /* number of chars read into inputbuffer */ char inputbuffer[MYBUFFER_SIZE]; /* buffer containing inputfile blocks */ FILE *handle; /* file handle */ }; Deque loadStack; /* stack of file info */ Deque *> dependencies; /* list of dependencies */ Deque source; /* list of source-file text */ Deque fileNames; /* list of file names */ Deque currentLine; /* contains the current line being parsed */ Deque currentDir; char *file = ""; unsigned pos = 0; int prevnl = 0; int filenumber = 0; char mybuffer[MYBUFFER_SIZE]; /* input buffer used in YY_INPUT */ int next = 0; int bufferused = 0; #define SETPOS(p) \ yylloc.first_line = yylineno; yylloc.first_column = pos-yyleng-p+1 #define YY_INPUT(buf,result,max_size) result = get_next_char(buf) %} /* Definitions */ name [a-zA-Z0-9_'@\$]+ whitespace [ \t\r\n\f]+ comment #.* numeral [0-9]+ /* Rules */ %x CCOMMENT %% "/*" BEGIN(CCOMMENT); { [^*\n\r]* /* ignore */ "*"+[^*/\n\r]* /* ignore */ [\n\r] /* ignore */ <> yyerror("end-of-file in comment\n"); "*"+"/" BEGIN(INITIAL); } "%" SETPOS(0); return tokMODULO; "&" SETPOS(0); return tokAND; "(" SETPOS(0); return tokLPAREN; ")" SETPOS(0); return tokRPAREN; "*" SETPOS(0); return tokSTAR; "+" SETPOS(0); return tokPLUS; "," SETPOS(0); return tokCOMMA; "-" SETPOS(1); return tokMINUS; "->" SETPOS(0); return tokARROW; "." SETPOS(1); return tokDOT; "..." SETPOS(0); return tokINTERVAL; "/" SETPOS(1); return tokSLASH; ":" SETPOS(0); return tokCOLON; ";" SETPOS(0); return tokSEMICOLON; "<" SETPOS(1); return tokLESS; "<=" SETPOS(1); return tokLESSEQ; "<=>" SETPOS(0); return tokBIIMPL; "=" SETPOS(1); return tokEQUAL; "=>" SETPOS(0); return tokIMPL; ">" SETPOS(1); return tokGREATER; ">=" SETPOS(0); return tokGREATEREQ; "[" SETPOS(0); return tokLBRACKET; "\\" SETPOS(0); return tokSETMINUS; "]" SETPOS(0); return tokRBRACKET; "^" SETPOS(0); return tokUP; "{" SETPOS(0); return tokLBRACE; "|" SETPOS(0); return tokOR; "}" SETPOS(0); return tokRBRACE; "~" SETPOS(1); return tokNOT; "~=" SETPOS(0); return tokNOTEQUAL; "m2l-str" SETPOS(0); return tokM2LSTR; "m2l-tree" SETPOS(0); return tokM2LTREE; "empty" SETPOS(1); return tokEMPTY; "universe" SETPOS(1); return tokUNIVERSE; "union" SETPOS(1); return tokUNION; "inter" SETPOS(1); return tokINTER; "true" SETPOS(1); return tokTRUE; "false" SETPOS(1); return tokFALSE; "in" SETPOS(1); return tokIN; "notin" SETPOS(1); return tokNOTIN; "sub" SETPOS(1); return tokSUB; "all0" SETPOS(1); return tokALL0; "ex0" SETPOS(1); return tokEX0; "all1" SETPOS(1); return tokALL1; "ex1" SETPOS(1); return tokEX1; "all2" SETPOS(1); return tokALL2; "ex2" SETPOS(1); return tokEX2; "var0" SETPOS(1); return tokVAR0; "var1" SETPOS(1); return tokVAR1; "var2" SETPOS(1); return tokVAR2; "let0" SETPOS(1); return tokLET0; "let1" SETPOS(1); return tokLET1; "let2" SETPOS(1); return tokLET2; "guide" SETPOS(1); return tokGUIDE; "const" SETPOS(1); return tokCONST; "pred" SETPOS(1); return tokPRED; "macro" SETPOS(1); return tokMACRO; "assert" SETPOS(1); return tokASSERT; "root" SETPOS(1); return tokUNIVROOT; "tree" SETPOS(1); return tokTREE; "ws1s" SETPOS(1); return tokWS1S; "ws2s" SETPOS(1); return tokWS2S; "min" SETPOS(1); return tokMIN; "max" SETPOS(1); return tokMAX; "where" SETPOS(1); return tokWHERE; "defaultwhere1" SETPOS(1); return tokDEFAULT1; "defaultwhere2" SETPOS(1); return tokDEFAULT2; "include" SETPOS(1); return tokINCLUDE; "import" SETPOS(1); return tokIMPORT; "export" SETPOS(1); return tokEXPORT; "prefix" SETPOS(1); return tokPREFIX; "in_state_space" SETPOS(1); return tokINSTATESPACE; "execute" SETPOS(1); return tokEXECUTE; "lastpos" SETPOS(1); return tokLASTPOS; "allpos" SETPOS(1); return tokALLPOS; "type" SETPOS(1); return tokTYPE; "sometype" SETPOS(1); return tokSOMETYPE; "variant" SETPOS(1); return tokVARIANT; "succ" SETPOS(1); return tokSUCC; "const_tree" SETPOS(1); return tokCONSTTREE; "tree_root" SETPOS(1); return tokTREEROOT; "restrict" SETPOS(1); return tokRESTRICT; "verify" SETPOS(1); return tokVERIFY; \"[^\"\n]*\" {SETPOS(1); yytext[strlen(yytext)-1] = 0; copyString(yytext); return tokSTRING;} {numeral} SETPOS(1); copyString(yytext); return tokINT; {name} SETPOS(1); copyString(yytext); return tokNAME; {whitespace} /* ignore */ {comment} /* ignore */ . yyerror("illegal character"); %% /* Subroutines */ void copyString(char *s) { char *str = new char[strlen(s)+1]; strcpy(str, s); str = symbolTable.insertString(str); yylval.string = str; } void yyerror(const char *s) { cout << "Error in file '" << file << "' near line " << yylineno << ": " << s << "\n" << "Execution aborted\n"; exit(-1); } int yywrap() { unsigned i; /* pop current directory */ delete[] currentDir.pop_back(); /* dependency info */ if (options.separateCompilation) { Deque *d = dependencies.pop_back(); lib.openDir(file, d); delete d; } /* close file */ fclose(yyin); /* done? */ if (loadStack.size() == 0) return -1; /* return to previous file */ FileInfo f = loadStack.pop_back(); yylineno = f.lineno; pos = f.pos; prevnl = f.prevnl; file = f.filename; filenumber = f.number; next = f.next; bufferused = f.bufferused; strncpy(mybuffer, f.inputbuffer, MYBUFFER_SIZE); yyin = f.handle; /* get currentline contents */ currentLine.reset(); for (i = 0; i < strlen(source.get(filenumber-1)->top()); i++) currentLine.push_back((source.get(filenumber-1)->top())[i]); delete[] source.get(filenumber-1)->pop_back(); return 0; } void loadFile(char *s) { unsigned i,n; char *line; char *ss; /* find current directory */ if (!currentDir.empty() && s[0] != '/') { ss = new char[strlen(currentDir.top())+strlen(s)+1]; strcpy(ss, currentDir.top()); } else { ss = new char[strlen(s)+1]; ss[0] = 0; } strcat(ss, s); unsigned t = strlen(ss); while (t > 0 && ss[t-1] != '/') t--; char *cd = new char[t+1]; strncpy(cd, ss, t); cd[t] = 0; currentDir.push_back(cd); if (filenumber > 0) { /* save status for current file on stack */ FileInfo f; f.lineno = yylineno; f.pos = pos; f.prevnl = prevnl; f.filename = file; f.number = filenumber; f.next = next; f.bufferused = bufferused; strncpy(f.inputbuffer, mybuffer, MYBUFFER_SIZE); f.handle = yyin; loadStack.push_back(f); /* store current line source */ line = new char[sizeof(char)*currentLine.size()+1]; line[currentLine.size()] = '\0'; for (n = 0; n < currentLine.size(); n++) line[n] = currentLine.get(n); source.get(filenumber-1)->push_back(line); } /* store info on new file in list */ file = new char[strlen(ss)+1]; strcpy(file, ss); delete[] ss; file = symbolTable.insertString(file); fileNames.push_back(file); source.push_back(new FileSource); /* open file */ for (i = 0; i+1 < loadStack.size(); i++) if (strcmp(loadStack.get(i).filename, file) == 0) yyerror("cyclic include"); if (!(yyin = fopen(file, "r"))) { cout << "Unable to open file '" << file << "'\n" << "Execution aborted\n"; exit(-1); } currentLine.reset(); filenumber++; pos = 0; prevnl = 0; yylineno = 1; next = bufferused = 0; /* find dependencies */ if (options.separateCompilation) { dependencies.push_back(new Deque); for (Deque *>::iterator d = dependencies.begin(); d != dependencies.end(); d++) (*d)->push_back(file); } } int get_next_char(char *buf) { char *line; unsigned n; int c; if (next == bufferused) { /* get a new chunk from the file */ bufferused = fread(mybuffer, 1, MYBUFFER_SIZE, yyin); next = 0; } if (next == bufferused || mybuffer[next] == '\n') { /* move to next line */ line = new char[currentLine.size()+1]; line[currentLine.size()] = '\0'; for (n = 0; n < currentLine.size(); n++) line[n] = currentLine.get(n); source.get(filenumber-1)->push_back(line); currentLine.reset(); } if (next < bufferused) { /* end-of-file not reached yet */ c = mybuffer[next++]; if (prevnl) { prevnl = 0; pos = 0; } pos++; if (c == '\n') prevnl = 1; else currentLine.push_back(c); buf[0] = c; return 1; } else { pos++; return YY_NULL; } } mona-1.4/Front/signature.cpp0000644000414100000240000000424110756504336013026 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "signature.h" #include "offsets.h" extern Offsets offsets; static int sortcmp(const void *i1, const void *i2) { if (*((int *) i1) < *((int *) i2)) return -1; else if (*((int *) i1) > *((int *) i2)) return 1; else return 0; } Signature::Signature() { size = 0; sign = NULL; hashvalue = 0; } Signature::Signature(IdentList &idents) { make(idents); } void Signature::make(IdentList &idents) { size = idents.size(); int *tab1 = new int[size]; int *tab2 = new int[size]; IdentList::iterator i; unsigned int x,y,s; for (i = idents.begin(), x = 0; i != idents.end(); i++, x++) tab1[x] = tab2[x] = offsets.off(*i); qsort((int *) tab2, size, sizeof(int), sortcmp); sign = new int[size]; hashvalue = 0; for (x = 0; x < size; x++) { for (y = 0, s = 0; tab2[y] != tab1[x]; y++) if (y < size && tab2[y] != tab2[y+1]) s++; sign[x] = s; hashvalue = hashvalue*x+sign[x]; } delete[] tab1; delete[] tab2; } Signature::~Signature() { delete[] sign; } void Signature::dump(char *to) { unsigned i; for (i = 0; i < size; i++) to += sprintf(to, "_%i", sign[i]); } int Signature::operator==(const Signature &s) { if (s.hashvalue != hashvalue || s.size != size) return false; unsigned x; for (x = 0; x < size; x++) if (s.sign[x] != sign[x]) return false; return true; } mona-1.4/Front/signature.h0000644000414100000240000000210110756504270012461 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __SIGNATURE_H #define __SIGNATURE_H #include "ident.h" class Signature { public: Signature(); Signature(IdentList &idents); ~Signature(); void make(IdentList &idents); void dump(char *to); int operator==(const Signature &); unsigned size; int *sign; int hashvalue; }; #endif mona-1.4/Front/st_dfa.cpp0000644000414100000240000002357110756504336012274 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "st_dfa.h" #include "printline.h" #include "env.h" #include "offsets.h" #include "timer.h" #include "codetable.h" using std::cout; extern Offsets offsets; extern Options options; extern CodeTable *codeTable; Timer timer_restrict; Timer timer_negation; Timer timer_product; Timer timer_right_quotient; Timer timer_project; Timer timer_minimization; Timer timer_copy; Timer timer_replace_indices; Timer timer_prefix; unsigned num_minimizations = 0; unsigned num_projections = 0; unsigned num_products = 0; unsigned num_copies = 0; unsigned num_replaces = 0; unsigned num_right_quotients = 0; unsigned num_restricts = 0; unsigned num_negations = 0; unsigned num_prefixes = 0; int largest_states = 0, largest_bdd = 0; void update_largest(DFA *a) { if (a->ns > largest_states) largest_states = a->ns; if ((int) bdd_size(a->bddm) > largest_bdd) largest_bdd = bdd_size(a->bddm); } DFA* st_dfa_restrict(DFA *a, Pos &p) { Timer temp; if (options.time) { timer_restrict.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Restrict"; p.printsource(); cout << "\n"; } dfaRestrict(a); num_restricts++; if (options.time) { timer_restrict.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } if (options.intermediate) dfaPrintVerbose(a); /*#warning update_largest(a);*/ return a; } DFA* st_dfa_negation(DFA *a, Pos &p) { Timer temp; if (options.time) { timer_negation.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Negation"; p.printsource(); cout <<"\n"; } dfaNegation(a); num_negations++; if (options.time) { timer_negation.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } if (options.intermediate) dfaPrintVerbose(a); /*#warning update_largest(a);*/ return a; } DFA* st_dfa_product(DFA *a1, DFA *a2, dfaProductType ff, Pos &p) { Timer temp; int a1_ns = a1->ns; int a2_ns = a2->ns; if (options.time) { timer_product.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Product "; switch (ff) { case dfaAND: cout << "&"; break; case dfaOR: cout << "|"; break; case dfaIMPL: cout << "=>"; break; case dfaBIIMPL: cout << "<=>"; break; } p.printsource(); cout << "\n (" << a1_ns << "," << bdd_size(a1->bddm) << ")x(" << a2_ns << "," << bdd_size(a2->bddm) << ") -> "; cout.flush(); } codeTable->begin(); DFA *result = dfaProduct(a1, a2, ff); codeTable->done(); num_products++; if (options.statistics) cout << "(" << result->ns << "," << bdd_size(result->bddm) << ")\n"; if (options.time) { timer_product.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } dfaFree(a1); dfaFree(a2); /*#warning update_largest(result);*/ return result; } DFA* st_dfa_project(DFA *a, Ident i, Pos &p, bool quotient) { Timer temp1, temp2; int a_ns = a->ns; if (options.time) { timer_right_quotient.start(); if (options.statistics) temp1.start(); } if (options.statistics) cout << "Right-quotient\n"; if (quotient) { codeTable->begin(); dfaRightQuotient(a, offsets.off(i)); codeTable->done(); num_right_quotients++; } if (options.time) { timer_right_quotient.stop(); if (options.statistics) { temp1.stop(); cout << " Time: "; temp1.print(); } } if (options.time) { timer_project.start(); if (options.statistics) temp2.start(); } if (options.statistics) { cout << "Projecting #" << i; p.printsource(); cout << "\n (" << a_ns << "," << bdd_size(a->bddm) << ") -> "; cout.flush(); } codeTable->begin(); DFA *result = dfaProject(a, offsets.off(i)); codeTable->done(); num_projections++; if (options.statistics) cout << "(" << result->ns << "," << bdd_size(result->bddm) << ")\n"; if (options.time) { timer_project.stop(); if (options.statistics) { temp2.stop(); cout << " Time: "; temp2.print(); } } dfaFree(a); /*#warning update_largest(result);*/ return result; } DFA* st_dfa_minimization(DFA *a) { Timer temp; int a_ns = a->ns; int a_sz = bdd_size(a->bddm); if (options.time) { timer_minimization.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << " Minimizing (" << a_ns << "," << a_sz << ") -> "; cout.flush(); } codeTable->begin(); DFA *result = dfaMinimize(a); codeTable->done(); num_minimizations++; if (options.statistics) cout << "(" << result->ns << "," << bdd_size(result->bddm) << ")\n"; if (options.time) { timer_minimization.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } dfaFree(a); if (options.intermediate) dfaPrintVerbose(result); update_largest(result); return result; } DFA* st_dfa_copy(DFA *a) { Timer temp; if (options.time) { timer_copy.start(); if (options.statistics) temp.start(); } if (options.statistics) cout << "Copying (" << a->ns << "," << bdd_size(a->bddm) << ")\n"; DFA *result = dfaCopy(a); num_copies++; if (options.time) { timer_copy.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } if (options.intermediate) dfaPrintVerbose(result); /*#warning update_largest(result);*/ return result; } void st_dfa_replace_indices(DFA *a, IdentList *newvars, IdentList *oldvars, bool offnew, bool offold) { if (newvars && oldvars && newvars != oldvars) { invariant(newvars->size() == oldvars->size()); int *indexmap = new int[offsets.maxOffset()]; IdentList::iterator i, j; bool dif = false; for(i = newvars->begin(), j = oldvars->begin(); j != oldvars->end(); i++, j++) { int theold = offold ? offsets.off(*j) : *j; int thenew = offnew ? offsets.off(*i) : *i; indexmap[theold] = thenew; if (theold != thenew) dif = true; } if (dif) { Timer temp; if (options.time) { timer_replace_indices.start(); if (options.statistics) temp.start(); } if (options.statistics) cout << "Replacing indices\n"; dfaReplaceIndices(a, indexmap); num_replaces++; if (options.time) { timer_replace_indices.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } } delete[] indexmap; if (options.intermediate) dfaPrintVerbose(a); } /*#warning update_largest(a);*/ } DFA* st_dfa_prefix(DFA *a, Pos &p) { Timer temp; if (options.time) { timer_prefix.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Prefix"; p.printsource(); cout <<"\n"; } dfaPrefixClose(a); num_prefixes++; if (options.time) { timer_prefix.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } if (options.intermediate) dfaPrintVerbose(a); /*#warning update_largest(a);*/ return a; } DFA* st_dfa_lastpos(DFA *dfa, Ident i) { DFA *t1, *t2; t1 = st_dfa_minimization(st_dfa_product(dfa, dfaLastPos(offsets.off(i)), dfaAND, dummyPos)); t2 = st_dfa_minimization(st_dfa_project(t1, i, dummyPos, false)); /*#warning update_largest(t2);*/ return t2; } DFA* st_dfa_allpos(DFA *dfa, Ident i) { DFA *t1, *t2; t1 = st_dfa_minimization(st_dfa_product(dfa, dfaAllPos(offsets.off(i)), dfaAND, dummyPos)); t2 = st_dfa_minimization(st_dfa_project(t1, i, dummyPos, false)); /*#warning update_largest(t2);*/ return t2; } void print_timing() { cout << "Minimize: "; timer_minimization.print(); cout << "Project: "; timer_project.print(); cout << "Product: "; timer_product.print(); cout << "Copy: " ; timer_copy.print(); cout << "Replace: "; timer_replace_indices.print(); cout << "Right-quotient: "; timer_right_quotient.print(); cout << "Negate: "; timer_negation.print(); if (num_prefixes > 0) { cout << "Prefix: "; timer_prefix.print(); } } void print_statistics() { cout << "\nMinimizations: " << num_minimizations << "\nProjections: " << num_projections << "\nProducts: " << num_products << "\nCopies: " << num_copies << "\nReplaces: " << num_replaces << "\nRight-quotients: " << num_right_quotients << "\nNegations: " << num_negations << "\n"; if (num_prefixes > 0) cout << "Prefixes: " << num_prefixes << "\n"; cout << "\nLargest number of states in a minimized automaton: " << largest_states << ", BDD nodes: " << largest_bdd << "\n"; cout << "Maximum number of automata in memory: " << max_dfa_in_mem+max_gta_in_mem << "\n"; } mona-1.4/Front/st_dfa.h0000644000414100000240000000266110756504270011733 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __ST_DFA_H #define __ST_DFA_H extern "C" { #include "../DFA/dfa.h" } #include "ident.h" #include "printline.h" DFA *st_dfa_restrict(DFA *a, Pos &p); DFA *st_dfa_negation(DFA *a, Pos &p); DFA *st_dfa_product(DFA *a1, DFA *a2, dfaProductType ff, Pos &p); DFA *st_dfa_project(DFA *a, Ident i, Pos &p, bool quotient = true); DFA *st_dfa_minimization(DFA *a); DFA *st_dfa_copy(DFA *a); void st_dfa_replace_indices(DFA *a, IdentList *newvars, IdentList *oldvars, bool offnew = true, bool offold = true); DFA *st_dfa_prefix(DFA *a, Pos &p); DFA *st_dfa_lastpos(DFA *dfa, Ident i); DFA *st_dfa_allpos(DFA *dfa, Ident i); void print_timing(); void print_statistics(); #endif mona-1.4/Front/st_gta.cpp0000644000414100000240000001727010756504336012314 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include "st_gta.h" #include "printline.h" #include "env.h" #include "offsets.h" #include "timer.h" #include "code.h" #include "symboltable.h" #include "codetable.h" using std::cout; extern Offsets offsets; extern Options options; extern SymbolTable symbolTable; extern CodeTable *codeTable; extern Timer timer_restrict; extern Timer timer_negation; extern Timer timer_product; extern Timer timer_right_quotient; extern Timer timer_project; extern Timer timer_minimization; extern Timer timer_copy; extern Timer timer_replace_indices; extern unsigned num_minimizations; extern unsigned num_projections; extern unsigned num_products; extern unsigned num_copies; extern unsigned num_replaces; extern unsigned num_right_quotients; extern unsigned num_negations; extern unsigned num_restricts; extern int largest_states, largest_bdd; void update_largest(GTA *g) { unsigned s; int states = 0, nodes = 0; for (s = 0; s < guide.numSs; s++) { states += g->ss[s].size; nodes += bdd_size(g->ss[s].bddm); } if (states > largest_states) largest_states = states; if (nodes > largest_bdd) largest_bdd = nodes; } void print_stat(GTA *g) { unsigned s; int dfasize = 0, bddsize = 0; for (s = 0; s < guide.numSs; s++) { dfasize += g->ss[s].size; bddsize += bdd_size(g->ss[s].bddm); } cout << "(" << dfasize << "," << bddsize << ")"; } GTA * st_gta_restrict(GTA *g, Pos &p) { Timer temp; if (options.time) { timer_restrict.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Restrict"; p.printsource(); cout << "\n"; } gtaRestrict(g); num_restricts++; if (options.time) { timer_restrict.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } if (options.intermediate) gtaPrintVerbose(g); /*#warning update_largest(g);*/ return g; } GTA * st_gta_negation(GTA *g, Pos &p) { Timer temp; if (options.time) { timer_negation.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Negation"; p.printsource(); cout << "\n"; } gtaNegation(g); num_negations++; if (options.time) { timer_negation.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } if (options.intermediate) gtaPrintVerbose(g); /*#warning update_largest(g);*/ return g; } GTA * st_gta_product(GTA *g1, GTA *g2, gtaProductType ff, Pos &p) { Timer temp; if (options.time) { timer_product.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Product "; switch (ff) { case gtaAND: cout << "&"; break; case gtaOR: cout << "|"; break; case gtaIMPL: cout << "=>"; break; case gtaBIIMPL: cout << "<=>"; break; } p.printsource(); cout << "\n "; print_stat(g1); cout << "x"; print_stat(g2); cout << " -> "; cout.flush(); } codeTable->begin(); GTA *result = gtaProduct(g1, g2, ff); codeTable->done(); num_products++; if (options.statistics) { print_stat(result); cout << "\n"; } if (options.time) { timer_product.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } gtaFree(g1); gtaFree(g2); /*#warning update_largest(result);*/ return result; } GTA * st_gta_project(GTA *g, Ident i, Pos &p, bool quotient) { Timer temp; if (options.time) { timer_project.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Right-quotient\n" << "Projecting #" << i; p.printsource(); cout << "\n "; print_stat(g); cout << " -> "; cout.flush(); } codeTable->begin(); GTA *result = gtaQuotientAndProject(g, offsets.off(i), quotient); codeTable->done(); num_projections++; num_right_quotients++; if (options.statistics) { print_stat(result); cout << "\n"; } if (options.time) { timer_project.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } gtaFree(g); /*#warning update_largest(result);*/ return result; } GTA * st_gta_minimization(GTA *g) { Timer temp; if (options.time) { timer_minimization.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << " Minimizing "; print_stat(g); cout << " -> "; cout.flush(); } codeTable->begin(); GTA *result = gtaMinimize(g); codeTable->done(); num_minimizations++; if (options.statistics) { print_stat(result); cout << "\n"; } if (options.time) { timer_minimization.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } gtaFree(g); if (options.intermediate) gtaPrintVerbose(result); update_largest(result); return result; } GTA * st_gta_copy(GTA *g) { Timer temp; if (options.time) { timer_copy.start(); if (options.statistics) temp.start(); } if (options.statistics) { cout << "Copying "; print_stat(g); cout << "\n"; } GTA *result = gtaCopy(g); num_copies++; if (options.time) { timer_copy.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } /*#warning update_largest(result);*/ return result; } void st_gta_replace_indices(GTA *g, IdentList *newvars, IdentList *oldvars, bool offnew, bool offold) { if (newvars && oldvars && newvars != oldvars) { invariant(newvars->size() == oldvars->size()); unsigned *indexmap = new unsigned[offsets.maxOffset()]; IdentList::iterator i, j; bool dif = false; for(i = newvars->begin(), j = oldvars->begin(); j != oldvars->end(); i++, j++) { int theold = offold ? offsets.off(*j) : *j; int thenew = offnew ? offsets.off(*i) : *i; indexmap[theold] = thenew; if (theold != thenew) dif = true; } if (dif) { Timer temp; if (options.time) { timer_replace_indices.start(); if (options.statistics) temp.start(); } if (options.statistics) cout << "Replacing indices\n"; gtaReplaceIndices(g, indexmap); num_replaces++; if (options.time) { timer_replace_indices.stop(); if (options.statistics) { temp.stop(); cout << " Time: "; temp.print(); } } } delete[] indexmap; } /*#warning update_largest(g);*/ } GTA * st_gta_allpos(GTA *gta, Ident i) { GTA *t1, *t2; IdentList *u = symbolTable.allRealUnivs(); SSSet set = stateSpaces(u); delete u; t1 = st_gta_minimization(st_gta_product(gta, gtaAllPos(offsets.off(i), set), gtaAND, dummyPos)); t2 = st_gta_minimization(st_gta_project(t1, i, dummyPos, false)); /*#warning update_largest(t2);*/ return t2; } mona-1.4/Front/st_gta.h0000644000414100000240000000246610756504270011757 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __ST_GTA_H #define __ST_GTA_H extern "C" { #include "../GTA/gta.h" } #include "ident.h" #include "printline.h" GTA *st_gta_restrict(GTA *g, Pos &p); GTA *st_gta_negation(GTA *g, Pos &p); GTA *st_gta_product(GTA *g1, GTA *g2, gtaProductType ff, Pos &p); GTA *st_gta_project(GTA *a, Ident i, Pos &p, bool quotient = true); GTA *st_gta_minimization(GTA *g); GTA *st_gta_copy(GTA *g); void st_gta_replace_indices(GTA *a, IdentList *newvars, IdentList *oldvars, bool offnew = true, bool offold = true); GTA *st_gta_allpos(GTA *gta, Ident i); #endif mona-1.4/Front/str.h0000644000414100000240000000311210756504270011273 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __STRING_H #define __STRING_H #include #include #include class String { struct srep { char *s; int n; srep() {n=1;} }; srep *p; public: String(const char *s) { p = new srep; p->s = new char[strlen(s)+1]; strcpy(p->s, s); } String(const String &s) { s.p->n++; p = s.p; } String(const int i) { p = new srep; p->s = new char[12]; sprintf(p->s, "%d", i); } friend String &operator+(const String &s1, const String &s2) { char t[1000]; strcpy(t, s1.p->s); strcat(t, s2.p->s); return *(new String(t)); } friend std::ostream &operator<<(std::ostream &o, const String &s) { return o << s.p->s; } ~String() { if (--p->n == 0) { delete[] p->s; delete p; } } }; #endif mona-1.4/Front/symboltable.cpp0000644000414100000240000003132410756504336013344 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "symboltable.h" #include "offsets.h" #include "code.h" using std::cout; extern Offsets offsets; extern void TypeError(String, Pos &); Ident SymbolTable::insert(Entry *e) { declarationTable[hash(e->string)].push_back(e); identMap.push_back(e); offsets.insert(); return noIdents++; } void SymbolTable::remove(int idx) // must be at end of Deque { declarationTable[idx].pop_back(); // don't delete and remove from indentMap since the entry // might still be in use } SymbolTable::Entry& SymbolTable::lookup(Name *name) { int idx = hash(name->str); for (Entry **e = declarationTable[idx].end(); e != declarationTable[idx].begin(); e--) if ((!(*(e-1))->string && !name->str) || ((*(e-1))->string && name->str && strcmp((*(e-1))->string, name->str) == 0)) return **(e-1); TypeError("'" + String(name->str) + "' not declared", name->pos); exit(-1); // avoid compiler warning } void SymbolTable::check(Name *name) { int idx = hash(name->str); for (Entry **e = declarationTable[idx].begin(); e != declarationTable[idx].end(); e++) if ((*e)->string && name->str && strcmp((*e)->string, name->str) == 0) TypeError("'" + String(name->str) + "' already declared", name->pos); } int SymbolTable::hash(char *s) { return (long) s % size; } SymbolTable::SymbolTable(int s) { size = s; noIdents = 0; defaultRestriction1 = NULL; defaultRestriction2 = NULL; declarationTable = new Deque[size]; symbols = new Deque[size]; } SymbolTable::~SymbolTable() { delete[] declarationTable; Deque::iterator l; for (l = identMap.begin(); l != identMap.end(); l++) delete *l; unsigned i; Deque::iterator j; for (i = 0; i < size; i++) for (j = symbols[i].begin(); j != symbols[i].end(); j++) delete[] *j; delete[] symbols; } char * SymbolTable::insertString(char *str) { char *t = str; unsigned idx = 0; while (*t) idx = (idx << 1) + *t++; idx = idx % size; char **s; for (s = symbols[idx].begin(); s != symbols[idx].end(); s++) if (strcmp(str, *s) == 0) { delete[] str; // string used before return *s; } symbols[idx].push_back(str); // string never used before return str; } Ident SymbolTable::insertPred(Name *name) { check(name); return insert(new PredEntry(name->str, noIdents)); } Ident SymbolTable::insertVar(Name *name, MonaTypeTag type, IdentList *univs, bool local, bool implicit) { if (local) localStack.push_back(hash(name->str)); else check(name); return insert(new VarEntry(name->str, type, noIdents, univs, implicit)); } Ident SymbolTable::insertUniv(Name *name, char *pos, bool dummy) { allUnivIds.push_back(noIdents); // automatically sorted if (!dummy) allRealUnivIds.push_back(noIdents); // automatically sorted check(name); return insert(new UnivEntry(name->str, noIdents, allUnivIds.size()-1, pos)); } Ident SymbolTable::insertUniv(Name *name, Ident type) { allUnivIds.push_back(noIdents); // automatically sorted allRealUnivIds.push_back(noIdents); // automatically sorted check(name); return insert(new UnivEntry(name->str, noIdents, allUnivIds.size()-1, type)); } Ident SymbolTable::insertConst(Name *name, int value) { check(name); return insert(new ConstEntry(name->str, noIdents, value)); } Ident SymbolTable::insertStatespace(Name *name) { check(name); statespaceIds.push_back(noIdents); return insert(new StateSpaceEntry(name->str, noIdents, noSS++)); } Ident SymbolTable::insertType(Name *name) { check(name); return insert(new TypeEntry(name->str, noIdents)); } void SymbolTable::setTypeVariants(Ident ident, ASTVariantList *variants) { ((TypeEntry *) (identMap.get(ident)))->variants = variants; } void SymbolTable::setTypeNumber(Ident ident, int number) { ((TypeEntry *) (identMap.get(ident)))->number = number; } void SymbolTable::setTypeReachable(Ident ident) { ((TypeEntry *) (identMap.get(ident)))->reached = true; } void SymbolTable::setSSType(Ident ident, Ident type) { ((StateSpaceEntry *) (identMap.get(ident)))->type = type; } Ident SymbolTable::insertFresh(MonaTypeTag type, IdentList *univs, bool implicit) { char *n = new char[10]; sprintf(n, "", noIdents); n = insertString(n); Name dummy = Name(n, dummyPos); return insertVar(&dummy, type, univs, false, implicit); } void SymbolTable::openLocal() { localStack.push_back(-1); } void SymbolTable::closeLocal() { int i; while ((i = localStack.pop_back()) != -1) remove(i); } Ident SymbolTable::lookupIdent(Name *name) { return lookup(name).ident; } char* SymbolTable::lookupSymbol(Ident ident) { char *res = (identMap.get(ident))->string; return res; } MonaTypeTag SymbolTable::lookupType(Ident ident) { return (identMap.get(ident))->monaTypeTag; } MonaTypeTag SymbolTable::lookupType(Name *name) { return lookup(name).monaTypeTag; } Ident SymbolTable::lookupStatespaceId(int number) { return statespaceIds.get(number); } int SymbolTable::lookupOrder(Ident ident) { switch ((identMap.get(ident))->monaTypeTag) { case Varname0: case Parname0: return 0; case Varname1: case Parname1: return 1; case Varname2: case Parname2: return 2; case VarnameTree: return 3; default: return -1; } } int SymbolTable::lookupValue(Name *name) { return ((ConstEntry &) lookup(name)).value; } int SymbolTable::lookupNumber(Name *name) { return ((StateSpaceEntry &) lookup(name)).number; } int SymbolTable::lookupNumber(Ident ident) { return ((StateSpaceEntry *) identMap.get(ident))->number; } int SymbolTable::lookupUnivNumber(Ident ident) { return ((UnivEntry *) identMap.get(ident))->number; } char* SymbolTable::lookupPos(Ident ident) { return ((UnivEntry *) identMap.get(ident))->pos; } Ident SymbolTable::lookupUnivType(Ident ident) { return ((UnivEntry *) identMap.get(ident))->type; } ASTVariantList* SymbolTable::lookupTypeVariants(Ident ident) { return ((TypeEntry *) identMap.get(ident))->variants; } int SymbolTable::lookupTypeNumber(Ident ident) { return ((TypeEntry *) identMap.get(ident))->number; } bool SymbolTable::lookupTypeReachable(Ident ident) { return ((TypeEntry *) (identMap.get(ident)))->reached; } IdentList* SymbolTable::lookupUnivIdents(NameList &names) { IdentList *idents = new IdentList; NameList::iterator i; for (i = names.begin(); i != names.end(); i++) { Entry &e = lookup(*i); switch (e.monaTypeTag) { case Univname: case Varname1: case Varname2: case VarnameTree: case Parname1: case Parname2: case ParnameU: case Statespacename: idents->push_back(e.ident); // vars are substituted later break; default: TypeError("Cannot inherit universes from '" + String((*i)->str) + "'", (*i)->pos); } } return idents; } IdentList* SymbolTable::lookupUnivs(Ident ident) { return ((VarEntry *) identMap.get(ident))->universes; } ASTForm* SymbolTable::lookupRestriction(Ident ident) { return ((VarEntry *) identMap.get(ident))->restriction; } bool SymbolTable::lookupImplicit(Ident ident) { return ((VarEntry *) identMap.get(ident))->implicit; } IdentList* SymbolTable::lookupTypeStatespaces(Ident ident) { return new IdentList(((TypeEntry *) identMap.get(ident))->statespaces); } Ident SymbolTable::lookupSSType(Ident ident) { return ((StateSpaceEntry *) identMap.get(ident))->type; } bool SymbolTable::exists(char *str) { int idx = hash(str); for (Entry **e = declarationTable[idx].end(); e != declarationTable[idx].begin(); e--) if ((!(*(e-1))->string && !str) || ((*(e-1))->string && str && strcmp((*(e-1))->string, str) == 0)) return true; return false; } ASTForm* SymbolTable::getRestriction(Ident ident, Ident *formal) { VarEntry *e = (VarEntry *) identMap.get(ident); ASTForm *f; switch (e->monaTypeTag) { case Varname0: case Varname1: case Varname2: case Parname0: case Parname1: case Parname2: case ParnameU: *formal = -1; // assume default restriction not needed f = e->restriction; if (!f && !e->implicit && e->string) { // return default restriction for explicit variables switch (e->monaTypeTag) { case Parname1: case Varname1: f = defaultRestriction1; *formal = defaultIdent1; break; case Parname2: case Varname2: f = defaultRestriction2; *formal = defaultIdent2; break; default: ; // should not occur } } break; default: // the rest can never have restrictions f = 0; break; } return f; } ASTForm* SymbolTable::getDefault1Restriction(Ident *formal) { *formal = defaultIdent1; return defaultRestriction1; } ASTForm* SymbolTable::getDefault2Restriction(Ident *formal) { *formal = defaultIdent2; return defaultRestriction2; } IdentList* SymbolTable::allUnivs() { return new IdentList(allUnivIds); } IdentList* SymbolTable::allRealUnivs() { if (allRealUnivIds.empty()) return 0; else return new IdentList(allRealUnivIds); } void SymbolTable::updateRestriction(Ident ident, ASTForm *restriction) { VarEntry *e = (VarEntry *) identMap.get(ident); e->restriction = restriction; // (don't delete old restriction) } void SymbolTable::updateUnivPos(Ident ident, char *pos) { ((UnivEntry *) identMap.get(ident))->pos = pos; } void SymbolTable::addTypeStatespace(Ident ident, char *ssname) { Name n(ssname, dummyPos); ((TypeEntry *) identMap.get(ident))->statespaces.insert(lookupIdent(&n)); } void SymbolTable::checkUniqueness(NameList &names) { NameList::iterator i, j; for (i = names.begin(); i != names.end(); i++) for (j = names.begin(); j != i; j++) if ((*i)->str && (*j)->str && strcmp((*i)->str, (*j)->str) == 0) TypeError("'" + String((*i)->str) + "' already declared", (*i)->pos); } void SymbolTable::setDefaultRestriction(MonaTypeTag type, ASTForm *f, Ident id) { switch (type) { case Varname1: defaultRestriction1 = f; defaultIdent1 = id; break; case Varname2: defaultRestriction2 = f; defaultIdent2 = id; break; default: ; } } void SymbolTable::dump() { cout << "\nSymbol table:\n" << "id offset name type statespaces\n" << "---------------------------------------------------------------\n"; bool anyTypes = false; Ident id; for (id = 0; id < (signed) noIdents; id++) { Entry *e = identMap.get(id); char *type; switch (e->monaTypeTag) { case Varname0: type = "var0"; break; case Varname1: type = "var1"; break; case Varname2: type = "var2"; break; case VarnameTree: type = "tree"; break; case Parname0: type = "par0"; break; case Parname1: type = "par1"; break; case Parname2: type = "par2"; break; case ParnameU: type = "par univ"; break; case Univname: type = "univ"; break; case Predname: type = "pred/macro"; break; case Constname: type = "const"; break; case Statespacename: type = "statespace"; break; case Typename: type = "type"; anyTypes = true; break; default: invariant(false); } printf("#%-5i @%-5i %-20s %-12s", id, offsets.off(id), e->string, type); if ((e->monaTypeTag==Varname1 || e->monaTypeTag==Varname2)) dumpStateSpaces(id); /*#warning NEW: DUMPING STATESPACE INFO*/ printf("\n"); } if (anyTypes) { cout << "\nTypes:\n"; for (id = 0; id < (signed) noIdents; id++) { Entry *e = identMap.get(id); if (e->monaTypeTag == Typename) { cout << " " << e->string << "="; ((TypeEntry *) e)->variants->dump(); cout << "\n"; } } cout << "\nUniverses:\n"; for (id = 0; id < (signed) noIdents; id++) { Entry *e = identMap.get(id); if (e->monaTypeTag == Univname) { cout << " " << e->string << "[" << ((UnivEntry *) e)->pos << "]"; if (strcmp(e->string, "")!=0) cout << ":" << lookupSymbol(((UnivEntry *) e)->type); cout << "\n"; } } } } mona-1.4/Front/symboltable.h0000644000414100000240000001442410756504270013010 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __SYMBOLTABLE_H #define __SYMBOLTABLE_H #include "deque.h" #include "ast.h" #include "printline.h" #include "ident.h" class Name { public: Name() {} // dummy Name(char *s, Pos p) : str(s), pos(p) {} Name(const Name& n) : str(n.str), pos(n.pos) {} char *str; Pos pos; }; class NameList: public DequeGC {}; enum MonaTypeTag { Varname0, Varname1, Varname2, VarnameTree, Parname0, Parname1, Parname2, ParnameU, Univname, Predname, Constname, Statespacename, Typename }; class SymbolTable { class Entry { public: Entry() {} // dummy Entry(char *s, MonaTypeTag t, Ident i) : string(s), monaTypeTag(t), ident(i) {} virtual ~Entry() {}; char *string; MonaTypeTag monaTypeTag; Ident ident; }; class VarEntry: public Entry { public: VarEntry(char *s, MonaTypeTag t, Ident i, IdentList *u, bool f) : Entry(s, t, i), universes(u), restriction(NULL), implicit(f) {} ~VarEntry() {delete universes; delete restriction;} IdentList *universes; // always sorted set! ASTForm *restriction; bool implicit; // (only explicit variables can get default restriction) }; class ConstEntry: public Entry { public: ConstEntry(char *s, Ident i, int v) : Entry(s, Constname, i), value(v) {} int value; }; class PredEntry: public Entry { public: PredEntry(char *s, Ident i) : Entry(s, Predname, i) {} }; class StateSpaceEntry: public Entry { public: StateSpaceEntry(char *s, Ident i, int v) : Entry(s, Statespacename, i), number(v), type(-1) {} int number; Ident type; // -1 if not a type root }; class UnivEntry: public Entry { public: UnivEntry(char *s, Ident i, int n, char *p) : Entry(s, Univname, i), number(n), pos(p) {} UnivEntry(char *s, Ident i, int n, Ident t) : Entry(s, Univname, i), number(n), pos(0), type(t) {} int number; char *pos; Ident type; /* only applicable if using types */ }; class TypeEntry: public Entry { public: TypeEntry(char *s, Ident i) : Entry(s, Typename, i), variants(0), number(-1), reached(false) {} ~TypeEntry() {delete variants;} ASTVariantList *variants; int number; bool reached; IdentList statespaces; }; Ident insert(Entry*); void remove(int idx); // must be last-in-first-out order Entry &lookup(Name*); void check(Name*); int hash(char*); Deque *symbols; // hashtable of symbols Deque *declarationTable; // hashtable String->Entry Deque localStack; // stack of hashtable indexes (-1 sentinel) Deque identMap; // map Ident->Entry IdentList allUnivIds; // all universe Idents, sorted IdentList allRealUnivIds; // allUnivIds except dummy IdentList statespaceIds; // all statespace IDs in order unsigned size; // hashtable array size public: SymbolTable(int size); ~SymbolTable(); char *insertString(char *); Ident insertPred(Name*); Ident insertVar(Name*, MonaTypeTag, IdentList *univs, bool local = false, bool implicit = false); Ident insertUniv(Name*, char *pos, bool dummy = false); Ident insertUniv(Name*, Ident type); Ident insertConst(Name*, int value); Ident insertStatespace(Name*); Ident insertType(Name*); void setTypeVariants(Ident, ASTVariantList*); void setTypeNumber(Ident, int); void setTypeReachable(Ident); void setSSType(Ident, Ident); Ident insertFresh(MonaTypeTag t, IdentList *univs = NULL, bool implicit = true); void openLocal(); void closeLocal(); Ident lookupIdent(Name*); char *lookupSymbol(Ident); MonaTypeTag lookupType(Ident); MonaTypeTag lookupType(Name*); Ident lookupStatespaceId(int number); int lookupOrder(Ident); int lookupValue(Name*); int lookupNumber(Name*); int lookupNumber(Ident ident); int lookupDepth(Ident); IdentList *lookupUnivIdents(NameList&); IdentList *lookupUnivs(Ident); ASTForm *lookupRestriction(Ident); bool lookupImplicit(Ident); int lookupUnivNumber(Ident); char *lookupPos(Ident); Ident lookupUnivType(Ident); ASTVariantList *lookupTypeVariants(Ident); int lookupTypeNumber(Ident); bool lookupTypeReachable(Ident); IdentList *lookupTypeStatespaces(Ident); Ident lookupSSType(Ident); bool exists(char*); ASTForm *getRestriction(Ident, Ident *formal); ASTForm *getDefault1Restriction(Ident *formal); ASTForm *getDefault2Restriction(Ident *formal); IdentList *allUnivs(); IdentList *allRealUnivs(); void updateRestriction(Ident, ASTForm *); void updateStateSpaces(Ident, Deque *statespaces); void updateUnivPos(Ident, char *pos); void addTypeStatespace(Ident, char *ssname); void checkUniqueness(NameList&); void setDefaultRestriction(MonaTypeTag, ASTForm *, Ident); void dump(); // dump contents unsigned noIdents; // total number of identifiers int noSS; // number of state spaces Ident defaultIdent1; // formal parameter for defaultwhere1 Ident defaultIdent2; // formal parameter for defaultwhere2 ASTForm *defaultRestriction1; // default restriction for first order variables ASTForm *defaultRestriction2; // default restriction for second order variables }; #endif mona-1.4/Front/timer.cpp0000644000414100000240000000377010756504336012153 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #define _LANGUAGE_C_PLUS_PLUS #include #include #include #include #include "timer.h" const unsigned long hour = 360000; const unsigned long min = 6000; const unsigned long sec = 100; const unsigned long step = 2000; // sec. pr. step static unsigned long prev, clocks, steps; // CPU time (user+system) void refresh(int) { unsigned long t = (unsigned long) clock(); clocks += t - prev; prev = t; while (clocks >= step*CLOCKS_PER_SEC) { steps++; clocks -= step*CLOCKS_PER_SEC; } signal(SIGALRM, &refresh); alarm(step); } void initTimer() { clocks = steps = 0; refresh(0); } void Timer::start() { alarm(0); refresh(0); tsteps = steps; tclocks = clocks; } void Timer::stop() { alarm(0); refresh(0); unsigned long ttsteps = steps; unsigned long ttclocks = clocks; if (ttclocks < tclocks) { ttclocks += step*CLOCKS_PER_SEC; ttsteps--; } res += (ttsteps - tsteps)*step*100 + (ttclocks - tclocks)/(CLOCKS_PER_SEC/100); } void Timer::print() { unsigned long t = res, hours, mins, secs; hours = t / hour; t -= hours * hour; mins = t / min; t -= mins * min; secs = t / sec; t -= secs * sec; printf("%02lu:%02lu:%02lu.%02lu\n", hours, mins, secs, t); } mona-1.4/Front/timer.h0000644000414100000240000000172310756504270011611 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __TIMER_H #define __TIMER_H class Timer { public: Timer() : res(0) {} void start(); void stop(); void print(); private: unsigned long tclocks, tsteps, res; }; void initTimer(); #endif mona-1.4/Front/untyped.cpp0000644000414100000240000016447010756504336012530 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "untyped.h" #include "predlib.h" #include "env.h" #include "deque.h" extern "C" { #include "../GTA/gta.h" } using std::cout; extern SymbolTable symbolTable; extern PredicateLib predicateLib; extern Options options; extern int numTypes; extern Guide_Declaration *guide_declaration; bool inDefault = false; bool predMacroEncountered = false; bool anyUniverses = false; /////////////////////////////////////////////////////////////////////////////// // // // Type-error reporting // // // /////////////////////////////////////////////////////////////////////////////// void TypeError(String str, Pos &p) { cout << "Error"; if (p.fileName) { cout << " in file"; p.printsource(); } cout << "\n" << str << "\n" << "Execution aborted\n"; exit(-1); } /////////////////////////////////////////////////////////////////////////////// // // // Arithmetic expressions // // // /////////////////////////////////////////////////////////////////////////////// int ArithExp_Add::evaluate() { return aexp1->evaluate() + aexp2->evaluate(); } int ArithExp_Subtr::evaluate() { return aexp1->evaluate() - aexp2->evaluate(); } int ArithExp_Mult::evaluate() { return aexp1->evaluate() * aexp2->evaluate(); } int ArithExp_Div::evaluate() { int x = aexp2->evaluate(); if (x == 0) TypeError("Division by zero", pos); return aexp1->evaluate() / x; } int ArithExp_Integer::evaluate() { return n; } int ArithExp_Const::evaluate() { if (symbolTable.lookupType(name) != Constname) TypeError("'" + String(name->str) + "' used as a constant", pos); return symbolTable.lookupValue(name); } /////////////////////////////////////////////////////////////////////////////// // // // Types // // // /////////////////////////////////////////////////////////////////////////////// ////////// Type variant components /////////////////////////////////////////// ASTComponent* Component::genAST() { if (symbolTable.exists(name->str)) TypeError((String) "'" + name->str + "' already defined", pos); Ident tid = symbolTable.lookupIdent(type); if (symbolTable.lookupType(tid) != Typename) TypeError((String) "'" + type->str + "' not a type", type->pos); return new ASTComponent(name->str, type->str, pos); } ASTComponentList* ComponentList::genAST() { ASTComponentList *v = new ASTComponentList; for (iterator i = begin(); i != end(); i++) v->push_back((*i)->genAST()); return v; } ////////// Type variants ///////////////////////////////////////////////////// ASTVariant* Variant::genAST() { ASTComponentList *c = NULL; if (components) c = components->genAST(); if (symbolTable.exists(name->str)) TypeError((String) "'" + name->str + "' already defined", pos); return new ASTVariant(name->str, c, pos); } ASTVariantList* VariantList::genAST() { ASTVariantList *v = new ASTVariantList; for (iterator i = begin(); i != end(); i++) v->push_back((*i)->genAST()); return v; } ////////// Constant Typed Trees ////////////////////////////////////////////// ASTForm* ConstNode::genAST(UntypedExp *t, Ident treevarId, Ident typeId) { Name *treevar = new Name(symbolTable.lookupSymbol(treevarId), pos); Name *type = new Name(symbolTable.lookupSymbol(typeId), pos); UntypedExp_Variant v(t, new UntypedExp_Name(treevar, pos), type, new Name(*variant), pos); ASTForm *res = (ASTForm *) v.genAST(); v.exp1 = NULL; /* don't gc */ ASTVariantList *vs = symbolTable.lookupTypeVariants(typeId); ASTVariantList::iterator i; for (i = vs->begin(); i != vs->end(); i++) if (variant->str == (*i)->name) break; if (i == vs->end()) TypeError("Variant not found", variant->pos); if (components) { ConstNodeList::iterator j; ASTComponentList::iterator k; if (components->size() != (*i)->components->size()) TypeError("Wrong number of components", pos); for (j = components->begin(), k = (*i)->components->begin(); j != components->end(); j++, k++) { Ident fresh = symbolTable.insertFresh(Varname1, NULL); UntypedExp_Name tt(new Name(symbolTable.lookupSymbol(fresh), pos), pos); Name nn((*k)->type, pos); ASTForm *c2 = (*j)->genAST(&tt, treevarId, symbolTable.lookupIdent(&nn)); Name *type = new Name(symbolTable.lookupSymbol(typeId), pos); Name *var = new Name(*variant); Name *com = new Name((*k)->name, pos); UntypedExp_Succ succ(t, type, var, com, pos); ASTForm *c1 = new ASTForm_Equal1(new ASTTerm1_Var1(fresh, pos), (ASTTerm1 *) succ.genAST(), pos); succ.exp = NULL; /* don't gc */ ASTForm *comp = new ASTForm_And(c1, c2, pos); comp = new ASTForm_Ex1(symbolTable.allRealUnivs(), new IdentList(fresh), comp, pos); // (can't find any better univlist) res = new ASTForm_And(res, comp, pos); } } return res; } /////////////////////////////////////////////////////////////////////////////// // // // Untyped mona expressions // // // /////////////////////////////////////////////////////////////////////////////// ////////// UntypedExp_Name /////////////////////////////////////////////////// AST* UntypedExp_Name::genAST() { Ident id = symbolTable.lookupIdent(name); switch (symbolTable.lookupType(name)) { case Varname0: case Parname0: return new ASTForm_Var0(id, pos); case Varname1: case Parname1: return new ASTTerm1_Var1(id, pos); case Parname2: case Varname2: return new ASTTerm2_Var2(id, pos); case VarnameTree: return new ASTTerm2_VarTree(id, pos); case ParnameU: case Univname: return new ASTUniv(id, pos); case Predname: { ASTList *empty = new ASTList; if (predicateLib.testTypes(id, empty) == tWrongNoParameters) TypeError("Wrong number of parameters to predicate '" + String(name->str) + "'", pos); return new ASTForm_Call(id, empty, pos); } case Constname: default: return new ASTTerm1_Int(symbolTable.lookupValue(name), pos); } } ////////// UntypedExp_Sub //////////////////////////////////////////////////// AST* UntypedExp_Sub::genAST() { AST *T1 = exp1->genAST(); AST *T2 = exp2->genAST(); if (T1->order != oTerm2 || T2->order != oTerm2) TypeError("Type mismatch at 'sub'", pos); return new ASTForm_Sub((ASTTerm2 *) T1, (ASTTerm2 *) T2, pos); } ////////// UntypedExp_In ///////////////////////////////////////////////////// AST* UntypedExp_In::genAST() { AST *t1 = exp1->genAST(); AST *T2 = exp2->genAST(); if (t1->order != oTerm1 || T2->order != oTerm2) TypeError("Type mismatch at 'in'", pos); return new ASTForm_In((ASTTerm1 *) t1, (ASTTerm2 *) T2, pos); } ////////// UntypedExp_NotIn ////////////////////////////////////////////////// AST* UntypedExp_NotIn::genAST() { AST *t1 = exp1->genAST(); AST *T2 = exp2->genAST(); if (t1->order != oTerm1 || T2->order != oTerm2) TypeError("Type mismatch at 'notin'", pos); return new ASTForm_Notin((ASTTerm1 *) t1, (ASTTerm2 *) T2, pos); } ////////// UntypedExp_Min //////////////////////////////////////////////////// AST* UntypedExp_Min::genAST() { if (options.mode == TREE) TypeError("'min' only allowed in linear mode", pos); AST *T = exp->genAST(); if (T->order != oTerm2) TypeError("Type mismatch at 'min'", pos); return new ASTTerm1_Min((ASTTerm2 *) T, pos); } ////////// UntypedExp_Max //////////////////////////////////////////////////// AST* UntypedExp_Max::genAST() { if (options.mode == TREE) TypeError("'max' only allowed in linear mode", pos); AST *T = exp->genAST(); if (T->order != oTerm2) TypeError("Type mismatch at 'max'", pos); return new ASTTerm1_Max((ASTTerm2 *) T, pos); } ////////// UntypedExp_Set //////////////////////////////////////////////////// AST* UntypedExp_Set::genAST() { ASTList *elements = new ASTList; ASTTerm1 *e1 = NULL; ASTTerm1 *e2; ASTTerm1 *e3 = NULL; if (options.mode == TREE && expList->empty()) TypeError("{} not allowed in tree mode (use empty(T))", pos); // convert to a list of intervals and single elements UntypedExpList::iterator n = expList->begin(); while (n != expList->end() || e1 != NULL) { if (e1 == NULL) { e1 = (ASTTerm1 *) (*n)->genAST(); n++; } if (n != expList->end()) { e2 = (ASTTerm1 *) (*n)->genAST(); n++; if (e2->kind == aInterval) { if (n != expList->end()) { e3 = (ASTTerm1 *) (*n)->genAST(); n++; } else TypeError("Illegal interval", pos); } } else e2 = (ASTTerm1 *) NULL; if ((e2 != NULL) && (e2->kind == aInterval)) { // interval if (e1->kind == aInterval || e3->kind == aInterval) TypeError("Illegal interval", pos); if (e1->order != oTerm1 || e3->order != oTerm1) TypeError("Type mismatch in set", pos); elements->push_back(new ASTTerm2_Interval(e1, e3, pos)); e1 = (ASTTerm1 *) NULL; delete e2; } else { // single element if (e1->kind == aInterval) TypeError("Illegal interval", pos); if (e1->order != oTerm1) TypeError("Type mismatch in set", pos); elements->push_back(e1); e1 = e2; } } return new ASTTerm2_Set(elements, pos); } ////////// UntypedExp_Interval /////////////////////////////////////////////// AST* UntypedExp_Interval::genAST() { return new ASTTerm2_Interval((ASTTerm1 *) NULL, (ASTTerm1 *) NULL, dummyPos); } ////////// UntypedExp_Less /////////////////////////////////////////////////// AST* UntypedExp_Less::genAST() { AST *t1 = exp1->genAST(); AST *t2 = exp2->genAST(); if (t1->order != oTerm1 || t2->order != oTerm1) TypeError("Type mismatch at '<'", pos); return new ASTForm_Less((ASTTerm1 *) t1, (ASTTerm1 *) t2, pos); } ////////// UntypedExp_LessEq ///////////////////////////////////////////////// AST* UntypedExp_LessEq::genAST() { AST *t1 = exp1->genAST(); AST *t2 = exp2->genAST(); if (t1->order != oTerm1 || t2->order != oTerm1) TypeError("Type mismatch at '<='", pos); return new ASTForm_LessEq((ASTTerm1 *) t1, (ASTTerm1 *) t2, pos); } ////////// UntypedExp_Greater //////////////////////////////////////////////// AST* UntypedExp_Greater::genAST() { AST *t1 = exp1->genAST(); AST *t2 = exp2->genAST(); if (t1->order != oTerm1 || t2->order != oTerm1) TypeError("Type mismatch at '>'", pos); return new ASTForm_Less((ASTTerm1 *) t2, (ASTTerm1 *) t1, pos); } ////////// UntypedExp_GreaterEq ////////////////////////////////////////////// AST* UntypedExp_GreaterEq::genAST() { AST *t1 = exp1->genAST(); AST *t2 = exp2->genAST(); if (t1->order != oTerm1 || t2->order != oTerm1) TypeError("Type mismatch at '>='", pos); return new ASTForm_LessEq((ASTTerm1 *) t2, (ASTTerm1 *) t1, pos); } ////////// UntypedExp_Equal ////////////////////////////////////////////////// AST* UntypedExp_Equal::genAST() { AST *e1 = exp1->genAST(); AST *e2 = exp2->genAST(); AST *result = 0; if (e1->order == oTerm1 && e2->order == oTerm1) result = new ASTForm_Equal1((ASTTerm1 *) e1, (ASTTerm1 *) e2, pos); else if (e1->order == oTerm2 && e2->order == oTerm2) result = new ASTForm_Equal2((ASTTerm2 *) e1, (ASTTerm2 *) e2, pos); else TypeError("Type mismatch at '='", pos); return result; } ////////// UntypedExp_NotEqual /////////////////////////////////////////////// AST* UntypedExp_NotEqual::genAST() { AST *e1 = exp1->genAST(); AST *e2 = exp2->genAST(); AST *result = 0; if (e1->order == oTerm1 && e2->order == oTerm1) result = new ASTForm_NotEqual1((ASTTerm1 *) e1, (ASTTerm1 *) e2, pos); else if (e1->order == oTerm2 && e2->order == oTerm2) result = new ASTForm_NotEqual2((ASTTerm2 *) e1, (ASTTerm2 *) e2, pos); else TypeError("Type mismatch at '~='", pos); return result; } ////////// UntypedExp_Union ////////////////////////////////////////////////// AST* UntypedExp_Union::genAST() { AST *T1 = exp1->genAST(); AST *T2 = exp2->genAST(); if (T1->order != oTerm2 || T2->order != oTerm2) TypeError("Type mismatch at 'union'", pos); return new ASTTerm2_Union((ASTTerm2 *) T1, (ASTTerm2 *) T2, pos); } ////////// UntypedExp_Inter ////////////////////////////////////////////////// AST* UntypedExp_Inter::genAST() { AST *T1 = exp1->genAST(); AST *T2 = exp2->genAST(); if (T1->order != oTerm2 || T2->order != oTerm2) TypeError("Type mismatch at 'inter'", pos); return new ASTTerm2_Inter((ASTTerm2 *) T1, (ASTTerm2 *) T2, pos); } ////////// UntypedExp_Setminus /////////////////////////////////////////////// AST* UntypedExp_Setminus::genAST() { AST *T1 = exp1->genAST(); AST *T2 = exp2->genAST(); if (T1->order != oTerm2 || T2->order != oTerm2) TypeError("Type mismatch at '\\'", pos); return new ASTTerm2_Setminus((ASTTerm2 *) T1, (ASTTerm2 *) T2, pos); } ////////// UntypedExp_Impl /////////////////////////////////////////////////// AST* UntypedExp_Impl::genAST() { AST *f1 = exp1->genAST(); AST *f2 = exp2->genAST(); if (f1->order != oForm || f2->order != oForm) TypeError("Type mismatch at '=>'", pos); return new ASTForm_Impl((ASTForm *) f1, (ASTForm *) f2, pos); } ////////// UntypedExp_Biimpl ///////////////////////////////////////////////// AST* UntypedExp_Biimpl::genAST() { AST *f1 = exp1->genAST(); AST *f2 = exp2->genAST(); if (f1->order != oForm || f2->order != oForm) TypeError("Type mismatch at '<=>'", pos); return new ASTForm_Biimpl((ASTForm *) f1, (ASTForm *) f2, pos); } ////////// UntypedExp_And //////////////////////////////////////////////////// AST* UntypedExp_And::genAST() { AST *f1 = exp1->genAST(); AST *f2 = exp2->genAST(); if (f1->order != oForm || f2->order != oForm) TypeError("Type mismatch at '&'", pos); return new ASTForm_And((ASTForm *) f1, (ASTForm *) f2, pos); } ////////// UntypedExp_Or ///////////////////////////////////////////////////// AST* UntypedExp_Or::genAST() { AST *f1 = exp1->genAST(); AST *f2 = exp2->genAST(); if (f1->order != oForm || f2->order != oForm) TypeError("Type mismatch at '|'", pos); return new ASTForm_Or((ASTForm *) f1, (ASTForm *) f2, pos); } ////////// UntypedExp_Not //////////////////////////////////////////////////// AST* UntypedExp_Not::genAST() { AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at '~'", pos); return new ASTForm_Not((ASTForm *) f, pos); } ////////// UntypedExp_Dot //////////////////////////////////////////////////// AST* UntypedExp_Dot::genAST() { if (numTypes > 0) cout << "Warning: '.' should not be used " << "explicitly if types are defined\n"; if (options.mode != TREE) TypeError("'.' only allowed in tree mode", pos); BitList *b = new BitList(bits); AST *t = exp->genAST(); switch (t->order) { case oTerm1: return new ASTTerm1_Dot((ASTTerm1 *) t, b, pos); case oTerm2: return new ASTTerm2_Dot((ASTTerm2 *) t, b, pos); default: TypeError("Type mismatch at '.'", pos); exit(-1); } } ////////// UntypedExp_Up ///////////////////////////////////////////////////// int numImplicitUp = 0; // number of implicit ^'s (generated by m2l-tree) AST* UntypedExp_Up::genAST() { if (numImplicitUp > 0) numImplicitUp--; else if (numTypes > 0) cout << "Warning: '^' should not be used " << "explicitly if types are defined\n"; if (options.mode != TREE) TypeError("'^' only allowed in tree mode", pos); AST *t = exp->genAST(); if (t->order != oTerm1 && t->order != oTerm2) TypeError("Type mismatch at '^'", pos); if (t->order == oTerm1) return new ASTTerm1_Up((ASTTerm1 *) t, pos); else return new ASTTerm2_Up((ASTTerm2 *) t, pos); } ////////// UntypedExp_Ex0 //////////////////////////////////////////////////// AST* UntypedExp_Ex0::genAST() { symbolTable.openLocal(); IdentList *idents = new IdentList; NameList names; Ident id; VarDeclList::iterator d; for (d = nameList->begin(); d != nameList->end(); d++) { names.push_back((*d)->name); id = symbolTable.insertVar((*d)->name, Varname0, NULL, true); idents->push_back(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } symbolTable.checkUniqueness(names); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'ex0'", pos); AST *result = new ASTForm_Ex0(idents, (ASTForm *) f, pos); symbolTable.closeLocal(); names.reset(); return result; } ////////// UntypedExp_Ex1 //////////////////////////////////////////////////// AST* UntypedExp_Ex1::genAST() { symbolTable.openLocal(); IdentList *idents = new IdentList; NameList names; Ident id; VarDeclList::iterator d; for (d = nameList->begin(); d != nameList->end(); d++) { names.push_back((*d)->name); id = symbolTable.insertVar((*d)->name, Varname1, NULL, true); idents->push_back(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } symbolTable.checkUniqueness(names); IdentList *univIdents = NULL; if (univList) univIdents = symbolTable.lookupUnivIdents(*univList); else univIdents = symbolTable.allRealUnivs(); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'ex1'", pos); AST *result = new ASTForm_Ex1(univIdents, idents, (ASTForm *) f, pos); symbolTable.closeLocal(); names.reset(); return result; } ////////// UntypedExp_Ex2 //////////////////////////////////////////////////// AST* UntypedExp_Ex2::genAST() { symbolTable.openLocal(); IdentList *idents = new IdentList; NameList names; Ident id; VarDeclList::iterator d; for (d = nameList->begin(); d != nameList->end(); d++) { names.push_back((*d)->name); id = symbolTable.insertVar((*d)->name, Varname2, NULL, true); idents->push_back(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } symbolTable.checkUniqueness(names); IdentList *univIdents = NULL; if (univList) univIdents = symbolTable.lookupUnivIdents(*univList); else univIdents = symbolTable.allRealUnivs(); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'ex2'", pos); AST *result = new ASTForm_Ex2(univIdents, idents, (ASTForm *) f, pos); symbolTable.closeLocal(); names.reset(); return result; } ////////// UntypedExp_All0 /////////////////////////////////////////////////// AST* UntypedExp_All0::genAST() { symbolTable.openLocal(); IdentList *idents = new IdentList; NameList names; Ident id; VarDeclList::iterator d; for (d = nameList->begin(); d != nameList->end(); d++) { names.push_back((*d)->name); id = symbolTable.insertVar((*d)->name, Varname0, NULL, true); idents->push_back(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } symbolTable.checkUniqueness(names); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'all0'", pos); AST *result = new ASTForm_All0(idents, (ASTForm *) f, pos); symbolTable.closeLocal(); names.reset(); return result; } ////////// UntypedExp_All1 /////////////////////////////////////////////////// AST* UntypedExp_All1::genAST() { symbolTable.openLocal(); IdentList *idents = new IdentList; NameList names; Ident id; VarDeclList::iterator d; for (d = nameList->begin(); d != nameList->end(); d++) { names.push_back((*d)->name); id = symbolTable.insertVar((*d)->name, Varname1, NULL, true); idents->push_back(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } symbolTable.checkUniqueness(names); IdentList *univIdents = NULL; if (univList) univIdents = symbolTable.lookupUnivIdents(*univList); else univIdents = symbolTable.allRealUnivs(); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'all1'", pos); AST *result = new ASTForm_All1(univIdents, idents, (ASTForm *) f, pos); symbolTable.closeLocal(); names.reset(); return result; } ////////// UntypedExp_All2 /////////////////////////////////////////////////// AST* UntypedExp_All2::genAST() { symbolTable.openLocal(); IdentList *idents = new IdentList; NameList names; Ident id; VarDeclList::iterator d; for (d = nameList->begin(); d != nameList->end(); d++) { names.push_back((*d)->name); id = symbolTable.insertVar((*d)->name, Varname2, NULL, true); idents->push_back(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } symbolTable.checkUniqueness(names); IdentList *univIdents = NULL; if (univList) univIdents = symbolTable.lookupUnivIdents(*univList); else univIdents = symbolTable.allRealUnivs(); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'all2'", pos); AST *result = new ASTForm_All2(univIdents, idents, (ASTForm *) f, pos); symbolTable.closeLocal(); names.reset(); return result; } ////////// UntypedExp_Let0 /////////////////////////////////////////////////// AST* UntypedExp_Let0::genAST() { symbolTable.openLocal(); NameList nl; BindExpList::iterator n; IdentList *idents = new IdentList; Ident id; FormList *forms = new FormList; IdentList::iterator i; for (n = bindList->begin(), i = idents->begin(); n != bindList->end(); n++, i++) { AST *t = ((*n)->exp)->genAST(); if (t->order != oForm) TypeError("Type mismatch at 'let0' in definition of '" + String(((*n)->name)->str) +"'", (*n)->pos); forms->push_back((ASTForm* ) t); } for (n = bindList->begin(); n!= bindList->end(); n++) { id = symbolTable.insertVar((*n)->name, Varname0, NULL, true); idents->push_back(id); nl.push_back((*n)->name); } symbolTable.checkUniqueness(nl); AST *t = exp->genAST(); if (t->order != oForm) TypeError("Type mismatch at 'let0' expression", pos); AST *result = new ASTForm_Let0(idents, forms, (ASTForm *) t, pos); symbolTable.closeLocal(); nl.reset(); return result; } ////////// UntypedExp_Let1 /////////////////////////////////////////////////// AST* UntypedExp_Let1::genAST() { symbolTable.openLocal(); NameList nl; BindExpList::iterator n; IdentList *idents = new IdentList; Ident id; Term1List *terms = new Term1List; IdentList::iterator i; for (n = bindList->begin(), i = idents->begin(); n != bindList->end(); n++, i++) { AST *t = ((*n)->exp)->genAST(); if (t->order != oTerm1) TypeError("Type mismatch at 'let1' in definition of '" + String(((*n)->name)->str) +"'", (*n)->pos); terms->push_back((ASTTerm1 *) t); } for (n = bindList->begin(); n!= bindList->end(); n++) { id = symbolTable.insertVar((*n)->name, Varname1, NULL, true); idents->push_back(id); nl.push_back((*n)->name); } symbolTable.checkUniqueness(nl); AST *t = exp->genAST(); if (t->order != oForm) TypeError("Type mismatch at 'let1' expression", pos); AST *result = new ASTForm_Let1(idents, terms, (ASTForm *) t, pos); symbolTable.closeLocal(); nl.reset(); return result; } ////////// UntypedExp_Let2 /////////////////////////////////////////////////// AST* UntypedExp_Let2::genAST() { symbolTable.openLocal(); NameList nl; BindExpList::iterator n; IdentList *idents = new IdentList; Ident id; Term2List *terms = new Term2List; IdentList::iterator i; for (n = bindList->begin(), i = idents->begin(); n != bindList->end(); n++, i++) { AST *t = ((*n)->exp)->genAST(); if (t->order != oTerm2) TypeError("Type mismatch at 'let2' in definition of '" + String(((*n)->name)->str) +"'", (*n)->pos); terms->push_back((ASTTerm2 *) t); } for (n = bindList->begin(); n!= bindList->end(); n++) { id = symbolTable.insertVar((*n)->name, Varname2, NULL, true); idents->push_back(id); nl.push_back((*n)->name); } symbolTable.checkUniqueness(nl); AST *t = exp->genAST(); if (t->order != oForm) TypeError("Type mismatch at 'let2' expression", pos); AST *result = new ASTForm_Let2(idents, terms, (ASTForm *) t, pos); symbolTable.closeLocal(); nl.reset(); return result; } ////////// UntypedExp_Call /////////////////////////////////////////////////// AST* UntypedExp_Call::genAST() { if (strcmp(name->str, "pconst") == 0) { // hack -- make generic mechanism!! if (options.mode == TREE) TypeError("'pconst' (currently) only allowed in linear mode", pos); if (expList->size() != 1) TypeError("Wrong number of arguments to function 'pconst'", pos); AST *arg = (expList->get(0))->genAST(); if (arg->kind != aInt) TypeError("Wrong type of parameter 1 at function 'pconst'", pos); int value = ((ASTTerm1_Int *) arg)->value(); if (value < 0) TypeError("Argument to 'presb' negative", pos); delete arg; return new ASTTerm2_PresbConst(value, pos); } if (symbolTable.lookupType(name) != Predname) TypeError("'" + String(name->str) + "' used as a predicate or function", pos); ASTList *par = new ASTList; if (expList) for (UntypedExpList::iterator i = expList->begin(); i != expList->end(); i++) par->push_back((*i)->genAST()); Ident id = symbolTable.lookupIdent(name); int no; switch (predicateLib.testTypes(id, par, &no)) { case tWrongNoParameters: TypeError("Wrong number of parameters to predicate '" + String(name->str) + "'", pos); case tWrongParameterType: char t[10]; sprintf(t, "%i",no); TypeError("Wrong type of parameter " + (String) t + " at predicate '" + String(name->str) + "'", pos); case tOK: ; } return new ASTForm_Call(id, par, pos); } ////////// UntypedExp_Empty ////////////////////////////////////////////////// AST* UntypedExp_Empty::genAST() { if (options.mode == TREE) TypeError("'empty'-term only allowed in linear mode " "(use predicate version", pos); return new ASTTerm2_Empty(pos); } ////////// UntypedExp_True /////////////////////////////////////////////////// AST* UntypedExp_True::genAST() { return new ASTForm_True(pos); } ////////// UntypedExp_False ////////////////////////////////////////////////// AST* UntypedExp_False::genAST() { return new ASTForm_False(pos); } ////////// UntypedExp_Root /////////////////////////////////////////////////// AST* UntypedExp_Root::genAST() { if (options.mode != TREE) TypeError("'root' only allowed in tree mode", pos); Ident u = 0; if (name) { switch (symbolTable.lookupType(name)) { case Varname1: case Varname2: case VarnameTree: case Univname: case Parname1: case Parname2: case ParnameU: u = symbolTable.lookupIdent(name); break; default: TypeError("Illegal argument to 'root'", pos); } } else if (!anyUniverses) u = -1; else TypeError("Argument to 'root' is missing", pos); return new ASTTerm1_Root(u, pos); } ////////// UntypedExp_RootPred /////////////////////////////////////////////// AST* UntypedExp_RootPred::genAST() { if (options.mode != TREE) TypeError("'root' only allowed in tree mode", pos); AST *t = exp->genAST(); if (t->order != oTerm1) TypeError("Type mismatch at 'root'", pos); IdentList *ul = symbolTable.lookupUnivIdents(*univList); return new ASTForm_RootPred((ASTTerm1 *) t, ul, pos); } ////////// UntypedExp_EmptyPred ////////////////////////////////////////////// AST* UntypedExp_EmptyPred::genAST() { AST *f = exp->genAST(); if (f->order != oTerm2) TypeError("Type mismatch at 'empty'", pos); return new ASTForm_EmptyPred((ASTTerm2 *) f, pos); } ////////// UntypedExp_Plus /////////////////////////////////////////////////// AST* UntypedExp_Plus::genAST() { if (options.mode == TREE) TypeError("'+' only allowed in linear mode", pos); AST *e = exp->genAST(); int i = aexp->evaluate(); if (e->kind == aInt) return new ASTTerm1_Int(((ASTTerm1_Int *) e)->value() + i, pos); if (e->order != oTerm1 && e->order != oTerm2) TypeError("Type mismatch at '+'", pos); if (i == 0) return e; else if (i > 0) { if (e->order == oTerm1) return new ASTTerm1_Plus((ASTTerm1 *) e, i, pos); else return new ASTTerm2_Plus((ASTTerm2 *) e, i, pos); } else { if (e->order == oTerm1) return new ASTTerm1_Minus((ASTTerm1 *) e, -i, pos); else return new ASTTerm2_Minus((ASTTerm2 *) e, -i, pos); } } ////////// UntypedExp_Minus ////////////////////////////////////////////////// AST* UntypedExp_Minus::genAST() { if (options.mode == TREE) TypeError("'-' only allowed in linear mode", pos); AST *e = exp->genAST(); int i = aexp->evaluate(); if (e->kind == aInt) return new ASTTerm1_Int(((ASTTerm1_Int *) e)->value() - i, pos); if (e->order != oTerm1 && e->order != oTerm2) TypeError("Type mismatch at '-'", pos); if (i == 0) return e; else if (i > 0) { if (e->order == oTerm1) return new ASTTerm1_Minus((ASTTerm1 *) e, i, pos); else return new ASTTerm2_Minus((ASTTerm2 *) e, i, pos); } else { if (e->order == oTerm1) return new ASTTerm1_Plus((ASTTerm1 *) e, -i, pos); else return new ASTTerm2_Plus((ASTTerm2 *) e, -i, pos); } } ////////// UntypedExp_PlusModulo ///////////////////////////////////////////// AST* UntypedExp_PlusModulo::genAST() { if (options.mode == TREE) TypeError("'+%' only allowed in linear mode", pos); AST *e1 = exp1->genAST(); AST *e2 = exp2->genAST(); int i = aexp->evaluate(); if (e1->order != oTerm1 || e2->order != oTerm1) TypeError("Type mismatch at '+%'", pos); if (i >= 0) return new ASTTerm1_PlusModulo((ASTTerm1 *) e1, i, (ASTTerm1 *) e2, pos); else return new ASTTerm1_MinusModulo((ASTTerm1 *) e1, -i, (ASTTerm1 *) e2, pos); } ////////// UntypedExp_MinusModulo //////////////////////////////////////////// AST* UntypedExp_MinusModulo::genAST() { if (options.mode == TREE) TypeError("'-%' only allowed in linear mode", pos); AST *e1 = exp1->genAST(); AST *e2 = exp2->genAST(); int i = aexp->evaluate(); if (e1->order != oTerm1 || e2->order != oTerm1) TypeError("Type mismatch at '-%'", pos); if (i >= 0) return new ASTTerm1_MinusModulo((ASTTerm1 *) e1, i, (ASTTerm1 *) e2, pos); else return new ASTTerm1_PlusModulo((ASTTerm1 *) e1, -i, (ASTTerm1 *) e2, pos); } ////////// UntypedExp_Mult /////////////////////////////////////////////////// AST* UntypedExp_Mult::genAST() { if (options.mode == TREE) TypeError("'*' only allowed in linear mode", pos); AST *e = exp->genAST(); int i = aexp->evaluate(); if (e->kind != aInt) TypeError("Type mismatch at '*'", pos); return new ASTTerm1_Int(((ASTTerm1_Int *) e)->value() *i, pos); } ////////// UntypedExp_Div //////////////////////////////////////////////////// AST* UntypedExp_Div::genAST() { if (options.mode == TREE) TypeError("'/' only allowed in linear mode", pos); AST *e = exp->genAST(); int i = aexp->evaluate(); if (i == 0) TypeError("Division by zero", pos); if (e->kind != aInt) TypeError("Type mismatch at '/'", pos); return new ASTTerm1_Int(((ASTTerm1_Int *) e)->value() / i, pos); } ////////// UntypedExp_Int //////////////////////////////////////////////////// AST* UntypedExp_Int::genAST() { if (options.mode == TREE) TypeError("Integer only allowed in linear mode", pos); return new ASTTerm1_Int(n, pos); } ////////// UntypedExp_Import ///////////////////////////////////////////////// AST* UntypedExp_Import::genAST() { Deque *fileVars = new Deque; IdentList *idents = new IdentList; ImportMapList::iterator i; for (i = mapList->begin(); i != mapList->end(); i++) { char *fileVar = (*i)->name1->str; Ident id = symbolTable.lookupIdent((*i)->name2); Deque::iterator j1; for (j1 = fileVars->begin(); j1 != fileVars->end(); j1++) if (fileVar == *j1) TypeError("Variable name already used in 'import' mapping", (*i)->name1->pos); fileVars->push_back(fileVar); IdentList::iterator j2; for (j2 = idents->begin(); j2 != idents->end(); j2++) if (id == *j2) TypeError("Variable name already used in 'import' mapping", (*i)->name2->pos); idents->push_back(id); } return new ASTForm_Import(file, fileVars, idents, pos); } ////////// UntypedExp_Export ///////////////////////////////////////////////// AST* UntypedExp_Export::genAST() { AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'export'", pos); return new ASTForm_Export((ASTForm *) f, file, pos); } ////////// UntypedExp_Prefix ///////////////////////////////////////////////// AST* UntypedExp_Prefix::genAST() { if (options.mode == TREE) TypeError("'prefix' only allowed in linear mode", pos); AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'prefix'", pos); return new ASTForm_Prefix((ASTForm *) f, pos); } ////////// UntypedExp_InStateSpace /////////////////////////////////////////// AST* UntypedExp_InStateSpace::genAST() { if (numTypes > 0) cout << "Warning: 'in_state_space' should not be used " << "explicitly if types are defined\n"; if (options.mode != TREE) TypeError("'in_state_space' only allowed in tree mode", pos); AST *t = exp->genAST(); IdentList *ssid = new IdentList; for (NameList::iterator i = ss->begin(); i != ss->end(); i++) { ssid->insert(symbolTable.lookupIdent(*i)); if ((t->order != oTerm1 && t->order != oTerm2) || symbolTable.lookupType(*i) != Statespacename) TypeError("Type mismatch at 'in_state_space'", pos); } ssid->sort(); if (t->order == oTerm1) return new ASTForm_InStateSpace1((ASTTerm1 *) t, ssid, pos); else return new ASTForm_InStateSpace2((ASTTerm2 *) t, ssid, pos); } ////////// UntypedExp_Succ /////////////////////////////////////////////////// AST* UntypedExp_Succ::genAST() { if (numTypes == 0) TypeError("'succ' only allowed when using types", pos); Ident typeId = symbolTable.lookupIdent(type); AST *t = exp->genAST(); if (t->order != oTerm1 || symbolTable.lookupType(typeId) != Typename) TypeError("Type mismatch at 'succ'", pos); // succ(p,A,a1,x) --> p.PATHPATH ASTVariantList *v = symbolTable.lookupTypeVariants(typeId); ASTVariantList::iterator i; for (i = v->begin(); i != v->end(); i++) if (strcmp((*i)->name, variant->str)==0) break; if (i == v->end()) TypeError((String) "Variant '" + variant->str + "' not found", pos); BitList *bits = new BitList(*(*i)->path); ASTComponentList *c = (*i)->components; ASTComponentList::iterator j = 0; if (c) for (j = c->begin(); j != c->end(); j++) if (strcmp((*j)->name, component->str)==0) break; if (!c || j == c->end()) TypeError((String) "Component '" + component->str + "' not found", pos); bits->append((*j)->path); return new ASTTerm1_Dot((ASTTerm1 *) t, bits, pos); } ////////// UntypedExp_WellFormedTree ///////////////////////////////////////// AST* UntypedExp_WellFormedTree::genAST() { if (numTypes == 0) TypeError("'tree' predicate only allowed when using types", pos); AST *t = exp->genAST(); if (t->order != oTerm2) TypeError("Type mismatch at 'tree'", pos); return new ASTForm_WellFormedTree((ASTTerm2 *) t, pos); } ////////// UntypedExp_Type /////////////////////////////////////////////////// AST* UntypedExp_Type::genAST() { if (numTypes == 0) TypeError("'type' only allowed when using types", pos); Ident typeId = symbolTable.lookupIdent(type); AST *t = exp->genAST(); if (t->order != oTerm1 || symbolTable.lookupType(typeId) != Typename) TypeError("Type mismatch at 'type'", pos); // type(p,A) --> in_state_space(p, STATESPACES) return new ASTForm_InStateSpace1((ASTTerm1 *) t, symbolTable.lookupTypeStatespaces(typeId), pos); } ////////// UntypedExp_SomeType /////////////////////////////////////////////// AST* UntypedExp_SomeType::genAST() { if (numTypes == 0) TypeError("'sometype' only allowed when using types", pos); AST *t = exp->genAST(); if (t->order != oTerm1 && t->order != oTerm2) TypeError("Type mismatch at 'sometype'", pos); return new ASTForm_SomeType((ASTTerm *) t, pos); } ////////// UntypedExp_Variant //////////////////////////////////////////////// AST* UntypedExp_Variant::genAST() { if (numTypes == 0) TypeError("'variant' only allowed when using types", pos); Ident typeId = symbolTable.lookupIdent(type); AST *t1 = exp1->genAST(); AST *t2 = exp2->genAST(); if (t1->order != oTerm1 || t2->order != oTerm2 || symbolTable.lookupType(typeId) != Typename) TypeError("Type mismatch at 'variant'", pos); // variant(p,T,A,a1) --> p.PATH in T & type(p,A) ASTVariantList *v = symbolTable.lookupTypeVariants(typeId); ASTVariantList::iterator i; for (i = v->begin(); i != v->end(); i++) if (strcmp((*i)->name, variant->str)==0) break; if (i == v->end()) TypeError((String) "Variant '" + variant->str + "' not found", pos); if (!(*i)->path) TypeError((String) "Type '" + type->str + "' not occuring in any universe", pos); BitList *bits = new BitList(*(*i)->path); UntypedExp_Type ttype(exp1, type, pos); AST *res = new ASTForm_And (new ASTForm_In(new ASTTerm1_Dot((ASTTerm1 *) t1, bits, pos), (ASTTerm2 *) t2, pos), (ASTForm *) ttype.genAST(), pos); ttype.exp = 0; ttype.type = 0; return res; } ////////// UntypedExp_ConstTree ////////////////////////////////////////////// AST* UntypedExp_ConstTree::genAST() { if (numTypes == 0) TypeError("'const_tree' predicate only allowed when using types", pos); Ident typeId = symbolTable.lookupIdent(type); if (symbolTable.lookupType(typeId) != Typename) TypeError("Type name expected", type->pos); AST *trash = exp->genAST(); if (trash->order != oTerm1) TypeError("Type mismatch at 'const_tree'", exp->pos); delete trash; Ident fresh = symbolTable.insertFresh(Varname2, symbolTable.allRealUnivs()); // (can't find any better univlist) ASTForm *eq = new ASTForm_Equal1(new ASTTerm1_TreeRoot(new ASTTerm2_Var2(fresh, pos), pos), (ASTTerm1 *) exp->genAST(), pos); ASTForm *f = new ASTForm_And(node->genAST(exp, fresh, typeId), eq, pos); return new ASTTerm2_Formula(fresh, f, pos); } ////////// UntypedExp_TreeRoot /////////////////////////////////////////////// AST* UntypedExp_TreeRoot::genAST() { if (numTypes == 0) TypeError("'tree_root' predicate only allowed when using types", pos); AST *T = exp->genAST(); if (T->order != oTerm2) TypeError("Type mismatch at 'tree_root'", pos); return new ASTTerm1_TreeRoot((ASTTerm2 *) T, pos); } ////////// UntypedExp_Restrict /////////////////////////////////////////////// AST* UntypedExp_Restrict::genAST() { AST *T = exp->genAST(); if (T->order != oForm) TypeError("Type mismatch at 'restrict'", pos); return new ASTForm_Restrict((ASTForm *) T, pos); } /////////////////////////////////////////////////////////////////////////////// // // // Declarations // // // /////////////////////////////////////////////////////////////////////////////// ////////// Predicate_Macro_Declaration /////////////////////////////////////// void Predicate_Macro_Declaration::genAST(MonaAST &) { symbolTable.openLocal(); IdentList *freeIdents = new IdentList; IdentList *formalIdents = new IdentList; IdentList *boundIdents = new IdentList; Ident ident; ParDeclList::iterator d; MonaTypeTag parKind = (MonaTypeTag) -1; for (d = parameters->begin(); d != parameters->end(); d++) { switch ((*d)->kind) { case pPar0: parKind = Parname0; break; case pPar1: parKind = Parname1; break; case pPar2: parKind = Parname2; break; case pParU: parKind = ParnameU; break; case pPar: if (parKind == -1) TypeError("Parameter type missing in declaration of '" + String(name->str) + "'", (*d)->pos); break; } if ((*d)->where && parKind != Parname1 && parKind != Parname2) TypeError("'where' only allowed at var1/var2", (*d)->pos); ident = symbolTable.insertVar((*d)->name, parKind, NULL, true); //univs?????? formalIdents->push_back(ident); boundIdents->push_back(ident); if ((*d)->where) { AST *f = (*d)->where->genAST(); // (restriction shouldn't be allowed to access other parameter vars.) if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(ident, (ASTForm *) f); } // update frees with restriction frees Ident d; ASTForm *fil = symbolTable.getRestriction(ident, &d); if (fil) { if (d != -1) boundIdents->insert(d); // skip the defaultwhere formal fil->freeVars(freeIdents, boundIdents); } } AST *f = body->genAST(); if (f->order != oForm) TypeError("Type mismatch at declaration of '" + String(name->str) + "'", pos); ((ASTForm *) f)->freeVars(freeIdents, boundIdents); symbolTable.closeLocal(); int id = symbolTable.insertPred(name); predicateLib.insert(formalIdents, freeIdents, boundIdents, (ASTForm *) f, kind == dMacro, id, source); predMacroEncountered = true; } ////////// Variable_Declaration ////////////////////////////////////////////// void Variable_Declaration::genAST(MonaAST &monaAST) { VarDeclList::iterator d; for (d = decls->begin(); d != decls->end(); d++) { MonaTypeTag t; switch (declKind) { case vVar0: t = Varname0; break; case vVar1: t = Varname1; break; case vVar2: t = Varname2; break; case vTree: if (numTypes == 0) TypeError("Tree declarations illegal when no types declared", pos); t = VarnameTree; break; default: invariant(false); } IdentList *u; switch (declKind) { case vVar0: u = NULL; break; case vVar1: case vVar2: case vTree: if (univs) u = symbolTable.lookupUnivIdents(*univs); else u = symbolTable.allRealUnivs(); break; default: invariant(false); } Ident id = symbolTable.insertVar((*d)->name, t, u); monaAST.globals.insert(id); if ((*d)->where) { AST *f = (*d)->where->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'where' expression", (*d)->pos); symbolTable.updateRestriction(id, (ASTForm *) f); } } } ////////// UntypedExp_LastPos //////////////////////////////////////////////// void LastPos_Declaration::genAST(MonaAST &monaAST) { if (options.mode == TREE) TypeError("'lastpos' not allowed in tree mode (use 'allpos')", pos); if (monaAST.lastPosVar != -1 || monaAST.allPosVar != -1) TypeError("'lastpos' or 'allpos' already declared", pos); monaAST.lastPosVar = symbolTable.lookupIdent(name); if (symbolTable.lookupType(name) != Varname1) TypeError("Type mismatch at 'lastpos'", pos); } ////////// UntypedExp_AllPos ///////////////////////////////////////////////// void AllPos_Declaration::genAST(MonaAST &monaAST) { if (monaAST.lastPosVar != -1 || monaAST.allPosVar != -1) TypeError("'lastpos' or 'allpos' already declared", pos); monaAST.allPosVar = symbolTable.lookupIdent(name); if (symbolTable.lookupType(name) != Varname2) TypeError("Type mismatch at 'allpos'", pos); } ////////// Universe_Declaration ////////////////////////////////////////////// void Universe_Declaration::genAST(MonaAST &monaAST) { if (options.mode != TREE) { cout << "Warning: 'universe' only used in tree mode\n"; return; } UnivList::iterator i; for (i = univList->begin(); i != univList->end(); i++) { if (numTypes > 0 && (*i)->type) { Ident t = symbolTable.lookupIdent((*i)->type); if (symbolTable.lookupType(t) != Typename) TypeError((String) "'" + (*i)->type->str + "' not declared as a type", (*i)->type->pos); symbolTable.insertUniv((*i)->name, t); } else if (!guide_declaration && (*i)->pos) TypeError("Universe position illegal when no guide declared", pos); else if (guide_declaration && !((*i)->pos)) TypeError("Universe position missing", pos); else if ((*i)->type) TypeError("Illegal universe position", pos); else if (numTypes > 0 && !(*i)->type) TypeError("Universe type missing", pos); else symbolTable.insertUniv((*i)->name, (*i)->pos); } } ////////// Expression_Declaration //////////////////////////////////////////// void Expression_Declaration::genAST(MonaAST &monaAST) { AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at expression", pos); monaAST.formula = new ASTForm_And(monaAST.formula, (ASTForm *) f, dummyPos); } ////////// Verify_Declaration //////////////////////////////////////////////// void Verify_Declaration::genAST(MonaAST &monaAST) { AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at expression", pos); monaAST.verifyformlist.push_back((ASTForm *) f); if (!title) title = ""; monaAST.verifytitlelist.push_back(title); } ////////// Execute_Declaration /////////////////////////////////////////////// void Execute_Declaration::genAST(MonaAST &monaAST) { AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at expression", pos); monaAST.formula = new ASTForm_IdLeft(monaAST.formula, (ASTForm *) f, dummyPos); } ////////// Assertion_Declaration ///////////////////////////////////////////// void Assertion_Declaration::genAST(MonaAST &monaAST) { AST *f = exp->genAST(); if (f->order != oForm) TypeError("Type mismatch at 'assert'", pos); monaAST.assertion = new ASTForm_And(monaAST.assertion, (ASTForm *) f, dummyPos); } ////////// Constant_Declaration ////////////////////////////////////////////// void Constant_Declaration::genAST(MonaAST&) { symbolTable.insertConst(name, aexp->evaluate()); } ////////// Guide_Declaration ///////////////////////////////////////////////// void Guide_Declaration::genAST(MonaAST &monaAST) { symbolTable.openLocal(); IdentList *univs = symbolTable.allUnivs(); if (univs && !univs->empty()) TypeError("Universes declared before guide", pos); if (univs) delete univs; if (guide_declaration) TypeError("Guide already declared", pos); if (numTypes > 0) TypeError("Cannot mix recursive types and guide declaration", pos); if (options.mode != TREE) TypeError("Guide not allowed in linear mode", pos); GuideFuncList::iterator i; for (i = funcList->begin(); i != funcList->end(); i++) symbolTable.insertStatespace((*i)->name1); guide_declaration = this; symbolTable.closeLocal(); } ////////// Default_Declaration /////////////////////////////////////////////// bool default1 = false, default2 = false; void Default_Declaration::genAST(MonaAST &) { if (predMacroEncountered) TypeError("'defaultwhere' declarations must come before all " "predicate and macro declarations", pos); MonaTypeTag t; switch (type) { case vVar1: t = Varname1; if (default1) TypeError("'defaultwhere1' already declared", pos); default1 = true; break; case vVar2: t = Varname2; if (default2) TypeError("'defaultwhere2' already declared", pos); default2 = true; break; default: invariant(false); } symbolTable.openLocal(); Ident id = symbolTable.insertVar(name, t, NULL, true); inDefault = true; AST *f = exp->genAST(); inDefault = false; if (f->order != oForm) TypeError("Type mismatch at 'defaultwhere'", pos); symbolTable.closeLocal(); symbolTable.setDefaultRestriction(t, (ASTForm *) f, id); } ////////// Type_Declaration ////////////////////////////////////////////////// void Type_Declaration::genAST(MonaAST &monaAST) { if (options.mode != TREE) TypeError("Types in linear mode not implemented", pos); if (guide_declaration) TypeError("Cannot mix type and guide declarations", pos); Ident id = symbolTable.lookupIdent(name); ASTVariantList *v = variants->genAST(); symbolTable.setTypeVariants(id, v); symbolTable.setTypeNumber(id, initTreetype(name->str, v->size())); for (ASTVariantList::iterator i = v->begin(); i != v->end(); i++) { ASTComponentList *c = (*i)->components; initTreetypeVariant((*i)->name, c ? c->size() : 0); if (c) for (ASTComponentList::iterator j = c->begin(); j != c->end(); j++) setTreetypeComponent((*j)->name, (*j)->type); } } void Type_Declaration::checkReachable() { if (!symbolTable.lookupTypeReachable(symbolTable.lookupIdent(name))) TypeError("Type not occuring in any universe", name->pos); } ////////// MonaUntypedAST //////////////////////////////////////////////////// MonaAST * MonaUntypedAST::typeCheck() { MonaAST *monaAST = new MonaAST(new ASTForm_True(dummyPos), // initial formula new ASTForm_True(dummyPos)); // initial assertion // desugar m2l-tree/str if (options.m2l) { UntypedExp *exp, *exp1, *exp2; UntypedExpList *elist; VarDeclList *vlist; char *varp = new char[2], *varP = new char[2], *vardol = new char[2]; strcpy(varp, "p"); strcpy(varP, "P"); strcpy(vardol, "$"); varp = symbolTable.insertString(varp), varP = symbolTable.insertString(varP), vardol = symbolTable.insertString(vardol); if (options.mode == TREE) { // m2l-tree --> tree; // var2 $ where all1 p where true: (p in $) => ((p^ in $) | (p^=p)); // allpos $; // defaultwhere1(p) = p in $; // defaultwhere2(P) = P sub $; // defaultwhere2(P) = P sub $; exp1 = new UntypedExp_Name(new Name(varP, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_Sub(exp1, exp2, dummyPos); declarations->push_front (new Default_Declaration(vVar2, new Name(varP, dummyPos), exp, dummyPos)); // defaultwhere1(p) = p in $; exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_In(exp1, exp2, dummyPos); declarations->push_front (new Default_Declaration(vVar1, new Name(varp, dummyPos), exp, dummyPos)); // allpos $; declarations->push_front (new AllPos_Declaration(new Name(vardol, dummyPos), dummyPos)); // var2 $ where all1 p where true: (p in $) => ((p^ in $) | (p^=p)); /*#warning bugfix: 'where true'*/ exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp1 = new UntypedExp_Up(exp1, dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_In(exp1, exp2, dummyPos); exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp1 = new UntypedExp_Up(exp1, dummyPos); exp2 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp1 = new UntypedExp_Equal(exp1, exp2, dummyPos); numImplicitUp = 2; exp = new UntypedExp_Or(exp, exp1, dummyPos); exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp1 = new UntypedExp_In(exp1, exp2, dummyPos); exp = new UntypedExp_Impl(exp1, exp, dummyPos); vlist = new VarDeclList(); vlist->push_back(new VarDecl(new Name(varp, dummyPos), new UntypedExp_True(dummyPos), dummyPos)); exp = new UntypedExp_All1(NULL, vlist, exp, dummyPos); vlist = new VarDeclList(); vlist->push_back(new VarDecl(new Name(vardol, dummyPos), exp, dummyPos)); declarations->push_front (new Variable_Declaration(vVar2, NULL, vlist, dummyPos)); } else { if (options.alternativeM2LStr) { // m2l-str --> linear; // var1 $ where true; // lastpos $; // defaultwhere1(p) = p <= $; // defaultwhere2(P) = P sub {0,...,$}; // defaultwhere2(P) = P sub {0,...,$}; elist = new UntypedExpList(); elist->push_back(new UntypedExp_Int(0, dummyPos)); elist->push_back(new UntypedExp_Interval(dummyPos)); elist->push_back(new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos)); exp1 = new UntypedExp_Name(new Name(varP, dummyPos), dummyPos); exp2 = new UntypedExp_Set(elist, dummyPos); exp = new UntypedExp_Sub(exp1, exp2, dummyPos); declarations->push_front (new Default_Declaration(vVar2, new Name(varP, dummyPos), exp, dummyPos)); // defaultwhere1(p) = p <= $; exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_LessEq(exp1, exp2, dummyPos); declarations->push_front (new Default_Declaration(vVar1, new Name(varp, dummyPos), exp, dummyPos)); // lastpos $; declarations->push_front (new LastPos_Declaration(new Name(vardol, dummyPos), dummyPos)); // var1 $ where true; vlist = new VarDeclList(); vlist->push_back(new VarDecl(new Name(vardol, dummyPos), new UntypedExp_True(dummyPos), dummyPos)); declarations->push_front (new Variable_Declaration(vVar1, NULL, vlist, dummyPos)); } else { // m2l-str --> linear; // var2 $ where ~ex1 p where true: p notin $ & p+1 in $; // allpos $; // defaultwhere1(p) = p in $; // defaultwhere2(P) = P sub $; // defaultwhere2(P) = P sub $; exp1 = new UntypedExp_Name(new Name(varP, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_Sub(exp1, exp2, dummyPos); declarations->push_front (new Default_Declaration(vVar2, new Name(varP, dummyPos), exp, dummyPos)); // defaultwhere1(p) = p in $; exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_In(exp1, exp2, dummyPos); declarations->push_front (new Default_Declaration(vVar1, new Name(varp, dummyPos), exp, dummyPos)); // allpos $; declarations->push_front (new AllPos_Declaration(new Name(vardol, dummyPos), dummyPos)); // var2 $ where ~ex1 p where true: p notin $ & p+1 in $; exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp = new UntypedExp_NotIn(exp1, exp2, dummyPos); exp1 = new UntypedExp_Name(new Name(varp, dummyPos), dummyPos); exp1 = new UntypedExp_Plus(exp1, new ArithExp_Integer(1, dummyPos), dummyPos); exp2 = new UntypedExp_Name(new Name(vardol, dummyPos), dummyPos); exp2 = new UntypedExp_In(exp1, exp2, dummyPos); exp = new UntypedExp_And(exp, exp2, dummyPos); vlist = new VarDeclList(); vlist->push_back(new VarDecl(new Name(varp, dummyPos), new UntypedExp_True(dummyPos), dummyPos)); exp = new UntypedExp_Ex1(NULL, vlist, exp, dummyPos); exp = new UntypedExp_Not(exp, dummyPos); vlist = new VarDeclList(); vlist->push_back(new VarDecl(new Name(vardol, dummyPos), exp, dummyPos)); declarations->push_front (new Variable_Declaration(vVar2, NULL, vlist, dummyPos)); } } } // initialize tree types for (unsigned i = 0; i < declarations->size(); i++) { Declaration *d = declarations->get(i); if (d->kind == dType) { symbolTable.insertType(((Type_Declaration *) d)->name); numTypes++; } } if (numTypes > 0) initTreetypes(numTypes); // iterate through guide/universe/type declarations for (DeclarationList::iterator decl = declarations->begin(); decl != declarations->end(); decl++) switch ((*decl)->kind) { case dGuide: case dUniverse: case dType: (*decl)->genAST(*monaAST); default: ; } if (numTypes > 0) setComponentTypes(); // make GTA guide if (options.mode == TREE) makeGTAGuide(); // make AST of other declarations for (DeclarationList::iterator decl = declarations->begin(); decl != declarations->end(); decl++) switch ((*decl)->kind) { case dGuide: case dUniverse: break; case dType: ((Type_Declaration *) (*decl))->checkReachable(); break; default: (*decl)->genAST(*monaAST); } return monaAST; } mona-1.4/Front/untyped.h0000644000414100000240000006637210756504270012174 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __UNTYPED_H #define __UNTYPED_H #include "ast.h" #include "symboltable.h" #include "printline.h" extern char *file; void TypeError(String str, Pos &p); ////////// Arithmetic expressions ///////////////////////////////////////////// enum ArithExpKind { aAdd, aConst, aDiv, aInteger, aMult, aSubtr }; class ArithExp { public: ArithExp(ArithExpKind k, Pos p) : kind(k), pos(p) {} virtual ~ArithExp() {}; virtual int evaluate() = 0; ArithExpKind kind; Pos pos; }; class ArithExp_par_aa: public ArithExp { public: ArithExp_par_aa(ArithExpKind k, ArithExp *a1, ArithExp *a2, Pos p) : ArithExp(k, p), aexp1(a1), aexp2(a2) {} virtual ~ArithExp_par_aa() {delete aexp1; delete aexp2;} ArithExp *aexp1; ArithExp *aexp2; }; class ArithExp_Add: public ArithExp_par_aa { public: ArithExp_Add(ArithExp *aexp1, ArithExp *aexp2, Pos p) : ArithExp_par_aa(aAdd, aexp1, aexp2, p) {} int evaluate(); }; class ArithExp_Subtr: public ArithExp_par_aa { public: ArithExp_Subtr(ArithExp *aexp1, ArithExp *aexp2, Pos p) : ArithExp_par_aa(aSubtr, aexp1, aexp2, p) {} int evaluate(); }; class ArithExp_Mult: public ArithExp_par_aa { public: ArithExp_Mult(ArithExp *aexp1, ArithExp *aexp2, Pos p) : ArithExp_par_aa(aMult, aexp1, aexp2, p) {} int evaluate(); }; class ArithExp_Div: public ArithExp_par_aa { public: ArithExp_Div(ArithExp *aexp1, ArithExp *aexp2, Pos p) : ArithExp_par_aa(aDiv, aexp1, aexp2, p) {} int evaluate(); }; class ArithExp_Integer: public ArithExp { public: ArithExp_Integer(int c, Pos p) : ArithExp(aInteger, p), n(c) {} int evaluate(); int n; }; class ArithExp_Const: public ArithExp { public: ArithExp_Const(Name *n, Pos p) : ArithExp(aConst, p), name(n) {} virtual ~ArithExp_Const() {delete name;} int evaluate(); Name *name; }; ////////// Untyped expressions //////////////////////////////////////////////// enum UntypedExpNodeKind { uAll0, uAll1, uAll2, uAnd, uBiimpl, uCall, uDiv, uDot, uEmpty, uEmptyPred, uEqual, uEx0, uEx1, uEx2, uFalse, uGreater, uGreaterEq, uImpl, uIn, uInt, uInter, uInterval, uLess, uLessEq, uLet0, uLet1, uLet2, uMax, uMin, uMinus, uMinusModulo, uMult, uName, uNot, uNotEqual, uNotIn, uOr, uPlus, uPlusModulo, uRoot, uSet, uSetminus, uSub, uRestrict, uTrue, uUnion, uUp, uImport, uExport, uPrefix, uRootPred, uInStateSpace, uSucc, uWellFormedTree, uType, uSomeType, uVariant, uConstTree, uTreeRoot }; class UntypedExp { public: UntypedExp(UntypedExpNodeKind k, Pos p) : kind(k), pos(p) {} virtual ~UntypedExp() {}; virtual AST *genAST() = 0; UntypedExpNodeKind kind; Pos pos; }; class UntypedExpList: public DequeGC {}; ////////// Variable declaration /////////////////////////////////////////////// enum VarDeclKind { vVar0, vVar1, vVar2, vTree }; class VarDecl { public: VarDecl() {} VarDecl(Name *n, UntypedExp *w, Pos p) : name(n), where(w), pos(p) {} ~VarDecl() {delete name; delete where;} Name *name; UntypedExp *where; Pos pos; }; class VarDeclList: public DequeGC {}; ////////// Untyped binds ////////////////////////////////////////////////////// class BindExp { public: BindExp(Name *n, UntypedExp *e, Pos p) : name(n), exp(e), pos(p) {} ~BindExp() {delete name; delete exp;} Name *name; UntypedExp *exp; Pos pos; }; class BindExpList: public DequeGC {}; ////////// Import Maps //////////////////////////////////////////////////////// class ImportMap { public: ImportMap(Name *n1, Name *n2, Pos p) : name1(n1), name2(n2), pos(p) {} ~ImportMap() {delete name1; delete name2;} Name *name1, *name2; Pos pos; }; class ImportMapList: public DequeGC {}; ////////// Types ////////////////////////////////////////////////////////////// class Component { public: Component(Name *n, Name *t, Pos p) : name(n), type(t), pos(p) {} ~Component() {delete name; delete type;} ASTComponent *genAST(); Name *name; Name *type; Pos pos; }; class ComponentList: public DequeGC { public: ASTComponentList *genAST(); }; class Variant { public: Variant(Name *n, ComponentList *c, Pos p) : name(n), components(c), pos(p) {} ~Variant() {delete name; delete components;} ASTVariant *genAST(); Name *name; ComponentList *components; Pos pos; }; class VariantList: public DequeGC { public: ASTVariantList *genAST(); }; class ConstNodeList; class ConstNode { public: ConstNode(Name *v, ConstNodeList *c, Pos p) : variant(v), components(c), pos(p) {} ~ConstNode() {delete variant; /* can't delete components here */} ASTForm *genAST(UntypedExp *t, Ident treevarId, Ident typeId); Name *variant; ConstNodeList *components; Pos pos; }; class ConstNodeList: public Deque { public: ~ConstNodeList() {for (iterator i = begin(); i != end(); i++) {delete (*i)->components; delete *i;}} }; ////////// Parameterized classes ////////////////////////////////////////////// class UntypedExp_par_e: public UntypedExp { public: UntypedExp_par_e(UntypedExpNodeKind k, UntypedExp *e, Pos p) : UntypedExp(k, p), exp(e) {} virtual ~UntypedExp_par_e() {delete exp;} UntypedExp *exp; }; class UntypedExp_par_ee: public UntypedExp { public: UntypedExp_par_ee(UntypedExpNodeKind k, UntypedExp *e1, UntypedExp *e2, Pos p) : UntypedExp(k, p), exp1(e1), exp2(e2) {} virtual ~UntypedExp_par_ee() {delete exp1; delete exp2;} UntypedExp *exp1; UntypedExp *exp2; }; class UntypedExp_par_npee: public UntypedExp { public: UntypedExp_par_npee(UntypedExpNodeKind k, VarDeclList *d, UntypedExp *e, Pos p) : UntypedExp(k, p), nameList(d), exp(e) {} virtual ~UntypedExp_par_npee() {delete nameList; delete exp;} VarDeclList *nameList; UntypedExp *exp; }; class UntypedExp_par_unpee: public UntypedExp { public: UntypedExp_par_unpee(UntypedExpNodeKind k, NameList *ul, VarDeclList *d, UntypedExp *e, Pos p) : UntypedExp(k, p), exp(e), univList(ul), nameList(d) {} virtual ~UntypedExp_par_unpee() {delete nameList; delete exp; delete univList;} UntypedExp *exp; NameList *univList; VarDeclList *nameList; }; class UntypedExp_par_bpe: public UntypedExp { public: UntypedExp_par_bpe(UntypedExpNodeKind k, BindExpList *bl, UntypedExp *e, Pos p) : UntypedExp(k, p), bindList(bl), exp(e) {} virtual ~UntypedExp_par_bpe() {delete bindList; delete exp;} BindExpList *bindList; UntypedExp *exp; }; class UntypedExp_par_ea: public UntypedExp { public: UntypedExp_par_ea(UntypedExpNodeKind k, UntypedExp *e, ArithExp *ae, Pos p) : UntypedExp(k, p), exp(e), aexp(ae) {} virtual ~UntypedExp_par_ea() {delete exp; delete aexp;} UntypedExp *exp; ArithExp *aexp; }; class UntypedExp_par_eae: public UntypedExp { public: UntypedExp_par_eae(UntypedExpNodeKind k, UntypedExp *e1, ArithExp *ae, UntypedExp *e2, Pos p) : UntypedExp(k, p), exp1(e1), aexp(ae), exp2(e2) {} virtual ~UntypedExp_par_eae() {delete exp1; delete aexp; delete exp2;} UntypedExp *exp1; ArithExp *aexp; UntypedExp *exp2; }; ////////// Syntactical categories of UntypedExp /////////////////////////////// class UntypedExp_Name: public UntypedExp { public: UntypedExp_Name(Name *n, Pos p) : UntypedExp(uName, p), name(n) {} virtual ~UntypedExp_Name() {delete name;} AST *genAST(); Name *name; }; class UntypedExp_Sub: public UntypedExp_par_ee { public: UntypedExp_Sub(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uSub, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_In: public UntypedExp_par_ee { public: UntypedExp_In(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uIn, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_NotIn: public UntypedExp_par_ee { public: UntypedExp_NotIn(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uNotIn, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Min: public UntypedExp_par_e { public: UntypedExp_Min(UntypedExp *exp, Pos p) : UntypedExp_par_e(uMin, exp, p) {} AST *genAST(); }; class UntypedExp_Max: public UntypedExp_par_e { public: UntypedExp_Max(UntypedExp *exp, Pos p) : UntypedExp_par_e(uMax, exp, p) {} AST *genAST(); }; class UntypedExp_Set: public UntypedExp { public: UntypedExp_Set(UntypedExpList *expList, Pos p) : UntypedExp(uSet, p), expList(expList) {} virtual ~UntypedExp_Set() {delete expList;} AST *genAST(); UntypedExpList *expList; }; class UntypedExp_Interval: public UntypedExp { public: UntypedExp_Interval(Pos p) : UntypedExp(uInterval, p) {} AST *genAST(); }; class UntypedExp_Less: public UntypedExp_par_ee { public: UntypedExp_Less(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uLess, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_LessEq: public UntypedExp_par_ee { public: UntypedExp_LessEq(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uLessEq, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Greater: public UntypedExp_par_ee { public: UntypedExp_Greater(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uGreater, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_GreaterEq: public UntypedExp_par_ee { public: UntypedExp_GreaterEq(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uGreaterEq, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Equal: public UntypedExp_par_ee { public: UntypedExp_Equal(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uEqual, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_NotEqual: public UntypedExp_par_ee { public: UntypedExp_NotEqual(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uNotEqual, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Union: public UntypedExp_par_ee { public: UntypedExp_Union(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uUnion, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Inter: public UntypedExp_par_ee { public: UntypedExp_Inter(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uInter, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Setminus: public UntypedExp_par_ee { public: UntypedExp_Setminus(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uSetminus, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Impl: public UntypedExp_par_ee { public: UntypedExp_Impl(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uImpl, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Biimpl: public UntypedExp_par_ee { public: UntypedExp_Biimpl(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uBiimpl, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_And: public UntypedExp_par_ee { public: UntypedExp_And(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uAnd, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Or: public UntypedExp_par_ee { public: UntypedExp_Or(UntypedExp *exp1, UntypedExp *exp2, Pos p) : UntypedExp_par_ee(uOr, exp1, exp2, p) {} AST *genAST(); }; class UntypedExp_Not: public UntypedExp_par_e { public: UntypedExp_Not(UntypedExp *exp, Pos p) : UntypedExp_par_e(uNot, exp, p) {} AST *genAST(); }; class UntypedExp_Dot: public UntypedExp { public: UntypedExp_Dot(UntypedExp *e, char *bts, Pos p) : UntypedExp(uDot, p), bits(bts), exp(e) {} virtual ~UntypedExp_Dot() {delete exp;} AST *genAST(); char *bits; UntypedExp *exp; }; class UntypedExp_Up: public UntypedExp_par_e { public: UntypedExp_Up(UntypedExp *exp, Pos p) : UntypedExp_par_e(uUp, exp, p) {} AST *genAST(); }; class UntypedExp_Ex0: public UntypedExp_par_npee { public: UntypedExp_Ex0(VarDeclList *d, UntypedExp *exp, Pos p) : UntypedExp_par_npee(uEx0, d, exp, p) {} AST *genAST(); }; class UntypedExp_Ex1: public UntypedExp_par_unpee { public: UntypedExp_Ex1(NameList *univList, VarDeclList *d, UntypedExp *exp, Pos p) : UntypedExp_par_unpee(uEx1, univList, d, exp, p) {} AST *genAST(); }; class UntypedExp_Ex2: public UntypedExp_par_unpee { public: UntypedExp_Ex2(NameList *univList, VarDeclList *d, UntypedExp *exp, Pos p) : UntypedExp_par_unpee(uEx2, univList, d, exp, p) {} AST *genAST(); }; class UntypedExp_All0: public UntypedExp_par_npee { public: UntypedExp_All0(VarDeclList *d, UntypedExp *exp, Pos p) : UntypedExp_par_npee(uAll0, d, exp, p) {} AST *genAST(); }; class UntypedExp_All1: public UntypedExp_par_unpee { public: UntypedExp_All1(NameList *univList, VarDeclList *d, UntypedExp *exp, Pos p) : UntypedExp_par_unpee(uAll1, univList, d, exp, p) {} AST *genAST(); }; class UntypedExp_All2: public UntypedExp_par_unpee { public: UntypedExp_All2(NameList *univList, VarDeclList *d, UntypedExp *exp, Pos p) : UntypedExp_par_unpee(uAll2, univList, d, exp, p) {} AST *genAST(); }; class UntypedExp_Let0: public UntypedExp_par_bpe { public: UntypedExp_Let0(BindExpList *bindList, UntypedExp *exp, Pos p) : UntypedExp_par_bpe(uLet0, bindList, exp, p) {} AST *genAST(); }; class UntypedExp_Let1: public UntypedExp_par_bpe { public: UntypedExp_Let1(BindExpList *bindList, UntypedExp *exp, Pos p) : UntypedExp_par_bpe(uLet1, bindList, exp, p) {} AST *genAST(); }; class UntypedExp_Let2: public UntypedExp_par_bpe { public: UntypedExp_Let2(BindExpList *bindList, UntypedExp *exp, Pos p) : UntypedExp_par_bpe(uLet2, bindList, exp, p) {} AST *genAST(); }; class UntypedExp_Call: public UntypedExp { public: UntypedExp_Call(Name *n, UntypedExpList *el, Pos p) : UntypedExp(uCall, p), name(n), expList(el) {} virtual ~UntypedExp_Call() {delete name; delete expList;} AST *genAST(); Name *name; UntypedExpList *expList; }; class UntypedExp_Empty: public UntypedExp { public: UntypedExp_Empty(Pos p) : UntypedExp(uEmpty, p) {} AST *genAST(); }; class UntypedExp_True: public UntypedExp { public: UntypedExp_True(Pos p) : UntypedExp(uTrue, p) {} AST *genAST(); }; class UntypedExp_False: public UntypedExp { public: UntypedExp_False(Pos p) : UntypedExp(uFalse, p) {} AST *genAST(); }; class UntypedExp_Root: public UntypedExp { public: UntypedExp_Root(Name *n, Pos p) : UntypedExp(uRoot, p), name(n) {} ~UntypedExp_Root() {delete name;} AST *genAST(); Name *name; }; class UntypedExp_RootPred: public UntypedExp { public: UntypedExp_RootPred(UntypedExp *e, NameList *ul, Pos p) : UntypedExp(uRootPred, p), exp(e), univList(ul) {} virtual ~UntypedExp_RootPred() {delete exp; delete univList;} AST *genAST(); UntypedExp *exp; NameList *univList; }; class UntypedExp_EmptyPred: public UntypedExp_par_e { public: UntypedExp_EmptyPred(UntypedExp *exp, Pos p) : UntypedExp_par_e(uEmptyPred, exp, p) {} AST *genAST(); }; class UntypedExp_Plus: public UntypedExp_par_ea { public: UntypedExp_Plus(UntypedExp *exp, ArithExp *aexp, Pos p) : UntypedExp_par_ea(uPlus, exp, aexp, p) {} AST *genAST(); }; class UntypedExp_Minus: public UntypedExp_par_ea { public: UntypedExp_Minus(UntypedExp *exp, ArithExp *aexp, Pos p) : UntypedExp_par_ea(uMinus, exp, aexp, p) {} AST *genAST(); }; class UntypedExp_PlusModulo: public UntypedExp_par_eae { public: UntypedExp_PlusModulo(UntypedExp *exp1, ArithExp *aexp, UntypedExp *exp2, Pos p) : UntypedExp_par_eae(uPlusModulo, exp1, aexp, exp2, p) {} AST *genAST(); }; class UntypedExp_MinusModulo: public UntypedExp_par_eae { public: UntypedExp_MinusModulo(UntypedExp *exp1, ArithExp *aexp, UntypedExp *exp2, Pos p) : UntypedExp_par_eae(uMinusModulo, exp1, aexp, exp2, p) {} AST *genAST(); }; class UntypedExp_Mult: public UntypedExp_par_ea { public: UntypedExp_Mult(UntypedExp *exp, ArithExp *aexp, Pos p) : UntypedExp_par_ea(uMult, exp, aexp, p) {} AST *genAST(); }; class UntypedExp_Div: public UntypedExp_par_ea { public: UntypedExp_Div(UntypedExp *exp, ArithExp *aexp, Pos p) : UntypedExp_par_ea(uDiv, exp, aexp, p) {} AST *genAST(); }; class UntypedExp_Int: public UntypedExp { public: UntypedExp_Int(int c, Pos p) : UntypedExp(uInt, p), n(c) {} AST *genAST(); int n; }; class UntypedExp_Import: public UntypedExp { public: UntypedExp_Import(char *f, ImportMapList *ml, Pos p) : UntypedExp(uImport, p), file(f), mapList(ml) {} virtual ~UntypedExp_Import() {delete mapList;} AST *genAST(); char *file; ImportMapList *mapList; }; class UntypedExp_Export: public UntypedExp { public: UntypedExp_Export(char *f, UntypedExp *e, Pos p) : UntypedExp(uExport, p), file(f), exp(e) {} virtual ~UntypedExp_Export() {delete exp;} AST *genAST(); char *file; UntypedExp *exp; }; class UntypedExp_Prefix: public UntypedExp { public: UntypedExp_Prefix(UntypedExp *e, Pos p) : UntypedExp(uPrefix, p), exp(e) {} virtual ~UntypedExp_Prefix() {delete exp;} AST *genAST(); UntypedExp *exp; }; class UntypedExp_InStateSpace: public UntypedExp { public: UntypedExp_InStateSpace(UntypedExp *e, NameList *s, Pos p) : UntypedExp(uInStateSpace, p), exp(e), ss(s) {} virtual ~UntypedExp_InStateSpace() {delete exp; delete ss;} AST *genAST(); UntypedExp *exp; NameList *ss; }; class UntypedExp_Succ: public UntypedExp { public: UntypedExp_Succ(UntypedExp *e, Name *t, Name *v, Name *c, Pos p) : UntypedExp(uSucc, p), exp(e), type(t), variant(v), component(c) {} virtual ~UntypedExp_Succ() {delete exp; delete type; delete variant; delete component;} AST *genAST(); UntypedExp *exp; Name *type; Name *variant; Name *component; }; class UntypedExp_WellFormedTree: public UntypedExp { public: UntypedExp_WellFormedTree(UntypedExp *e, Pos p) : UntypedExp(uWellFormedTree, p), exp(e) {} virtual ~UntypedExp_WellFormedTree() {delete exp;} AST *genAST(); UntypedExp *exp; }; class UntypedExp_Type: public UntypedExp { public: UntypedExp_Type(UntypedExp *e, Name *t, Pos p) : UntypedExp(uType, p), exp(e), type(t) {} virtual ~UntypedExp_Type() {delete exp; delete type;} AST *genAST(); UntypedExp *exp; Name *type; }; class UntypedExp_SomeType: public UntypedExp { public: UntypedExp_SomeType(UntypedExp *e, Pos p) : UntypedExp(uSomeType, p), exp(e) {} virtual ~UntypedExp_SomeType() {delete exp;} AST *genAST(); UntypedExp *exp; }; class UntypedExp_Variant: public UntypedExp { public: UntypedExp_Variant(UntypedExp *e1, UntypedExp *e2, Name *t, Name *v, Pos p) : UntypedExp(uVariant, p), exp1(e1), exp2(e2), type(t), variant(v) {} virtual ~UntypedExp_Variant() {delete exp1; delete exp2; delete type; delete variant;} AST *genAST(); UntypedExp *exp1; UntypedExp *exp2; Name *type; Name *variant; }; class UntypedExp_ConstTree: public UntypedExp { public: UntypedExp_ConstTree(UntypedExp *e, Name *t, ConstNode *n, Pos p) : UntypedExp(uConstTree, p), exp(e), type(t), node(n) {} virtual ~UntypedExp_ConstTree() {delete exp; delete type; delete node->components; delete node;} AST *genAST(); UntypedExp *exp; Name *type; ConstNode *node; }; class UntypedExp_TreeRoot: public UntypedExp { public: UntypedExp_TreeRoot(UntypedExp *e, Pos p) : UntypedExp(uTreeRoot, p), exp(e) {} virtual ~UntypedExp_TreeRoot() {delete exp;} AST *genAST(); UntypedExp *exp; }; class UntypedExp_Restrict: public UntypedExp { public: UntypedExp_Restrict(UntypedExp *e, Pos p) : UntypedExp(uRestrict, p), exp(e) {} virtual ~UntypedExp_Restrict() {delete exp;} AST *genAST(); UntypedExp *exp; }; ////////// Guide declaration ////////////////////////////////////////////////// enum SSKind { SS_UNIVHAT, SS_ORHAT, SS_ORLEAF, SS_AND, SS_DUMMY, SS_NA }; class GuideFunc { public: GuideFunc(Name *n1, Name *n2, Name *n3, SSKind k = SS_NA) : name1(n1), name2(n2), name3(n3), kind(k) {} ~GuideFunc() {delete name1; delete name2; delete name3;} Name *name1; Name *name2; Name *name3; SSKind kind; }; class GuideFuncList: public DequeGC {}; ////////// Universe declaration /////////////////////////////////////////////// class Univ { public: Univ(Name *n, char *p = NULL, int d = 0) : name(n), pos(p), type(0), depth(d) {} Univ(Name *n, Name *t) : name(n), pos(0), type(t) {} ~Univ() {delete name; delete type;} Name *name; char *pos; Name *type; /* if pos==0, type is used */ int depth; }; class UnivList: public DequeGC {}; ////////// Parameter declaration auxiliary classes //////////////////////////// enum ParDeclKind { pPar0, pPar1, pPar2, pParU, pPar }; class ParDecl { public: ParDecl() {} ParDecl(ParDeclKind k, Name *n, UntypedExp *w, Pos p) : kind(k), name(n), where(w), pos(p) {} ~ParDecl() {delete name; delete where;} ParDeclKind kind; Name *name; UntypedExp *where; Pos pos; }; class ParDeclList: public DequeGC {}; ////////// Declarations /////////////////////////////////////////////////////// enum DeclarationKind { dAssertion, dConstant, dDefault, dExpression, dGuide, dMacro, dPredicate, dUniverse, dVariable, dLastPos, dAllPos, dExecute, dType, dVerify }; class Declaration { public: Declaration() {} Declaration(DeclarationKind k, Pos p) : kind(k), pos(p) {} virtual ~Declaration() {}; virtual void genAST(MonaAST &monaAST) = 0; DeclarationKind kind; Pos pos; }; class DeclarationList: public DequeGC {}; class Predicate_Macro_Declaration: public Declaration { public: Predicate_Macro_Declaration(DeclarationKind k, Name *n, ParDeclList *pars, UntypedExp *b, Pos p) : Declaration(k, p), name(n), parameters(pars), body(b) {source = file;} virtual ~Predicate_Macro_Declaration() {delete name; delete parameters; delete body;} void genAST(MonaAST &monaAST); Name *name; ParDeclList *parameters; UntypedExp *body; char *source; }; class Predicate_Declaration: public Predicate_Macro_Declaration { public: Predicate_Declaration(Name *n, ParDeclList *pars, UntypedExp *b, Pos p) : Predicate_Macro_Declaration(dPredicate, n, pars, b, p) {} }; class Macro_Declaration: public Predicate_Macro_Declaration { public: Macro_Declaration(Name *n, ParDeclList *pars, UntypedExp *b, Pos p) : Predicate_Macro_Declaration(dMacro, n, pars, b, p) {} }; class Variable_Declaration: public Declaration { public: Variable_Declaration(VarDeclKind k, NameList *u, VarDeclList *d, Pos p) : Declaration(dVariable, p), declKind(k), univs(u), decls(d) {} virtual ~Variable_Declaration() {delete univs; delete decls;} void genAST(MonaAST &monaAST); VarDeclKind declKind; NameList *univs; VarDeclList *decls; }; class Universe_Declaration: public Declaration { public: Universe_Declaration(UnivList *ul, Pos p) : Declaration(dUniverse, p), univList(ul) {} virtual ~Universe_Declaration() {delete univList;} void genAST(MonaAST &monaAST); UnivList *univList; }; class Expression_Declaration: public Declaration { public: Expression_Declaration(UntypedExp *e, Pos p) : Declaration(dExpression, p), exp(e) {} virtual ~Expression_Declaration() {delete exp;} void genAST(MonaAST &monaAST); UntypedExp *exp; }; class Verify_Declaration: public Declaration { public: Verify_Declaration(char *t, UntypedExp *e, Pos p) : Declaration(dVerify, p), title(t), exp(e) {} virtual ~Verify_Declaration() {delete exp;} void genAST(MonaAST &monaAST); char *title; UntypedExp *exp; }; class Execute_Declaration: public Declaration { public: Execute_Declaration(UntypedExp *e, Pos p) : Declaration(dExecute, p), exp(e) {} virtual ~Execute_Declaration() {delete exp;} void genAST(MonaAST &monaAST); UntypedExp *exp; }; class Assertion_Declaration: public Declaration { public: Assertion_Declaration(UntypedExp *e, Pos p) : Declaration(dAssertion, p), exp(e) {} virtual ~Assertion_Declaration() {delete exp;} void genAST(MonaAST &monaAST); UntypedExp *exp; }; class Constant_Declaration: public Declaration { public: Constant_Declaration(Name *n, ArithExp *a, Pos p) : Declaration(dConstant, p), name(n), aexp(a) {} virtual ~Constant_Declaration() {delete name; delete aexp;} void genAST(MonaAST &monaAST); Name *name; ArithExp *aexp; }; class Guide_Declaration: public Declaration { public: Guide_Declaration(GuideFuncList *g, Pos p) : Declaration(dGuide, p), funcList(g) {} virtual ~Guide_Declaration() {delete funcList;} void genAST(MonaAST &monaAST); GuideFuncList *funcList; }; class Default_Declaration: public Declaration { public: Default_Declaration(VarDeclKind k, Name *n, UntypedExp *e, Pos p) : Declaration(dDefault, p), type(k), name(n), exp(e) {} virtual ~Default_Declaration() {delete name; delete exp;} void genAST(MonaAST &monaAST); VarDeclKind type; Name *name; UntypedExp *exp; }; class LastPos_Declaration: public Declaration { public: LastPos_Declaration(Name *n, Pos p) : Declaration(dLastPos, p), name(n) {} virtual ~LastPos_Declaration() {delete name;} void genAST(MonaAST &monaAST); Name *name; }; class AllPos_Declaration: public Declaration { public: AllPos_Declaration(Name *n, Pos p) : Declaration(dAllPos, p), name(n) {} virtual ~AllPos_Declaration() {delete name;} void genAST(MonaAST &monaAST); Name *name; }; class Type_Declaration: public Declaration { public: Type_Declaration(Name *n, VariantList *vl, Pos p) : Declaration(dType, p), name(n), variants(vl) {} virtual ~Type_Declaration() {delete name; delete variants;} void genAST(MonaAST &monaAST); void checkReachable(); Name *name; VariantList *variants; }; ////////// Main untyped AST /////////////////////////////////////////////////// class MonaUntypedAST { public: MonaUntypedAST(DeclarationList *decls) : declarations(decls) {} ~MonaUntypedAST() {delete declarations;} MonaAST *typeCheck(); // GTA guide construction (makeguide.cpp) void makeGTAGuide(); char *typedUnivs2guide(unsigned num, IdentList *univs, unsigned idx, char *pos); char *variants2guide(unsigned num, ASTVariantList *variants, unsigned idx, IdentList *typeSet, Ident typeId, char *univ, char *type, char *pos); char* components2guide(unsigned num, ASTComponentList *components, unsigned idx, IdentList *typeSet, Ident typeId, unsigned variantidx, char *univ, char *type, char *variant, char *pos); GuideFunc *makeStateSpace(char *ssname, char *pos, char **leftpos, char **rightpos, SSKind kind); char *makeDummySS(char *univ); DeclarationList *declarations; }; #endif mona-1.4/Lib/0000777000414100000240000000000011045777453010026 500000000000000mona-1.4/Lib/makefile.am0000644000414100000240000000027110764207701012025 00000000000000MAINTAINERCLEANFILES = makefile.in makefile bin_PROGRAMS = dfa2dot gta2dot dfa2dot_SOURCES = dfa2dot.c dfalib.c dfalib.h bddlib.h gta2dot_SOURCES = gta2dot.c gtalib.c gtalib.h bddlib.h mona-1.4/Lib/makefile.in0000644000414100000240000003452411045777402012051 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = dfa2dot$(EXEEXT) gta2dot$(EXEEXT) subdir = Lib DIST_COMMON = $(srcdir)/makefile.am $(srcdir)/makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_dfa2dot_OBJECTS = dfa2dot.$(OBJEXT) dfalib.$(OBJEXT) dfa2dot_OBJECTS = $(am_dfa2dot_OBJECTS) dfa2dot_LDADD = $(LDADD) am_gta2dot_OBJECTS = gta2dot.$(OBJEXT) gtalib.$(OBJEXT) gta2dot_OBJECTS = $(am_gta2dot_OBJECTS) gta2dot_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(dfa2dot_SOURCES) $(gta2dot_SOURCES) DIST_SOURCES = $(dfa2dot_SOURCES) $(gta2dot_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile dfa2dot_SOURCES = dfa2dot.c dfalib.c dfalib.h bddlib.h gta2dot_SOURCES = gta2dot.c gtalib.c gtalib.h bddlib.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Lib/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Lib/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done dfa2dot$(EXEEXT): $(dfa2dot_OBJECTS) $(dfa2dot_DEPENDENCIES) @rm -f dfa2dot$(EXEEXT) $(LINK) $(dfa2dot_LDFLAGS) $(dfa2dot_OBJECTS) $(dfa2dot_LDADD) $(LIBS) gta2dot$(EXEEXT): $(gta2dot_OBJECTS) $(gta2dot_DEPENDENCIES) @rm -f gta2dot$(EXEEXT) $(LINK) $(gta2dot_LDFLAGS) $(gta2dot_OBJECTS) $(gta2dot_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfa2dot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfalib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gta2dot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtalib.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/Lib/dfa2dot.c0000644000414100000240000000472310756504321011425 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "dfalib.h" void mdDump(mdDfa *dfa, FILE *file) { int i; fprintf(file, "digraph MONA_DFA_BDD {\n" " center = true;\n" " size = \"10.5,7.5\"\n" " orientation = landscape;\n" " node [shape=record];\n" " s1 [shape=record,label=\""); for (i = 0; i < dfa->states; i++) { fprintf(file, "{%d|<%d> %d}", (dfa->f[i] == mdREJECT) ? -1 : (dfa->f[i] == mdACCEPT) ? 1 : 0, i, i); if (i+1 < dfa->states) fprintf(file, "|"); } fprintf(file, "\"];\n"); fprintf(file, " node [shape = circle];"); for (i = 0; i < dfa->bddNodes; i++) if (dfa->bdd[i].idx != -1) fprintf(file, " %d [label=\"%d\"]", i, dfa->bdd[i].idx); fprintf(file, "\n node [shape = box];"); for (i = 0; i < dfa->bddNodes; i++) if (dfa->bdd[i].idx == -1) fprintf(file, " %d [label=\"%d\"]", i, dfa->bdd[i].lo); fprintf(file, "\n"); for (i = 0; i < dfa->states; i++) fprintf(file, " s1:%d -> %d [style=bold];\n", i, dfa->behaviour[i]); for (i = 0; i < dfa->bddNodes; i++) if (dfa->bdd[i].idx != -1) { mNode lo = dfa->bdd[i].lo; mNode hi = dfa->bdd[i].hi; fprintf(file, " %d -> %d [style=dashed];\n", i, lo); fprintf(file, " %d -> %d [style=filled];\n", i, hi); } fprintf(file, "}\n"); } int main(int argc, char *argv[]) { mdDfa *dfa; FILE *file; if (argc != 3) { printf("usage: dfa2dot \n"); exit(-1); } dfa = mdLoad(argv[1]); if (!dfa) { printf("dfa load error\n"); exit(-1); } if (!(file = fopen(argv[2], "w"))) { printf("unable to write to %s\n", argv[2]); exit(-1); } mdDump(dfa, file); fclose(file); mdFree(dfa); exit(0); } mona-1.4/Lib/dfalib.c0000644000414100000240000001070510756504321011320 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "dfalib.h" void makeIncident(mdDfa *dfa, mdState i, mNode n, int *j) { if (dfa->bdd[n].idx == -1) dfa->incident[i][*(j++)] = dfa->bdd[n].lo; else { makeIncident(dfa, i, dfa->bdd[n].lo, j); makeIncident(dfa, i, dfa->bdd[n].hi, j); } } mdDfa *mdLoad(char *filename) { FILE *file; mdDfa *dfa; mdState i; int j; if ((file = fopen(filename, "r")) == 0) return 0; dfa = (mdDfa *) malloc(sizeof(mdDfa)); if (fscanf(file, "MONA DFA\n" "number of variables: %u\n" "variables:", &dfa->numVars) != 1) { fclose(file); free(dfa); return 0; } dfa->var = (char **) malloc(sizeof(char *)*dfa->numVars); for (i = 0; i < dfa->numVars; i++) { char t[100]; fscanf(file, " %s", t); dfa->var[i] = (char *) malloc(sizeof(char)*(strlen(t)+1)); strcpy(dfa->var[i], t); } fscanf(file, "\norders:"); dfa->order = (int *) malloc(sizeof(int)*dfa->numVars); for (i = 0; i < dfa->numVars; i++) fscanf(file, " %d", &dfa->order[i]); if (fscanf(file, "\nstates: %u\n" "initial: %u\n" "bdd nodes: %u\n" "final:", &dfa->states, &dfa->q0, &dfa->bddNodes) != 3) { fclose(file); free(dfa); return 0; } dfa->f = (mdKind *) malloc(sizeof(mdKind)*dfa->states); for (i = 0; i < dfa->states; i++) { int t; fscanf(file, " %d", &t); dfa->f[i] = t; } fscanf(file, "\nbehaviour:"); dfa->behaviour = (mNode *) malloc(sizeof(mNode)*dfa->states); for (i = 0; i < dfa->states; i++) fscanf(file, " %u", &dfa->behaviour[i]); fscanf(file, "\nbdd:\n"); dfa->bdd = (mBdd *) malloc(sizeof(mBdd)*dfa->bddNodes); for (i = 0; i < dfa->bddNodes; i++) fscanf(file, "%i %u %u\n", &dfa->bdd[i].idx, &dfa->bdd[i].lo, &dfa->bdd[i].hi); dfa->incident = 0; fscanf(file, " "); if (fgetc(file) != 'e' || fgetc(file) != 'n' || fgetc(file) != 'd') { fclose(file); mdFree(dfa); return 0; } fclose(file); dfa->incident = (unsigned **) malloc(sizeof(unsigned *)*dfa->states); for (i = 0; i < dfa->states; i++) { dfa->incident[i] = (unsigned *) malloc(sizeof(unsigned)*(dfa->states+1)); j = 0; makeIncident(dfa, i, dfa->behaviour[i], &j); dfa->incident[i][j] = -1; } return dfa; } int mdStore(mdDfa *dfa, char *filename) { int i; FILE *file; if ((file = fopen(filename, "w")) == 0) return 0; fprintf(file, "MONA DFA\n" "number of variables: %u\n" "variables:", dfa->numVars); for (i = 0; i < dfa->numVars; i++) fprintf(file, " %s", dfa->var[i]); fprintf(file, "\norders:"); for (i = 0; i < dfa->numVars; i++) fprintf(file, " %d", dfa->order[i]); fprintf(file, "\nstates: %u\n" "initial: %u\n" "bdd nodes: %u\n" "final:", dfa->states, dfa->q0, dfa->bddNodes); for (i = 0; i < dfa->states; i++) { int t = dfa->f[i]; fprintf(file, " %d", t); } fprintf(file, "\nbehaviour:"); for (i = 0; i < dfa->states; i++) fprintf(file, " %u", dfa->behaviour[i]); fprintf(file, "\nbdd:\n"); for (i = 0; i < dfa->bddNodes; i++) fprintf(file, "%i %u %u\n", dfa->bdd[i].idx, dfa->bdd[i].lo, dfa->bdd[i].hi); fprintf(file, "end\n"); fclose(file); return 1; } void mdFree(mdDfa *dfa) { int i; if (dfa->incident) { for (i = 0; i < dfa->states; i++) free(dfa->incident[i]); free(dfa->incident); } free(dfa->behaviour); free(dfa->bdd); free(dfa->f); free(dfa); } mdState mdDelta(mdDfa *dfa, mdState s, mA a) { mNode n = dfa->behaviour[s]; while (dfa->bdd[n].idx != -1) if (a[dfa->bdd[n].idx]) n = dfa->bdd[n].hi; else n = dfa->bdd[n].lo; return dfa->bdd[n].lo; } mona-1.4/Lib/dfalib.h0000644000414100000240000000417610756504270011335 00000000000000/* dfalib.h - library for using MONA-generated external DFAs */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __DFALIB_H #define __DFALIB_H #include #include "bddlib.h" typedef unsigned mdState; /* index into state array */ typedef enum mdKind {mdREJECT = -1, mdDONTCARE = 0, mdACCEPT = 1} mdKind; typedef struct mdDfa { unsigned states; /* number of automaton states */ mdState q0; /* initial state */ mdKind *f; /* state kinds, reject/don't-care/accept */ unsigned numVars; /* number of free variables */ char **var; /* array of names of free variables */ int *order; /* array of orders of free variables (0/1/2) */ mdState **incident; /* -1 terminated arrays of states incident to q_i */ unsigned bddNodes; /* number of BDD nodes */ mBdd *bdd; /* array of BDD nodes */ mNode *behaviour; /* array of pointers to BDD nodes, one for each state */ } mdDfa; /* load DFA from text file */ mdDfa *mdLoad(char *filename); /* returns 0 if unable to load automaton */ /* write DFA to text file notice: when using external automata, the user has to ensure that the files are consistent and that involved BDDs are properly reduced and ordered */ int mdStore(mdDfa *dfa, char *filename); /* returns 0 if unable to write */ /* clean up DFA */ void mdFree(mdDfa *dfa); /* transition function */ mdState mdDelta(mdDfa *dfa, mdState s, mA a); #endif mona-1.4/Lib/bddlib.h0000644000414100000240000000221710756504270011326 00000000000000/* bddlib.h - BDD definitions for external automaton library */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __BDDLIB_H #define __BDDLIB_H typedef unsigned mNode; /* index into BDD array */ typedef char *mA; /* alphabet element, 0/1 array */ typedef struct mBdd { int idx; /* variable index, -1 iff leaf */ mNode lo; /* low pointer, if idx==-1 then lo contains state number */ mNode hi; /* high pointer */ } mBdd; #endif mona-1.4/Lib/gta2dot.c0000644000414100000240000000666110756504321011451 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "gtalib.h" void mgDump(mgGta *gta, FILE *file) { mgId d; fprintf(file, "digraph MONA_GTA_BDD {\n" " center = true;\n" " size = \"10.5,7.5\"\n" " orientation = landscape;\n\n"); for (d = 0; d < gta->numSS; d++) { mNode n; mgId l,r; mgId d1 = gta->stateSpace[d].leftSS; mgId d2 = gta->stateSpace[d].rightSS; fprintf(file, " node [shape = plaintext,\n" " label = \"state space: %s%s\\n\\n" "left state space: %s\\nright state space: %s\\n" "initial state: %u\"]; T_%u\n" " node [shape = record, label = \"", gta->stateSpace[d].name, (d == 0) ? " (root)" : "", gta->stateSpace[d1].name, gta->stateSpace[d2].name, gta->stateSpace[d].initial, d); for (l = 0; l < gta->stateSpace[d1].numStates; l++) for (r = 0; r < gta->stateSpace[d2].numStates; r++) fprintf(file, "%s(%u,%u)", (l > 0 || r > 0) ? "|" : "", l, r, l, r); fprintf(file, "\"]; B_%u\n" " T_%u -> B_%u [style = invis];\n" " node [shape = circle]; ", d, d, d); for (n = 0; n < gta->stateSpace[d].numBddNodes; n++) if (gta->stateSpace[d].bddNode[n].idx != -1) fprintf(file, " N_%u_%u [label = \"%u\"]", d, n, gta->stateSpace[d].bddNode[n].idx); fprintf(file, "\n node [shape = box];"); for (n = 0; n < gta->stateSpace[d].numBddNodes; n++) if (gta->stateSpace[d].bddNode[n].idx == -1) { fprintf(file, " N_%u_%u [label = \"%u", d, n, gta->stateSpace[d].bddNode[n].lo); if (d == 0) fprintf(file, " (%d)", gta->final[gta->stateSpace[d].bddNode[n].lo]); fprintf(file, "\"]"); } fprintf(file, "\n"); for (l = 0; l < gta->stateSpace[d1].numStates; l++) for (r = 0; r < gta->stateSpace[d2].numStates; r++) fprintf(file, " B_%u:F_%u_%u -> N_%u_%u [style = bold];\n", d, l, r, d, gta->stateSpace[d].behaviour[l][r]); for (n = 0; n < gta->stateSpace[d].numBddNodes; n++) if (gta->stateSpace[d].bddNode[n].idx != -1) { mNode lo = gta->stateSpace[d].bddNode[n].lo; mNode hi = gta->stateSpace[d].bddNode[n].hi; fprintf(file, " N_%u_%u -> N_%u_%u [style = dashed];\n", d, n, d, lo); fprintf(file, " N_%u_%u -> N_%u_%u [style = filled];\n", d, n, d, hi); } } fprintf(file, "}\n"); } int main(int argc, char *argv[]) { mgGta *gta; FILE *file; if (argc != 3) { printf("usage: gta2dot \n"); exit(-1); } gta = mgLoad(argv[1]); if (!gta) { printf("gta load error\n"); exit(-1); } if (!(file = fopen(argv[2], "w"))) { printf("unable to write to %s\n", argv[2]); exit(-1); } mgDump(gta, file); fclose(file); mgFree(gta); exit(0); } mona-1.4/Lib/gtalib.c0000644000414100000240000002663110756504321011346 00000000000000/* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include #include "gtalib.h" mgGta *mgLoad(char *filename) { FILE *file; mgGta *gta; mgId i, l, r; mgState j; mNode n; unsigned t; char buffer[1000], buffer2[1000]; int i1, i2, i3; if ((file = fopen(filename, "r")) == 0) return 0; gta = (mgGta *) memset(malloc(sizeof(mgGta)), 0, sizeof(mgGta)); if (fscanf(file, "MONA GTA\n" "number of variables: %u\n" "state spaces: %u\n" "universes: %u\n" "state space sizes:", >a->numVars, >a->numSS, >a->numUnivs) != 3) { fclose(file); mgFree(gta); return 0; } gta->stateSpace = (mgStateSpace *) memset(malloc(sizeof(mgStateSpace)*gta->numSS), 0, sizeof(mgStateSpace)*gta->numSS); for (i = 0; i < gta->numSS; i++) if (fscanf(file, " %u", >a->stateSpace[i].numStates) != 1) { fclose(file); mgFree(gta); return 0; } fscanf(file, "\nfinal:"); gta->final = (mgKind *) malloc(sizeof(mgKind)*gta->stateSpace[0].numStates); for (i = 0; i < gta->stateSpace[0].numStates; i++) { int f; fscanf(file, " %d", &f); gta->final[i] = f; } fscanf(file, "\nguide:\n"); for (i = 0; i < gta->numSS; i++) { if (fscanf(file, "%s %u %u\n", buffer, >a->stateSpace[i].leftSS, >a->stateSpace[i].rightSS) != 3) { fclose(file); mgFree(gta); return 0; } gta->stateSpace[i].name = (char *) malloc(strlen(buffer)+1); strcpy(gta->stateSpace[i].name, buffer); } if (fscanf(file, "\ntypes: %u\n", >a->numTypes) != 1) { fclose(file); mgFree(gta); return 0; } gta->type = (mgType *) malloc(sizeof(mgType)*gta->numTypes); for (i1 = 0; i1 < gta->numTypes; i1++) { mgType *t = >a->type[i1]; fscanf(file, "\ntype: %s\n", buffer); t->name = (char *) malloc(strlen(buffer)+1); strcpy(t->name, buffer); fscanf(file, "\nvariants: %u\n", &t->numVariants); t->variant = (mgTypeVariant *) malloc(sizeof(mgTypeVariant)*t->numVariants); for (i2 = 0; i2 < t->numVariants; i2++) { mgTypeVariant *v = &t->variant[i2]; fscanf(file, "\nvariant: %s ", buffer); v->name = (char *) malloc(strlen(buffer)+1); strcpy(v->name, buffer); fscanf(file, "%s\n", buffer); if (buffer[0] == '-') buffer[0] = 0; v->pos = (char *) malloc(strlen(buffer)+1); strcpy(v->pos, buffer); fscanf(file, "\ncomponents: %u\n", &v->numComponents); v->component = (mgTypeComponent *) malloc(sizeof(mgTypeComponent)*v->numComponents); for (i3 = 0; i3 < v->numComponents; i3++) { mgTypeComponent *c = &v->component[i3]; fscanf(file, "\n%s", buffer); c->name = (char *) malloc(strlen(buffer)+1); strcpy(c->name, buffer); fscanf(file, " %s ", buffer); if (buffer[0] == '-') buffer[0] = 0; c->pos = (char *) malloc(strlen(buffer)+1); strcpy(c->pos, buffer); fscanf(file, "%u\n", &c->type); } } } fscanf(file, "\nuniverses:\n"); gta->universe = (mgUniverse *) memset(malloc(sizeof(mgUniverse)*gta->numUnivs), 0, sizeof(mgUniverse)*gta->numUnivs); for (i = 0; i < gta->numUnivs; i++) { if (fscanf(file, "%s %s\n", buffer, buffer2) != 2) { fclose(file); mgFree(gta); return 0; } gta->universe[i].name = (char *) malloc(strlen(buffer)+1); strcpy(gta->universe[i].name, buffer); gta->universe[i].pos = (char *) malloc(strlen(buffer2)+1); strcpy(gta->universe[i].pos, buffer2); } fscanf(file, "\nvariable orders and state spaces:\n"); gta->var = (mgVariable *) memset(malloc(sizeof(mgVariable)*gta->numVars), 0, sizeof(mgVariable)*gta->numVars); for (i = 0; i < gta->numVars; i++) { fscanf(file, " %s %d:", buffer, >a->var[i].order); gta->var[i].name = (char *) malloc(strlen(buffer)+1); strcpy(gta->var[i].name, buffer); gta->var[i].varSS = (mgId *) malloc(sizeof(mgId)*gta->numSS); j = 0; while (1) { fscanf(file, " %u", >a->var[i].varSS[j++]); if (fgetc(file)=='\n') break; }; gta->var[i].numVarSS = j; gta->var[i].varSS = (mgId *) realloc(gta->var[i].varSS, sizeof(mgId)*j); } for (i = 0; i < gta->numSS; i++) { mgStateSpace *ss = >a->stateSpace[i]; fscanf(file, "\nstate space %u:\n" "initial state: %u\n" "bdd nodes: %u\n", &t, &ss->initial, &ss->numBddNodes); fscanf(file, "%s", buffer); ss->inhacc = NULL; if (strcmp(buffer, "inherited-acceptance:") == 0) { unsigned t1, t2, t3; ss->inhacc = (mgInhAcc *) malloc(sizeof(mgInhAcc)*ss->numStates); for (j = 0; j < ss->numStates; j++) { fscanf(file, "\n%u %u %u ", &t1, &t2, &t3); ss->inhacc[j].canReject = t1; ss->inhacc[j].canDontCare = t2; ss->inhacc[j].canAccept = t3; } fscanf(file, "behaviour:\n"); } ss->behaviour = (mNode **) malloc(sizeof(mNode *)*gta->stateSpace[ss->leftSS].numStates); for (l = 0; l < gta->stateSpace[ss->leftSS].numStates; l++) { ss->behaviour[l] = (mNode *) malloc(sizeof(mNode)*gta->stateSpace[ss->rightSS].numStates); for (r = 0; r < gta->stateSpace[ss->rightSS].numStates; r++) fscanf(file, "%u ", &ss->behaviour[l][r]); } fscanf(file, "\nbdd:\n"); ss->bddNode = (mBdd *) malloc(sizeof(mBdd)*ss->numBddNodes); for (n = 0; n < ss->numBddNodes; n++) fscanf(file, "%i %u %u\n", &ss->bddNode[n].idx, &ss->bddNode[n].lo, &ss->bddNode[n].hi); } if (fgetc(file) != 'e' || fgetc(file) != 'n' || fgetc(file) != 'd') { fclose(file); mgFree(gta); return 0; } fclose(file); return gta; } int mgStore(mgGta *gta, char *filename) { FILE *file; mgId i, l, r; mgState j; mNode n; int i1, i2, i3; if ((file = fopen(filename, "w")) == 0) return 0; fprintf(file, "MONA GTA\n" "number of variables: %u\n" "state spaces: %u\n" "universes: %u\n" "state space sizes:", gta->numVars, gta->numSS, gta->numUnivs); for (i = 0; i < gta->numSS; i++) fprintf(file, " %u", gta->stateSpace[i].numStates); fprintf(file, "\nfinal:"); for (i = 0; i < gta->stateSpace[0].numStates; i++) fprintf(file, " %d", gta->final[i]); fprintf(file, "\nguide:\n"); for (i = 0; i < gta->numSS; i++) fprintf(file, " %s %u %u\n", gta->stateSpace[i].name, gta->stateSpace[i].leftSS, gta->stateSpace[i].rightSS); fprintf(file, "types: %d\n", gta->numTypes); for (i1 = 0; i1 < gta->numTypes; i1++) { mgType *t = >a->type[i1]; fprintf(file, " type: %s\n", t->name); fprintf(file, " variants: %d\n", t->numVariants); for (i2 = 0; i2 < t->numVariants; i2++) { mgTypeVariant *v = &t->variant[i2]; fprintf(file, " variant: %s %s\n", v->name, v->pos[0] ? v->pos : "-"); fprintf(file, " components: %d\n", v->numComponents); for (i3 = 0; i3 < v->numComponents; i3++) { mgTypeComponent *c = &v->component[i3]; fprintf(file, " %s %s %d\n", c->name, c->pos[0] ? c->pos : "-", c->type); } } } fprintf(file, "universes:\n"); for (i = 0; i < gta->numUnivs; i++) fprintf(file, " %s %s\n", gta->universe[i].name, gta->universe[i].pos); fprintf(file, "variable orders and state spaces:\n"); for (i = 0; i < gta->numVars; i++) { fprintf(file, " %s %u:", gta->var[i].name, gta->var[i].order); for (j = 0; j < gta->var[i].numVarSS; j++) fprintf(file, " %d", gta->var[i].varSS[j]); fprintf(file, "\n"); } for (i = 0; i < gta->numSS; i++) { fprintf(file, "\nstate space %u:\n" " initial state: %u\n" " bdd nodes: %u\n", i, gta->stateSpace[i].initial, gta->stateSpace[i].numBddNodes); if (gta->stateSpace[i].inhacc) { fprintf(file, " inherited-acceptance:\n"); for (j = 0; j < gta->stateSpace[i].numStates; j++) fprintf(file, " %u %u %u\n", gta->stateSpace[i].inhacc[j].canAccept, gta->stateSpace[i].inhacc[j].canDontCare, gta->stateSpace[i].inhacc[j].canReject); } fprintf(file, " behaviour:\n "); for (l = 0; l < gta->stateSpace[gta->stateSpace[i].leftSS].numStates; l++) { for (r = 0; r < gta->stateSpace[gta->stateSpace[i].rightSS].numStates; r++) fprintf(file, " %u", gta->stateSpace[i].behaviour[l][r]); fprintf(file, "\n "); } fprintf(file, "bdd:\n"); for (n = 0; n < gta->stateSpace[i].numBddNodes; n++) fprintf(file, " %i %u %u\n", gta->stateSpace[i].bddNode[n].idx, gta->stateSpace[i].bddNode[n].lo, gta->stateSpace[i].bddNode[n].hi); } fprintf(file, "\nend\n"); fclose(file); return 1; } void mgFree(mgGta *gta) { mgId i, l; int i1, i2, i3; if (gta->stateSpace) { for (i = 0; i < gta->numSS; i++) { for (l = 0; l < gta->stateSpace[gta->stateSpace[i].leftSS].numStates; l++) free(gta->stateSpace[i].behaviour[l]); free(gta->stateSpace[i].behaviour); free(gta->stateSpace[i].bddNode); free(gta->stateSpace[i].name); free(gta->stateSpace[i].inhacc); } free(gta->stateSpace); } if (gta->universe) { for (i = 0; i < gta->numUnivs; i++) { if (gta->universe[i].name) free(gta->universe[i].name); if (gta->universe[i].pos) free(gta->universe[i].pos); } free(gta->universe); } if (gta->var) { for (i = 0; i < gta->numVars; i++) { if (gta->var[i].name) free(gta->var[i].name); if (gta->var[i].varSS) free(gta->var[i].varSS); } free(gta->var); } if (gta->final) free(gta->final); if (gta->numTypes && gta->type) { for (i1 = 0; i1 < gta->numTypes; i1++) { mgType *t = >a->type[i1]; for (i2 = 0; i2 < t->numVariants; i2++) { mgTypeVariant *v = &t->variant[i2]; for (i3 = 0; i3 < v->numComponents; i3++) { mgTypeComponent *c = &v->component[i3]; free(c->name); free(c->pos); } free(v->name); free(v->pos); free(v->component); } free(t->name); free(t->variant); } free(gta->type); } free(gta); } mgState mgDelta(mgGta *gta, mgId ss, mgState left, mgState right, mA a) { mNode n = gta->stateSpace[ss].behaviour[left][right]; mBdd *bdd = gta->stateSpace[ss].bddNode; while (bdd[n].idx != -1) if (a[bdd[n].idx]) n = bdd[n].hi; else n = bdd[n].lo; return bdd[n].lo; } void mgAssign(mgGta *gta, mgTreeNode *t, mgId id) { if (t) { mgState left, right; t->id = id; mgAssign(gta, t->left, gta->stateSpace[id].leftSS); mgAssign(gta, t->right, gta->stateSpace[id].rightSS); if (t->left) left = t->left->state; else left = gta->stateSpace[gta->stateSpace[id].leftSS].initial; if (t->right) right = t->right->state; else right = gta->stateSpace[gta->stateSpace[id].rightSS].initial; t->state = mgDelta(gta, id, left, right, t->a); } } int mgCheck(mgGta *gta, mgTreeNode *t) { mgAssign(gta, t, 0); return gta->final[t->state]; } mona-1.4/Lib/gtalib.h0000644000414100000240000001107210756504270011347 00000000000000/* gtalib.h - library for using MONA-generated external GTAs */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef __GTALIB_H #define __GTALIB_H #include "bddlib.h" typedef unsigned mgState; /* automaton state */ typedef unsigned mgId; /* state space id */ typedef enum mgKind {mgREJECT = -1, mgDONTCARE = 0, mgACCEPT = 1} mgKind; typedef struct mgInhAcc { /* inherited acceptance information */ char canAccept; /* can lead to accept */ char canDontCare; /* can lead to don't care */ char canReject; /* can lead to reject */ } mgInhAcc; typedef struct mgStateSpace { /* GTA state space */ mgState initial; /* initial state */ unsigned numStates; /* number of states */ unsigned numBddNodes; /* number of BDD nodes */ mBdd *bddNode; /* array of BDD nodes */ mNode **behaviour; /* matrix of BDD nodes, one pointer per pair of states */ mgId leftSS; /* id of left state space */ mgId rightSS; /* id of right state space */ char *name; /* state space name */ mgInhAcc *inhacc; /* inherited acceptance (NULL if not available) */ } mgStateSpace; typedef struct mgTypeComponent { /* component of variant of recursive type */ char *name; /* component name */ char *pos; /* position bitstring */ unsigned type; /* component type number */ } mgTypeComponent; typedef struct mgTypeVariant { /* variant of recursive type */ char *name; /* variant name */ char *pos; /* position bitstring */ unsigned numComponents; /* number of components */ mgTypeComponent *component; /* variant components */ } mgTypeVariant; typedef struct mgType { /* recursive type */ char *name; /* type name */ unsigned numVariants; /* number of variants */ mgTypeVariant *variant; /* type variants */ } mgType; typedef struct mgUniverse { /* GTA universe information */ char *name; /* universe name */ char *pos; /* position ('0'/'1' string) */ unsigned type; /* universe root type (N/A if no types) */ } mgUniverse; typedef struct mgVariable { /* variable information */ char *name; /* variable name */ int order; /* order (0/1/2) */ unsigned numVarSS; /* number of variable state-spaces */ mgId *varSS; /* array of variable state-spaces */ } mgVariable; typedef struct mgGta { /* Guided Tree Automaton */ unsigned numSS; /* number of state spaces */ mgStateSpace *stateSpace; /* array of state spaces */ unsigned numUnivs; /* number of universes */ mgUniverse *universe; /* array of universes */ unsigned numVars; /* number of free variables */ mgVariable *var; /* array of variables */ mgKind *final; /* initial state space state kinds */ unsigned numTypes; /* number of types (0: not using types) */ mgType *type; /* array of types (NULL if not using types) */ } mgGta; typedef struct mgTreeNode { /* labelled tree */ mA a; /* alphabet element */ struct mgTreeNode *left, *right; /* successors */ mgId id; /* state space id */ mgState state; /* automaton state */ } mgTreeNode; /* load GTA from text file */ mgGta *mgLoad(char *filename); /* returns 0 if unable to load automaton */ /* write GTA to text file notice: when using external automata, the user has to ensure that the files are consistent and that involved BDDs are properly reduced and ordered */ int mgStore(mgGta *gta, char *filename); /* returns 0 if unable to write file */ /* clean up GTA */ void mgFree(mgGta *gta); /* transition function */ mgState mgDelta(mgGta *gta, mgId ss, mgState left, mgState right, mA a); /* assign state space ids and automaton states to tree nodes */ void mgAssign(mgGta *gta, mgTreeNode *t, mgId id); /* check acceptance of input tree */ int mgCheck(mgGta *gta, mgTreeNode *t); #endif mona-1.4/Examples/0000777000414100000240000000000011045777454011077 500000000000000mona-1.4/Examples/makefile.am0000644000414100000240000000201710764207701013075 00000000000000MAINTAINERCLEANFILES = makefile.in makefile html.gta \ presburger_plus_012.dfa presburger_less_01.dfa \ presburger_timestwo_01.dfa presburger_const42.dfa EXTRA_DIST = bdd_volatility ab1.mona even_with_pred.mona minusmodulo.mona \ regexp.mona ab2.mona html.mona nadder.mona even.mona hyman.mona \ plusmodulo.mona even_with_assert.mona lossy_queue.mona presburger.mona noinst_PROGRAMS = bdd_example gta_example presburger_transduction \ presburger_analysis AM_CPPFLAGS = -I../Mem -I../BDD -I../DFA -I../GTA bdd_example_SOURCES = bdd_example.c bdd_example_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la gta_example_SOURCES = gta_example.c gta_example_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../GTA/libmonagta.la presburger_transduction_SOURCES = presburger_transduction.c presburger_transduction_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../DFA/libmonadfa.la presburger_analysis_SOURCES = presburger_analysis.c presburger_analysis_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../DFA/libmonadfa.la mona-1.4/Examples/makefile.in0000644000414100000240000003672411045777400013123 00000000000000# makefile.in generated by automake 1.9.6 from makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = bdd_example$(EXEEXT) gta_example$(EXEEXT) \ presburger_transduction$(EXEEXT) presburger_analysis$(EXEEXT) subdir = Examples DIST_COMMON = $(srcdir)/makefile.am $(srcdir)/makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_bdd_example_OBJECTS = bdd_example.$(OBJEXT) bdd_example_OBJECTS = $(am_bdd_example_OBJECTS) bdd_example_DEPENDENCIES = ../Mem/libmonamem.la ../BDD/libmonabdd.la am_gta_example_OBJECTS = gta_example.$(OBJEXT) gta_example_OBJECTS = $(am_gta_example_OBJECTS) gta_example_DEPENDENCIES = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../GTA/libmonagta.la am_presburger_analysis_OBJECTS = presburger_analysis.$(OBJEXT) presburger_analysis_OBJECTS = $(am_presburger_analysis_OBJECTS) presburger_analysis_DEPENDENCIES = ../Mem/libmonamem.la \ ../BDD/libmonabdd.la ../DFA/libmonadfa.la am_presburger_transduction_OBJECTS = \ presburger_transduction.$(OBJEXT) presburger_transduction_OBJECTS = \ $(am_presburger_transduction_OBJECTS) presburger_transduction_DEPENDENCIES = ../Mem/libmonamem.la \ ../BDD/libmonabdd.la ../DFA/libmonadfa.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(bdd_example_SOURCES) $(gta_example_SOURCES) \ $(presburger_analysis_SOURCES) \ $(presburger_transduction_SOURCES) DIST_SOURCES = $(bdd_example_SOURCES) $(gta_example_SOURCES) \ $(presburger_analysis_SOURCES) \ $(presburger_transduction_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFG = @CFG@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RELEASE = @RELEASE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ MAINTAINERCLEANFILES = makefile.in makefile html.gta \ presburger_plus_012.dfa presburger_less_01.dfa \ presburger_timestwo_01.dfa presburger_const42.dfa EXTRA_DIST = bdd_volatility ab1.mona even_with_pred.mona minusmodulo.mona \ regexp.mona ab2.mona html.mona nadder.mona even.mona hyman.mona \ plusmodulo.mona even_with_assert.mona lossy_queue.mona presburger.mona AM_CPPFLAGS = -I../Mem -I../BDD -I../DFA -I../GTA bdd_example_SOURCES = bdd_example.c bdd_example_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la gta_example_SOURCES = gta_example.c gta_example_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../GTA/libmonagta.la presburger_transduction_SOURCES = presburger_transduction.c presburger_transduction_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../DFA/libmonadfa.la presburger_analysis_SOURCES = presburger_analysis.c presburger_analysis_LDADD = ../Mem/libmonamem.la ../BDD/libmonabdd.la \ ../DFA/libmonadfa.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Examples/makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Examples/makefile .PRECIOUS: makefile makefile: $(srcdir)/makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done bdd_example$(EXEEXT): $(bdd_example_OBJECTS) $(bdd_example_DEPENDENCIES) @rm -f bdd_example$(EXEEXT) $(LINK) $(bdd_example_LDFLAGS) $(bdd_example_OBJECTS) $(bdd_example_LDADD) $(LIBS) gta_example$(EXEEXT): $(gta_example_OBJECTS) $(gta_example_DEPENDENCIES) @rm -f gta_example$(EXEEXT) $(LINK) $(gta_example_LDFLAGS) $(gta_example_OBJECTS) $(gta_example_LDADD) $(LIBS) presburger_analysis$(EXEEXT): $(presburger_analysis_OBJECTS) $(presburger_analysis_DEPENDENCIES) @rm -f presburger_analysis$(EXEEXT) $(LINK) $(presburger_analysis_LDFLAGS) $(presburger_analysis_OBJECTS) $(presburger_analysis_LDADD) $(LIBS) presburger_transduction$(EXEEXT): $(presburger_transduction_OBJECTS) $(presburger_transduction_DEPENDENCIES) @rm -f presburger_transduction$(EXEEXT) $(LINK) $(presburger_transduction_LDFLAGS) $(presburger_transduction_OBJECTS) $(presburger_transduction_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdd_example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gta_example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/presburger_analysis.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/presburger_transduction.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mona-1.4/Examples/bdd_example.c0000644000414100000240000001035210756504320013410 00000000000000/* bdd_example.c - BDD package example application */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include "bdd.h" unsigned and(unsigned a, unsigned b) { if (a && b) return 1; else return 0; } unsigned not(unsigned a) { if (a) return 0; else return 1; } void print_bdd(bdd_manager *bddm, bdd_ptr b) { unsigned index; if (bdd_is_leaf(bddm, b)) { printf("(leafvalue: %d)", bdd_leaf_value(bddm, b)); } else { index=bdd_ifindex(bddm,b); printf("(node %d, indx %d, high:", b, index); print_bdd(bddm, bdd_then(bddm,b)); printf(")"); printf("(node %d, indx %d, low:", b, index); print_bdd(bddm, bdd_else(bddm,b)); printf(")"); } } int main() { bdd_manager *bddm, *bddm1; bdd_ptr zero, one; bdd_handle var2, var7; bdd_ptr and_2_7, nand_2_7; bdd_handle handle; bdd_init(); /* needed since we're using statistics */ bddm = bdd_new_manager(100,50); /* get a BDD pointer to a node that is the leaf with value 0 */ zero = bdd_find_leaf_hashed_add_root(bddm, 0); /* and a leaf with value 1 */ one = bdd_find_leaf_hashed_add_root(bddm, 1); /* note already at this point "zero" could have been invalidated if the table doubled, but we know that there is room for a 100 nodes---anyway, this is really very bad style, so we go on in a more appropriate manner */ /* "then" part is one, "else" part is zero */ var2 = bdd_handle_find_node_hashed_add_root(bddm, zero, one, 2); var7 = bdd_handle_find_node_hashed_add_root(bddm, zero, one, 7); /* check node pointers and handles */ assert(zero == BDD_ROOT(bddm, 0)); /* since table was not doubled */ assert(one == BDD_ROOT(bddm, 1)); assert(var2 == 2); assert(var7 == 3); bddm1 = bdd_new_manager(100,50); /* make room for at least 100 nodes, overflow increment is 50 */ bdd_make_cache(bddm1, 100, 50); /* apply2 needs a result cache, here the size is a hundred with increment 50 */ /* apply operation on var2 and var7 in bddm; the result is a completely fresh bdd in bddm1 and a BDD pointer, named "and_2_7" */ and_2_7 = bdd_apply2_hashed(bddm, BDD_ROOT(bddm, var2), /* BDD #1 */ bddm, BDD_ROOT(bddm, var7), /* BDD #2 */ bddm1, /* result BDD */ &and); /* leaf operation */ bdd_update_statistics(bddm, 0); /* update statics group "0" with data from bddm before killing the manager */ printf("Size of bddm: %d\n\n", bdd_size(bddm)); /* let's see the number of nodes created */ bdd_kill_manager(bddm); printf("Size of bddm1: %d\n\n", bdd_size(bddm1)); handle = BDD_LAST_HANDLE(bddm1); assert(handle == 0); assert(BDD_ROOT(bddm1, handle) == and_2_7); /* reset all mark fields in bddm1 before an apply1 operation */ bdd_prepare_apply1(bddm1); /* a new bdd (which as an unlabelled graph is isomorphic to old one) in bddm1 is the result of the following apply operation */ /* it's safe here to use and_2_7 since no operations were performed after it was calculated that could have entailed doubling of table */ nand_2_7 = bdd_apply1(bddm1, and_2_7, bddm1, ¬); bdd_update_statistics(bddm1, 1); printf("Size of bddm1: %d\n\n", bdd_size(bddm1)); print_bdd(bddm1, and_2_7); printf("\n\n"); print_bdd(bddm1, nand_2_7); printf("\n\n"); bdd_kill_manager(bddm1); bdd_print_statistics(0, "bddm"); /* print group 0 statistics with heading "bddm" */ bdd_print_statistics(1, "bddm1"); /* print group 1 statistics with heading "bddm1" */ return 0; } mona-1.4/Examples/gta_example.c0000644000414100000240000001202310756504320013427 00000000000000/* gta_example.c - GTA package example dummy application */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "gta.h" #define MAXVARS 1000 Guide guide; char *my_global_variable; bdd_manager *global_bddm; void check_off_index(bdd_record *node_pointer) /*this function is written using primitives at a lower level than using the bdd_then and bdd_else; the reason is that bdd_operate_on_nodes requires a C pointer a BDD node, not something of the type bdd_ptr */ { bdd_ptr low, high; unsigned index; LOAD_lri(node_pointer, low, high, index); if (index != BDD_LEAF_INDEX) { if (my_global_variable[index] == 0) my_global_variable[index] = 1; } else {} } int main () { GTA* G; char **free_vars; int *orders; unsigned numvars; SSSet *statespaces; /*read the automaton from a file, the TRUE argument means that the guide is being defined by the automaton description in the file */ G = gtaImport("html.gta", &free_vars, &orders, &statespaces, TRUE); if(!G) { printf("error: file 'html.gta' not found (run 'mona -n html.mona')\n"); exit(1); } printf("Guide: number of state spaces is %d\n", guide.numSs); /* illustrate use of state space names */ { SsId d; for (d = 0; d < guide.numSs; d++) printf("State space %s is numbered %d\n", guide.ssName[d], d); } /* illustrate use of inherited acceptance information */ { SsId d; State p; int s; boolean ***inheritedAcceptance = gtaCalcInheritedAcceptance(G); for (d = 0; d < guide.numSs; d++) { printf("State space %d\n", d); for (p = 0; p < G->ss[d].size; p++) for (s = 1; s >= -1; s--) printf(" State %d can%s lead to %s\n", p, inheritedAcceptance[d][p][s]? "": " not", (s==1)? "accept":(s==0)? "don't care": "reject"); } gtaFreeInheritedAcceptance(inheritedAcceptance); } /* illustrate how to find indices of free variables and how to find out about their order (Boolean, first-order, or second-order) */ { unsigned i; numvars = 0; while (free_vars[numvars] != 0) numvars++; printf("Number of free variables: %d\n", numvars); if (numvars != 6) { printf("Oops\n"); exit(1); } /* get table index of variable G1 */ for (i = 0; i < numvars; i++) if (strcmp(free_vars[i], "G1")==0) break; if (i == numvars) printf("G1 not found\n"); else { printf("G1 has index %d and is %d. order\n", i, orders[i]); } } /* illustrate how to analyze the BDD associated with an entry in the transition table */ { /* lookup, say, transition corresponding to state space 1, state pair (left, right) = (4,3) */ unsigned i; bdd_ptr my_bdd_ptr = BDD_ROOT(G->ss[1].bddm, BEH(G->ss[1], 4, 3)); char var_is_used[MAXVARS]; /* var_is_used[i] is true iff variable i is the index of some BDD node in the DAG rooted in my_bdd_ptr */ printf("State space 0 goes to (%d, %d)\n", guide.muLeft[0], guide.muRight[0]); printf("State space 1 goes to (%d, %d)\n", guide.muLeft[1], guide.muRight[1]); printf("Number of BDD nodes in state space 1: %d\n", bdd_size(G->ss[1].bddm)); for (i = 0; i < numvars; i++) var_is_used[i] = 0; bdd_prepare_apply1(G->ss[1].bddm); my_global_variable = var_is_used; global_bddm = (G->ss[1].bddm); bdd_operate_on_nodes(G->ss[1].bddm, my_bdd_ptr, &check_off_index); for (i = 0; i < numvars; i++) if (var_is_used[i]) printf("Variable %s in use for transitions from (4,3) in state space 1\n", free_vars[i]); } /* illustrate how to perform a lookup in the transition table */ { char bit_vector[6] = {0, 1, 1, 0, 1, 0}; bdd_manager *bddm = G->ss[1].bddm; bdd_ptr my_bdd_ptr = BDD_ROOT(bddm, BEH(G->ss[1], 0, 2)); while (!bdd_is_leaf(bddm, my_bdd_ptr)) { my_bdd_ptr = (bit_vector[bdd_ifindex(bddm, my_bdd_ptr)])? bdd_then(bddm, my_bdd_ptr): bdd_else(bddm, my_bdd_ptr); } printf("State reached from (0,2) on {0, 1, 1, 0, 1, 0} is %d\n", bdd_leaf_value(bddm, my_bdd_ptr)); } return 0; } mona-1.4/Examples/presburger_analysis.c0000644000414100000240000000466010756504320015234 00000000000000/* presburger_analysis.c - DFA package example application */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #include #include #include #include "dfa.h" #include "mem.h" int decode_example(char *example, int row, int num_rows) { /* decode one row of the example string */ int i, val = 0, length = strlen(example)/(num_rows+1); for (i = length-1; i > 0; i--) val = val<<1 | (example[row*length+i] == '1'); return val; } int main(int argc, char *argv[]) { char **vars; int *orders; DFA *a; char *example; unsigned indices[1]; unsigned index; int i; if (argc != 3) { printf("usage: %s \n", argv[0]); exit(-1); } /* initialize the BDD package */ bdd_init(); /* import the automaton */ a = dfaImport(argv[1], &vars, &orders); if (!a) { printf("error: unable to import '%s'\n", argv[1]); exit(-1); } /* find the index */ for (index = 0; vars[index]; index++) if (strcmp(vars[index], argv[2]) == 0) break; if (!vars[index]) { printf("error: '%s' not found in '%s'\n", argv[2], argv[1]); exit(-1); } /* 'dfaMakeExample' finds a string leading from the initial state to a nearest accepting state, this string represents a binary encoded number for each free variable */ indices[0] = index; example = dfaMakeExample(a, 1, 1, indices); /* print the result */ if (!example) printf("relation is unsatisfiable!\n"); else { printf("satisfying example:\n" "%s = %d\n", argv[2], decode_example(example, 0, 1)); mem_free(example); } /* clean up */ dfaFree(a); for (i = 0; vars[i]; i++) mem_free(vars[i]); mem_free(vars); mem_free(orders); return 0; } mona-1.4/Examples/presburger_transduction.c0000644000414100000240000000750610756504320016130 00000000000000/* presburger_transduction.c - DFA package example application */ /* * MONA * Copyright (C) 1997-2008 BRICS. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* This example illustrates how to use transduction and * iteration. It constructs an automaton for 'p_index = value' * using Presburger encoding by starting with an automaton * for the relation 'p_i = 1' and iteratively adding 1 * to the constant using projection, product and index-replacing. * (This is not supposed to be an efficient way of * constructing these automata - the purpuse is to illustrate * the iterative approach.) */ #define INDEX 7 #define VALUE 13 #include #include #include "dfa.h" #include "mem.h" int main() { DFA *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9; int i; /* initialize the BDD package */ bdd_init(); /* import the 'presburger_plus_012.dfa' automaton generated by running 'mona presburger.mona' */ { char **vars; /* 0 terminated array of variable names */ int *orders; /* array of variable orders (0/1/2) */ a1 = dfaImport("presburger_plus_012.dfa", &vars, &orders); if (!a1) { printf("error: unable to read 'presburger_plus_012.dfa' " "(run 'mona -n presburger.mona')\n"); exit(-1); } /* 'vars' now contains {"p","q","r"}, i.e. the variables in their original index ordering, 'orders' contains {2,2,2} */ for (i = 0; vars[i]; i++) mem_free(vars[i]); mem_free(vars); mem_free(orders); } /* make automaton for 'p_1 = 1' */ a2 = dfaPresbConst(1, 1); /* make the intersection product of 'a1' and 'a2' and project(+right-quotient) 'p_1' away - this corresponds to making an automaton for the following formula: 'ex p_1: p_0 + p_1 = p_2 & p_1 = 1' */ a3 = dfaProduct(a1, a2, dfaAND); a4 = dfaMinimize(a3); dfaRightQuotient(a4, 1); a5 = dfaProject(a4, 1); a6 = dfaMinimize(a5); /* a6 now represents the formula 'p_0 + 1 = p_2' */ /* clean up the temporary automata */ dfaFree(a1); dfaFree(a3); dfaFree(a4); dfaFree(a5); /* for the base case of the iteration, we need an automaton for 'p_0 = 1' - reuse a2 by replacing the index */ { int map[2]; map[1] = 0; /* means: replace 1 with 0 in all BDD nodes */ dfaReplaceIndices(a2, map); } /* the main part: iterate the transduction */ for (i = 1; i < VALUE; i++) { /* make an automaton for 'ex p_0: p_0 = i & p_0 + 1 = p_2' */ a7 = dfaProduct(a6, a2, dfaAND); a8 = dfaMinimize(a7); dfaRightQuotient(a8, 0); a9 = dfaProject(a8, 0); /* make automaton for 'p_0 = i+1' by a replace-indices */ { int map[3]; map[2] = 0; dfaReplaceIndices(a9, map); } /* clean up */ dfaFree(a7); dfaFree(a8); dfaFree(a2); a2 = a9; /* now a2 represents 'p_0 = i+1' */ } /* clean up */ dfaFree(a6); /* set the index */ { int map[1]; map[0] = INDEX; dfaReplaceIndices(a2, map); } /* output the resulting automaton in Graphviz format */ { unsigned indices[1]; /* array of indices in alphabet */ indices[0] = INDEX; dfaPrintGraphviz(a2, 1, indices); } dfaFree(a2); return 0; } mona-1.4/Examples/bdd_volatility0000644000414100000240000000321510073170377013737 00000000000000bdd_ptr bddpaths[10]; /* function that updates BDD pointers floating around in user's code; the remaining ones are kept in the sub_results list below */ void update_bddpaths(unsigned (*new_place) (unsigned node)) { int j; /* update the pointers in bddpaths */ for (j = 0; j < exp_count; j++) bddpaths[j] = new_place(bddpaths[j]); } /* we can only update pointers that are not stored as local variables, so values of local variables are thrown onto a stack */ DECLARE_SEQUENTIAL_LIST(sub_results, unsigned); bdd_ptr makepath(bdd_manager *bddm, ..., void (*update_bddpaths) (unsigned (*new_place) (unsigned node))) { ... bdd_ptr res, sub_res, default_state_ptr; sub_res = makepath(bddm, n+1, leaf_value, update_bddpaths); /* push BDD pointer sub_res on list sub_results */ PUSH_SEQUENTIAL_LIST(sub_results, unsigned, sub_res); /* insert a new hashed node; thus potentially changing the pointer to the node known as sub_res above, and also potentially changing the pointers in bddpaths[10]. But bdd_find_leaf_hashed automatically updates all pointers in the sub_results list, since it was provided as an argument. Also, the function update_bddpaths is called when a doubling of the table takes place and an appropriate renaming function new_place is supplied by bdd_find_leaf_hashed */ default_state_ptr = bdd_find_leaf_hashed(bddm, default_state, SEQUENTIAL_LIST(sub_results), update_bddpaths); /* restore the value of sub_res */ POP_SEQUENTIAL_LIST(sub_results, unsigned, sub_res); ... } mona-1.4/Examples/ab1.mona0000644000414100000240000000031510073170400012303 00000000000000ws2s; var2 A,B; ex1 p1,p2,p3,p4,p5: p1 (q in Q => q - 1 notin Q) & (q notin Q => q - 1 in Q)) & 0 in Q; var1 x; var0 A; A & even(x) & x notin P; mona-1.4/Examples/minusmodulo.mona0000644000414100000240000000022010073170400014206 00000000000000var1 i,j,k; ((j>k => i=0) & (j<=k => ((j>0 => i=j-1) & ((j=0 & k>0) => i=k-1) & ((j=0 & k=0) => i=0)))) <=> i=j-1%k; mona-1.4/Examples/regexp.mona0000644000414100000240000000321110573773016013151 00000000000000var2 $ where ~ex1 p where true: p notin $ & p+1 in $; allpos $; defaultwhere1(p) = all1 r: r

r in $; defaultwhere2(P) = all1 p: p in P => all1 r: r

r in $; # we declare a string of 8-bit vectors var2 bit0 where bit0 sub $, bit1 where bit1 sub $, bit2 where bit2 sub $, bit3 where bit3 sub $, bit4 where bit4 sub $, bit5 where bit5 sub $, bit6 where bit6 sub $, bit7 where bit7 sub $; macro consecutive_in_set(var1 p, var1 q, var2 P) = p < q & p in P & q in P & all1 r: p < r & r < q => r notin P; # ASCII 'a' is 97, which is 01100001 macro is_a(var1 p, var1 q) = q = p + 1 & p in bit0 & p notin bit1 & p notin bit2 & p notin bit3 & p notin bit4 & p in bit5 & p in bit6 & p notin bit7; # ASCII 'b' is 98, which is 01100010 macro is_b(var1 p, var1 q) = q = p + 1 & p notin bit0 & p in bit1 & p notin bit2 & p notin bit3 & p notin bit4 & p in bit5 & p in bit6 & p notin bit7; # we concatenate by guessing the intermediate position where # the string parsed according to the first regular expression # (in this case "a") ends and the string parsed according to # the second (in this case "b") starts pred is_ab(var1 p, var1 q) = ex1 r where p<=r & r<=q: is_a(p, r) & is_b(r, q); # a star expression is handled by guessing the set of # intermediate positions pred is_ab_star(var1 p, var1 q) = ex2 P: p in P & q in P & all1 r, r': consecutive_in_set(r, r', P) => is_ab(r, r'); pred is_a_star(var1 p, var1 q) = ex2 P: p in P & q in P & all1 r, r': consecutive_in_set(r, r', P) => is_a(r, r'); pred is_a_star_ab_star(var1 p, var1 q) = ex1 r where p<=r & r<=q: is_a_star(p, r) & is_ab_star(r, q); is_a_star_ab_star(0, max($)+1); mona-1.4/Examples/ab2.mona0000644000414100000240000000044210073170400012305 00000000000000ws2s; guide d0->(a,b), a->(a,a), b->(b,b); universe ua:0, ub:1; var2 [ua] A; var2 [ub] B; ex1 [ua] p1,p2,p3,p4,p5: p1(dummy,b), b->(b,b), dummy->(dummy,dummy); universe UNI_H:1, u_dummy:0; # Skeleton var2 [UNI_H] $ where all1 p: (p in $) => (p^ in $); defaultwhere1(p) = p in $; # Type environment var2 T0,T1; var2 G0,G1,G2; # Type predicates macro NULL(var1 p) = (p notin T0) & (p notin T1) & (p notin G0) & (p notin G1) & (p notin G2); macro TYPE_Bool(var1 p) = (p notin T0) & (p notin T1); macro TYPE0_Bool(var0 t0,t1) = ~t0 & ~t1; macro TYPE_HTML(var1 p) = (p in T0) & (p notin T1); macro TYPE0_HTML(var0 t0,t1) = t0 & ~t1; macro TYPE_LIST(var1 p) = (p notin T0) & (p in T1); macro TYPE0_LIST(var0 t0,t1) = ~t0 & t1; macro TYPE_URL(var1 p) = (p in T0) & (p in T1); macro TYPE0_URL(var0 t0,t1) = t0 & t1; macro GROUP_HTML_word(var1 p,var2 G0,G1,G2) = (p notin G0) & (p notin G1) & (p notin G2); macro GROUP0_HTML_word(var0 g0,g1,g2) = ~g0 & ~g1 & ~g2; macro GROUP_HTML_anchor(var1 p,var2 G0,G1,G2) = (p in G0) & (p notin G1) & (p notin G2); macro GROUP0_HTML_anchor(var0 g0,g1,g2) = g0 & ~g1 & ~g2; macro GROUP_HTML_bold(var1 p,var2 G0,G1,G2) = (p notin G0) & (p in G1) & (p notin G2); macro GROUP0_HTML_bold(var0 g0,g1,g2) = ~g0 & g1 & ~g2; macro GROUP_HTML_italic(var1 p,var2 G0,G1,G2) = (p in G0) & (p in G1) & (p notin G2); macro GROUP0_HTML_italic(var0 g0,g1,g2) = g0 & g1 & ~g2; macro GROUP_HTML_paragraph(var1 p,var2 G0,G1,G2) = (p notin G0) & (p notin G1) & (p in G2); macro GROUP0_HTML_paragraph(var0 g0,g1,g2) = ~g0 & ~g1 & g2; macro GROUP_HTML_rule(var1 p,var2 G0,G1,G2) = (p in G0) & (p notin G1) & (p in G2); macro GROUP0_HTML_rule(var0 g0,g1,g2) = g0 & ~g1 & g2; macro GROUP_HTML_list(var1 p,var2 G0,G1,G2) = (p notin G0) & (p in G1) & (p in G2); macro GROUP0_HTML_list(var0 g0,g1,g2) = ~g0 & g1 & g2; macro GROUP_HTML(var1 p,var2 G0,G1,G2) = GROUP_HTML_word(p,G0,G1,G2) | GROUP_HTML_anchor(p,G0,G1,G2) | GROUP_HTML_bold(p,G0,G1,G2) | GROUP_HTML_italic(p,G0,G1,G2) | GROUP_HTML_paragraph(p,G0,G1,G2) | GROUP_HTML_rule(p,G0,G1,G2) | GROUP_HTML_list(p,G0,G1,G2); macro GROUP0_HTML(var0 g0,g1,g2) = GROUP0_HTML_word(g0,g1,g2) | GROUP0_HTML_anchor(g0,g1,g2) | GROUP0_HTML_bold(g0,g1,g2) | GROUP0_HTML_italic(g0,g1,g2) | GROUP0_HTML_paragraph(g0,g1,g2) | GROUP0_HTML_rule(g0,g1,g2) | GROUP0_HTML_list(g0,g1,g2); macro GROUP_LIST_empty(var1 p,var2 G0) = (p notin G0); macro GROUP0_LIST_empty(var0 g0) = ~g0; macro GROUP_LIST_entity(var1 p,var2 G0) = (p in G0); macro GROUP0_LIST_entity(var0 g0) = g0; macro GROUP_LIST(var1 p,var2 G0) = GROUP_LIST_empty(p,G0) | GROUP_LIST_entity(p,G0); macro GROUP0_LIST(var0 g0) = GROUP0_LIST_empty(g0) | GROUP0_LIST_entity(g0); macro SCALAR_Bool_false_true(var1 p, var2 S0) = true; macro SCALAR0_Bool_false_true(var0 s0) = true; macro SCALAR_Bool(var1 p, var2 S0) = SCALAR_Bool_false_true(p,S0); macro SCALAR0_Bool(var0 s0) = SCALAR0_Bool_false_true(s0); macro SUCC_HTML_word(var1 p) = (p.0 notin $) & (p.1 notin $); macro SUCC_HTML_anchor(var1 p) = (p.11 notin $) & (p.1 in $) & NULL(p.1) & (p.0 in $) & TYPE_URL(p.0) & (p.10 in $) & TYPE_HTML(p.10); macro SUCC_HTML_bold(var1 p) = (p.1 notin $) & (p.0 in $) & TYPE_HTML(p.0); macro SUCC_HTML_italic(var1 p) = (p.1 notin $) & (p.0 in $) & TYPE_HTML(p.0); macro SUCC_HTML_paragraph(var1 p) = (p.0 notin $) & (p.1 notin $); macro SUCC_HTML_rule(var1 p) = (p.0 notin $) & (p.1 notin $); macro SUCC_HTML_list(var1 p) = (p.1 notin $) & (p.0 in $) & TYPE_LIST(p.0); macro SUCC_LIST_empty(var1 p) = (p.0 notin $) & (p.1 notin $); macro SUCC_LIST_entity(var1 p) = (p.11 notin $) & (p.1 in $) & NULL(p.1) & (p.0 in $) & TYPE_HTML(p.0) & (p.10 in $) & TYPE_LIST(p.10); macro SUCC_URL_url(var1 p) = (p.0 notin $) & (p.1 notin $); macro EQ0_HTML(var0 g0_l,g1_l,g2_l,g0_r,g1_r,g2_r) = ( (g0_l <=> g0_r) & (g1_l <=> g1_r) & (g2_l <=> g2_r) ); macro WF_HTML(var1 p,var2 G0,G1,G2) = TYPE_HTML(p) & ( (GROUP_HTML_word(p,G0,G1,G2) & SUCC_HTML_word(p)) | (GROUP_HTML_anchor(p,G0,G1,G2) & SUCC_HTML_anchor(p)) | (GROUP_HTML_bold(p,G0,G1,G2) & SUCC_HTML_bold(p)) | (GROUP_HTML_italic(p,G0,G1,G2) & SUCC_HTML_italic(p)) | (GROUP_HTML_paragraph(p,G0,G1,G2) & SUCC_HTML_paragraph(p)) | (GROUP_HTML_rule(p,G0,G1,G2) & SUCC_HTML_rule(p)) | (GROUP_HTML_list(p,G0,G1,G2) & SUCC_HTML_list(p)) ); macro WF0_HTML(var0 t0,t1,g0,g1,g2) = TYPE0_HTML(t0,t1) & ( (GROUP0_HTML_word(g0,g1,g2)) | (GROUP0_HTML_anchor(g0,g1,g2)) | (GROUP0_HTML_bold(g0,g1,g2)) | (GROUP0_HTML_italic(g0,g1,g2)) | (GROUP0_HTML_paragraph(g0,g1,g2)) | (GROUP0_HTML_rule(g0,g1,g2)) | (GROUP0_HTML_list(g0,g1,g2)) ); macro EQ0_LIST(var0 g0_l,g0_r) = ( (g0_l <=> g0_r) ); macro WF_LIST(var1 p,var2 G0) = TYPE_LIST(p) & ( (GROUP_LIST_empty(p,G0) & SUCC_LIST_empty(p)) | (GROUP_LIST_entity(p,G0) & SUCC_LIST_entity(p)) ); macro WF0_LIST(var0 t0,t1,g0) = TYPE0_LIST(t0,t1) & ( (GROUP0_LIST_empty(g0)) | (GROUP0_LIST_entity(g0)) ); macro WF_URL(var1 p) = TYPE_URL(p) & ( (SUCC_URL_url(p)) ); macro WF0_URL(var0 t0,t1) = TYPE0_URL(t0,t1); macro TREE_HTML(var1 p,var2 G0,G1,G2) = TYPE_HTML(p) & (all1 [p] q: (p<=q) => (NULL(q) | WF_HTML(q,G0,G1,G2) | WF_LIST(q,G0) | WF_URL(q))); macro SKEL_HTML(var1 p,var2 G0_f,G1_f,G2_f) = all1 [p] q: (p<=q) => ( (TYPE_HTML(q) => ( (GROUP_HTML_word(q,G0,G1,G2) <=> GROUP_HTML_word(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_anchor(q,G0,G1,G2) <=> GROUP_HTML_anchor(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_bold(q,G0,G1,G2) <=> GROUP_HTML_bold(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_italic(q,G0,G1,G2) <=> GROUP_HTML_italic(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_paragraph(q,G0,G1,G2) <=> GROUP_HTML_paragraph(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_rule(q,G0,G1,G2) <=> GROUP_HTML_rule(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_list(q,G0,G1,G2) <=> GROUP_HTML_list(q,G0_f,G1_f,G2_f)) )) & (TYPE_LIST(q) => ( (GROUP_LIST_empty(q,G0) <=> GROUP_LIST_empty(q,G0_f)) & (GROUP_LIST_entity(q,G0) <=> GROUP_LIST_entity(q,G0_f)) )) & (TYPE_URL(q) => ( true )) ); macro TREE_LIST(var1 p,var2 G0,G1,G2) = TYPE_LIST(p) & (all1 [p] q: (p<=q) => (NULL(q) | WF_LIST(q,G0) | WF_HTML(q,G0,G1,G2) | WF_URL(q))); macro SKEL_LIST(var1 p,var2 G0_f,G1_f,G2_f) = all1 [p] q: (p<=q) => ( (TYPE_LIST(q) => ( (GROUP_LIST_empty(q,G0) <=> GROUP_LIST_empty(q,G0_f)) & (GROUP_LIST_entity(q,G0) <=> GROUP_LIST_entity(q,G0_f)) )) & (TYPE_HTML(q) => ( (GROUP_HTML_word(q,G0,G1,G2) <=> GROUP_HTML_word(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_anchor(q,G0,G1,G2) <=> GROUP_HTML_anchor(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_bold(q,G0,G1,G2) <=> GROUP_HTML_bold(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_italic(q,G0,G1,G2) <=> GROUP_HTML_italic(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_paragraph(q,G0,G1,G2) <=> GROUP_HTML_paragraph(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_rule(q,G0,G1,G2) <=> GROUP_HTML_rule(q,G0_f,G1_f,G2_f)) & (GROUP_HTML_list(q,G0,G1,G2) <=> GROUP_HTML_list(q,G0_f,G1_f,G2_f)) )) & (TYPE_URL(q) => ( true )) ); macro TREE_URL(var1 p) = TYPE_URL(p) & (all1 [p] q: (p<=q) => (NULL(q) | WF_URL(q))); macro SKEL_URL(var1 p) = all1 [p] q: (p<=q) => ( (TYPE_URL(q) => ( true )) ); macro DOT_u(var1 p,var1 q) = (TYPE_HTML(p) & GROUP_HTML_word(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_anchor(p,G0,G1,G2) & (q=p.0)) | (TYPE_HTML(p) & GROUP_HTML_bold(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_italic(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_paragraph(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_rule(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_list(p,G0,G1,G2) & (q=p)); macro DOT_a(var1 p,var1 q) = (TYPE_HTML(p) & GROUP_HTML_word(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_anchor(p,G0,G1,G2) & (q=p.10)) | (TYPE_HTML(p) & GROUP_HTML_bold(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_italic(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_paragraph(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_rule(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_list(p,G0,G1,G2) & (q=p)); macro DOT_b(var1 p,var1 q) = (TYPE_HTML(p) & GROUP_HTML_word(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_anchor(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_bold(p,G0,G1,G2) & (q=p.0)) | (TYPE_HTML(p) & GROUP_HTML_italic(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_paragraph(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_rule(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_list(p,G0,G1,G2) & (q=p)); macro DOT_i(var1 p,var1 q) = (TYPE_HTML(p) & GROUP_HTML_word(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_anchor(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_bold(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_italic(p,G0,G1,G2) & (q=p.0)) | (TYPE_HTML(p) & GROUP_HTML_paragraph(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_rule(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_list(p,G0,G1,G2) & (q=p)); macro DOT_l(var1 p,var1 q) = (TYPE_HTML(p) & GROUP_HTML_word(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_anchor(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_bold(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_italic(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_paragraph(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_rule(p,G0,G1,G2) & (q=p)) | (TYPE_HTML(p) & GROUP_HTML_list(p,G0,G1,G2) & (q=p.0)); macro DOT_h(var1 p,var1 q) = (TYPE_LIST(p) & GROUP_LIST_empty(p,G0) & (q=p)) | (TYPE_LIST(p) & GROUP_LIST_entity(p,G0) & (q=p.0)); macro DOT_next(var1 p,var1 q) = (TYPE_LIST(p) & GROUP_LIST_empty(p,G0) & (q=p)) | (TYPE_LIST(p) & GROUP_LIST_entity(p,G0) & (q=p.10)); macro DOT(var1 p,var1 q) = DOT_u(p,q) | DOT_a(p,q) | DOT_b(p,q) | DOT_i(p,q) | DOT_l(p,q) | DOT_h(p,q) | DOT_next(p,q); macro UP(var1 p,var1 q) = (root(p,[p]) & p=q) | DOT(q,p); # Free variables assert ex1 [UNI_H] p: root(p,[p]) & TREE_HTML(p,G0,G1,G2); # Functions pred FUNC_NoNestedAnchors(universe UNI_h,var2 G0_h,G1_h,G2_h) = (all1 [UNI_h] POS_p: (TYPE_HTML(POS_p)) => ((ex0 t0_1,t1_1,g0_1,g1_1,g2_1: ex0 t0_4,t1_4,g0_4,g1_4,g2_4: (ex1 [UNI_h] POS3: (POS3=POS_p) & (t1_1<=>(POS3 in T1)) & (t0_1<=>(POS3 in T0)) & (g2_1<=>(POS3 in G2)) & (g1_1<=>(POS3 in G1)) & (g0_1<=>(POS3 in G0))) & ((TYPE0_HTML(t0_4,t1_4) & g0_4 & ~g1_4 & ~g2_4)) & EQ0_HTML(g0_1,g1_1,g2_1,g0_4,g1_4,g2_4)) => (~(ex1 [UNI_h] POS_q: (TYPE_HTML(POS_q)) & ((ex1 [UNI_h] POS6: ex1 [UNI_h] POS8: (POS6=POS_p) & (POS8=POS_q) & (POS6 < POS8)) & (ex0 t0_9,t1_9,g0_9,g1_9,g2_9: ex0 t0_12,t1_12,g0_12,g1_12,g2_12: (ex1 [UNI_h] POS11: (POS11=POS_q) & (t1_9<=>(POS11 in T1)) & (t0_9<=>(POS11 in T0)) & (g2_9<=>(POS11 in G2)) & (g1_9<=>(POS11 in G1)) & (g0_9<=>(POS11 in G0))) & ((TYPE0_HTML(t0_12,t1_12) & g0_12 & ~g1_12 & ~g2_12)) & EQ0_HTML(g0_9,g1_9,g2_9,g0_12,g1_12,g2_12))))))); # Main formula export("html.gta",(ex2 G0_13,G1_13,G2_13: ((G0_13=G0) & (G1_13=G1) & (G2_13=G2)) & FUNC_NoNestedAnchors(UNI_H,G0_13,G1_13,G2_13))); mona-1.4/Examples/nadder.mona0000644000414100000240000000576710073170400013115 00000000000000var1 $; defaultwhere1(p) = p <= $; defaultwhere2(P) = P sub {0,...,$}; pred at_least_two(var0 A,var0 B,var0 C) = (A & B) | (A & C) | (B & C); pred mod_two(var0 A,var0 B,var0 C,var0 @d) = (A <=> B <=> C <=> @d); # "high-level" description of the addition of Cin (carry in) and vectors X # and Y with result Z and Cout (carry out); all vectors have length $+1 # and LSB is in position 0 (so LSB is set in X iff 0 in X) pred add(var2 X, var2 Y, var2 Result, var0 Cin, var0 Cout) = ex2 C1: (0 in C1 <=> Cin) & (all1 p: mod_two(p in X, p in Y, p in C1, p in Result) & (p < $ => ((p+1 in C1) <=> at_least_two(p in X, p in Y, p in C1)))) & (Cout <=> at_least_two($ in X, $ in Y, $ in C1)); # Circuit constructors as functions pred not(var0 A) = ~A; pred and(var0 A,var0 B) = A & B; pred or(var0 A,var0 B) = A | B; pred xor(var0 A,var0 B) = or(and(not(A),B),and(A,not(B))); pred nor(var0 A,var0 B) = not(or(A,B)); pred nand(var0 A,var0 B) = not(and(A,B)); # Circut constructors as relations pred notrel(var0 A,var0 B) = not(A) <=> B; pred andrel(var0 A,var0 B,var0 C) = and(A,B) <=> C; pred orrel(var0 A,var0 B,var0 C) = or(A,B) <=> C; pred xorrel(var0 A,var0 B,var0 C) = xor(A,B) <=> C; pred norrel(var0 A,var0 B,var0 C) = nor(A,B) <=> C; pred nandrel(var0 A,var0 B,var0 C) = nand(A,B) <=> C; # classical one-bit full adder circuit pred full_adder(var0 A,var0 B,var0 @out,var0 Cin,var0 Cout) = ex0 W1, W2, W3: xorrel(A,B,W1) & xorrel(W1,Cin,@out) & andrel(A,B,W2) & andrel(Cin,W1,W3) & orrel(W3,W2,Cout) ; # an n-bit adder is strung together from 1-bit adders pred n_bit_adder(var2 X, var2 Y, var2 Z, var0 Cin, var0 Cout) = ex2 C, D: all1 p: full_adder(p in X, p in Y, p in Z, p in C, p in D) & (all1 p: (p < $) => (p in D <=> (p+1 % ($+1) in C))) & (0 in C <=> Cin) & ($ in D <=> Cout); # theorems var2 X, Y, Z; assert X sub {0,...,$}; # restrict X to represent a bit-vectorsof length $+1 assert Y sub {0,...,$}; assert Z sub {0,...,$}; var0 Cin, Cout; # is an n-bit-adder equivalent to the abstract specification of add? # add(X,Y,Z,Cin,Cout) <=> n_bit_adder(X,Y,Z,Cin,Cout); # what is 7 + 12 ? 7 is 111 and 12 is 0011 (with LSB at left); # so answer should be Z=11001 (19) # X = {0,1,2} & Y = {2,3} & (Cin <=> false) & add(X,Y,Z,Cin,Cout); # can output values always be calculated? (this might not be the case # if the circuit was overconstrained) # # all2 X, Y, Z: all0 Cin: ex0 Cout: n_bit_adder(X,Y,Z,Cin,Cout); # same question as above, but we omit the leading universal # quantifiers, relying instead on global variables X, Y, and Cin # ex2 Z: ex0 Cout: n_bit_adder(X,Y,Z,Cin,Cout); # # all2 X, Y: all0 Cin: ex2 Z: ex0 Cout: add(X,Y,Z,Cin,Cout); # are these values unique? that is, does n_bit_adder denote a function # of the input values? # # all2 X, Y: all0 Cin: ex2 Z: ex0 Cout: n_bit_adder(X,Y,Z,Cin,Cout) # & all2 Z' : all0 Cout': # n_bit_adder(X,Y,Z',Cin,Cout') => (Z = Z' & (Cout<=> Cout')); mona-1.4/Examples/even.mona0000644000414100000240000000035510073170400012601 00000000000000var2 P,Q; P\Q = {0,4} union {1,2}; # the formula from Section 1 var1 x; var0 A; ex2 Q: x in Q & (all1 q: (0 < q & q <= x) => (q in Q => q - 1 notin Q) & (q notin Q => q - 1 in Q)) & 0 in Q; A & x notin P; mona-1.4/Examples/hyman.mona0000644000414100000240000001026610073170400012762 00000000000000# while true do begin # # b_i := true; # while k != i do begin # while b_j do skip; # k := i; # end; # # b_i := false; # end; var1 $; var2 PC1', PC1'', PC1''', PC2', PC2'', PC2''', b1, b2, K; pred p1_at_line_1(var1 t) = t notin PC1' & t notin PC1'' & t notin PC1'''; pred p1_at_line_2(var1 t) = t notin PC1' & t notin PC1'' & t in PC1'''; pred p1_at_line_3(var1 t) = t notin PC1' & t in PC1'' & t notin PC1'''; pred p1_at_line_4(var1 t) = t notin PC1' & t in PC1'' & t in PC1'''; pred p1_at_line_5(var1 t) = t in PC1' & t notin PC1'' & t notin PC1'''; pred p1_at_line_6(var1 t) = t in PC1' & t notin PC1'' & t in PC1'''; pred p1_at_line_7(var1 t) = t in PC1' & t in PC1'' & t notin PC1'''; pred p2_at_line_1(var1 t) = t notin PC2' & t notin PC2'' & t notin PC2'''; pred p2_at_line_2(var1 t) = t notin PC2' & t notin PC2'' & t in PC2'''; pred p2_at_line_3(var1 t) = t notin PC2' & t in PC2'' & t notin PC2'''; pred p2_at_line_4(var1 t) = t notin PC2' & t in PC2'' & t in PC2'''; pred p2_at_line_5(var1 t) = t in PC2' & t notin PC2'' & t notin PC2'''; pred p2_at_line_6(var1 t) = t in PC2' & t notin PC2'' & t in PC2'''; pred p2_at_line_7(var1 t) = t in PC2' & t in PC2'' & t notin PC2'''; pred b1_false(var1 t) = t notin b1; pred b1_true(var1 t) = t in b1; pred b2_false(var1 t) = t notin b2; pred b2_true(var1 t) = t in b2; pred K_is_2(var1 t) = t notin K; pred K_is_1(var1 t) = t in K; pred unchanged(var1 t, var2 Track) = t in Track <=> t+1 in Track; pred unchanged_PC1(var1 t) = unchanged(t, PC1') & unchanged(t, PC1'') & unchanged(t, PC1'''); pred unchanged_PC2(var1 t) = unchanged(t, PC2') & unchanged(t, PC2'') & unchanged(t, PC2'''); pred unchanged_K(var1 t) = unchanged(t, K); pred unchanged_b1(var1 t) = unchanged(t, b1); pred unchanged_b2(var1 t) = unchanged(t, b2); pred unchanged_vars(var1 t) = unchanged_K(t) & unchanged_b1(t) & unchanged_b2(t); pred p1_proc_step(var1 t) = (p1_at_line_1(t) => p1_at_line_2(t+1) & unchanged_vars(t)) & (p1_at_line_2(t) => p1_at_line_3(t+1) & b1_true(t+1) & unchanged_K(t) & unchanged_b2(t)) & (p1_at_line_3(t) => (unchanged_vars(t) & (K_is_1(t) => p1_at_line_6(t+1)) & (K_is_2(t) => p1_at_line_4(t+1)))) & (p1_at_line_4(t) => (unchanged_vars(t) & (b2_false(t) => p1_at_line_5(t+1)) & (~b2_false(t) => p1_at_line_4(t+1)))) & (p1_at_line_5(t) => K_is_1(t+1) & unchanged_b1(t) & unchanged_b2(t) & p1_at_line_3(t+1)) & (p1_at_line_6(t) => p1_at_line_7(t+1) & unchanged_vars(t)) & (p1_at_line_7(t) => p1_at_line_1(t+1) & b1_false(t+1) & unchanged_K(t) & unchanged_b2(t)); pred p2_proc_step(var1 t) = (p2_at_line_1(t) => p2_at_line_2(t+1) & unchanged_vars(t)) & (p2_at_line_2(t) => p2_at_line_3(t+1) & b2_true(t+1) & unchanged_K(t) & unchanged_b1(t)) & (p2_at_line_3(t) => (unchanged_vars(t) & (K_is_2(t) => p2_at_line_6(t+1)) & (K_is_1(t) => p2_at_line_4(t+1)))) & (p2_at_line_4(t) => (unchanged_vars(t) & (b1_false(t) => p2_at_line_5(t+1)) & (~b1_false(t) => p2_at_line_4(t+1)))) & (p2_at_line_5(t) => K_is_2(t+1) & unchanged_b1(t) & unchanged_b2(t) & p2_at_line_3(t+1)) & (p2_at_line_6(t) => p2_at_line_7(t+1) & unchanged_vars(t)) & (p2_at_line_7(t) => p2_at_line_1(t+1) & b2_false(t+1) & unchanged_K(t) & unchanged_b1(t)); pred Valid = p1_at_line_1(0) & p2_at_line_1(0) & b1_false(0) & b2_false(0) & K_is_2(0) & (all1 t: t < $ => ((p1_proc_step(t) & unchanged_PC2(t)) | (p2_proc_step(t) & unchanged_PC1(t)))); #Mutual exclusion Valid => all1 p: (p<=$ => ~(p1_at_line_6(p) & p2_at_line_6(p))); mona-1.4/Examples/plusmodulo.mona0000644000414100000240000000026111045663202014052 00000000000000var1 i,j,k; ((j>k => i=0) & (j<=k => ((j+1 i=j+1) & (j+1=k => i=0) & ((j=k & k>1) => i=1) & ((j=k & k<=1) => i=0)))) <=> i=j+1%k; mona-1.4/Examples/even_with_assert.mona0000644000414100000240000000041010073170400015205 00000000000000var2 P,Q; assert P\Q = {0,4} union {1,2}; pred even(var1 p) = ex2 Q: p in Q & (all1 q: (0 < q & q <= p) => (q in Q => q - 1 notin Q) & (q notin Q => q - 1 in Q)) & 0 in Q; var1 x; var0 A; assert A & x notin P; even(x); mona-1.4/Examples/lossy_queue.mona0000644000414100000240000000405110073170400014216 00000000000000# Qe describes the valid indices of a queue pred isWfQueue(var2 Qe) = all1 p: (p in Qe & p > 0 => p - 1 in Qe); # isx holds if p contains an x pred is0(var1 p, var2 Qe, Q1, Q2) = p in Qe & p notin Q1 & p notin Q2; pred is1(var1 p, var2 Qe, Q1, Q2) = p in Qe & p notin Q1 & p in Q2; pred is2(var1 p, var2 Qe, Q1, Q2) = p in Qe & p in Q1 & p notin Q2; pred is3(var1 p, var2 Qe, Q1, Q2) = p in Qe & p in Q1 & p in Q2; # lt compares the elements at positions p and q of a queue pred lt(var1 p, q, var2 Qe, Q1, Q2) = (is0(p, Qe, Q1, Q2) & ~is0(q, Qe, Q1, Q2)) | ( is1(p, Qe, Q1, Q2) & (is2(q, Qe, Q1, Q2) | is3(q, Qe, Q1, Q2))) | ( is2(p, Qe, Q1, Q2) & (is3(q, Qe, Q1, Q2))); # isLast holds if p is the last element in the queue pred isLast(var1 p, var2 Qe) = p in Qe & (all1 q': q' in Qe => q' <= p); # an ordered queue of length l pred Queue(var2 Qe, Q1, Q2, var1 l) = isLast(l - 1, Qe) & (all1 p, q: p < q & p in Qe & q in Qe => lt(p, q, Qe, Q1, Q2)); # eqQueue2 compares elements in two queues pred eqQueue2(var1 p, q, var2 Q1, Q2, Q1', Q2') = (p in Q1 <=> q in Q1') & (p in Q2 <=> q in Q2'); # LooseOne holds about a queue Q and a queue Q' if # queue Q' is the same as Q except that one # element (denoted by p below) is removed pred LooseOne(var2 Qe, Q1, Q2, Qe', Q1', Q2') = ex1 p: p in Qe & (all1 q: (~isLast(q, Qe) => (q in Qe <=> q in Qe')) & (isLast(q, Qe) => (q notin Qe'))) & (all1 q: q < p & q in Qe => eqQueue2(q, q, Q1, Q2, Q1', Q2')) & (all1 q: q > p & q in Qe => eqQueue2(q, q - 1, Q1, Q2, Q1', Q2')); var2 Qe, Q1, Q2; # the queue Q var2 Qe', Q1', Q2'; # the queue Q' assert isWfQueue(Qe); # the primed variables denote a queue of length 3 containing # three of the elements 0, 1, 2, 3 in that order and the element 3 Queue(Qe, Q1, Q2, 4); # the queue Q is a queue of length 3 # containing the elements 0, 1, 2, 3 LooseOne(Qe, Q1, Q2, Qe', Q1', Q2'); # Q' is Q except for one element ex1 p: is3(p, Qe', Q1', Q2'); # Q' does contain the element 3 mona-1.4/Examples/presburger.mona0000644000414100000240000000170410073170400014023 00000000000000# MONA Presburger predicates # auxiliary predicates pred xor(var0 x,y) = x&~y | ~x&y; pred at_least_two(var0 x,y,z) = x&y | x&z | y&z; # addition relation (p "+" q = r) pred plus(var2 p,q,r) = ex2 c: # carry track 0 notin c # no carry-in & all1 t: (t+1 in c <=> at_least_two(t in p, t in q, t in c)) # propagate carry & (t in r <=> xor(xor(t in p, t in q), t in c)); # calculate result # less-than relation (p "<" q) pred less(var2 p,q) = ex2 t: t ~= empty & plus(p,t,q); # times-2 relation (p = q "*2") pred times_two(var2 p,q) = plus(q,q,p); # export some automata var2 p, q, r; execute export("presburger_plus_012.dfa", plus(p,q,r)); # 012 denotes variable ordering execute export("presburger_less_01.dfa", less(p,q)); execute export("presburger_timestwo_01.dfa", times_two(p,q)); execute export("presburger_const42.dfa", p = pconst(42));