[pure-lang-svn] SF.net SVN: pure-lang: [182] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-06-06 17:58:46
|
Revision: 182 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=182&view=rev Author: agraef Date: 2008-06-06 10:58:53 -0700 (Fri, 06 Jun 2008) Log Message: ----------- Windows compatibility fixes. Modified Paths: -------------- pure/trunk/Makefile.in pure/trunk/config.h.in pure/trunk/configure pure/trunk/configure.ac pure/trunk/interpreter.cc pure/trunk/runtime.cc pure/trunk/runtime.h Modified: pure/trunk/Makefile.in =================================================================== --- pure/trunk/Makefile.in 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/Makefile.in 2008-06-06 17:58:53 UTC (rev 182) @@ -54,7 +54,7 @@ LLVM_LIBS = `llvm-config --ldflags --libs core jit native` CPPFLAGS = @CPPFLAGS@ $(LLVM_FLAGS) -CXXFLAGS = @CXXFLAGS@ -Wall +CXXFLAGS = @CXXFLAGS@ # Pure library name. Currently we use a simple versioning scheme, which # requires that the library version matches that of the interpreter. With some @@ -75,6 +75,16 @@ SHARED = @SHARED@ +# Auxiliary libraries to be loaded at runtime. Usually this is just libpure +# (when built), but on some systems we have to load additional dlls to resolve +# some library functions. + +ifeq ($(SHARED), yes) +AUXLIBS = -DLIBPURE='"$(libpure)"' @AUXLIBS@ +else +AUXLIBS = @AUXLIBS@ +endif + # No need to edit below this line. Unless you really have to. :) ############ SOURCE = expr.cc expr.hh funcall.h interpreter.cc interpreter.hh lexer.ll \ @@ -111,6 +121,9 @@ pure.o: pure.cc $(CXX) $(CXXFLAGS) $(CPPFLAGS) -DPURELIB='"$(libdir)/pure"' -c -o $@ $< +interpreter.o: interpreter.cc + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(AUXLIBS) -c -o $@ $< + lexer.cc: lexer.ll flex -o lexer.cc $< Modified: pure/trunk/config.h.in =================================================================== --- pure/trunk/config.h.in 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/config.h.in 2008-06-06 17:58:53 UTC (rev 182) @@ -3,6 +3,9 @@ /* Define if you have the iconv() function. */ #undef HAVE_ICONV +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET @@ -21,6 +24,30 @@ /* Define to 1 if you have the `regex' library (-lregex). */ #undef HAVE_LIBREGEX +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + /* Define to the name of the host system. */ #undef HOST @@ -41,3 +68,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION + +/* The size of `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS Modified: pure/trunk/configure =================================================================== --- pure/trunk/configure 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/configure 2008-06-06 17:58:53 UTC (rev 182) @@ -576,6 +576,42 @@ PACKAGE_STRING='pure 0.3' PACKAGE_BUGREPORT='' +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME @@ -623,6 +659,7 @@ host_os RDYNAMIC DLLEXT +AUXLIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA @@ -633,10 +670,13 @@ ac_ct_CXX EXEEXT OBJEXT -SHARED CC CFLAGS ac_ct_CC +CPP +GREP +EGREP +SHARED LIBICONV LIBOBJS LTLIBOBJS' @@ -651,7 +691,8 @@ CPPFLAGS CCC CC -CFLAGS' +CFLAGS +CPP' # Initialize some variables set by options. @@ -1230,6 +1271,7 @@ --enable-debug enable the debug build --enable-debug2 enable the maintenance build --disable-shared link the interpreter statically + --enable-warnings enable compiler warnings (-Wall) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1246,6 +1288,7 @@ you have headers in a nonstandard directory <include dir> CC C compiler command CFLAGS C compiler flags + CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1804,9 +1847,12 @@ RDYNAMIC= DLLEXT=".so" +AUX_LIBS= case "$host" in - *-*-mingw*) RDYNAMIC="-rdynamic"; LIBS="$LIBS -limagehlp -lpsapi"; - LDFLAGS="-Wl,--enable-auto-import"; DLLEXT=".dll";; + *-*-mingw*) RDYNAMIC="-rdynamic"; DLLEXT=".dll"; + AUXLIBS="-DLIBGLOB='\"libglob.dll\"' -DLIBREGEX='\"libgnurx-0.dll\"'"; + LIBS="$LIBS -limagehlp -lpsapi"; + LDFLAGS="-Wl,--enable-auto-import";; *-*-linux*) RDYNAMIC="-rdynamic";; *-*-freebsd*) RDYNAMIC="-rdynamic";; *-*-darwin*) DLLEXT=".dylib";; @@ -1814,6 +1860,7 @@ esac + # 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: @@ -2501,36 +2548,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Check whether --enable-release was given. -if test "${enable_release+set}" = set; then - enableval=$enable_release; case "${enableval}" in - yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;; - esac -fi - -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then - enableval=$enable_debug; case "${enableval}" in - yes) CXXFLAGS="-g" ;; - esac -fi - -# Check whether --enable-debug2 was given. -if test "${enable_debug2+set}" = set; then - enableval=$enable_debug2; case "${enableval}" in - yes) CPPFLAGS="-DDEBUG=2"; CXXFLAGS="-g" ;; - esac -fi - -SHARED=yes -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then - enableval=$enable_shared; case "${enableval}" in - no) LDFLAGS="$LDFLAGS $RDYNAMIC"; SHARED=no ;; - esac -fi - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3208,45 +3225,611 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +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 <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> 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 <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -{ echo "$as_me:$LINENO: checking for __gmpz_init in -lgmp" >&5 -echo $ECHO_N "checking for __gmpz_init in -lgmp... $ECHO_C" >&6; } -if test "${ac_cv_lib_gmp___gmpz_init+set}" = set; then + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent 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 <ac_nonexistent.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.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 <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> 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 <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.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 nonexistent 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 <ac_nonexistent.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.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 grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgmp $LIBS" -cat >conftest.$ac_ext <<_ACEOF + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_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_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ 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 <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char __gmpz_init (); int main () { -return __gmpz_init (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; 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 core 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 <string.h> + +_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 <stdlib.h> + +_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 <ctype.h> +#include <stdlib.h> +#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)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_link") 2>&5 ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 @@ -3254,69 +3837,158 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_gmp___gmpz_init=yes + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gmp___gmpz_init=no + eval "$as_ac_Header=no" fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpz_init" >&5 -echo "${ECHO_T}$ac_cv_lib_gmp___gmpz_init" >&6; } -if test $ac_cv_lib_gmp___gmpz_init = yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGMP 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - LIBS="-lgmp $LIBS" +fi +done + + +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +if test "${ac_cv_type_void_p+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 +typedef void * ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_void_p=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -{ echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 -echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } -if test "${ac_cv_lib_readline_readline+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lreadline $LIBS" + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. 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 + typedef void * ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char readline (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + 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 + typedef void * ac__type_sizeof_; int main () { -return readline (); +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3325,39 +3997,320 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_readline_readline=yes + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_readline_readline=no + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + 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 + typedef void * ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + 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 + typedef void * ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } -if test $ac_cv_lib_readline_readline = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBREADLINE 1 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 + typedef void * ac__type_sizeof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 - LIBS="-lreadline $LIBS" + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr '(' $ac_mid ')' + 1` fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_void_p=$ac_lo;; +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; +esac +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 + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ -{ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 -echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; } -if test "${ac_cv_lib_iconv_iconv+set}" = set; then + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_void_p=`cat conftest.val` +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 ) +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +# Check whether --enable-release was given. +if test "${enable_release+set}" = set; then + enableval=$enable_release; case "${enableval}" in + yes) CPPFLAGS="-DNDEBUG -DDEBUG=0"; CXXFLAGS="-O3" ;; + esac +fi + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then + enableval=$enable_debug; case "${enableval}" in + yes) CXXFLAGS="-g" ;; + esac +fi + +# Check whether --enable-debug2 was given. +if test "${enable_debug2+set}" = set; then + enableval=$enable_debug2; case "${enableval}" in + yes) CPPFLAGS="-DDEBUG=2"; CXXFLAGS="-g" ;; + esac +fi + +SHARED=yes +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; case "${enableval}" in + no) LDFLAGS="$LDFLAGS $RDYNAMIC"; SHARED=no ;; + esac +fi + + +# Check whether --enable-warnings was given. +if test "${enable_warnings+set}" = set; then + enableval=$enable_warnings; case "${enableval}" in + yes) CXXFLAGS="$CXXFLAGS -Wall" ;; + esac +fi + + +{ echo "$as_me:$LINENO: checking for __gmpz_init in -lgmp" >&5 +echo $ECHO_N "checking for __gmpz_init in -lgmp... $ECHO_C" >&6; } +if test "${ac_cv_lib_gmp___gmpz_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" +LIBS="-lgmp $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3371,11 +4324,11 @@ #ifdef __cplusplus extern "C" #endif -char iconv (); +char __gmpz_init (); int main () { -return iconv (); +return __gmpz_init (); ; return 0; } @@ -3398,38 +4351,37 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_iconv_iconv=yes + ac_cv_lib_gmp___gmpz_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_iconv_iconv=no + ac_cv_lib_gmp___gmpz_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 -echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6; } -if test $ac_cv_lib_iconv_iconv = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmpz_init" >&5 +echo "${ECHO_T}$ac_cv_lib_gmp___gmpz_init" >&6; } +if test $ac_cv_lib_gmp___gmpz_init = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBICONV 1 +#define HAVE_LIBGMP 1 _ACEOF - LIBS="-liconv $LIBS" + LIBS="-lgmp $LIBS" fi -if test $ac_cv_lib_iconv_iconv = no; then -{ echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 -echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; } -if test "${ac_cv_lib_iconv_libiconv+set}" = set; then +{ echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 +echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } +if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" +LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3443,11 +4395,11 @@ #ifdef __cplusplus extern "C" #endif -char libiconv (); +char readline (); int main () { -return libiconv (); +return readline (); ; return 0; } @@ -3470,38 +4422,37 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_iconv_libiconv=yes + ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_iconv_libiconv=no + ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5 -echo "${ECHO_T}$ac_cv_lib_iconv_libiconv" >&6; } -if test $ac_cv_lib_iconv_libiconv = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } +if test $ac_cv_lib_readline_readline = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBICONV 1 +#define HAVE_LIBREADLINE 1 _ACEOF - LIBS="-liconv $LIBS" + LIBS="-lreadline $LIBS" fi -fi -{ echo "$as_me:$LINENO: checking for glob in -lglob" >&5 -echo $ECHO_N "checking for glob in -lglob... $ECHO_C" >&6; } -if test "${ac_cv_lib_glob_glob+set}" = set; then +{ echo "$as_me:$LINENO: checking for libiconv in -liconv" >&5 +echo $ECHO_N "checking for libiconv in -liconv... $ECHO_C" >&6; } +if test "${ac_cv_lib_iconv_libiconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lglob $LIBS" +LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3515,11 +4466,11 @@ #ifdef __cplusplus extern "C" #endif -char glob (); +char libiconv (); int main () { -return glob (); +return libiconv (); ; return 0; } @@ -3542,38 +4493,38 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_glob_glob=yes + ac_cv_lib_iconv_libiconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_glob_glob=no + ac_cv_lib_iconv_libiconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_glob_glob" >&5 -echo "${ECHO_T}$ac_cv_lib_glob_glob" >&6; } -if test $ac_cv_lib_glob_glob = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv" >&5 +echo "${ECHO_T}$ac_cv_lib_iconv_libiconv" >&6; } +if test $ac_cv_lib_iconv_libiconv = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGLOB 1 +#define HAVE_LIBICONV 1 _ACEOF - LIBS="-lglob $LIBS" + LIBS="-liconv $LIBS" fi -if test $ac_cv_lib_glob_glob = no; then +if test $ac_cv_lib_iconv_libiconv = no; then -{ echo "$as_me:$LINENO: checking for xxglob in -lglob" >&5 -echo $ECHO_N "checking for xxglob in -lglob... $ECHO_C" >&6; } -if test "${ac_cv_lib_glob_xxglob+set}" = set; then +{ echo "$as_me:$LINENO: checking for iconv in -liconv" >&5 +echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6; } +if test "${ac_cv_lib_iconv_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lglob $LIBS" +LIBS="-liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3587,11 +4538,11 @@ #ifdef __cplusplus extern "C" #endif -char xxglob (); +char iconv (); int main () { -return xxglob (); +return iconv (); ; return 0; } @@ -3614,38 +4565,38 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_glob_xxglob=yes + ac_cv_lib_iconv_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_glob_xxglob=no + ac_cv_lib_iconv_iconv=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_glob_xxglob" >&5 -echo "${ECHO_T}$ac_cv_lib_glob_xxglob" >&6; } -if test $ac_cv_lib_glob_xxglob = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv" >&5 +echo "${ECHO_T}$ac_cv_lib_iconv_iconv" >&6; } +if test $ac_cv_lib_iconv_iconv = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGLOB 1 +#define HAVE_LIBICONV 1 _ACEOF - LIBS="-lglob $LIBS" + LIBS="-liconv $LIBS" fi fi -{ echo "$as_me:$LINENO: checking for regcomp in -lregex" >&5 -echo $ECHO_N "checking for regcomp in -lregex... $ECHO_C" >&6; } -if test "${ac_cv_lib_regex_regcomp+set}" = set; then +{ echo "$as_me:$LINENO: checking for glob in -lglob" >&5 +echo $ECHO_N "checking for glob in -lglob... $ECHO_C" >&6; } +if test "${ac_cv_lib_glob_glob+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lregex $LIBS" +LIBS="-lglob $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3659,11 +4610,11 @@ #ifdef __cplusplus extern "C" #endif -char regcomp (); +char glob (); int main () { -return regcomp (); +return glob (); ; return 0; } @@ -3686,34 +4637,33 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_regex_regcomp=yes + ac_cv_lib_glob_glob=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_regex_regcomp=no + ac_cv_lib_glob_glob=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_regex_regcomp" >&5 -echo "${ECHO_T}$ac_cv_lib_regex_regcomp" >&6; } -if test $ac_cv_lib_regex_regcomp = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_glob_glob" >&5 +echo "${ECHO_T}$ac_cv_lib_glob_glob" >&6; } +if test $ac_cv_lib_glob_glob = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBREGEX 1 +#define HAVE_LIBGLOB 1 _ACEOF - LIBS="-lregex $LIBS" + LIBS="-lglob $LIBS" fi -if test $ac_cv_lib_regex_regcomp = no; then -{ echo "$as_me:$LINENO: checking for xxregcomp in -lregex" >&5 -echo $ECHO_N "checking for xxregcomp in -lregex... $ECHO_C" >&6; } -if test "${ac_cv_lib_regex_xxregcomp+set}" = set; then +{ echo "$as_me:$LINENO: checking for regcomp in -lregex" >&5 +echo $ECHO_N "checking for regcomp in -lregex... $ECHO_C" >&6; } +if test "${ac_cv_lib_regex_regcomp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3731,11 +4681,11 @@ #ifdef __cplusplus extern "C" #endif -char xxregcomp (); +char regcomp (); int main () { -return xxregcomp (); +return regcomp (); ; return 0; } @@ -3758,21 +4708,21 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_regex_xxregcomp=yes + ac_cv_lib_regex_regcomp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_regex_xxregcomp=no + ac_cv_lib_regex_regcomp=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_regex_xxregcomp" >&5 -echo "${ECHO_T}$ac_cv_lib_regex_xxregcomp" >&6; } -if test $ac_cv_lib_regex_xxregcomp = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_regex_regcomp" >&5 +echo "${ECHO_T}$ac_cv_lib_regex_regcomp" >&6; } +if test $ac_cv_lib_regex_regcomp = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBREGEX 1 _ACEOF @@ -3781,7 +4731,6 @@ fi -fi am_cv_lib_iconv_ldpath= @@ -4718,6 +5667,7 @@ host_os!$host_os$ac_delim RDYNAMIC!$RDYNAMIC$ac_delim DLLEXT!$DLLEXT$ac_delim +AUXLIBS!$AUXLIBS$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim @@ -4728,16 +5678,19 @@ ac_ct_CXX!$ac_ct_CXX$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim -SHARED!$SHARED$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +SHARED!$SHARED$ac_delim LIBICONV!$LIBICONV$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: pure/trunk/configure.ac =================================================================== --- pure/trunk/configure.ac 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/configure.ac 2008-06-06 17:58:53 UTC (rev 182) @@ -11,9 +11,12 @@ dnl Figure out extra build flags and filename extensions for various systems. RDYNAMIC= DLLEXT=".so" +AUX_LIBS= case "$host" in - *-*-mingw*) RDYNAMIC="-rdynamic"; LIBS="$LIBS -limagehlp -lpsapi"; - LDFLAGS="-Wl,--enable-auto-import"; DLLEXT=".dll";; + *-*-mingw*) RDYNAMIC="-rdynamic"; DLLEXT=".dll"; + AUXLIBS="-DLIBGLOB='\"libglob.dll\"' -DLIBREGEX='\"libgnurx-0.dll\"'"; + LIBS="$LIBS -limagehlp -lpsapi"; + LDFLAGS="-Wl,--enable-auto-import";; *-*-linux*) RDYNAMIC="-rdynamic";; *-*-freebsd*) RDYNAMIC="-rdynamic";; *-*-darwin*) DLLEXT=".dylib";; @@ -21,9 +24,12 @@ esac AC_SUBST(RDYNAMIC) AC_SUBST(DLLEXT) +AC_SUBST(AUXLIBS) dnl Check for programs. AC_PROG_INSTALL AC_PROG_CXX +dnl Determine pointer sizes. This will be 8 on 64 bit systems. +AC_CHECK_SIZEOF(void *) dnl Parse --enable options. AC_ARG_ENABLE(release, [ --enable-release enable the release build], @@ -47,22 +53,24 @@ no) LDFLAGS="$LDFLAGS $RDYNAMIC"; SHARED=no ;; esac]) AC_SUBST(SHARED) +AC_ARG_ENABLE(warnings, + [ --enable-warnings enable compiler warnings (-Wall)], + [case "${enableval}" in + yes) CXXFLAGS="$CXXFLAGS -Wall" ;; + esac]) dnl Check for libraries. AC_CHECK_LIB(gmp, __gmpz_init) AC_CHECK_LIB(readline, readline) -dnl On some systems these are in separate libraries, and may have other names. -AC_CHECK_LIB(iconv, iconv) -if test $ac_cv_lib_iconv_iconv = no; then - AC_CHECK_LIB(iconv, libiconv) +dnl On some systems iconv is in a separate library, and may actually be named +dnl libiconv. +AC_CHECK_LIB(iconv, libiconv) +if test $ac_cv_lib_iconv_libiconv = no; then + AC_CHECK_LIB(iconv, iconv) fi +dnl On non-POSIX systems like Windows, we have to get the glob and regex +dnl functions from separate libraries, too. AC_CHECK_LIB(glob, glob) -if test $ac_cv_lib_glob_glob = no; then - AC_CHECK_LIB(glob, xxglob) -fi AC_CHECK_LIB(regex, regcomp) -if test $ac_cv_lib_regex_regcomp = no; then - AC_CHECK_LIB(regex, xxregcomp) -fi dnl iconv and nl_langinfo need special treatment (macros by Bruno Haible). AM_ICONV AM_LANGINFO_CODESET Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/interpreter.cc 2008-06-06 17:58:53 UTC (rev 182) @@ -11,6 +11,8 @@ #include <llvm/System/DynamicLibrary.h> #include <llvm/Transforms/Utils/BasicBlockUtils.h> +#include "config.h" + uint8_t interpreter::g_verbose = 0; bool interpreter::g_interactive = false; interpreter* interpreter::g_interp = 0; @@ -61,7 +63,17 @@ if (!g_interp) { g_interp = this; stackdir = c_stack_dir(); - llvm::sys::DynamicLibrary::LoadLibraryPermanently("libpure", 0); + // Preload some auxiliary dlls. First load the Pure library if we built it. +#ifdef LIBPURE + llvm::sys::DynamicLibrary::LoadLibraryPermanently(LIBPURE, 0); +#endif + // Additional stuff to be loaded on some systems (e.g., Windows). +#ifdef LIBGLOB + llvm::sys::DynamicLibrary::LoadLibraryPermanently(LIBGLOB, 0); +#endif +#ifdef LIBREGEX + llvm::sys::DynamicLibrary::LoadLibraryPermanently(LIBREGEX, 0); +#endif } sstk_sz = 0; sstk_cap = 0x10000; // 64K Modified: pure/trunk/runtime.cc =================================================================== --- pure/trunk/runtime.cc 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/runtime.cc 2008-06-06 17:58:53 UTC (rev 182) @@ -10,6 +10,7 @@ #include <iostream> #include <sstream> +#include "config.h" #include "funcall.h" // Hook to report stack overflows and other kinds of hard errors. @@ -1068,9 +1069,13 @@ case EXPR::INT: return x; case EXPR::BIGINT: return pure_int(mpz_get_ui(x->data.z)); case EXPR::DBL: return pure_int((int32_t)x->data.d); +#if SIZEOF_VOID_P==8 // Must cast to 64 bit here first, since on 64 bit systems g++ gives an // error when directly casting a 64 bit pointer to a 32 bit integer. case EXPR::PTR: return pure_int((uint32_t)(uint64_t)x->data.p); +#else + case EXPR::PTR: return pure_int((uint32_t)x->data.p); +#endif default: return 0; } } @@ -1097,13 +1102,19 @@ case EXPR::INT: return pure_pointer((void*)x->data.i); case EXPR::BIGINT: if (sizeof(mp_limb_t) == 8) +#if SIZEOF_VOID_P==8 return pure_pointer((void*)mpz_getlimbn(x->data.z, 0)); - else if (sizeof(void*) == 4) - return pure_pointer((void*)mpz_get_ui(x->data.z)); +#else + return pure_pointer((void*)(uint32_t)mpz_getlimbn(x->data.z, 0)); +#endif else { +#if SIZEOF_VOID_P==8 uint64_t u = mpz_getlimbn(x->data.z, 0) + (((uint64_t)mpz_getlimbn(x->data.z, 1))<<32); return pure_pointer((void*)u); +#else + return pure_pointer((void*)mpz_get_ui(x->data.z)); +#endif } default: return 0; } @@ -1113,21 +1124,24 @@ { if (sizeof(mp_limb_t) == 8) { // In this case the pointer value ought to fit into a single limb. +#if SIZEOF_VOID_P==8 limb_t u[1] = { (uint64_t)p }; +#else + limb_t u[1] = { (uint64_t)(uint32_t)p }; +#endif return pure_bigint(1, u); } // 4 byte limbs. - if (sizeof(void*) == 4) { - // 4 byte pointers. Note that we still cast to 64 bit first, since - // otherwise the code will give an error on 64 bit systems. - limb_t u[1] = { (uint32_t)(uint64_t)p }; - return pure_bigint(1, u); - } else { - // 8 byte pointers, put least significant word in the first limb. - assert(sizeof(void*) == 8); - limb_t u[2] = { (uint32_t)(uint64_t)p, (uint32_t)(((uint64_t)p)>>32) }; - return pure_bigint(2, u); - } +#if SIZEOF_VOID_P==8 + // 8 byte pointers, put least significant word in the first limb. + assert(sizeof(void*) == 8); + limb_t u[2] = { (uint32_t)(uint64_t)p, (uint32_t)(((uint64_t)p)>>32) }; + return pure_bigint(2, u); +#else + // 4 byte pointers. + limb_t u[1] = { (uint32_t)p }; + return pure_bigint(1, u); +#endif } extern "C" @@ -1604,7 +1618,21 @@ errno = value; } +#ifdef __MINGW32__ extern "C" +FILE *popen(const char *command, const char *type) +{ + return _popen(command, type); +} + +extern "C" +int pclose(FILE *stream) +{ + return _pclose(stream); +} +#endif + +extern "C" int pure_fprintf(FILE *fp, const char *format) { return fprintf(fp, format); Modified: pure/trunk/runtime.h =================================================================== --- pure/trunk/runtime.h 2008-06-06 17:12:35 UTC (rev 181) +++ pure/trunk/runtime.h 2008-06-06 17:58:53 UTC (rev 182) @@ -324,6 +324,13 @@ int pure_errno(void); void pure_set_errno(int value); +#ifdef __MINGW32__ +/* Windows compatibility. */ + +FILE *popen(const char *command, const char *type); +int pclose(FILE *stream); +#endif + /* printf/scanf support. Since we don't support calling C vararg functions from Pure right now, these little wrappers are provided to process at most one value at a time. It is the responsibility of the caller that the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |