diff options
Diffstat (limited to 'libgcobol')
-rw-r--r-- | libgcobol/ChangeLog | 140 | ||||
-rw-r--r-- | libgcobol/Makefile.am | 37 | ||||
-rw-r--r-- | libgcobol/Makefile.in | 340 | ||||
-rw-r--r-- | libgcobol/acinclude.m4 | 162 | ||||
-rw-r--r-- | libgcobol/aclocal.m4 | 20 | ||||
-rw-r--r-- | libgcobol/charmaps.h | 2 | ||||
-rw-r--r-- | libgcobol/common-defs.h | 1 | ||||
-rw-r--r-- | libgcobol/config.h.in | 39 | ||||
-rwxr-xr-x | libgcobol/configure | 6338 | ||||
-rw-r--r-- | libgcobol/configure.ac | 318 | ||||
-rw-r--r-- | libgcobol/configure.tgt | 7 | ||||
-rw-r--r-- | libgcobol/constants.cc | 10 | ||||
-rw-r--r-- | libgcobol/gfileio.cc | 32 | ||||
-rw-r--r-- | libgcobol/gmath.cc | 108 | ||||
-rw-r--r-- | libgcobol/intrinsic.cc | 278 | ||||
-rw-r--r-- | libgcobol/libgcobol-fp.h | 59 | ||||
-rw-r--r-- | libgcobol/libgcobol.cc | 276 | ||||
-rw-r--r-- | libgcobol/libgcobol.h | 16 | ||||
-rw-r--r-- | libgcobol/libgcobol.spec.in | 8 | ||||
-rw-r--r-- | libgcobol/valconv.cc | 6 |
20 files changed, 3854 insertions, 4343 deletions
diff --git a/libgcobol/ChangeLog b/libgcobol/ChangeLog index 48d65ef..9de1714 100644 --- a/libgcobol/ChangeLog +++ b/libgcobol/ChangeLog @@ -1,3 +1,143 @@ +2025-04-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * configure.ac: Check for struct tm.tm_zone. + * configure, config.h.in: Regenerate. + * intrinsic.cc (__gg__formatted_current_date): Guard tm.tm_zone + use with HAVE_STRUCT_TM_TM_ZONE. + +2025-04-15 Andreas Schwab <schwab@suse.de> + + * configure.tgt: Set LIBGCOBOL_SUPPORTED for riscv64-*-linux* with + 64-bit multilib. + +2025-04-15 Jakub Jelinek <jakub@redhat.com> + Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR cobol/119244 + * acinclude.m4 (LIBGCOBOL_CHECK_FLOAT128): Ensure + libgcob_cv_have_float128 is not yes on targets with IEEE quad + long double. Don't check for --as-needed nor set LIBQUADSPEC + on targets which USE_IEC_60559. + * libgcobol-fp.h (FP128_FMT, strtofp128, strfromfp128): Define. + * intrinsic.cc (strtof128): Don't redefine. + (WEIRD_TRANSCENDENT_RETURN_VALUE): Use GCOB_FP128_LITERAL macro. + (__gg__numval_f): Use strtofp128 instead of strtof128. + * libgcobol.cc (strtof128): Don't redefine. + (format_for_display_internal): Use strfromfp128 instead of + strfromf128 or quadmath_snprintf and use FP128_FMT in the format + string. + (get_float128, __gg__compare_2, __gg__move, __gg__move_literala): + Use strtofp128 instead of strtof128. + * configure: Regenerate. + +2025-04-14 Andreas Schwab <schwab@suse.de> + + * libgcobol.cc (__gg__float64_from_128): Mark literal as float128 + literal. + +2025-04-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * valconv.cc (__gg__string_to_numeric_edited): Use strchr instead + of index. + +2025-04-12 Bob Dubner <rdubner@symas.com> + + PR cobol/119694 + * gfileio.cc: Eliminate getenv() calls. + * libgcobol.cc: Likewise. + +2025-04-10 Iain Sandoe <iain@sandoe.co.uk> + + * configure.tgt: Enable for x86_64 Darwin. + +2025-04-10 Iain Sandoe <iain@sandoe.co.uk> + + PR cobol/119244 + * Makefile.am: Add support for libquadmath. + * Makefile.in: Regenerate. + * acinclude.m4: Add support for libquadmath. + * config.h.in: Regenerate. + * configure: Regenerate. + * configure.ac: Configure libquadmath support. + * gmath.cc: Use GCOB_FP128 to represent the configured + 128b floating point type. Use FP128_FUNC to represent + the naming of intrinsics in the configure 128b floating + point type. Render literals with GCOB_FP128_LITERAL. + * intrinsic.cc: Likewise. + * libgcobol.cc: Likewise. + * libgcobol.h: Likewise. + * libgcobol-fp.h: New file. + * gfileio.cc: Include libgcobol-fp.h. + * libgcobol.spec.in: Add libquadmath configure output. + +2025-04-09 Bob Dubner <rdubner@symas.com> + + PR cobol/119682 + * common-defs.h: Define the REFER_T_REFMOD constant. + * intrinsic.cc: (__gg__max): Change the calls to __gg__compare_2(), + (__gg__min): Likewise, (__gg__ord_min): Likewise, + (__gg__ord_max): Likewise. + * libgcobol.cc: (__gg__compare_2): Change definition of calling + parameters, eliminate separate flag bit for ALL and ADDRESS_OF, + change comparison of alphanumeric to numeric when the numeric + is a refmod. + * libgcobol.h: Change declaration of __gg__compare_2. + +2025-04-05 Iain Sandoe <iain@sandoe.co.uk> + + * Makefile.am: Add libgcobol.spec and dependency. + * Makefile.in: Regenerate. + * configure: Regenerate. + * configure.ac: Add libgcobol.spec handling. + * libgcobol.spec.in: New file. + +2025-04-05 Iain Sandoe <iain@sandoe.co.uk> + + * aclocal.m4: Regenerate. + * config.h.in: Regenerate. + * Makefile.am: Use the configured LIBS and extra_ldflags. + * Makefile.in: Regenerate. + * configure: Regenerate. + * configure.ac: Shift configure to use c++. Order tests for tools + and environment before other tests. + +2025-04-04 Iain Sandoe <iain@sandoe.co.uk> + + * Makefile.am: Use $(LIBM) to add the math lib when + it is needed. + * Makefile.in: Regenerate. + * configure: Regenerate. + * configure.ac: Check if the target wants libm. + +2025-04-04 Bob Dubner <rdubner@symas.com> + + * charmaps.h: Change __gg__data_return_code to 'short' type. + * constants.cc: Likewise. + +2025-04-03 Iain Sandoe <iain@sandoe.co.uk> + + * config.h.in: Regenerate. + * configure: Regenerate. + * configure.ac: Check for availability of strfromf32 and + strfromf64. + * libgcobol.cc (strfromf32, strfromf64): New. + +2025-04-03 Iain Sandoe <iain@sandoe.co.uk> + + PR cobol/119295 + * config.h.in: Regenerate. + * configure: Regenerate. + * configure.ac: Configure random_r and friends + * intrinsic.cc (__gg__random): Use random_r when available. + (__gg__random_next): Likewise. + +2025-04-03 Iain Sandoe <iain@sandoe.co.uk> + + * gfileio.cc: Include config.h. + * gmath.cc: Likewise. + * io.cc: Likewise. + * libgcobol.cc: Likewise. + 2025-04-02 Bob Dubner <rdubner@symas.com> PR cobol/119521 diff --git a/libgcobol/Makefile.am b/libgcobol/Makefile.am index cafb733..0a17d20 100644 --- a/libgcobol/Makefile.am +++ b/libgcobol/Makefile.am @@ -25,9 +25,10 @@ ACLOCAL_AMFLAGS = -I .. -I ../config # May be used by various substitution variables. gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) +# Skip the whole process if we are not building libgcobol. if BUILD_LIBGCOBOL toolexeclib_LTLIBRARIES = libgcobol.la -endif +toolexeclib_DATA = libgcobol.spec ## ## 2.2.12 Automatic Dependency Tracking @@ -43,22 +44,26 @@ libgcobol_la_SOURCES = \ libgcobol.cc \ valconv.cc -libgcobol_la_LINK = $(LIBTOOL) --mode=link --tag=CXX $(CXX) \ - -o libgcobol$(libsuffix).la \ - -Wc,-shared-libgcc \ - -version-info $(LIBGCOBOL_VERSION) \ - -lstdc++ \ - $(LTLDFLAGS) $(LTLIBICONV) - WARN_CFLAGS = -W -Wall -Wwrite-strings -AM_CXXFLAGS = $(CXXFLAGS_FOR_TARGET) +AM_CPPFLAGS = -I. -I$(srcdir) $(LIBQUADINCLUDE) +AM_CFLAGS = $(XCFLAGS) +AM_CXXFLAGS = $(XCFLAGS) +AM_CXXFLAGS += $(WARN_CFLAGS) +AM_CXXFLAGS += -DIN_TARGET_LIBS +AM_CXXFLAGS += -fno-strict-aliasing + +if ENABLE_DARWIN_AT_RPATH +# Handle embedded rpaths for Darwin. +extra_ldflags_libgcobol += -Wc,-nodefaultrpaths +extra_ldflags_libgcobol += -Wl,-rpath,@loader_path +endif -# not defined: DEFS, MAX_ERRORS, LTLDFLAGS -ALL_CXXFLAGS = -I. -I$(srcdir) $(AM_CPPFLAGS) $(DEFS) \ - $(XCFLAGS) $(AM_CXXFLAGS) $(WARN_CFLAGS) $(MAX_ERRORS) \ - -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing +# We want to link with the c++ runtime. +libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS) +version_arg = -version-info $(LIBGCOBOL_VERSION) +libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \ + $(extra_ldflags_libgcobol) $(LIBS) $(version_arg) +libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP) -%.lo: %.cc - $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c \ - -o $@ $(INCLUDES) $(ALL_CXXFLAGS) $< +endif BUILD_LIBGCOBOL diff --git a/libgcobol/Makefile.in b/libgcobol/Makefile.in index c4a562a..5fdc42c 100644 --- a/libgcobol/Makefile.in +++ b/libgcobol/Makefile.in @@ -35,6 +35,7 @@ # Written de novo for libgcobol. + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -110,6 +111,10 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ + +# Handle embedded rpaths for Darwin. +@BUILD_LIBGCOBOL_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -Wc,-nodefaultrpaths \ +@BUILD_LIBGCOBOL_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@ -Wl,-rpath,@loader_path subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ @@ -132,12 +137,12 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) + $(am__configure_deps) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libgcobol.spec CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -166,11 +171,14 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(toolexeclibdir)" +am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ + "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) libgcobol_la_LIBADD = -am_libgcobol_la_OBJECTS = charmaps.lo constants.lo gfileio.lo gmath.lo \ - intrinsic.lo io.lo libgcobol.lo valconv.lo +@BUILD_LIBGCOBOL_TRUE@am_libgcobol_la_OBJECTS = charmaps.lo \ +@BUILD_LIBGCOBOL_TRUE@ constants.lo gfileio.lo gmath.lo \ +@BUILD_LIBGCOBOL_TRUE@ intrinsic.lo io.lo libgcobol.lo \ +@BUILD_LIBGCOBOL_TRUE@ valconv.lo libgcobol_la_OBJECTS = $(am_libgcobol_la_OBJECTS) @BUILD_LIBGCOBOL_TRUE@am_libgcobol_la_rpath = -rpath $(toolexeclibdir) AM_V_P = $(am__v_P_@AM_V@) @@ -212,12 +220,12 @@ am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libgcobol_la_SOURCES) -DIST_SOURCES = $(libgcobol_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +DATA = $(toolexeclib_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -240,29 +248,6 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/../compile $(top_srcdir)/../config.guess \ - $(top_srcdir)/../config.sub $(top_srcdir)/../depcomp \ - $(top_srcdir)/../install-sh $(top_srcdir)/../ltmain.sh \ - $(top_srcdir)/../missing $(top_srcdir)/../mkinstalldirs \ - ChangeLog README -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -272,11 +257,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ -CCAS = @CCAS@ -CCASDEPMODE = @CCASDEPMODE@ -CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ -CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -305,7 +286,12 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGCOBOL_VERSION = @LIBGCOBOL_VERSION@ LIBICONV = @LIBICONV@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ +LIBQUADINCLUDE = @LIBQUADINCLUDE@ +LIBQUADLIB = @LIBQUADLIB@ +LIBQUADLIB_DEP = @LIBQUADLIB_DEP@ +LIBQUADSPEC = @LIBQUADSPEC@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ @@ -335,8 +321,8 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SPEC_LIBGCOBOL_DEPS = @SPEC_LIBGCOBOL_DEPS@ STRIP = @STRIP@ +USE_IEC_60559 = @USE_IEC_60559@ VERSION = @VERSION@ -VERSION_SUFFIX = @VERSION_SUFFIX@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -353,9 +339,7 @@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ -build_libsubdir = @build_libsubdir@ build_os = @build_os@ -build_subdir = @build_subdir@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ @@ -365,14 +349,12 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ -extra_darwin_ldflags_libgcobol = @extra_darwin_ldflags_libgcobol@ +extra_ldflags_libgcobol = @extra_ldflags_libgcobol@ $(am__append_1) get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ -host_noncanonical = @host_noncanonical@ host_os = @host_os@ -host_subdir = @host_subdir@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ @@ -392,7 +374,6 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -slibdir = @slibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ @@ -400,7 +381,6 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_noncanonical = @target_noncanonical@ target_os = @target_os@ -target_subdir = @target_subdir@ target_vendor = @target_vendor@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ @@ -412,32 +392,33 @@ ACLOCAL_AMFLAGS = -I .. -I ../config # May be used by various substitution variables. gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) -@BUILD_LIBGCOBOL_TRUE@toolexeclib_LTLIBRARIES = libgcobol.la -libgcobol_la_SOURCES = \ - charmaps.cc \ - constants.cc \ - gfileio.cc \ - gmath.cc \ - intrinsic.cc \ - io.cc \ - libgcobol.cc \ - valconv.cc - -libgcobol_la_LINK = $(LIBTOOL) --mode=link --tag=CXX $(CXX) \ - -o libgcobol$(libsuffix).la \ - -Wc,-shared-libgcc \ - -version-info $(LIBGCOBOL_VERSION) \ - -lstdc++ \ - $(LTLDFLAGS) $(LTLIBICONV) - -WARN_CFLAGS = -W -Wall -Wwrite-strings -AM_CXXFLAGS = $(CXXFLAGS_FOR_TARGET) - -# not defined: DEFS, MAX_ERRORS, LTLDFLAGS -ALL_CXXFLAGS = -I. -I$(srcdir) $(AM_CPPFLAGS) $(DEFS) \ - $(XCFLAGS) $(AM_CXXFLAGS) $(WARN_CFLAGS) $(MAX_ERRORS) \ - -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing +# Skip the whole process if we are not building libgcobol. +@BUILD_LIBGCOBOL_TRUE@toolexeclib_LTLIBRARIES = libgcobol.la +@BUILD_LIBGCOBOL_TRUE@toolexeclib_DATA = libgcobol.spec +@BUILD_LIBGCOBOL_TRUE@libgcobol_la_SOURCES = \ +@BUILD_LIBGCOBOL_TRUE@ charmaps.cc \ +@BUILD_LIBGCOBOL_TRUE@ constants.cc \ +@BUILD_LIBGCOBOL_TRUE@ gfileio.cc \ +@BUILD_LIBGCOBOL_TRUE@ gmath.cc \ +@BUILD_LIBGCOBOL_TRUE@ intrinsic.cc \ +@BUILD_LIBGCOBOL_TRUE@ io.cc \ +@BUILD_LIBGCOBOL_TRUE@ libgcobol.cc \ +@BUILD_LIBGCOBOL_TRUE@ valconv.cc + +@BUILD_LIBGCOBOL_TRUE@WARN_CFLAGS = -W -Wall -Wwrite-strings +@BUILD_LIBGCOBOL_TRUE@AM_CPPFLAGS = -I. -I$(srcdir) $(LIBQUADINCLUDE) +@BUILD_LIBGCOBOL_TRUE@AM_CFLAGS = $(XCFLAGS) +@BUILD_LIBGCOBOL_TRUE@AM_CXXFLAGS = $(XCFLAGS) $(WARN_CFLAGS) \ +@BUILD_LIBGCOBOL_TRUE@ -DIN_TARGET_LIBS -fno-strict-aliasing + +# We want to link with the c++ runtime. +@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS) +@BUILD_LIBGCOBOL_TRUE@version_arg = -version-info $(LIBGCOBOL_VERSION) +@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \ +@BUILD_LIBGCOBOL_TRUE@ $(extra_ldflags_libgcobol) $(LIBS) $(version_arg) + +@BUILD_LIBGCOBOL_TRUE@libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -491,6 +472,8 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +libgcobol.spec: $(top_builddir)/config.status $(srcdir)/libgcobol.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) @@ -574,6 +557,27 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-toolexeclibDATA: $(toolexeclib_DATA) + @$(NORMAL_INSTALL) + @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \ + done + +uninstall-toolexeclibDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclib_DATA)'; test -n "$(toolexeclibdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(toolexeclibdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -633,175 +637,11 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_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*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(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 \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { 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-am -all-am: Makefile $(LTLIBRARIES) config.h +all-am: Makefile $(LTLIBRARIES) $(DATA) config.h installdirs: - for dir in "$(DESTDIR)$(toolexeclibdir)"; do \ + for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -864,7 +704,8 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-toolexeclibLTLIBRARIES +install-exec-am: install-toolexeclibDATA \ + install-toolexeclibLTLIBRARIES install-html: install-html-am @@ -906,36 +747,31 @@ ps: ps-am ps-am: -uninstall-am: uninstall-toolexeclibLTLIBRARIES +uninstall-am: uninstall-toolexeclibDATA \ + uninstall-toolexeclibLTLIBRARIES .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ clean-cscope clean-generic clean-libtool \ clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \ - ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \ - dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip install-toolexeclibLTLIBRARIES installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip install-toolexeclibDATA \ + install-toolexeclibLTLIBRARIES installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-toolexeclibDATA \ uninstall-toolexeclibLTLIBRARIES .PRECIOUS: Makefile -%.lo: %.cc - $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c \ - -o $@ $(INCLUDES) $(ALL_CXXFLAGS) $< - # 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: diff --git a/libgcobol/acinclude.m4 b/libgcobol/acinclude.m4 index ed340c7..0e81b10 100644 --- a/libgcobol/acinclude.m4 +++ b/libgcobol/acinclude.m4 @@ -24,3 +24,165 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN],) AC_DEFUN([AC_LIBLTDL_CONVENIENCE],) AC_SUBST(LIBTOOL) ]) + +dnl Check whether we have a __float128 and _Float128 type +dnl Unashamedly plagiarized from libgfortran. + +AC_DEFUN([LIBGCOBOL_CHECK_FLOAT128], [ + LIBQUADSPEC= + LIBQUADLIB= + LIBQUADLIB_DEP= + LIBQUADINCLUDE= + USE_IEC_60559=no + + if test "x$enable_libquadmath_support" = "xno"; then + if test "x$have_iec_60559_libc_support" = "xyes"; then + AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.]) + fi + else + + AC_CACHE_CHECK([whether we have a usable _Float128 type], + libgcob_cv_have_float128, [ + GCC_TRY_COMPILE_OR_LINK([ +#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381 +#error "long double is IEEE quad, no need for libquadmath" +#endif + + _Float128 foo (_Float128 x) + { + _Complex _Float128 z1, z2; + + z1 = x; + z2 = x / 7.F128; + z2 /= z1; + + return __real__ z2; + } + + _Float128 bar (_Float128 x) + { + return x * __builtin_huge_valf128 (); + } + + __float128 baz (__float128 x) + { + return x * __builtin_huge_valf128 (); + } + ],[ + foo (1.2F128); + bar (1.2F128); + baz (1.2F128); + foo (1.2Q); + bar (1.2Q); + baz (1.2Q); + ],[ + libgcob_cv_have_float128=yes + ],[ + libgcob_cv_have_float128=no +])]) + + if test "x$have_iec_60559_libc_support$enable_libquadmath_support$libgcob_cv_have_float128" = xyesdefaultyes; then + USE_IEC_60559=yes + fi + + if test "x$libgcob_cv_have_float128" = xyes; then + + if test "x$USE_IEC_60559" = xyes; then + AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.]) + else + AC_DEFINE(USE_QUADMATH, 1, [Define if *q APIs should be used for __float128.]) + fi + AC_DEFINE(HAVE_FLOAT128, 1, [Define if target has usable _Float128 and __float128 types.]) + + if test "x$USE_IEC_60559" != xyes; then + dnl Check whether -Wl,--as-needed resp. -Wl,-zignore is supported + dnl + dnl Turn warnings into error to avoid testsuite breakage. So enable + dnl AC_LANG_WERROR, but there's currently (autoconf 2.64) no way to turn + dnl it off again. As a workaround, save and restore werror flag like + dnl AC_PATH_XTRA. + dnl Cf. http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01889.html + ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag + AC_CACHE_CHECK([whether --as-needed/-z ignore works], + [libgcob_cv_have_as_needed], + [ + # Test for native Solaris options first. + # No whitespace after -z to pass it through -Wl. + libgcob_cv_as_needed_option="-zignore" + libgcob_cv_no_as_needed_option="-zrecord" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option" + libgcob_cv_have_as_needed=no + AC_LANG_WERROR + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], + [libgcob_cv_have_as_needed=yes], + [libgcob_cv_have_as_needed=no]) + LDFLAGS="$save_LDFLAGS" + if test "x$libgcob_cv_have_as_needed" = xno; then + libgcob_cv_as_needed_option="--as-needed" + libgcob_cv_no_as_needed_option="--no-as-needed" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option" + libgcob_cv_have_as_needed=no + AC_LANG_WERROR + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], + [libgcob_cv_have_as_needed=yes], + [libgcob_cv_have_as_needed=no]) + LDFLAGS="$save_LDFLAGS" + fi + ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag + ]) + + dnl Determine -Bstatic ... -Bdynamic etc. support from gfortran -### stderr. + touch conftest1.$ac_objext conftest2.$ac_objext + LQUADMATH=-lquadmath + $CXX -static-libgcobol -### -o conftest \ + conftest1.$ac_objext -lgcobol conftest2.$ac_objext 2>&1 >/dev/null \ + | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd + if grep "conftest1.$ac_objext.* -Bstatic -lgcobol -Bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}" + elif grep "conftest1.$ac_objext.* -bstatic -lgcobol -bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}" + elif grep "conftest1.$ac_objext.* -aarchive_shared -lgcobol -adefault .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}" + elif grep "conftest1.$ac_objext.*libgcobol.a .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}" + fi + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd + + if test "x$libgcob_cv_have_as_needed" = xyes; then + if test "x$USE_IEC_60559" = xyes; then + LIBQUADSPEC="$libgcob_cv_as_needed_option $LQUADMATH $libgcob_cv_no_as_needed_option" + else + LIBQUADSPEC="%{static-libgcobol:$libgcob_cv_as_needed_option} $LQUADMATH %{static-libgcobol:$libgcob_cv_no_as_needed_option}" + fi + else + LIBQUADSPEC="$LQUADMATH" + fi + if test -f ../libquadmath/libquadmath.la; then + LIBQUADLIB=../libquadmath/libquadmath.la + LIBQUADLIB_DEP=../libquadmath/libquadmath.la + LIBQUADINCLUDE='-I$(srcdir)/../libquadmath' + else + LIBQUADLIB="-lquadmath" + fi + fi + else + if test "x$USE_IEC_60559" = xyes; then + AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.]) + fi + fi + + fi + + dnl For the spec file + AC_SUBST(LIBQUADSPEC) + AC_SUBST(LIBQUADLIB) + AC_SUBST(LIBQUADLIB_DEP) + AC_SUBST(LIBQUADINCLUDE) + AC_SUBST(USE_IEC_60559) +]) diff --git a/libgcobol/aclocal.m4 b/libgcobol/aclocal.m4 index 25c8b71..c3c69e6 100644 --- a/libgcobol/aclocal.m4 +++ b/libgcobol/aclocal.m4 @@ -56,26 +56,6 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Figure out how to run the assembler. -*- Autoconf -*- - -# Copyright (C) 2001-2017 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_AS -# ---------- -AC_DEFUN([AM_PROG_AS], -[# By default we simply use the C compiler to build assembly code. -AC_REQUIRE([AC_PROG_CC]) -test "${CCAS+set}" = set || CCAS=$CC -test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS -AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) -AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) -_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl -]) - # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. diff --git a/libgcobol/charmaps.h b/libgcobol/charmaps.h index 12968fd..6b4e9f5 100644 --- a/libgcobol/charmaps.h +++ b/libgcobol/charmaps.h @@ -297,7 +297,7 @@ extern unsigned char __gg__data_zeros[1] ; extern unsigned char __gg__data_high_values[1] ; extern unsigned char __gg__data_quotes[1] ; extern unsigned char __gg__data_upsi_0[2] ; -extern unsigned char __gg__data_return_code[2] ; +extern short __gg__data_return_code ; // These are the various hardcoded tables used for conversions. extern const unsigned short __gg__one_to_one_values[256]; diff --git a/libgcobol/common-defs.h b/libgcobol/common-defs.h index f9d9c56..6bf32ef 100644 --- a/libgcobol/common-defs.h +++ b/libgcobol/common-defs.h @@ -70,6 +70,7 @@ #define REFER_T_ALL_FLAGS_MASK 0x0FF // We allow for seven subscripts #define REFER_T_MOVE_ALL 0x100 // This is the move_all flag #define REFER_T_ADDRESS_OF 0x200 // This is the address_of flag +#define REFER_T_REFMOD 0x400 // Indicates to library the refer was a refmod #define MIN_FIELD_BLOCK_SIZE (16) diff --git a/libgcobol/config.h.in b/libgcobol/config.h.in index 5dd2b50..fdf5e3e 100644 --- a/libgcobol/config.h.in +++ b/libgcobol/config.h.in @@ -3,12 +3,30 @@ /* Define to 1 if the target assembler supports thread-local storage. */ #undef HAVE_CC_TLS +/* Define to 1 if you have the <complex.h> header file. */ +#undef HAVE_COMPLEX_H + /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the <fenv.h> header file. */ +#undef HAVE_FENV_H + +/* Define if target has usable _Float128 and __float128 types. */ +#undef HAVE_FLOAT128 + +/* Define to 1 if you have the <floatingpoint.h> header file. */ +#undef HAVE_FLOATINGPOINT_H + +/* Define to 1 if you have the <fptrap.h> header file. */ +#undef HAVE_FPTRAP_H + /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV +/* Define to 1 if you have the <ieeefp.h> header file. */ +#undef HAVE_IEEEFP_H + /* Define to 1 if you have the `initstate_r' function. */ #undef HAVE_INITSTATE_R @@ -36,6 +54,9 @@ /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strfromf128' function. */ +#undef HAVE_STRFROMF128 + /* Define to 1 if you have the `strfromf32' function. */ #undef HAVE_STRFROMF32 @@ -48,6 +69,12 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strtof128' function. */ +#undef HAVE_STRTOF128 + +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +#undef HAVE_STRUCT_TM_TM_ZONE + /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H @@ -64,9 +91,6 @@ */ #undef LT_OBJDIR -/* Name of package */ -#undef PACKAGE - /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -91,6 +115,12 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if IEC 60559 *f128 APIs should be used for _Float128. */ +#undef USE_IEC_60559 + +/* Define if *q APIs should be used for __float128. */ +#undef USE_QUADMATH + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -113,9 +143,6 @@ #endif -/* Version number of package */ -#undef VERSION - /* Define to 1 if on MINIX. */ #undef _MINIX diff --git a/libgcobol/configure b/libgcobol/configure index e12b72e..6821591 100755 --- a/libgcobol/configure +++ b/libgcobol/configure @@ -629,24 +629,41 @@ ac_includes_default="\ # include <unistd.h> #endif" +ac_header_list= ac_func_list= -ac_unique_file="Makefile.am" +ac_cxx_werror_flag= +ac_cxx_werror_flag= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +SPEC_LIBGCOBOL_DEPS +get_gcc_base_ver +USE_IEC_60559 +LIBQUADINCLUDE +LIBQUADLIB_DEP +LIBQUADLIB +LIBQUADSPEC +extra_ldflags_libgcobol +LIBGCOBOL_VERSION +BUILD_LIBGCOBOL_FALSE +BUILD_LIBGCOBOL_TRUE LTLIBICONV LIBICONV -extra_darwin_ldflags_libgcobol -VERSION_SUFFIX -LIBGCOBOL_VERSION -SPEC_LIBGCOBOL_DEPS -CC_FOR_BUILD +toolexeclibdir +toolexecdir +CXXCPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX enable_static enable_shared ENABLE_DARWIN_AT_RPATH_FALSE ENABLE_DARWIN_AT_RPATH_TRUE -CXXCPP +LIBM OTOOL64 OTOOL LIPO @@ -663,36 +680,9 @@ LIBTOOL RANLIB NM AR -am__fastdepCCAS_FALSE -am__fastdepCCAS_TRUE -CCASDEPMODE -CCASFLAGS -CCAS -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -ac_ct_CXX -CXXFLAGS -CXX -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -get_gcc_base_ver -toolexeclibdir -toolexecdir -MAINT -slibdir -BUILD_LIBGCOBOL_FALSE -BUILD_LIBGCOBOL_TRUE -target_subdir -host_subdir -build_subdir -build_libsubdir -target_noncanonical -host_noncanonical -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V +EGREP +GREP +CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -703,6 +693,17 @@ AMDEP_TRUE am__quote am__include DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -726,6 +727,11 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +multi_basedir +target_noncanonical target_os target_vendor target_cpu @@ -738,17 +744,6 @@ build_os build_vendor build_cpu build -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -multi_basedir target_alias host_alias build_alias @@ -791,15 +786,10 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_multilib -enable_dependency_tracking +enable_maintainer_mode enable_silent_rules -with_cross_host -with_build_libsubdir -with_toolexeclibdir enable_version_specific_runtime_libs -with_slibdir -enable_maintainer_mode -with_gcc_major_version_only +enable_dependency_tracking enable_shared enable_static with_pic @@ -807,9 +797,12 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_darwin_at_rpath +with_toolexeclibdir enable_rpath with_libiconv_prefix with_libiconv_type +enable_libquadmath +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -819,8 +812,7 @@ CFLAGS LDFLAGS LIBS CPPFLAGS -CPP -CXXCPP' +CPP' # Initialize some variables set by options. @@ -1441,19 +1433,18 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-multilib build many library versions (default) + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-version-specific-runtime-libs + Specify that runtime libraries should be installed + in a compiler-specific directory --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -1463,25 +1454,23 @@ Optional Features: install libraries with @rpath/library-name, requires rpaths to be added to executables --disable-rpath do not hardcode runtime library paths + --disable-libquadmath disable libquadmath support for libgcobol Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-cross-host=HOST Configuring with a cross compiler - --with-build-libsubdir=DIR Directory where to find libraries for build system - --with-toolexeclibdir=DIR - install libraries built with a cross compiler within - DIR - --with-slibdir=DIR shared libraries in DIR LIBDIR - --with-gcc-major-version-only - use only GCC major number in filesystem paths --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-toolexeclibdir=DIR + install libraries built with a cross compiler within + DIR --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libiconv-type=TYPE type of library to search for (auto/static/shared) + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -1494,8 +1483,6 @@ Some influential environment variables: CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags - CCAS assembler compiler command (defaults to CC) - CCASFLAGS assembler compiler flags (defaults to CFLAGS) CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help @@ -1813,12 +1800,378 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* 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 $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_mongrel + +# ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES +# ---------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed -ac_fn_c_compute_int () +ac_fn_cxx_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then @@ -1837,7 +2190,7 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1854,7 +2207,7 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val @@ -1881,7 +2234,7 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1898,7 +2251,7 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val @@ -1933,7 +2286,7 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val @@ -1981,7 +2334,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : echo >>conftest.val; read $3 <conftest.val; ac_retval=0 else ac_retval=1 @@ -1994,96 +2347,43 @@ rm -f conftest.val eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_compute_int +} # ac_fn_cxx_compute_int -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_cxx_try_compile +} # ac_fn_cxx_check_header_compile -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- +# ac_fn_cxx_check_func LINENO FUNC VAR +# ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -2135,7 +2435,7 @@ return $2 (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" @@ -2148,90 +2448,64 @@ eval ac_res=\$$3 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_func +} # ac_fn_cxx_check_func -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () +# ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES +# ------------------------------------------------------ +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_cxx_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$4=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_cxx_try_link +} # ac_fn_cxx_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2516,12 +2790,20 @@ $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +as_fn_append ac_header_list " floatingpoint.h" +as_fn_append ac_header_list " ieeefp.h" +as_fn_append ac_header_list " fenv.h" +as_fn_append ac_header_list " fptrap.h" +as_fn_append ac_header_list " complex.h" +as_fn_append ac_header_list " stdlib.h" as_fn_append ac_func_list " random_r" as_fn_append ac_func_list " srandom_r" as_fn_append ac_func_list " initstate_r" as_fn_append ac_func_list " setstate_r" as_fn_append ac_func_list " strfromf32" as_fn_append ac_func_list " strfromf64" +as_fn_append ac_func_list " strtof128" +as_fn_append ac_func_list " strfromf128" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2597,52 +2879,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" -# Default to --enable-multilib -# Check whether --enable-multilib was given. -if test "${enable_multilib+set}" = set; then : - enableval=$enable_multilib; case "$enableval" in - yes) multilib=yes ;; - no) multilib=no ;; - *) as_fn_error $? "bad value $enableval for multilib option" "$LINENO" 5 ;; - esac -else - multilib=yes -fi - - -# We may get other options which we leave undocumented: -# --with-target-subdir, --with-multisrctop, --with-multisubdir -# See config-ml.in if you want the gory details. - -if test "$srcdir" = "."; then - if test "$with_target_subdir" != "."; then - multi_basedir="$srcdir/$with_multisrctop../.." - else - multi_basedir="$srcdir/$with_multisrctop.." - fi -else - multi_basedir="$srcdir/.." -fi - - -# Even if the default multilib is not a cross compilation, -# it may be that some of the other multilibs are. -if test $cross_compiling = no && test $multilib = yes \ - && test "x${with_multisubdir}" != x ; then - cross_compiling=maybe -fi - -ac_config_commands="$ac_config_commands default-1" - - -# This works around the fact that libtool configuration may change LD -# for this particular configuration, but some shells, instead of -# keeping the changes in LD private, export them just because LD is -# exported. -ORIGINAL_LD_FOR_MULTILIBS=$LD - - - +# Do not delete or change the following two lines. For why, see +# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -2672,1348 +2910,6 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_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" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -printf ("hello world\n"); - ; - return 0; -} -_ACEOF -# FIXME: Cleanup? -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - gcc_no_link=no -else - gcc_no_link=yes -fi -if test x$gcc_no_link = xyes; then - # Setting cross_compile will disable run tests; it will - # also disable AC_CHECK_FILE but that's generally - # correct if we can't link. - cross_compiling=yes - EXEEXT= -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* 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 -std 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 -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 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 -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -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 - -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -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 - - - -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -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 - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - 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" - as_fn_executable_p "$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 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_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 - as_fn_arith $ac_count + 1 && ac_count=$as_val - 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 - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - 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" - as_fn_executable_p "$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 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_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 - as_fn_arith $ac_count + 1 && ac_count=$as_val - 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 - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* 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 -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - - -# Do not delete or change the following two lines. For why, see -# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 @@ -4125,9 +3021,89 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + + + + +# Default to --enable-multilib +# Check whether --enable-multilib was given. +if test "${enable_multilib+set}" = set; then : + enableval=$enable_multilib; case "$enableval" in + yes) multilib=yes ;; + no) multilib=no ;; + *) as_fn_error $? "bad value $enableval for multilib option" "$LINENO" 5 ;; + esac +else + multilib=yes +fi + + +# We may get other options which we leave undocumented: +# --with-target-subdir, --with-multisrctop, --with-multisubdir +# See config-ml.in if you want the gory details. + +if test "$srcdir" = "."; then + if test "$with_target_subdir" != "."; then + multi_basedir="$srcdir/$with_multisrctop../.." + else + multi_basedir="$srcdir/$with_multisrctop.." + fi +else + multi_basedir="$srcdir/.." +fi + + +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling = no && test $multilib = yes \ + && test "x${with_multisubdir}" != x ; then + cross_compiling=maybe +fi + +ac_config_commands="$ac_config_commands default-1" + + target_alias=${target_alias-$host_alias} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + am__api_version='1.15' # Find a good install program. We prefer a C program (faster), @@ -4300,6 +3276,9 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) @@ -4550,69 +3529,6 @@ else fi rmdir .tst 2>/dev/null -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-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='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; @@ -4677,15 +3593,6 @@ fi VERSION='version-unused' -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}"} @@ -4724,134 +3631,6 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&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". - rm -rf conftest.dir - 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 - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - 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 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # 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. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - 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 - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$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 - - # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -4894,238 +3673,6 @@ END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi - # ([1.15.1 no-define foreign no-dist -Wall -Wno-portability]) - - - - - -# Check whether --with-cross-host was given. -if test "${with_cross_host+set}" = set; then : - withval=$with_cross_host; -fi - - -# Checks for header files. -for ac_header in malloc.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_H 1 -_ACEOF - -fi - -done - - - - case ${build_alias} in - "") build_noncanonical=${build} ;; - *) build_noncanonical=${build_alias} ;; -esac - - case ${host_alias} in - "") host_noncanonical=${build_noncanonical} ;; - *) host_noncanonical=${host_alias} ;; -esac - - - - case ${target_alias} in - "") target_noncanonical=${host_noncanonical} ;; - *) target_noncanonical=${target_alias} ;; -esac - - - - -# post-stage1 host modules use a different CC_FOR_BUILD so, in order to -# have matching libraries, they should use host libraries: Makefile.tpl -# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR). -# However, they still use the build modules, because the corresponding -# host modules (e.g. bison) are only built for the host when bootstrap -# finishes. So: -# - build_subdir is where we find build modules, and never changes. -# - build_libsubdir is where we find build libraries, and can be overridden. - -# Prefix 'build-' so this never conflicts with target_subdir. -build_subdir="build-${build_noncanonical}" - -# Check whether --with-build-libsubdir was given. -if test "${with_build_libsubdir+set}" = set; then : - withval=$with_build_libsubdir; build_libsubdir="$withval" -else - build_libsubdir="$build_subdir" -fi - -# --srcdir=. covers the toplevel, while "test -d" covers the subdirectories -if ( test $srcdir = . && test -d gcc ) \ - || test -d $srcdir/../host-${host_noncanonical}; then - host_subdir="host-${host_noncanonical}" -else - host_subdir=. -fi -# No prefix. -target_subdir=${target_noncanonical} - - -# 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. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - - -# Get target configury. -unset LIBGCOBOL_SUPPORTED -. ${srcdir}/configure.tgt - -# ----------------- -# __int128 support -# ----------------- - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __int128 is supported" >&5 -$as_echo_n "checking whether __int128 is supported... " >&6; } -if ${libgcobol_cv_have_int128+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test x$gcc_no_link = xyes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - __int128 foo (__int128 ) - { - __int128 aaa; - return (__int128) aaa; - } - - __int128 bar (__int128 ) - { - __int128 aaa; - return (__int128) aaa; - } - -int -main () -{ - - foo (1); - bar (1); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - libgcobol_cv_have_int128=yes - -else - - libgcobol_cv_have_int128=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - __int128 foo (__int128 ) - { - __int128 aaa; - return (__int128) aaa; - } - - __int128 bar (__int128 ) - { - __int128 aaa; - return (__int128) aaa; - } - -int -main () -{ - - foo (1); - bar (1); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - libgcobol_cv_have_int128=yes - -else - - libgcobol_cv_have_int128=no - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcobol_cv_have_int128" >&5 -$as_echo "$libgcobol_cv_have_int128" >&6; } -# The following conditional is useful when this creates a Makefile.am file that -# is subsequently processed into a Makefile.in file. At the present time, -# however the libgcobol build uses a hardcoded Makefile.in file. - if test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then - BUILD_LIBGCOBOL_TRUE= - BUILD_LIBGCOBOL_FALSE='#' -else - BUILD_LIBGCOBOL_TRUE='#' - BUILD_LIBGCOBOL_FALSE= -fi - - - -# Check whether --with-toolexeclibdir was given. -if test "${with_toolexeclibdir+set}" = set; then : - withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in - /) - ;; - */) - with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'` - ;; -esac -else - with_toolexeclibdir=no -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5 @@ -5144,120 +3691,76 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version_specific_libs" >&5 $as_echo "$version_specific_libs" >&6; } - -# Check whether --with-slibdir was given. -if test "${with_slibdir+set}" = set; then : - withval=$with_slibdir; slibdir="$with_slibdir" -else - if test "${version_specific_libs}" = yes; then - slibdir='$(libsubdir)' -elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then - slibdir='$(exec_prefix)/$(host_noncanonical)/lib' -else - slibdir='$(libdir)' -fi -fi +# This works around the fact that libtool configuration may change LD +# for this particular configuration, but some shells, instead of +# keeping the changes in LD private, export them just because LD is +# exported. +ORIGINAL_LD_FOR_MULTILIBS=$LD -# Command-line options. -# Very limited version of AC_MAINTAINER_MODE. -# Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; case ${enable_maintainer_mode} in - yes) MAINT='' ;; - no) MAINT='#' ;; - *) as_fn_error $? "--enable-maintainer-mode must be yes or no" "$LINENO" 5 ;; - esac - maintainer_mode=${enableval} -else - MAINT='#' -fi +DEPDIR="${am__leading_dot}deps" +ac_config_commands="$ac_config_commands depfiles" -toolexecdir=no -toolexeclibdir=no -# Calculate toolexeclibdir -# Also toolexecdir, though it's only used in toolexeclibdir -case ${version_specific_libs} in - yes) - # Need the gcc compiler version to know where to install libraries - # and header files if --enable-version-specific-runtime-libs option - # is selected. - toolexecdir='$(libdir)/gcc/$(target_noncanonical)' - toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' - ;; - no) - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - # Install a library built with a cross compiler in tooldir, not libdir. - toolexecdir='$(exec_prefix)/$(target_noncanonical)' - toolexeclibdir='$(toolexecdir)/lib' - else - toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)' - toolexeclibdir='$(libdir)' - fi - multi_os_directory=`$CC -print-multi-os-directory` - case $multi_os_directory in - .) ;; # Avoid trailing /. - *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; - esac - ;; +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; esac - - - - -# Determine what GCC version number to use in filesystem paths. - - get_gcc_base_ver="cat" - -# Check whether --with-gcc-major-version-only was given. -if test "${with_gcc_major_version_only+set}" = set; then : - withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then - get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'" - fi - +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= + AMDEP_TRUE='#' + AMDEP_FALSE= fi - MAINT=$MAINTAINER_MODE_TRUE - - - -# Check the compiler. -# The same as in boehm-gc and libstdc++. Have to borrow it from there. -# We must force CC to /not/ be precious variables; otherwise -# the wrong, non-multilib-adjusted value will be used in multilibs. -# As a side effect, we have to subst CFLAGS ourselves. - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5587,6 +4090,285 @@ $as_echo "$ac_try_echo"; } >&5 test $ac_status = 0; } done +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +printf ("hello world\n"); + ; + return 0; +} +_ACEOF +# FIXME: Cleanup? +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + gcc_no_link=no +else + gcc_no_link=yes +fi +if test x$gcc_no_link = xyes; then + # Setting cross_compile will disable run tests; it will + # also disable AC_CHECK_FILE but that's generally + # correct if we can't link. + cross_compiling=yes + EXEEXT= +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : @@ -5857,268 +4639,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=cpp -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 -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$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 -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= +depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -6141,7 +4666,7 @@ else # directory. mkdir sub - am_cv_CXX_dependencies_compiler_type=none + 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 @@ -6214,7 +4739,7 @@ else # 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 + am_cv_CC_dependencies_compiler_type=$depmode break fi fi @@ -6223,166 +4748,484 @@ else cd .. rm -rf conftest.dir else - am_cv_CXX_dependencies_compiler_type=none + am_cv_CC_dependencies_compiler_type=none fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$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_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi -# By default we simply use the C compiler to build assembly code. -test "${CCAS+set}" = set || CCAS=$CC -test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi -depcc="$CCAS" am_compiler_list= + done + ac_cv_prog_CPP=$CPP -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&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". - rm -rf conftest.dir - 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 + if test -z "$GREP"; then + 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" + as_fn_executable_p "$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 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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 - am_cv_CCAS_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi - am__universal=false +else + ac_cv_path_GREP=$GREP +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" - 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 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # 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. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - 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 - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj 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_CCAS_dependencies_compiler_type=$depmode - break - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + 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" + as_fn_executable_p "$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 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + 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 - cd .. - rm -rf conftest.dir + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - am_cv_CCAS_dependencies_compiler_type=none + ac_cv_path_EGREP=$EGREP fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } -CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then - am__fastdepCCAS_TRUE= - am__fastdepCCAS_FALSE='#' else - am__fastdepCCAS_TRUE='#' - am__fastdepCCAS_FALSE= + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 +if ac_fn_c_try_run "$LINENO"; then : +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h -# In order to override CFLAGS_FOR_TARGET, all of our special flags go -# in XCFLAGS. But we need them in CFLAGS during configury. So put them -# in both places for now and restore CFLAGS at the end of config. -save_CFLAGS="$CFLAGS" # Find other programs we need. if test -n "$ac_tool_prefix"; then @@ -9345,7 +8188,6 @@ done - # Set options @@ -12908,7 +11750,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12911 "configure" +#line 11753 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13014,7 +11856,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13017 "configure" +#line 11859 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13231,6 +12073,585 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +enable_dlopen=yes + + + +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } +if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 _mwvalidcheckl (); +int +main () +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mw__mwvalidcheckl=yes +else + ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : + LIBM="-lmw" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM="$LIBM -lm" +fi + + ;; +*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM="-lm" +fi + + ;; +esac + + + + if test x$enable_darwin_at_rpath = xyes; then + ENABLE_DARWIN_AT_RPATH_TRUE= + ENABLE_DARWIN_AT_RPATH_FALSE='#' +else + ENABLE_DARWIN_AT_RPATH_TRUE='#' + ENABLE_DARWIN_AT_RPATH_FALSE= +fi + + + + + +# This library is written in C++ and needs to link with the C++ runtime. +ac_ext=cpp +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 + + +# We must force CC/CXX to /not/ be precious variables; otherwise +# the wrong, non-multilib-adjusted value will be used in multilibs. +# As a side effect, we have to subst CFLAGS ourselves. + + + +ac_ext=cpp +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 -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$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 +ac_ext=cpp +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 + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&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". + rm -rf conftest.dir + 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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + 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 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # 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. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + 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 + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$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 + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then @@ -13361,11 +12782,11 @@ as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 +ac_ext=cpp +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 else _lt_caught_CXX_error=yes @@ -16316,923 +15737,63 @@ fi lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != 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 - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - - -enable_dlopen=yes - - - - - if test x$enable_darwin_at_rpath = xyes; then - ENABLE_DARWIN_AT_RPATH_TRUE= - ENABLE_DARWIN_AT_RPATH_FALSE='#' -else - ENABLE_DARWIN_AT_RPATH_TRUE='#' - ENABLE_DARWIN_AT_RPATH_FALSE= -fi - - - - - -# These are GLIBC - - - - for ac_func in $ac_func_list -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - - - - - -# These are C23, and might not be available in libc. - - - - - - -if test "${multilib}" = "yes"; then - multilib_arg="--enable-multilib" -else - multilib_arg= -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 - -# Check the compiler. -# The same as in boehm-gc and libstdc++. Have to borrow it from there. -# We must force CC to /not/ be precious variables; otherwise -# the wrong, non-multilib-adjusted value will be used in multilibs. -# As a side effect, we have to subst CFLAGS ourselves. - - - -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_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" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +ac_ext=cpp +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 - test -n "$ac_ct_CC" && break -done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi -fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +# Check whether --with-toolexeclibdir was given. +if test "${with_toolexeclibdir+set}" = set; then : + withval=$with_toolexeclibdir; case ${with_toolexeclibdir} in + /) + ;; + */) + with_toolexeclibdir=`echo $with_toolexeclibdir | sed 's,/$,,'` + ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* 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 -std 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 -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 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 -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - + with_toolexeclibdir=no 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 - -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK +# Calculate toolexeclibdir +# Also toolexecdir, though it's only used in toolexeclibdir +case ${version_specific_libs} in + yes) + # Need the gcc compiler version to know where to install libraries + # and header files if --enable-version-specific-runtime-libs option + # is selected. + toolexecdir='$(libdir)/gcc/$(target_noncanonical)' + toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' + ;; + no) + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + # Install a library built with a cross compiler in tooldir, not libdir. + toolexecdir='$(exec_prefix)/$(target_noncanonical)' + toolexeclibdir='$(toolexecdir)/lib' else - am_cv_prog_cc_c_o=no - break + toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)' + toolexeclibdir='$(libdir)' fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -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_FOR_BUILD=${CC_FOR_BUILD:-gcc} - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing malloc" >&5 -$as_echo_n "checking for library containing malloc... " >&6; } -if ${ac_cv_search_malloc+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.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 malloc (); -int -main () -{ -return malloc (); - ; - return 0; -} -_ACEOF -for ac_lib in '' c; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_malloc=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_malloc+:} false; then : - break -fi -done -if ${ac_cv_search_malloc+:} false; then : - -else - ac_cv_search_malloc=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_malloc" >&5 -$as_echo "$ac_cv_search_malloc" >&6; } -ac_res=$ac_cv_search_malloc -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cosf" >&5 -$as_echo_n "checking for library containing cosf... " >&6; } -if ${ac_cv_search_cosf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.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 cosf (); -int -main () -{ -return cosf (); - ; - return 0; -} -_ACEOF -for ac_lib in '' m; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_cosf=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_cosf+:} false; then : - break -fi -done -if ${ac_cv_search_cosf+:} false; then : - -else - ac_cv_search_cosf=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cosf" >&5 -$as_echo "$ac_cv_search_cosf" >&6; } -ac_res=$ac_cv_search_cosf -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.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 clock_gettime (); -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if test x$gcc_no_link = xyes; then - as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 -fi -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : - break -fi -done -if ${ac_cv_search_clock_gettime+:} false; then : - -else - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -# Add dependencies for libgcobol.spec file -SPEC_LIBGCOBOL_DEPS="$LIBS" - - -# libgcobol soname version -LIBGCOBOL_VERSION=1:0:0 - - -## added -VERSION_SUFFIX=$(echo $LIBGCOBOL_VERSION | tr ':' '.' ) - -## end added - -# Determine what GCC version number to use in filesystem paths. - - get_gcc_base_ver="cat" - -# Check whether --with-gcc-major-version-only was given. -if test "${with_gcc_major_version_only+set}" = set; then : - withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then - get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'" - fi - -fi - - - - -extra_darwin_ldflags_libgcobol= -case $host in - *-*-darwin*) - extra_darwin_ldflags_libgcobol=-Wl,-U,___cobol_main ;; - *) ;; + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; + esac + ;; esac + # For iconv support. if test "X$prefix" = "XNONE"; then @@ -17847,7 +16408,7 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ @@ -17874,7 +16435,7 @@ iconv_t cd = iconv_open("",""); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi @@ -18029,7 +16590,7 @@ int result = 0; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18093,7 +16654,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : gl_cv_iconv_nonconst=yes else gl_cv_iconv_nonconst=no @@ -18133,10 +16694,844 @@ _ACEOF fi +# Checks for header files. + +for ac_header in malloc.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" +if test "x$ac_cv_header_malloc_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MALLOC_H 1 +_ACEOF + +fi + +done + + +# 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. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + + +# Get target configury. +unset LIBGCOBOL_SUPPORTED +. ${srcdir}/configure.tgt + +# ----------------- +# __int128 support +# ----------------- + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __int128 is supported" >&5 +$as_echo_n "checking whether __int128 is supported... " >&6; } +if ${libgcobol_cv_have_int128+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x$gcc_no_link = xyes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + __int128 foo (__int128 ) + { + __int128 aaa; + return (__int128) aaa; + } + + __int128 bar (__int128 ) + { + __int128 aaa; + return (__int128) aaa; + } + +int +main () +{ + + foo (1); + bar (1); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + libgcobol_cv_have_int128=yes + +else + + libgcobol_cv_have_int128=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + __int128 foo (__int128 ) + { + __int128 aaa; + return (__int128) aaa; + } + + __int128 bar (__int128 ) + { + __int128 aaa; + return (__int128) aaa; + } + +int +main () +{ + + foo (1); + bar (1); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + libgcobol_cv_have_int128=yes + +else + + libgcobol_cv_have_int128=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcobol_cv_have_int128" >&5 +$as_echo "$libgcobol_cv_have_int128" >&6; } + + if test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then + BUILD_LIBGCOBOL_TRUE= + BUILD_LIBGCOBOL_FALSE='#' +else + BUILD_LIBGCOBOL_TRUE='#' + BUILD_LIBGCOBOL_FALSE= +fi + + +# Check if functions are available in libc before adding extra libs. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing malloc" >&5 +$as_echo_n "checking for library containing malloc... " >&6; } +if ${ac_cv_search_malloc+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 malloc (); +int +main () +{ +return malloc (); + ; + return 0; +} +_ACEOF +for ac_lib in '' c; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_malloc=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_malloc+:} false; then : + break +fi +done +if ${ac_cv_search_malloc+:} false; then : + +else + ac_cv_search_malloc=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_malloc" >&5 +$as_echo "$ac_cv_search_malloc" >&6; } +ac_res=$ac_cv_search_malloc +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' c rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break +fi +done +if ${ac_cv_search_clock_gettime+:} false; then : + +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +# libgcobol soname version +LIBGCOBOL_VERSION=1:0:0 + + +## added, currently unused. +# VERSION_SUFFIX=$(echo $LIBGCOBOL_VERSION | tr ':' '.' ) +# AC_SUBST(VERSION_SUFFIX) +## end added + +extra_ldflags_libgcobol= +case $host in + *-*-darwin*) + extra_ldflags_libgcobol=-Wl,-U,___cobol_main ;; + *) ;; +esac + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + -ac_config_files="$ac_config_files Makefile" -####AC_CONFIG_FILES(libgcobol.spec) + + + + + + +# These are GLIBC + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + + + + +# Some functions we check to figure out if the libc Float128 support +# is adequate. + +# These are C23. + + + + + + +# These are GLIBC. + + + + + +# We need to make sure to check libc before adding libm. +libgcobol_have_sinf128=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sinf128" >&5 +$as_echo_n "checking for library containing sinf128... " >&6; } +if ${ac_cv_search_sinf128+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 sinf128 (); +int +main () +{ +return sinf128 (); + ; + return 0; +} +_ACEOF +for ac_lib in '' c m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_sinf128=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_sinf128+:} false; then : + break +fi +done +if ${ac_cv_search_sinf128+:} false; then : + +else + ac_cv_search_sinf128=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sinf128" >&5 +$as_echo "$ac_cv_search_sinf128" >&6; } +ac_res=$ac_cv_search_sinf128 +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + libgcobol_have_sinf128=yes +fi + +libgcobol_have_cacosf128=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cacosf128" >&5 +$as_echo_n "checking for library containing cacosf128... " >&6; } +if ${ac_cv_search_cacosf128+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.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 cacosf128 (); +int +main () +{ +return cacosf128 (); + ; + return 0; +} +_ACEOF +for ac_lib in '' c m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_cacosf128=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_cacosf128+:} false; then : + break +fi +done +if ${ac_cv_search_cacosf128+:} false; then : + +else + ac_cv_search_cacosf128=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cacosf128" >&5 +$as_echo "$ac_cv_search_cacosf128" >&6; } +ac_res=$ac_cv_search_cacosf128 +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + libgcobol_have_cacosf128=yes +fi + + +have_iec_60559_libc_support=no +if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \ + && test "x$libgcobol_have_sinf128$libgcobol_have_cacosf128" = xyesyes; then + have_iec_60559_libc_support=yes +fi + +# Check whether libquadmath should be used +# Check whether --enable-libquadmath was given. +if test "${enable_libquadmath+set}" = set; then : + enableval=$enable_libquadmath; ENABLE_LIBQUADMATH_SUPPORT=$enableval +else + if test "x$have_iec_60559_libc_support" = xyes; then + ENABLE_LIBQUADMATH_SUPPORT=default +else + ENABLE_LIBQUADMATH_SUPPORT=yes +fi +fi + +enable_libquadmath_support= +if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then + enable_libquadmath_support=no +elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then + enable_libquadmath_support=default +fi + + LIBQUADSPEC= + LIBQUADLIB= + LIBQUADLIB_DEP= + LIBQUADINCLUDE= + USE_IEC_60559=no + + if test "x$enable_libquadmath_support" = "xno"; then + if test "x$have_iec_60559_libc_support" = "xyes"; then + +$as_echo "#define USE_IEC_60559 1" >>confdefs.h + + fi + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a usable _Float128 type" >&5 +$as_echo_n "checking whether we have a usable _Float128 type... " >&6; } +if ${libgcob_cv_have_float128+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test x$gcc_no_link = xyes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381 +#error "long double is IEEE quad, no need for libquadmath" +#endif + + _Float128 foo (_Float128 x) + { + _Complex _Float128 z1, z2; + + z1 = x; + z2 = x / 7.F128; + z2 /= z1; + + return __real__ z2; + } + + _Float128 bar (_Float128 x) + { + return x * __builtin_huge_valf128 (); + } + + __float128 baz (__float128 x) + { + return x * __builtin_huge_valf128 (); + } + +int +main () +{ + + foo (1.2F128); + bar (1.2F128); + baz (1.2F128); + foo (1.2Q); + bar (1.2Q); + baz (1.2Q); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + libgcob_cv_have_float128=yes + +else + + libgcob_cv_have_float128=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381 +#error "long double is IEEE quad, no need for libquadmath" +#endif + + _Float128 foo (_Float128 x) + { + _Complex _Float128 z1, z2; + + z1 = x; + z2 = x / 7.F128; + z2 /= z1; + + return __real__ z2; + } + + _Float128 bar (_Float128 x) + { + return x * __builtin_huge_valf128 (); + } + + __float128 baz (__float128 x) + { + return x * __builtin_huge_valf128 (); + } + +int +main () +{ + + foo (1.2F128); + bar (1.2F128); + baz (1.2F128); + foo (1.2Q); + bar (1.2Q); + baz (1.2Q); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + libgcob_cv_have_float128=yes + +else + + libgcob_cv_have_float128=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcob_cv_have_float128" >&5 +$as_echo "$libgcob_cv_have_float128" >&6; } + + if test "x$have_iec_60559_libc_support$enable_libquadmath_support$libgcob_cv_have_float128" = xyesdefaultyes; then + USE_IEC_60559=yes + fi + + if test "x$libgcob_cv_have_float128" = xyes; then + + if test "x$USE_IEC_60559" = xyes; then + +$as_echo "#define USE_IEC_60559 1" >>confdefs.h + + else + +$as_echo "#define USE_QUADMATH 1" >>confdefs.h + + fi + +$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h + + + if test "x$USE_IEC_60559" != xyes; then + ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed/-z ignore works" >&5 +$as_echo_n "checking whether --as-needed/-z ignore works... " >&6; } +if ${libgcob_cv_have_as_needed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + # Test for native Solaris options first. + # No whitespace after -z to pass it through -Wl. + libgcob_cv_as_needed_option="-zignore" + libgcob_cv_no_as_needed_option="-zrecord" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option" + libgcob_cv_have_as_needed=no + +ac_cxx_werror_flag=yes + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + libgcob_cv_have_as_needed=yes +else + libgcob_cv_have_as_needed=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + if test "x$libgcob_cv_have_as_needed" = xno; then + libgcob_cv_as_needed_option="--as-needed" + libgcob_cv_no_as_needed_option="--no-as-needed" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option" + libgcob_cv_have_as_needed=no + +ac_cxx_werror_flag=yes + if test x$gcc_no_link = xyes; then + as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + libgcob_cv_have_as_needed=yes +else + libgcob_cv_have_as_needed=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + fi + ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcob_cv_have_as_needed" >&5 +$as_echo "$libgcob_cv_have_as_needed" >&6; } + + touch conftest1.$ac_objext conftest2.$ac_objext + LQUADMATH=-lquadmath + $CXX -static-libgcobol -### -o conftest \ + conftest1.$ac_objext -lgcobol conftest2.$ac_objext 2>&1 >/dev/null \ + | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd + if grep "conftest1.$ac_objext.* -Bstatic -lgcobol -Bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}" + elif grep "conftest1.$ac_objext.* -bstatic -lgcobol -bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}" + elif grep "conftest1.$ac_objext.* -aarchive_shared -lgcobol -adefault .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}" + elif grep "conftest1.$ac_objext.*libgcobol.a .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}" + fi + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd + + if test "x$libgcob_cv_have_as_needed" = xyes; then + if test "x$USE_IEC_60559" = xyes; then + LIBQUADSPEC="$libgcob_cv_as_needed_option $LQUADMATH $libgcob_cv_no_as_needed_option" + else + LIBQUADSPEC="%{static-libgcobol:$libgcob_cv_as_needed_option} $LQUADMATH %{static-libgcobol:$libgcob_cv_no_as_needed_option}" + fi + else + LIBQUADSPEC="$LQUADMATH" + fi + if test -f ../libquadmath/libquadmath.la; then + LIBQUADLIB=../libquadmath/libquadmath.la + LIBQUADLIB_DEP=../libquadmath/libquadmath.la + LIBQUADINCLUDE='-I$(srcdir)/../libquadmath' + else + LIBQUADLIB="-lquadmath" + fi + fi + else + if test "x$USE_IEC_60559" = xyes; then + +$as_echo "#define USE_IEC_60559 1" >>confdefs.h + + fi + fi + + fi + + + + + + + + +# struct tm tm_zone is a POSIX.1-2024 addition. +ac_fn_cxx_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <time.h> +" +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TM_TM_ZONE 1 +_ACEOF + + +fi + + +if test "${multilib}" = "yes"; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + +# Determine what GCC version number to use in filesystem paths. + + get_gcc_base_ver="cat" + +# Check whether --with-gcc-major-version-only was given. +if test "${with_gcc_major_version_only+set}" = set; then : + withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then + get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'" + fi + +fi + + + + +# Add dependencies for libgcobol.spec file, this might be excessive - since +# the spec file might not use all of them. +SPEC_LIBGCOBOL_DEPS="$LIBS" + + +ac_config_files="$ac_config_files Makefile libgcobol.spec" + { $as_echo "$as_me:${as_lineno-$LINENO}: libgcobol has been configured." >&5 $as_echo "$as_me: libgcobol has been configured." >&6;} @@ -18250,6 +17645,10 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then @@ -18258,14 +17657,6 @@ $as_echo_n "checking that generated files are newer than configure... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -18274,24 +17665,24 @@ else am__EXEEXT_FALSE= fi -if test -z "${BUILD_LIBGCOBOL_TRUE}" && test -z "${BUILD_LIBGCOBOL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_LIBGCOBOL\" was never defined. +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +if test -z "${ENABLE_DARWIN_AT_RPATH_TRUE}" && test -z "${ENABLE_DARWIN_AT_RPATH_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_DARWIN_AT_RPATH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_DARWIN_AT_RPATH_TRUE}" && test -z "${ENABLE_DARWIN_AT_RPATH_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_DARWIN_AT_RPATH\" was never defined. +if test -z "${BUILD_LIBGCOBOL_TRUE}" && test -z "${BUILD_LIBGCOBOL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_LIBGCOBOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -19265,6 +18656,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libgcobol.spec") CONFIG_FILES="$CONFIG_FILES libgcobol.spec" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/libgcobol/configure.ac b/libgcobol/configure.ac index 34c0235..4bb6905 100644 --- a/libgcobol/configure.ac +++ b/libgcobol/configure.ac @@ -26,8 +26,32 @@ AC_INIT(package-unused, version-unused,,libgcobol) AC_CONFIG_SRCDIR(Makefile.am) AC_CONFIG_HEADER(config.h) +# Do not delete or change the following two lines. For why, see +# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html +AC_CANONICAL_SYSTEM +ACX_NONCANONICAL_TARGET + AM_ENABLE_MULTILIB(, ..) +target_alias=${target_alias-$host_alias} +AC_SUBST(target_alias) + +AM_MAINTAINER_MODE + +AM_INIT_AUTOMAKE([1.15.1 no-define foreign no-dist -Wall -Wno-portability]) + +AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) +AC_ARG_ENABLE(version-specific-runtime-libs, +AS_HELP_STRING([--enable-version-specific-runtime-libs], +[Specify that runtime libraries should be installed in a compiler-specific directory]), +[case "$enableval" in + yes) version_specific_libs=yes ;; + no) version_specific_libs=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[version_specific_libs=no]) +AC_MSG_RESULT($version_specific_libs) + # This works around the fact that libtool configuration may change LD # for this particular configuration, but some shells, instead of # keeping the changes in LD private, export them just because LD is @@ -38,107 +62,40 @@ GCC_NO_EXECUTABLES AC_USE_SYSTEM_EXTENSIONS -# Do not delete or change the following two lines. For why, see -# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html -AC_CANONICAL_SYSTEM -target_alias=${target_alias-$host_alias} -AC_SUBST(target_alias) - -AM_INIT_AUTOMAKE # ([1.15.1 no-define foreign no-dist -Wall -Wno-portability]) - -AH_TEMPLATE(PACKAGE, [Name of package]) -AH_TEMPLATE(VERSION, [Version number of package]) +# Find other programs we need. +AC_CHECK_TOOL(AR, ar) +AC_CHECK_TOOL(NM, nm) +AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) +AC_PROG_MAKE_SET +AC_PROG_INSTALL -AC_ARG_WITH(cross-host, -[ --with-cross-host=HOST Configuring with a cross compiler]) +AM_PROG_LIBTOOL +LT_INIT -# Checks for header files. -AC_CHECK_HEADERS(malloc.h) +AC_LIBTOOL_DLOPEN +LT_LIB_M -AC_CANONICAL_HOST -ACX_NONCANONICAL_HOST -ACX_NONCANONICAL_TARGET -GCC_TOPLEV_SUBDIRS +AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes]) -AC_CHECK_SIZEOF([void *]) +AC_SUBST(enable_shared) +AC_SUBST(enable_static) -# Get target configury. -unset LIBGCOBOL_SUPPORTED -. ${srcdir}/configure.tgt +# This library is written in C++ and needs to link with the C++ runtime. +AC_LANG([C++]) -# ----------------- -# __int128 support -# ----------------- +# We must force CC/CXX to /not/ be precious variables; otherwise +# the wrong, non-multilib-adjusted value will be used in multilibs. +# As a side effect, we have to subst CFLAGS ourselves. -AC_CACHE_CHECK([whether __int128 is supported], [libgcobol_cv_have_int128], - [GCC_TRY_COMPILE_OR_LINK([ - __int128 foo (__int128 ) - { - __int128 aaa; - return (__int128) aaa; - } +m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) +m4_define([_AC_ARG_VAR_PRECIOUS],[]) +AC_PROG_CXX +m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) - __int128 bar (__int128 ) - { - __int128 aaa; - return (__int128) aaa; - } - ],[ - foo (1); - bar (1); - ],[ - libgcobol_cv_have_int128=yes - ],[ - libgcobol_cv_have_int128=no -])]) -# The following conditional is useful when this creates a Makefile.am file that -# is subsequently processed into a Makefile.in file. At the present time, -# however the libgcobol build uses a hardcoded Makefile.in file. -AM_CONDITIONAL(BUILD_LIBGCOBOL, [test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes]) +AC_SUBST(CXXFLAGS) GCC_WITH_TOOLEXECLIBDIR -AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) -AC_ARG_ENABLE(version-specific-runtime-libs, -[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], -[case "$enableval" in - yes) version_specific_libs=yes ;; - no) version_specific_libs=no ;; - *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; - esac], -[version_specific_libs=no]) -AC_MSG_RESULT($version_specific_libs) - -AC_ARG_WITH(slibdir, -[ --with-slibdir=DIR shared libraries in DIR [LIBDIR]], -slibdir="$with_slibdir", -if test "${version_specific_libs}" = yes; then - slibdir='$(libsubdir)' -elif test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then - slibdir='$(exec_prefix)/$(host_noncanonical)/lib' -else - slibdir='$(libdir)' -fi) -AC_SUBST(slibdir) - -# Command-line options. -# Very limited version of AC_MAINTAINER_MODE. -AC_ARG_ENABLE([maintainer-mode], - [AC_HELP_STRING([--enable-maintainer-mode], - [enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer])], - [case ${enable_maintainer_mode} in - yes) MAINT='' ;; - no) MAINT='#' ;; - *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;; - esac - maintainer_mode=${enableval}], - [MAINT='#']) -AC_SUBST([MAINT])dnl - -toolexecdir=no -toolexeclibdir=no - # Calculate toolexeclibdir # Also toolexecdir, though it's only used in toolexeclibdir case ${version_specific_libs} in @@ -166,118 +123,135 @@ case ${version_specific_libs} in esac ;; esac - AC_SUBST(toolexecdir) AC_SUBST(toolexeclibdir) -# Determine what GCC version number to use in filesystem paths. -GCC_BASE_VER +# For iconv support. +AM_ICONV -AH_TEMPLATE(PACKAGE, [Name of package]) -AH_TEMPLATE(VERSION, [Version number of package]) +# Checks for header files. +AC_CHECK_HEADERS(malloc.h) -AM_MAINTAINER_MODE +AC_CHECK_SIZEOF([void *]) -# Check the compiler. -# The same as in boehm-gc and libstdc++. Have to borrow it from there. -# We must force CC to /not/ be precious variables; otherwise -# the wrong, non-multilib-adjusted value will be used in multilibs. -# As a side effect, we have to subst CFLAGS ourselves. +# Get target configury. +unset LIBGCOBOL_SUPPORTED +. ${srcdir}/configure.tgt -m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) -m4_define([_AC_ARG_VAR_PRECIOUS],[]) -AC_PROG_CC -AC_PROG_CXX -AM_PROG_AS -m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) +# ----------------- +# __int128 support +# ----------------- -AC_SUBST(CFLAGS) +AC_CACHE_CHECK([whether __int128 is supported], [libgcobol_cv_have_int128], + [GCC_TRY_COMPILE_OR_LINK([ + __int128 foo (__int128 ) + { + __int128 aaa; + return (__int128) aaa; + } -# In order to override CFLAGS_FOR_TARGET, all of our special flags go -# in XCFLAGS. But we need them in CFLAGS during configury. So put them -# in both places for now and restore CFLAGS at the end of config. -save_CFLAGS="$CFLAGS" + __int128 bar (__int128 ) + { + __int128 aaa; + return (__int128) aaa; + } + ],[ + foo (1); + bar (1); + ],[ + libgcobol_cv_have_int128=yes + ],[ + libgcobol_cv_have_int128=no +])]) -# Find other programs we need. -AC_CHECK_TOOL(AR, ar) -AC_CHECK_TOOL(NM, nm) -AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error) -AC_PROG_MAKE_SET -AC_PROG_INSTALL +AM_CONDITIONAL(BUILD_LIBGCOBOL, [test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes]) -AM_PROG_LIBTOOL -LT_INIT +# Check if functions are available in libc before adding extra libs. +AC_SEARCH_LIBS([malloc], [c]) +AC_SEARCH_LIBS([clock_gettime], [c rt]) -AC_LIBTOOL_DLOPEN +# libgcobol soname version +LIBGCOBOL_VERSION=1:0:0 +AC_SUBST(LIBGCOBOL_VERSION) -AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes]) +## added, currently unused. +# VERSION_SUFFIX=$(echo $LIBGCOBOL_VERSION | tr ':' '.' ) +# AC_SUBST(VERSION_SUFFIX) +## end added -AC_SUBST(enable_shared) -AC_SUBST(enable_static) +extra_ldflags_libgcobol= +case $host in + *-*-darwin*) + extra_ldflags_libgcobol=-Wl,-U,___cobol_main ;; + *) ;; +esac +AC_SUBST(extra_ldflags_libgcobol) + +AC_CHECK_HEADERS_ONCE(floatingpoint.h ieeefp.h fenv.h fptrap.h \ +complex.h stdlib.h) # These are GLIBC AC_CHECK_FUNCS_ONCE(random_r srandom_r initstate_r setstate_r) -# These are C23, and might not be available in libc. +# Some functions we check to figure out if the libc Float128 support +# is adequate. + +# These are C23. AC_CHECK_FUNCS_ONCE(strfromf32 strfromf64) +# These are GLIBC. +AC_CHECK_FUNCS_ONCE(strtof128 strfromf128) +# We need to make sure to check libc before adding libm. +libgcobol_have_sinf128=no +AC_SEARCH_LIBS([sinf128], [c m], libgcobol_have_sinf128=yes) +libgcobol_have_cacosf128=no +AC_SEARCH_LIBS([cacosf128], [c m], libgcobol_have_cacosf128=yes) + +have_iec_60559_libc_support=no +if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \ + && test "x$libgcobol_have_sinf128$libgcobol_have_cacosf128" = xyesyes; then + have_iec_60559_libc_support=yes +fi + +# Check whether libquadmath should be used +AC_ARG_ENABLE(libquadmath, +AS_HELP_STRING([--disable-libquadmath], + [disable libquadmath support for libgcobol]), +ENABLE_LIBQUADMATH_SUPPORT=$enableval, +if test "x$have_iec_60559_libc_support" = xyes; then + ENABLE_LIBQUADMATH_SUPPORT=default +else + ENABLE_LIBQUADMATH_SUPPORT=yes +fi) +enable_libquadmath_support= +if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then + enable_libquadmath_support=no +elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then + enable_libquadmath_support=default +fi +LIBGCOBOL_CHECK_FLOAT128 + +# struct tm tm_zone is a POSIX.1-2024 addition. +AC_CHECK_MEMBERS([struct tm.tm_zone],,,[#include <time.h>]) + if test "${multilib}" = "yes"; then multilib_arg="--enable-multilib" else multilib_arg= fi -AC_LANG_C -# Check the compiler. -# The same as in boehm-gc and libstdc++. Have to borrow it from there. -# We must force CC to /not/ be precious variables; otherwise -# the wrong, non-multilib-adjusted value will be used in multilibs. -# As a side effect, we have to subst CFLAGS ourselves. - -m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) -m4_define([_AC_ARG_VAR_PRECIOUS],[]) -AC_PROG_CC -m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) - -AC_SUBST(CFLAGS) - -CC_FOR_BUILD=${CC_FOR_BUILD:-gcc} -AC_SUBST(CC_FOR_BUILD) - -AC_SEARCH_LIBS([malloc], [c]) -AC_SEARCH_LIBS([cosf], [m]) -AC_SEARCH_LIBS([clock_gettime], [rt]) - -# Add dependencies for libgcobol.spec file -SPEC_LIBGCOBOL_DEPS="$LIBS" -AC_SUBST(SPEC_LIBGCOBOL_DEPS) - -# libgcobol soname version -LIBGCOBOL_VERSION=1:0:0 -AC_SUBST(LIBGCOBOL_VERSION) - -## added -VERSION_SUFFIX=$(echo $LIBGCOBOL_VERSION | tr ':' '.' ) -AC_SUBST(VERSION_SUFFIX) -## end added - # Determine what GCC version number to use in filesystem paths. GCC_BASE_VER -extra_darwin_ldflags_libgcobol= -case $host in - *-*-darwin*) - extra_darwin_ldflags_libgcobol=-Wl,-U,___cobol_main ;; - *) ;; -esac -AC_SUBST(extra_darwin_ldflags_libgcobol) - -# For iconv support. -AM_ICONV +# Add dependencies for libgcobol.spec file, this might be excessive - since +# the spec file might not use all of them. +SPEC_LIBGCOBOL_DEPS="$LIBS" +AC_SUBST(SPEC_LIBGCOBOL_DEPS) -AC_CONFIG_SRCDIR([Makefile.am]) -AC_CONFIG_FILES([Makefile]) -####AC_CONFIG_FILES(libgcobol.spec) +AC_CONFIG_FILES([ +Makefile +libgcobol.spec +]) AC_MSG_NOTICE([libgcobol has been configured.]) diff --git a/libgcobol/configure.tgt b/libgcobol/configure.tgt index c5e263a..a239252 100644 --- a/libgcobol/configure.tgt +++ b/libgcobol/configure.tgt @@ -34,7 +34,12 @@ case "${target}" in LIBGCOBOL_SUPPORTED=yes fi ;; - x86_64-*-linux* | i?86-*-linux*) + riscv64-*-linux*) + if test x$ac_cv_sizeof_void_p = x8; then + LIBGCOBOL_SUPPORTED=yes + fi + ;; + x86_64-*-linux* | i?86-*-linux* | x86_64-*-darwin*) if test x$ac_cv_sizeof_void_p = x8; then LIBGCOBOL_SUPPORTED=yes fi diff --git a/libgcobol/constants.cc b/libgcobol/constants.cc index 026f919..d37c791 100644 --- a/libgcobol/constants.cc +++ b/libgcobol/constants.cc @@ -288,7 +288,7 @@ struct cblc_field_t __gg___14_linage_counter6 = { unsigned char __gg__data_upsi_0[2] = {0,0}; -struct cblc_field_t __gg___6_upsi_04 = { +struct cblc_field_t __gg__upsi = { .data = __gg__data_upsi_0 , .capacity = 2 , .allocated = 2 , @@ -307,9 +307,9 @@ struct cblc_field_t __gg___6_upsi_04 = { .dummy = 0 , }; -unsigned char __gg__data_return_code[2] = {0,0}; -struct cblc_field_t __gg___11_return_code6 = { - .data = __gg__data_return_code , +short __gg__data_return_code = 0; +struct cblc_field_t __gg__return_code = { + .data = (unsigned char *)&__gg__data_return_code , .capacity = 2 , .allocated = 2 , .offset = 0 , @@ -319,7 +319,7 @@ struct cblc_field_t __gg___11_return_code6 = { .parent = NULL, .occurs_lower = 0 , .occurs_upper = 0 , - .attr = 0x0 , + .attr = signable_e , .type = FldNumericBin5 , .level = 0 , .digits = 4 , diff --git a/libgcobol/gfileio.cc b/libgcobol/gfileio.cc index ed250c4..e6ad03fc 100644 --- a/libgcobol/gfileio.cc +++ b/libgcobol/gfileio.cc @@ -41,6 +41,7 @@ #include <algorithm> #include "config.h" +#include "libgcobol-fp.h" #include "ec.h" #include "io.h" @@ -4054,34 +4055,6 @@ file_indexed_close(cblc_file_t *file) file->supplemental = NULL; } -static void -report_open_failure(const char *type, - const char *structure_name, - const char *filename) - { - bool quiet = true; - if( !quiet ) - { - if( getenv(filename) ) - { - fprintf(stderr, - "Trying to 'OPEN %s %s %s -> \"%s\"', which doesn't exist\n", - type, - structure_name, - filename, - getenv(filename)); - } - else - { - fprintf(stderr, - "Trying to 'OPEN %s %s \"%s\"', which doesn't exist\n", - type, - structure_name, - filename); - } - } - } - extern "C" void __gg__file_reopen(cblc_file_t *file, int mode_char) @@ -4210,7 +4183,6 @@ __gg__file_reopen(cblc_file_t *file, int mode_char) } else { - report_open_failure("INPUT", file->name, trimmed_name); file->io_status = FsNoFile; // "35" goto done; } @@ -4252,7 +4224,6 @@ __gg__file_reopen(cblc_file_t *file, int mode_char) else { // Trying to extend a non-optional non-existing file is against the rules - report_open_failure("EXTEND", file->name, trimmed_name); file->io_status = FsNoFile; // "35" goto done; } @@ -4268,7 +4239,6 @@ __gg__file_reopen(cblc_file_t *file, int mode_char) } else { - report_open_failure("I-O", file->name, trimmed_name); file->io_status = FsNoFile; // "35" goto done; } diff --git a/libgcobol/gmath.cc b/libgcobol/gmath.cc index fb2eae3..3fe2bbb 100644 --- a/libgcobol/gmath.cc +++ b/libgcobol/gmath.cc @@ -40,6 +40,7 @@ #include <algorithm> #include "config.h" +#include "libgcobol-fp.h" #include "ec.h" #include "common-defs.h" @@ -54,10 +55,6 @@ #include <sys/stat.h> #include <sys/types.h> -#ifdef __aarch64__ -#define __float128 _Float128 -#endif - #define MAX_INTERMEDIATE_BITS 126 #define MAX_INTERMEDIATE_DECIMALS 16 @@ -114,7 +111,7 @@ conditional_stash( cblc_field_t *destination, size_t destination_o, size_t destination_s, bool on_error_flag, - _Float128 value, + GCOB_FP128 value, cbl_round_t rounded) { int retval = compute_error_none; @@ -150,15 +147,10 @@ conditional_stash( cblc_field_t *destination, return retval; } - -#if defined(__aarch64__) -# define __float128 _Float128 /* double */ -#endif - static -_Float128 -divide_helper_float(_Float128 a_value, - _Float128 b_value, +GCOB_FP128 +divide_helper_float(GCOB_FP128 a_value, + GCOB_FP128 b_value, int *compute_error) { if( b_value == 0 ) @@ -187,9 +179,9 @@ divide_helper_float(_Float128 a_value, } static -_Float128 -multiply_helper_float(_Float128 a_value, - _Float128 b_value, +GCOB_FP128 +multiply_helper_float(GCOB_FP128 a_value, + GCOB_FP128 b_value, int *compute_error) { a_value *= b_value; @@ -210,9 +202,9 @@ multiply_helper_float(_Float128 a_value, } static -_Float128 -addition_helper_float(_Float128 a_value, - _Float128 b_value, +GCOB_FP128 +addition_helper_float(GCOB_FP128 a_value, + GCOB_FP128 b_value, int *compute_error) { a_value += b_value; @@ -233,9 +225,9 @@ addition_helper_float(_Float128 a_value, } static -_Float128 -subtraction_helper_float(_Float128 a_value, - _Float128 b_value, +GCOB_FP128 +subtraction_helper_float(GCOB_FP128 a_value, + GCOB_FP128 b_value, int *compute_error) { a_value -= b_value; @@ -276,9 +268,9 @@ __gg__pow( cbl_arith_format_t, size_t *C_o = __gg__treeplet_3o; size_t *C_s = __gg__treeplet_3s; - _Float128 avalue = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]); - _Float128 bvalue = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); - _Float128 tgt_value; + GCOB_FP128 avalue = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]); + GCOB_FP128 bvalue = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); + GCOB_FP128 tgt_value; if( avalue == 0 && bvalue == 0 ) { @@ -295,7 +287,7 @@ __gg__pow( cbl_arith_format_t, // Calculate our answer, in floating point: errno = 0; feclearexcept(FE_ALL_EXCEPT); - tgt_value = powf128(avalue, bvalue); + tgt_value = FP128_FUNC(pow)(avalue, bvalue); if( errno || fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) ) { // One of a large number of errors took place. See math_error(7) and @@ -568,7 +560,7 @@ get_int256_from_qualified_field(int256 &var, static int256 phase1_result; static int phase1_rdigits; -static _Float128 phase1_result_float; +static GCOB_FP128 phase1_result_float; extern "C" void @@ -654,11 +646,11 @@ __gg__addf1_fixed_phase2( cbl_arith_format_t , // proceed accordingly. // Convert the intermediate - _Float128 value_a = (_Float128)phase1_result.i128[0]; + GCOB_FP128 value_a = (GCOB_FP128)phase1_result.i128[0]; value_a /= __gg__power_of_ten(phase1_rdigits); // Pick up the target - _Float128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); + GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); value_a += value_b; @@ -740,7 +732,7 @@ __gg__fixed_phase2_assign_to_c( cbl_arith_format_t , // proceed accordingly. // Convert the intermediate - _Float128 value_a = (_Float128)phase1_result.i128[0]; + GCOB_FP128 value_a = (GCOB_FP128)phase1_result.i128[0]; value_a /= __gg__power_of_ten(phase1_rdigits); *compute_error |= conditional_stash(C[0], C_o[0], C_s[0], @@ -796,7 +788,7 @@ __gg__add_float_phase1( cbl_arith_format_t , for( size_t i=1; i<nA; i++ ) { - _Float128 temp = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]); + GCOB_FP128 temp = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]); phase1_result_float = addition_helper_float(phase1_result_float, temp, compute_error); @@ -822,7 +814,7 @@ __gg__addf1_float_phase2( cbl_arith_format_t , // This is the assignment phase of an ADD Format 2 // We take phase1_result and accumulate it into C - _Float128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); + GCOB_FP128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); temp = addition_helper_float(temp, phase1_result_float, compute_error); *compute_error |= conditional_stash(C[0], C_o[0], C_s[0], on_size_error, @@ -883,8 +875,8 @@ __gg__addf3(cbl_arith_format_t , { if( A[i]->type == FldFloat || C[i]->type == FldFloat ) { - _Float128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]); - _Float128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]); + GCOB_FP128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]); + GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]); value_a = addition_helper_float(value_a, value_b, compute_error); @@ -966,11 +958,11 @@ __gg__subtractf1_fixed_phase2(cbl_arith_format_t , // proceed accordingly. // Convert the intermediate - _Float128 value_a = (_Float128)phase1_result.i128[0]; + GCOB_FP128 value_a = (GCOB_FP128)phase1_result.i128[0]; value_a /= __gg__power_of_ten(phase1_rdigits); // Pick up the target - _Float128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); + GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); value_b -= value_a; @@ -1106,7 +1098,7 @@ __gg__subtractf1_float_phase2(cbl_arith_format_t , // This is the assignment phase of an ADD Format 2 // We take phase1_result and subtract it from C - _Float128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); + GCOB_FP128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); temp = subtraction_helper_float(temp, phase1_result_float, compute_error); *compute_error |= conditional_stash(C[0], C_o[0], C_s[0], on_size_error, @@ -1143,7 +1135,7 @@ __gg__subtractf2_float_phase1(cbl_arith_format_t , ); // Subtract that from the B value: - _Float128 value_b = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); + GCOB_FP128 value_b = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); // The two numbers have the same number of rdigits. It's now safe to add // them. @@ -1177,8 +1169,8 @@ __gg__subtractf3( cbl_arith_format_t , { if( A[i]->type == FldFloat || C[i]->type == FldFloat) { - _Float128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]); - _Float128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]); + GCOB_FP128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]); + GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]); value_b = subtraction_helper_float(value_b, value_a, compute_error); @@ -1235,7 +1227,7 @@ __gg__subtractf3( cbl_arith_format_t , } static bool multiply_intermediate_is_float; -static _Float128 multiply_intermediate_float; +static GCOB_FP128 multiply_intermediate_float; static __int128 multiply_intermediate_int128; static int multiply_intermediate_rdigits; @@ -1351,8 +1343,8 @@ __gg__multiplyf1_phase2(cbl_arith_format_t , bool on_size_error = !!(on_error_flag & ON_SIZE_ERROR); int error_this_time=0; - _Float128 a_value; - _Float128 b_value; + GCOB_FP128 a_value; + GCOB_FP128 b_value; if( multiply_intermediate_is_float ) { @@ -1374,10 +1366,10 @@ __gg__multiplyf1_phase2(cbl_arith_format_t , if( C[0]->type == FldFloat ) { // gixed * float - a_value = (_Float128) multiply_intermediate_int128; + a_value = (GCOB_FP128) multiply_intermediate_int128; if( multiply_intermediate_rdigits ) { - a_value /= (_Float128)__gg__power_of_ten(multiply_intermediate_rdigits); + a_value /= (GCOB_FP128)__gg__power_of_ten(multiply_intermediate_rdigits); } b_value = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); goto float_float; @@ -1457,14 +1449,14 @@ __gg__multiplyf2( cbl_arith_format_t , bool on_size_error = !!(on_error_flag & ON_SIZE_ERROR); bool got_float = false; - _Float128 product_float; + GCOB_FP128 product_float; int256 product_fix; int product_fix_digits; if( A[0]->type == FldFloat || B[0]->type == FldFloat ) { - _Float128 a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]); - _Float128 b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); + GCOB_FP128 a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]); + GCOB_FP128 b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); product_float = multiply_helper_float(a_value, b_value, compute_error); got_float = true; } @@ -1834,8 +1826,8 @@ __gg__dividef1_phase2(cbl_arith_format_t , bool on_size_error = !!(on_error_flag & ON_SIZE_ERROR); int error_this_time=0; - _Float128 a_value; - _Float128 b_value; + GCOB_FP128 a_value; + GCOB_FP128 b_value; if( multiply_intermediate_is_float ) { @@ -1857,10 +1849,10 @@ __gg__dividef1_phase2(cbl_arith_format_t , if( C[0]->type == FldFloat ) { // gixed * float - a_value = (_Float128) multiply_intermediate_int128; + a_value = (GCOB_FP128) multiply_intermediate_int128; if( multiply_intermediate_rdigits ) { - a_value /= (_Float128)__gg__power_of_ten(multiply_intermediate_rdigits); + a_value /= (GCOB_FP128)__gg__power_of_ten(multiply_intermediate_rdigits); } b_value = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]); goto float_float; @@ -1948,9 +1940,9 @@ __gg__dividef23(cbl_arith_format_t , if( A[0]->type == FldFloat || B[0]->type == FldFloat ) { - _Float128 a_value; - _Float128 b_value; - _Float128 c_value; + GCOB_FP128 a_value; + GCOB_FP128 b_value; + GCOB_FP128 c_value; a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]); b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); c_value = divide_helper_float(a_value, b_value, &error_this_time); @@ -2029,9 +2021,9 @@ __gg__dividef45(cbl_arith_format_t , if( A[0]->type == FldFloat || B[0]->type == FldFloat ) { - _Float128 a_value; - _Float128 b_value; - _Float128 c_value; + GCOB_FP128 a_value; + GCOB_FP128 b_value; + GCOB_FP128 c_value; a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]); b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]); c_value = divide_helper_float(a_value, b_value, &error_this_time); diff --git a/libgcobol/intrinsic.cc b/libgcobol/intrinsic.cc index 4bce481..97f2bdc 100644 --- a/libgcobol/intrinsic.cc +++ b/libgcobol/intrinsic.cc @@ -45,6 +45,7 @@ #include <string.h> #include "config.h" +#include "libgcobol-fp.h" #include "ec.h" #include "common-defs.h" @@ -53,11 +54,12 @@ #include "libgcobol.h" #include "charmaps.h" + #pragma GCC diagnostic ignored "-Wformat-truncation" #define JD_OF_1601_01_02 2305812.5 -#define WEIRD_TRANSCENDENT_RETURN_VALUE (0.0Q) +#define WEIRD_TRANSCENDENT_RETURN_VALUE GCOB_FP128_LITERAL (0.0) #define NO_RDIGITS (0) struct cobol_tm @@ -406,7 +408,7 @@ get_value_as_double_from_qualified_field( cblc_field_t *input, } static -_Float128 kahan_summation(size_t ncount, +GCOB_FP128 kahan_summation(size_t ncount, cblc_field_t **source, size_t *source_o, size_t *source_s, @@ -420,11 +422,11 @@ _Float128 kahan_summation(size_t ncount, // an aggressive optimizing compiler from just making it go away. *k_count = 0; - _Float128 sum = 0; - volatile _Float128 kahan_c = 0; - _Float128 input; - _Float128 y; - _Float128 t; + GCOB_FP128 sum = 0; + volatile GCOB_FP128 kahan_c = 0; + GCOB_FP128 input; + GCOB_FP128 y; + GCOB_FP128 t; for(size_t i=0; i<ncount; i++) { @@ -452,7 +454,7 @@ _Float128 kahan_summation(size_t ncount, } static -_Float128 +GCOB_FP128 variance( size_t ncount, cblc_field_t **source, size_t *source_o, @@ -463,13 +465,13 @@ variance( size_t ncount, // algorithm that is a bit wasteful of time, but is described as particularly // robust. - _Float128 retval = 0; + GCOB_FP128 retval = 0; if( ncount ) { // First, we calculate the mean of the input variables, which we will use // as an offset in the second stage: size_t k_count; - _Float128 offset = kahan_summation( ncount, + GCOB_FP128 offset = kahan_summation( ncount, source, source_o, source_s, @@ -480,11 +482,11 @@ variance( size_t ncount, // Next, we use Welford's algorithm on the residuals: size_t count = 0; - _Float128 mean = 0; - _Float128 M2 = 0; - _Float128 delta; - _Float128 delta2; - _Float128 newValue; + GCOB_FP128 mean = 0; + GCOB_FP128 M2 = 0; + GCOB_FP128 delta; + GCOB_FP128 delta2; + GCOB_FP128 newValue; for(size_t i=0; i<ncount; i++) { @@ -958,7 +960,7 @@ __gg__abs(cblc_field_t *dest, size_t source_size) { // FUNCTION ABS - _Float128 value; + GCOB_FP128 value; value = __gg__float128_from_qualified_field(source, source_offset, source_size); @@ -980,17 +982,17 @@ __gg__acos( cblc_field_t *dest, size_t source_size) { // FUNCTION ACOS - _Float128 value; + GCOB_FP128 value; value = __gg__float128_from_qualified_field(source, source_offset, source_size); - if( value < -1.00Q || value > +1.00Q ) + if( value < GCOB_FP128_LITERAL(-1.00) || value > GCOB_FP128_LITERAL(+1.00) ) { exception_raise(ec_argument_function_e); value = WEIRD_TRANSCENDENT_RETURN_VALUE; } else { - value = acosf128(value); + value = FP128_FUNC(acos)(value); } __gg__float128_to_field( dest, @@ -1011,12 +1013,12 @@ __gg__annuity(cblc_field_t *dest, { // FUNCTION ANNUITY - _Float128 retval = 0; + GCOB_FP128 retval = 0; - _Float128 val1 = fabsf128(__gg__float128_from_qualified_field(arg1, + GCOB_FP128 val1 = FP128_FUNC(fabs)(__gg__float128_from_qualified_field(arg1, arg1_offset, arg1_size)); - _Float128 val2 = fabsf128(__gg__float128_from_qualified_field(arg2, + GCOB_FP128 val2 = FP128_FUNC(fabs)(__gg__float128_from_qualified_field(arg2, arg2_offset, arg2_size)); if( val2 > 0) @@ -1031,7 +1033,7 @@ __gg__annuity(cblc_field_t *dest, } else { - retval = val1 / (1- powf128( (1+val1), -val2 )); + retval = val1 / (1- FP128_FUNC(pow)( (1+val1), -val2 )); } } else @@ -1053,19 +1055,19 @@ __gg__asin( cblc_field_t *dest, { // FUNCTION ASIN - _Float128 value; + GCOB_FP128 value; value = __gg__float128_from_qualified_field(source, source_offset, source_size); - if( value < -1.0Q || value > +1.00Q ) + if( value < GCOB_FP128_LITERAL(-1.0) || value > GCOB_FP128_LITERAL(+1.00) ) { exception_raise(ec_argument_function_e); value = WEIRD_TRANSCENDENT_RETURN_VALUE; } else { - value = asinf128(value); + value = FP128_FUNC(asin)(value); } __gg__float128_to_field( dest, @@ -1083,12 +1085,12 @@ __gg__atan( cblc_field_t *dest, { // FUNCTION ATAN - _Float128 value; + GCOB_FP128 value; value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = atanf128(value); + value = FP128_FUNC(atan)(value); __gg__float128_to_field( dest, value, @@ -1195,10 +1197,10 @@ __gg__cos(cblc_field_t *dest, { // FUNCTION COS - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = cosf128(value); + value = FP128_FUNC(cos)(value); __gg__float128_to_field(dest, value, truncation_e, @@ -1368,7 +1370,8 @@ void __gg__e(cblc_field_t *dest) { // FUNCTION E - static _Float128 e = 2.7182818284590452353602874713526624977572Q; + static GCOB_FP128 e + = GCOB_FP128_LITERAL(2.7182818284590452353602874713526624977572); __gg__float128_to_field(dest, e, truncation_e, @@ -1384,10 +1387,10 @@ __gg__exp(cblc_field_t *dest, { // FUNCTION EXP - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = expf128(value); + value = FP128_FUNC(exp)(value); __gg__float128_to_field(dest, value, truncation_e, @@ -1403,10 +1406,10 @@ __gg__exp10(cblc_field_t *dest, { // FUNCTION EXP10 - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = powf128(10.0Q, value); + value = FP128_FUNC(pow)(GCOB_FP128_LITERAL(10.0), value); __gg__float128_to_field(dest, value, truncation_e, @@ -1479,7 +1482,9 @@ __gg__formatted_current_date( cblc_field_t *dest, // Destination string __gg__clock_gettime(CLOCK_REALTIME, &ts); struct tm tm = {}; +#ifdef HAVE_STRUCT_TM_TM_ZONE tm.tm_zone = "GMT"; +#endif if( is_zulu ) { gmtime_r(&ts.tv_sec, &tm); @@ -1658,10 +1663,10 @@ __gg__integer(cblc_field_t *dest, size_t source_size) { // FUNCTION INTEGER - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = floorf128(value); + value = FP128_FUNC(floor)(value); __gg__float128_to_field(dest, value, truncation_e, @@ -1758,10 +1763,10 @@ __gg__integer_part( cblc_field_t *dest, size_t source_size) { // FUNCTION INTEGER-PART - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - _Float128 retval = floorf128(fabsf128(value)); + GCOB_FP128 retval = FP128_FUNC(floor)(FP128_FUNC(fabs)(value)); if( value < 0 ) { @@ -1781,7 +1786,7 @@ __gg__fraction_part(cblc_field_t *dest, size_t source_size) { // FUNCTION INTEGER-PART - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); bool is_negative = false; @@ -1791,7 +1796,7 @@ __gg__fraction_part(cblc_field_t *dest, value = -value; } - _Float128 retval = value - floorf128(value); + GCOB_FP128 retval = value - FP128_FUNC(floor)(value); if( is_negative ) { @@ -1811,7 +1816,7 @@ __gg__log( cblc_field_t *dest, size_t source_size) { // FUNCTION LOG - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); if( value <= 0.00 ) @@ -1820,7 +1825,7 @@ __gg__log( cblc_field_t *dest, } else { - _Float128 retval = logf128(value); + GCOB_FP128 retval = FP128_FUNC(log)(value); __gg__float128_to_field(dest, retval, truncation_e, @@ -1836,7 +1841,7 @@ __gg__log10( cblc_field_t *dest, size_t source_size) { // FUNCTION LOG10 - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); if( value <= 0.00 ) @@ -1845,7 +1850,7 @@ __gg__log10( cblc_field_t *dest, } else { - _Float128 retval = log10f128(value); + GCOB_FP128 retval = FP128_FUNC(log10)(value); __gg__float128_to_field(dest, retval, truncation_e, @@ -1867,8 +1872,7 @@ __gg__max(cblc_field_t *dest, unsigned char *best_location ; size_t best_length ; int best_attr ; - bool best_move_all ; - bool best_address_of ; + int best_flags ; bool first_time = true; assert(ncount); @@ -1887,8 +1891,7 @@ __gg__max(cblc_field_t *dest, best_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; best_length = __gg__treeplet_1s[i]; best_attr = __gg__treeplet_1f[i]->attr; - best_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - best_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + best_flags = __gg__fourplet_flags[i]; } else { @@ -1896,31 +1899,27 @@ __gg__max(cblc_field_t *dest, unsigned char *candidate_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; size_t candidate_length = __gg__treeplet_1s[i]; int candidate_attr = __gg__treeplet_1f[i]->attr; - bool candidate_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - bool candidate_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + int candidate_flags = __gg__fourplet_flags[i]; int compare_result = __gg__compare_2( candidate_field, candidate_location, candidate_length, candidate_attr, - candidate_move_all, - candidate_address_of, + candidate_flags, best_field, best_location, best_length, best_attr, - best_move_all, - best_address_of, + best_flags, 0); if( compare_result >= 0 ) { - best_field = candidate_field ; - best_location = candidate_location ; - best_length = candidate_length ; - best_attr = candidate_attr ; - best_move_all = candidate_move_all ; - best_address_of = candidate_address_of ; + best_field = candidate_field ; + best_location = candidate_location ; + best_length = candidate_length ; + best_attr = candidate_attr ; + best_flags = candidate_flags ; } } if( !update_refer_state_for_all(state, __gg__treeplet_1f[i]) ) @@ -1937,7 +1936,7 @@ __gg__max(cblc_field_t *dest, } else { - _Float128 retval; + GCOB_FP128 retval; bool first_time = true; assert(ncount); for(size_t i=0; i<ncount; i++) @@ -1954,7 +1953,7 @@ __gg__max(cblc_field_t *dest, } else { - _Float128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]); + GCOB_FP128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]); if( candidate >= retval ) { retval = candidate; @@ -1998,7 +1997,7 @@ __gg__mean( cblc_field_t *dest, { // FUNCTION MEAN size_t k_count; - _Float128 sum = kahan_summation(ninputs, + GCOB_FP128 sum = kahan_summation(ninputs, __gg__treeplet_1f, __gg__treeplet_1o, __gg__treeplet_1s, @@ -2027,7 +2026,7 @@ __gg__median( cblc_field_t *dest, size_t list_size = 1; - _Float128 *the_list = (_Float128 *)malloc(list_size *sizeof(_Float128)); + GCOB_FP128 *the_list = (GCOB_FP128 *)malloc(list_size *sizeof(GCOB_FP128)); size_t k_count = 0; assert(ncount); for(size_t i=0; i<ncount; i++) @@ -2040,7 +2039,7 @@ __gg__median( cblc_field_t *dest, if(k_count >= list_size) { list_size *= 2; - the_list = (_Float128 *)realloc(the_list, list_size *sizeof(_Float128)); + the_list = (GCOB_FP128 *)realloc(the_list, list_size *sizeof(GCOB_FP128)); } the_list[k_count] = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], @@ -2056,7 +2055,7 @@ __gg__median( cblc_field_t *dest, } std::sort(the_list, the_list+k_count); - _Float128 retval; + GCOB_FP128 retval; size_t i=k_count/2; if( k_count & 1 ) { @@ -2079,9 +2078,9 @@ __gg__midrange( cblc_field_t *dest, size_t ncount) { // FUNCTION MIDRANGE - _Float128 val; - _Float128 min=0; - _Float128 max=0; + GCOB_FP128 val; + GCOB_FP128 min=0; + GCOB_FP128 max=0; bool first_time = true; assert(ncount); for(size_t i=0; i<ncount; i++) @@ -2108,7 +2107,7 @@ __gg__midrange( cblc_field_t *dest, } } } - _Float128 retval = (min + max)/2.0; + GCOB_FP128 retval = (min + max)/2.0; __gg__float128_to_field(dest, retval, truncation_e, @@ -2129,8 +2128,7 @@ __gg__min(cblc_field_t *dest, unsigned char *best_location ; size_t best_length ; int best_attr ; - bool best_move_all ; - bool best_address_of ; + int best_flags ; bool first_time = true; assert(ncount); @@ -2149,8 +2147,7 @@ __gg__min(cblc_field_t *dest, best_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; best_length = __gg__treeplet_1s[i]; best_attr = __gg__treeplet_1f[i]->attr; - best_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - best_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + best_flags = __gg__fourplet_flags[i]; } else { @@ -2158,31 +2155,27 @@ __gg__min(cblc_field_t *dest, unsigned char *candidate_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; size_t candidate_length = __gg__treeplet_1s[i]; int candidate_attr = __gg__treeplet_1f[i]->attr; - bool candidate_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - bool candidate_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + int candidate_flags = __gg__fourplet_flags[i]; int compare_result = __gg__compare_2( candidate_field, candidate_location, candidate_length, candidate_attr, - candidate_move_all, - candidate_address_of, + candidate_flags, best_field, best_location, best_length, best_attr, - best_move_all, - best_address_of, + best_flags, 0); if( compare_result < 0 ) { - best_field = candidate_field ; - best_location = candidate_location ; - best_length = candidate_length ; - best_attr = candidate_attr ; - best_move_all = candidate_move_all ; - best_address_of = candidate_address_of ; + best_field = candidate_field ; + best_location = candidate_location ; + best_length = candidate_length ; + best_attr = candidate_attr ; + best_flags = candidate_flags ; } } if( !update_refer_state_for_all(state, __gg__treeplet_1f[i]) ) @@ -2199,7 +2192,7 @@ __gg__min(cblc_field_t *dest, } else { - _Float128 retval; + GCOB_FP128 retval; bool first_time = true; assert(ncount); for(size_t i=0; i<ncount; i++) @@ -2216,7 +2209,7 @@ __gg__min(cblc_field_t *dest, } else { - _Float128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]); + GCOB_FP128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]); if( candidate < retval ) { retval = candidate; @@ -2588,7 +2581,7 @@ numval_c( cblc_field_t *dest, char *pend = pstart + src_size; char *p = pstart; - _Float128 retval = 0; + GCOB_FP128 retval = 0; int sign = 0; int rdigits = 0; int rdigit_bump = 0; @@ -2991,14 +2984,12 @@ __gg__ord_min(cblc_field_t *dest, unsigned char *best_location; size_t best_length; int best_attr; - bool best_move_all; - bool best_address_of ; + int best_flags; unsigned char *candidate_location; size_t candidate_length; int candidate_attr; - bool candidate_move_all; - bool candidate_address_of; + int candidate_flags; for( size_t i=0; i<ninputs; i++ ) { @@ -3016,8 +3007,7 @@ __gg__ord_min(cblc_field_t *dest, best_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; best_length = __gg__treeplet_1s[i]; best_attr = __gg__treeplet_1f[i]->attr; - best_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - best_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + best_flags = __gg__fourplet_flags[i]; } else { @@ -3026,8 +3016,7 @@ __gg__ord_min(cblc_field_t *dest, candidate_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; candidate_length = __gg__treeplet_1s[i]; candidate_attr = __gg__treeplet_1f[i]->attr; - candidate_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - candidate_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + candidate_flags = __gg__fourplet_flags[i]; int compare_result = __gg__compare_2( @@ -3035,14 +3024,12 @@ __gg__ord_min(cblc_field_t *dest, candidate_location, candidate_length, candidate_attr, - candidate_move_all, - candidate_address_of, + candidate_flags, best, best_location, best_length, best_attr, - best_move_all, - best_address_of, + best_flags, 0); if( compare_result < 0 ) { @@ -3051,8 +3038,7 @@ __gg__ord_min(cblc_field_t *dest, best_location = candidate_location; best_length = candidate_length; best_attr = candidate_attr; - best_move_all = candidate_move_all; - best_address_of = candidate_address_of; + best_flags = candidate_flags; } } if( !update_refer_state_for_all(state, __gg__treeplet_1f[i]) ) @@ -3086,14 +3072,12 @@ __gg__ord_max(cblc_field_t *dest, unsigned char *best_location; size_t best_length; int best_attr; - bool best_move_all; - bool best_address_of ; + int best_flags; unsigned char *candidate_location; size_t candidate_length; int candidate_attr; - bool candidate_move_all; - bool candidate_address_of; + int candidate_flags; for( size_t i=0; i<ninputs; i++ ) { @@ -3111,8 +3095,7 @@ __gg__ord_max(cblc_field_t *dest, best_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; best_length = __gg__treeplet_1s[i]; best_attr = __gg__treeplet_1f[i]->attr; - best_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - best_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + best_flags = __gg__fourplet_flags[i]; } else { @@ -3121,8 +3104,7 @@ __gg__ord_max(cblc_field_t *dest, candidate_location = __gg__treeplet_1f[i]->data + __gg__treeplet_1o[i]; candidate_length = __gg__treeplet_1s[i]; candidate_attr = __gg__treeplet_1f[i]->attr; - candidate_move_all = !!(__gg__fourplet_flags[i] & REFER_T_MOVE_ALL); - candidate_address_of = !!(__gg__fourplet_flags[i] & REFER_T_ADDRESS_OF); + candidate_flags = __gg__fourplet_flags[i]; int compare_result = __gg__compare_2( @@ -3130,14 +3112,12 @@ __gg__ord_max(cblc_field_t *dest, candidate_location, candidate_length, candidate_attr, - candidate_move_all, - candidate_address_of, + candidate_flags, best, best_location, best_length, best_attr, - best_move_all, - best_address_of, + best_flags, 0); if( compare_result > 0 ) { @@ -3146,8 +3126,7 @@ __gg__ord_max(cblc_field_t *dest, best_location = candidate_location; best_length = candidate_length; best_attr = candidate_attr; - best_move_all = candidate_move_all; - best_address_of = candidate_address_of; + best_flags = candidate_flags; } } if( !update_refer_state_for_all(state, __gg__treeplet_1f[i]) ) @@ -3172,7 +3151,8 @@ __gg__pi(cblc_field_t *dest) { // FUNCTION PI - static _Float128 pi = 3.141592653589793238462643383279502884Q; + static GCOB_FP128 pi + = GCOB_FP128_LITERAL(3.141592653589793238462643383279502884); __gg__float128_to_field(dest, pi, truncation_e, @@ -3184,10 +3164,10 @@ void __gg__present_value(cblc_field_t *dest, size_t ncount) { - _Float128 discount = 0;; - _Float128 denom = 1; + GCOB_FP128 discount = 0;; + GCOB_FP128 denom = 1; - _Float128 retval = 0; + GCOB_FP128 retval = 0; bool first_time = true; for(size_t i=0; i<ncount; i++) { @@ -3198,19 +3178,19 @@ __gg__present_value(cblc_field_t *dest, if(first_time) { first_time = false; - _Float128 arg1 = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], + GCOB_FP128 arg1 = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]); - if( arg1 <= -1.0Q ) + if( arg1 <= GCOB_FP128_LITERAL(-1.0) ) { exception_raise(ec_argument_function_e); break; } - discount = 1.0Q / (1.0Q + arg1); + discount = GCOB_FP128_LITERAL(1.0) / (GCOB_FP128_LITERAL(1.0) + arg1); } else { - _Float128 arg = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], + GCOB_FP128 arg = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]); denom *= discount; @@ -3236,9 +3216,9 @@ __gg__range(cblc_field_t *dest, { // FUNCTION RANGE bool first_time = true; - _Float128 val; - _Float128 min; - _Float128 max; + GCOB_FP128 val; + GCOB_FP128 min; + GCOB_FP128 max; assert(ncount > 0); for(size_t i=0; i<ncount; i++) @@ -3266,7 +3246,7 @@ __gg__range(cblc_field_t *dest, } } - _Float128 retval = max - min; + GCOB_FP128 retval = max - min; __gg__float128_to_field(dest, retval, truncation_e, @@ -3290,15 +3270,15 @@ __gg__rem(cblc_field_t *dest, // The ISO spec says: // ((argument-1) – ((argument-2) * FUNCTION INTEGER-PART ((argument-1) / (argument-2)))) - _Float128 arg1 = __gg__float128_from_qualified_field( par1, + GCOB_FP128 arg1 = __gg__float128_from_qualified_field( par1, par1_offset, par1_size); - _Float128 arg2 = __gg__float128_from_qualified_field( par2, + GCOB_FP128 arg2 = __gg__float128_from_qualified_field( par2, par2_offset, par2_size); - _Float128 intpart; - _Float128 retval; + GCOB_FP128 intpart; + GCOB_FP128 retval; if( arg2 == 0 ) { exception_raise(ec_argument_function_e); @@ -3306,7 +3286,7 @@ __gg__rem(cblc_field_t *dest, } else { - modff128(arg1 / arg2, &intpart); + FP128_FUNC(modf)(arg1 / arg2, &intpart); retval = arg1 - arg2 * intpart; } @@ -3526,7 +3506,7 @@ __gg__sign( cblc_field_t *dest, { // FUNCTION SIGN - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); @@ -3559,11 +3539,11 @@ __gg__sin(cblc_field_t *dest, { // FUNCTION SIN - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = sinf128(value); + value = FP128_FUNC(sin)(value); __gg__float128_to_field(dest, value, @@ -3580,17 +3560,17 @@ __gg__sqrt( cblc_field_t *dest, { // FUNCTION SQRT - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - if( value <= 0.0Q ) + if( value <= GCOB_FP128_LITERAL(0.0) ) { exception_raise(ec_argument_function_e); } else { - value = sqrtf128(value); + value = FP128_FUNC(sqrt)(value); } __gg__float128_to_field(dest, @@ -3605,12 +3585,12 @@ __gg__standard_deviation( cblc_field_t *dest, size_t ninputs) { // FUNCTION STANDARD-DEVIATION - _Float128 retval = variance(ninputs, + GCOB_FP128 retval = variance(ninputs, __gg__treeplet_1f, __gg__treeplet_1o, __gg__treeplet_1s, __gg__fourplet_flags); - retval = sqrtf128(retval); + retval = FP128_FUNC(sqrt)(retval); __gg__float128_to_field(dest, retval, @@ -3625,7 +3605,7 @@ __gg__sum(cblc_field_t *dest, { // FUNCTION SUM size_t k_count; - _Float128 sum = kahan_summation(ninputs, + GCOB_FP128 sum = kahan_summation(ninputs, __gg__treeplet_1f, __gg__treeplet_1o, __gg__treeplet_1s, @@ -3646,10 +3626,10 @@ __gg__tan(cblc_field_t *dest, { // FUNCTION TAN - _Float128 value = __gg__float128_from_qualified_field(source, + GCOB_FP128 value = __gg__float128_from_qualified_field(source, source_offset, source_size); - value = tanf128(value); + value = FP128_FUNC(tan)(value); __gg__float128_to_field(dest, value, truncation_e, @@ -3769,7 +3749,7 @@ __gg__variance( cblc_field_t *dest, size_t ncount) { // FUNCTION VARIANCE - _Float128 retval = variance(ncount, + GCOB_FP128 retval = variance(ncount, __gg__treeplet_1f, __gg__treeplet_1o, __gg__treeplet_1s, @@ -5006,7 +4986,7 @@ __gg__numval_f( cblc_field_t *dest, size_t source_offset, size_t source_size) { - _Float128 value = 0; + GCOB_FP128 value = 0; char *data = (char * )(source->data + source_offset); char *data_end = data + source_size; @@ -5030,7 +5010,7 @@ __gg__numval_f( cblc_field_t *dest, } } *p++ = '\0'; - value = strtof128(ach, NULL); + value = strtofp128(ach, NULL); } __gg__float128_to_field(dest, value, diff --git a/libgcobol/libgcobol-fp.h b/libgcobol/libgcobol-fp.h new file mode 100644 index 0000000..fcfa0a7 --- /dev/null +++ b/libgcobol/libgcobol-fp.h @@ -0,0 +1,59 @@ +/* Copyright The GNU Toolchain Authors. */ + +/* This file is part of the GNU COBOL runtime library (libgcobol). + +libgcobol 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 3 of the License, or (at your option) any later version. + +libgcobol 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. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +<http://www.gnu.org/licenses/>. */ + +/* You must include "config.h" before this file. */ + +#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381 +// Use long double, l suffix on calls, l or L suffix in literals +# define GCOB_FP128 long double +# define GCOB_FP128_LITERAL(lit) (lit ## l) +# define FP128_FUNC(funcname) funcname ## l +# define FP128_FMT "L" +# define strtofp128(nptr, endptr) strtold(nptr, endptr) +# define strfromfp128(str, n, format, fp) snprintf(str, n, format, fp) +#elif __FLT128_MANT_DIG__ == 113 && __FLT128_MIN_EXP__ == -16381 \ + && defined(USE_IEC_60559) +// Use _Float128, f128 suffix on calls, f128 or F128 suffix on literals +# define GCOB_FP128 _Float128 +# define GCOB_FP128_LITERAL(lit) (lit ## f128) +# define FP128_FUNC(funcname) funcname ## f128 +# define FP128_FMT "" +# define strtofp128(nptr, endptr) strtof128(nptr, endptr) +# define strfromfp128(str, n, format, fp) strfromf128(str, n, format, fp) +#elif __FLT128_MANT_DIG__ == 113 && __FLT128_MIN_EXP__ == -16381 +// Use __float128, q suffix on calls, q or Q suffix on literals +# define GCOB_FP128 __float128 +# define GCOB_FP128_LITERAL(lit) (lit ## q) +# define FP128_FUNC(funcname) funcname ## q +# define FP128_FMT "Q" +# define strtofp128(nptr, endptr) strtoflt128(nptr, endptr) +# define strfromfp128(str, n, format, fp) quadmath_snprintf(str, n, format, fp) +#else +# error "libgcobol requires 128b floating point" +#endif + +#if USE_QUADMATH +/* We will assume that unless we found the 128 to/from string and some + representative trig functions, we need libquadmath to support those. */ +# include "quadmath.h" +#endif diff --git a/libgcobol/libgcobol.cc b/libgcobol/libgcobol.cc index c163e2c..c438d6b 100644 --- a/libgcobol/libgcobol.cc +++ b/libgcobol/libgcobol.cc @@ -50,6 +50,7 @@ #include <sys/resource.h> #include "config.h" +#include "libgcobol-fp.h" #include "ec.h" #include "common-defs.h" @@ -216,12 +217,16 @@ local_ec_type_descr( ec_type_t type ) { return p; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" +// Keep this debugging function around for when it is needed static const char * local_ec_type_str( ec_type_t type ) { if( type == ec_none_e ) return "EC-NONE"; auto p = local_ec_type_descr(type); return p->name; } +#pragma GCC diagnostic pop ec_status_t& ec_status_t::update() { handled = ec_type_t(__gg__exception_handled); @@ -233,13 +238,6 @@ ec_status_t& ec_status_t::update() { snprintf(statement, sizeof(statement), "%s", __gg__exception_statement); } - if( type != ec_none_e && getenv("match_declarative") ) { - warnx( "ec_status_t::update:%d: EC %s by %s handled %02X " , __LINE__, - local_ec_type_str(type), - __gg__exception_statement? statement : "<none>", - handled ); // might be file-status, not ec_type_t - } - return *this; } @@ -881,10 +879,12 @@ int128_to_int128_rounded( cbl_round_t rounded, int *compute_error) { // value is signed, and is scaled to the target - _Float128 fpart = _Float128(remainder) / _Float128(factor); + GCOB_FP128 fpart = ((GCOB_FP128)remainder) / ((GCOB_FP128)factor); __int128 retval = value; - if(rounded == nearest_even_e && fpart != -0.5Q && fpart != 0.5Q ) + if(rounded == nearest_even_e + && fpart != GCOB_FP128_LITERAL (-0.5) + && fpart != GCOB_FP128_LITERAL (0.5)) { // "bankers rounding" has been requested. // @@ -905,14 +905,14 @@ int128_to_int128_rounded( cbl_round_t rounded, // 0.5 through 0.9 becomes 1 if( value < 0 ) { - if( fpart <= -0.5Q ) + if( fpart <= GCOB_FP128_LITERAL(-0.5) ) { retval -= 1; } } else { - if( fpart >= 0.5Q ) + if( fpart >= GCOB_FP128_LITERAL(0.5) ) { retval += 1; } @@ -946,14 +946,14 @@ int128_to_int128_rounded( cbl_round_t rounded, // 0.6 through 0.9 becomes 1 if( value < 0 ) { - if( fpart < -0.5Q ) + if( fpart < GCOB_FP128_LITERAL(-0.5) ) { retval -= 1; } } else { - if( fpart > 0.5Q ) + if( fpart > GCOB_FP128_LITERAL(0.5) ) { retval += 1; } @@ -1035,15 +1035,17 @@ int128_to_int128_rounded( cbl_round_t rounded, static __int128 f128_to_i128_rounded( cbl_round_t rounded, - _Float128 value, + GCOB_FP128 value, int *compute_error) { // value is signed, and is scaled to the target - _Float128 ipart; - _Float128 fpart = modff128(value, &ipart); + GCOB_FP128 ipart; + GCOB_FP128 fpart = FP128_FUNC(modf)(value, &ipart); __int128 retval = (__int128)ipart; - if(rounded == nearest_even_e && fpart != -0.5Q && fpart != 0.5Q ) + if(rounded == nearest_even_e + && fpart != GCOB_FP128_LITERAL (-0.5) + && fpart != GCOB_FP128_LITERAL (0.5)) { // "bankers rounding" has been requested. // @@ -1064,14 +1066,14 @@ f128_to_i128_rounded( cbl_round_t rounded, // 0.5 through 0.9 becomes 1 if( value < 0 ) { - if( fpart <= -0.5Q ) + if( fpart <= GCOB_FP128_LITERAL (-0.5) ) { retval -= 1; } } else { - if( fpart >= 0.5Q ) + if( fpart >= GCOB_FP128_LITERAL (0.5) ) { retval += 1; } @@ -1105,14 +1107,14 @@ f128_to_i128_rounded( cbl_round_t rounded, // 0.6 through 0.9 becomes 1 if( value < 0 ) { - if( fpart < -0.5Q ) + if( fpart < GCOB_FP128_LITERAL (-0.5) ) { retval -= 1; } } else { - if( fpart > 0.5Q ) + if( fpart > GCOB_FP128_LITERAL (0.5) ) { retval += 1; } @@ -1276,8 +1278,8 @@ int128_to_field(cblc_field_t *var, { value = -value; } - _Float128 tvalue = (_Float128 )value; - tvalue /= (_Float128 )__gg__power_of_ten(source_rdigits); + GCOB_FP128 tvalue = (GCOB_FP128 )value; + tvalue /= (GCOB_FP128 )__gg__power_of_ten(source_rdigits); // *(_Float128 *)location = tvalue; // memcpy because *(_Float128 *) requires a 16-byte boundary. memcpy(location, &tvalue, 16); @@ -2202,7 +2204,7 @@ extern "C" void __gg__clock_gettime(clockid_t clk_id, struct timespec *tp) { - const char *p = getenv("COB_CURRENT_DATE"); + const char *p = getenv("GCOBOL_CURRENT_DATE"); if( p ) { @@ -2573,7 +2575,7 @@ __gg__dirty_to_binary_internal( const char *dirty, } extern "C" -_Float128 +GCOB_FP128 __gg__dirty_to_float( const char *dirty, int length) { @@ -2589,7 +2591,7 @@ __gg__dirty_to_float( const char *dirty, // It also can handle 12345E-2 notation. - _Float128 retval = 0; + GCOB_FP128 retval = 0; int rdigits = 0; int hyphen = 0; @@ -3244,9 +3246,9 @@ format_for_display_internal(char **dest, // We can't use *(_Float64 *)actual_location; // That uses the SSE registers, which won't work if the source isn't // on a 16-bit boundary. - _Float128 floatval; + GCOB_FP128 floatval; memcpy(&floatval, actual_location, 16); - strfromf128(ach, sizeof(ach), "%.36E", floatval); + strfromfp128(ach, sizeof(ach), "%.36" FP128_FMT "E", floatval); char *p = strchr(ach, 'E'); if( !p ) { @@ -3268,8 +3270,8 @@ format_for_display_internal(char **dest, int precision = 36 - exp; char achFormat[24]; - sprintf(achFormat, "%%.%df", precision); - strfromf128(ach, sizeof(ach), achFormat, floatval); + sprintf(achFormat, "%%.%d" FP128_FMT "f", precision); + strfromfp128(ach, sizeof(ach), achFormat, floatval); } __gg__remove_trailing_zeroes(ach); __gg__realloc_if_necessary(dest, dest_size, strlen(ach)+1); @@ -3481,11 +3483,11 @@ compare_88( const char *list, return cmpval; } -static _Float128 +static GCOB_FP128 get_float128( cblc_field_t *field, unsigned char *location ) { - _Float128 retval=0; + GCOB_FP128 retval=0; if(field->type == FldFloat ) { switch( field->capacity ) @@ -3508,7 +3510,7 @@ get_float128( cblc_field_t *field, { if( __gg__decimal_point == '.' ) { - retval = strtof128(field->initial, NULL); + retval = strtofp128(field->initial, NULL); } else { @@ -3526,7 +3528,7 @@ get_float128( cblc_field_t *field, { *p = '.'; } - retval = strtof128(buffer, NULL); + retval = strtofp128(buffer, NULL); } } else @@ -3710,7 +3712,7 @@ compare_field_class(cblc_field_t *conditional, case FldFloat: { - _Float128 value = get_float128(conditional, conditional_location) ; + GCOB_FP128 value = get_float128(conditional, conditional_location) ; char *walker = list->initial; while(*walker) { @@ -3734,7 +3736,7 @@ compare_field_class(cblc_field_t *conditional, walker = right + right_len; - _Float128 left_value; + GCOB_FP128 left_value; if( left_flag == 'F' && left[0] == 'Z' ) { left_value = 0; @@ -3745,7 +3747,7 @@ compare_field_class(cblc_field_t *conditional, left_len); } - _Float128 right_value; + GCOB_FP128 right_value; if( right_flag == 'F' && right[0] == 'Z' ) { right_value = 0; @@ -3919,23 +3921,17 @@ __gg__compare_2(cblc_field_t *left_side, unsigned char *left_location, size_t left_length, int left_attr, - bool left_all, - bool left_address_of, + int left_flags, cblc_field_t *right_side, unsigned char *right_location, size_t right_length, int right_attr, - bool right_all, - bool right_address_of, + int right_flags, int second_time_through) { // First order of business: If right_side is a FldClass, pass that off // to the speciality squad: - // static size_t converted_initial_size = MINIMUM_ALLOCATION_SIZE; - // static unsigned char *converted_initial = - // (unsigned char *)malloc(converted_initial_size); - if( right_side->type == FldClass ) { return compare_field_class( left_side, @@ -3945,8 +3941,17 @@ __gg__compare_2(cblc_field_t *left_side, } // Serene in our conviction that the left_side isn't a FldClass, we - // move on: + // move on. + // Extract the individual flags from the flag words: + bool left_all = !!(left_flags & REFER_T_MOVE_ALL ); + bool left_address_of = !!(left_flags & REFER_T_ADDRESS_OF); + bool right_all = !!(right_flags & REFER_T_MOVE_ALL ); + bool right_address_of = !!(right_flags & REFER_T_ADDRESS_OF); +//bool left_refmod = !!(left_flags & REFER_T_REFMOD ); + bool right_refmod = !!(right_flags & REFER_T_REFMOD ); + + // Figure out if we have any figurative constants cbl_figconst_t left_figconst = (cbl_figconst_t)(left_attr & FIGCONST_MASK); cbl_figconst_t right_figconst = (cbl_figconst_t)(right_attr & FIGCONST_MASK); @@ -4097,7 +4102,7 @@ __gg__compare_2(cblc_field_t *left_side, case FldFloat: { - _Float128 value = __gg__float128_from_location(left_side, + GCOB_FP128 value = __gg__float128_from_location(left_side, left_location); retval = 0; retval = value < 0 ? -1 : retval; @@ -4154,8 +4159,8 @@ __gg__compare_2(cblc_field_t *left_side, if( left_side->type == FldFloat && right_side->type == FldFloat ) { // One or the other of the numerics is a FldFloat - _Float128 left_value = __gg__float128_from_location(left_side, left_location); - _Float128 right_value = __gg__float128_from_location(right_side, right_location); + GCOB_FP128 left_value = __gg__float128_from_location(left_side, left_location); + GCOB_FP128 right_value = __gg__float128_from_location(right_side, right_location); retval = 0; retval = left_value < right_value ? -1 : retval; retval = left_value > right_value ? 1 : retval; @@ -4167,8 +4172,8 @@ __gg__compare_2(cblc_field_t *left_side, { // The left side is a FldFloat; the other is another type of numeric: int rdecimals; - _Float128 left_value; - _Float128 right_value; + GCOB_FP128 left_value; + GCOB_FP128 right_value; if( right_side->type == FldLiteralN) { @@ -4200,7 +4205,7 @@ __gg__compare_2(cblc_field_t *left_side, case 4: { _Float32 left_value = *(_Float32 *)left_location; - _Float32 right_value = strtof32(buffer, NULL); + _Float32 right_value = strtof(buffer, NULL); retval = 0; retval = left_value < right_value ? -1 : retval; retval = left_value > right_value ? 1 : retval; @@ -4209,7 +4214,7 @@ __gg__compare_2(cblc_field_t *left_side, case 8: { _Float64 left_value = *(_Float64 *)left_location; - _Float64 right_value = strtof64(buffer, NULL); + _Float64 right_value = strtod(buffer, NULL); retval = 0; retval = left_value < right_value ? -1 : retval; retval = left_value > right_value ? 1 : retval; @@ -4218,9 +4223,9 @@ __gg__compare_2(cblc_field_t *left_side, case 16: { //_Float128 left_value = *(_Float128 *)left_location; - _Float128 left_value; + GCOB_FP128 left_value; memcpy(&left_value, left_location, 16); - _Float128 right_value = strtof128(buffer, NULL); + GCOB_FP128 right_value = strtofp128(buffer, NULL); retval = 0; retval = left_value < right_value ? -1 : retval; retval = left_value > right_value ? 1 : retval; @@ -4302,6 +4307,23 @@ __gg__compare_2(cblc_field_t *left_side, { // We are comparing an alphanumeric to a numeric. + // The right side is numeric. Sometimes people write code where they + // take the refmod of a numeric displays. If somebody did that here, + // just do a complete straight-up character by character comparison: + + if( right_refmod ) + { + retval = compare_strings( (char *)left_location, + left_length, + left_all, + (char *)right_location, + right_length, + right_all); + compare = true; + goto fixup_retval; + } + + // The trick here is to convert the numeric to its display form, // and compare that to the alphanumeric. For example, when comparing // a VAL5 PIC X(3) VALUE 5 to literals, @@ -4310,7 +4332,6 @@ __gg__compare_2(cblc_field_t *left_side, // VAL5 EQUAL 005 is TRUE // VAL5 EQUAL "5" is FALSE // VAL5 EQUAL "005" is TRUE - if( left_side->type == FldLiteralA ) { left_location = (unsigned char *)left_side->data; @@ -4373,14 +4394,12 @@ fixup_retval: right_location, right_length, right_attr, - right_all, - right_address_of, + right_flags, left_side, left_location, left_length, left_attr, - left_all, - left_address_of, + left_flags, 1); // And reverse the sense of the return value: compare = true; @@ -4428,14 +4447,12 @@ __gg__compare(struct cblc_field_t *left, left->data + left_offset, left_length, left->attr, - !!(left_flags & REFER_T_MOVE_ALL), - !!(left_flags & REFER_T_ADDRESS_OF), + left_flags, right, right->data + right_offset, right_length, right->attr, - !!(right_flags & REFER_T_MOVE_ALL), - !!(right_flags & REFER_T_ADDRESS_OF), + right_flags, second_time_through); return retval; } @@ -5710,7 +5727,7 @@ __gg__move( cblc_field_t *fdest, case 16: { //_Float128 val = *(_Float128 *)(fsource->data+source_offset); - _Float128 val; + GCOB_FP128 val; memcpy(&val, fsource->data+source_offset, 16); if(val < 0) { @@ -5798,7 +5815,7 @@ __gg__move( cblc_field_t *fdest, // We are converted a floating-point value fixed-point rdigits = get_scaled_rdigits(fdest); - _Float128 value=0; + GCOB_FP128 value=0; switch(fsource->capacity) { case 4: @@ -5948,18 +5965,18 @@ __gg__move( cblc_field_t *fdest, { case 4: { - *(float *)(fdest->data+dest_offset) = strtof32(ach, NULL); + *(float *)(fdest->data+dest_offset) = strtof(ach, NULL); break; } case 8: { - *(double *)(fdest->data+dest_offset) = strtof64(ach, NULL); + *(double *)(fdest->data+dest_offset) = strtod(ach, NULL); break; } case 16: { - //*(_Float128 *)(fdest->data+dest_offset) = strtof128(ach, NULL); - _Float128 t = strtof128(ach, NULL); + //*(_Float128 *)(fdest->data+dest_offset) = strtofp128(ach, NULL); + GCOB_FP128 t = strtofp128(ach, NULL); memcpy(fdest->data+dest_offset, &t, 16); break; } @@ -6118,17 +6135,17 @@ __gg__move_literala(cblc_field_t *field, { case 4: { - *(float *)(field->data+field_offset) = strtof32(ach, NULL); + *(float *)(field->data+field_offset) = strtof(ach, NULL); break; } case 8: { - *(double *)(field->data+field_offset) = strtof64(ach, NULL); + *(double *)(field->data+field_offset) = strtod(ach, NULL); break; } case 16: { - _Float128 t = strtof128(ach, NULL); + GCOB_FP128 t = strtofp128(ach, NULL); memcpy(field->data+field_offset, &t, 16); break; } @@ -9112,10 +9129,10 @@ __gg__binary_value_from_qualified_field(int *rdigits, } extern "C" -_Float128 +GCOB_FP128 __gg__float128_from_field( cblc_field_t *field ) { - _Float128 retval=0; + GCOB_FP128 retval=0; if( field->type == FldFloat || field->type == FldLiteralN ) { retval = get_float128(field, field->data); @@ -9123,20 +9140,20 @@ __gg__float128_from_field( cblc_field_t *field ) else { int rdigits; - retval = (_Float128)__gg__binary_value_from_field(&rdigits, field); + retval = (GCOB_FP128)__gg__binary_value_from_field(&rdigits, field); if( rdigits ) { - retval /= (_Float128)__gg__power_of_ten(rdigits); + retval /= (GCOB_FP128)__gg__power_of_ten(rdigits); } } return retval; } extern "C" -_Float128 +GCOB_FP128 __gg__float128_from_qualified_field( cblc_field_t *field, size_t offset, size_t size) { - _Float128 retval=0; + GCOB_FP128 retval=0; if( field->type == FldFloat || field->type == FldLiteralN ) { retval = get_float128(field, field->data+offset); @@ -9144,10 +9161,10 @@ __gg__float128_from_qualified_field( cblc_field_t *field, size_t offset, size_t else { int rdigits; - retval = (_Float128)__gg__binary_value_from_qualified_field(&rdigits, field, offset, size); + retval = (GCOB_FP128)__gg__binary_value_from_qualified_field(&rdigits, field, offset, size); if( rdigits ) { - retval /= (_Float128)__gg__power_of_ten(rdigits); + retval /= (GCOB_FP128)__gg__power_of_ten(rdigits); } } return retval; @@ -9213,7 +9230,7 @@ __gg__int128_to_qualified_field(cblc_field_t *tgt, static __int128 float128_to_int128( int *rdigits, cblc_field_t *field, - _Float128 value, + GCOB_FP128 value, cbl_round_t rounded, int *compute_error) { @@ -9238,7 +9255,7 @@ float128_to_int128( int *rdigits, // get away with. // Calculate the number of digits to the left of the decimal point: - int digits = (int)(floorf128(logf128(fabsf128(value)))+1); + int digits = (int)(FP128_FUNC(floor)(FP128_FUNC(log)(FP128_FUNC(fabs)(value)))+1); // Make sure it is not a negative number digits = std::max(0, digits); @@ -9255,12 +9272,12 @@ float128_to_int128( int *rdigits, // We now multiply our value by 10**rdigits, in order to make the // floating-point value have the same magnitude as our target __int128 - value *= powf128(10.0Q, (_Float128)(*rdigits)); + value *= FP128_FUNC(pow)(GCOB_FP128_LITERAL (10.0), (GCOB_FP128)(*rdigits)); // We are ready to cast value to an __int128. But this value could be // too large to fit, which is an error condition we want to flag: - if( fabsf128(value) >= 1.0E38Q ) + if( FP128_FUNC(fabs)(value) >= GCOB_FP128_LITERAL (1.0E38) ) { *compute_error = compute_error_overflow; } @@ -9277,7 +9294,7 @@ static void float128_to_location( cblc_field_t *tgt, unsigned char *data, size_t size, - _Float128 value, + GCOB_FP128 value, enum cbl_round_t rounded, int *compute_error) { @@ -9288,8 +9305,8 @@ float128_to_location( cblc_field_t *tgt, switch(tgt->capacity) { case 4: - if( fabsf128(value) == (_Float128)INFINITY - || fabsf128(value) > 3.4028235E38Q ) + if( FP128_FUNC(fabs)(value) == (GCOB_FP128)INFINITY + || FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) ) { if( compute_error ) { @@ -9311,8 +9328,8 @@ float128_to_location( cblc_field_t *tgt, break; case 8: - if( fabsf128(value) == (_Float128)INFINITY - || fabsf128(value) > 1.7976931348623157E308Q ) + if( FP128_FUNC(fabs)(value) == (GCOB_FP128)INFINITY + || FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (1.7976931348623157E308) ) { if( compute_error ) { @@ -9334,7 +9351,7 @@ float128_to_location( cblc_field_t *tgt, break; case 16: - if( fabsf128(value) == (_Float128)INFINITY ) + if( FP128_FUNC(fabs)(value) == (GCOB_FP128)INFINITY ) { if( compute_error ) { @@ -9363,7 +9380,7 @@ float128_to_location( cblc_field_t *tgt, digits = tgt->digits; } - _Float128 maximum; + GCOB_FP128 maximum; if( digits ) { @@ -9372,7 +9389,7 @@ float128_to_location( cblc_field_t *tgt, // When digits is zero, this is a binary value without a PICTURE string. // we don't truncate in that case - if( digits && fabsf128(value) >= maximum ) + if( digits && FP128_FUNC(fabs)(value) >= maximum ) { *compute_error |= compute_error_truncate; } @@ -9400,7 +9417,7 @@ float128_to_location( cblc_field_t *tgt, extern "C" void __gg__float128_to_field(cblc_field_t *tgt, - _Float128 value, + GCOB_FP128 value, enum cbl_round_t rounded, int *compute_error) { @@ -9416,7 +9433,7 @@ extern "C" void __gg__float128_to_qualified_field(cblc_field_t *tgt, size_t tgt_offset, - _Float128 value, + GCOB_FP128 value, enum cbl_round_t rounded, int *compute_error) { @@ -10394,7 +10411,7 @@ __gg__fetch_call_by_value_value(cblc_field_t *field, case 16: // *(_Float128 *)(&retval) = double(*(_Float128 *)data); - _Float128 t; + GCOB_FP128 t; memcpy(&t, data, 16); memcpy(&retval, &t, 16); break; @@ -10455,7 +10472,7 @@ __gg__assign_value_from_stack(cblc_field_t *dest, __int128 parameter) case 16: // *(_Float128 *)(dest->data) = *(_Float128 *)¶meter; - _Float128 t; + GCOB_FP128 t; memcpy(&t, ¶meter, 16); memcpy(dest->data, &t, 16); break; @@ -10968,13 +10985,6 @@ class match_file_declarative { bool operator()( const cbl_declarative_t& dcl ) { - if( getenv("match_declarative") && oops.type) { - warnx("match_file_declarative: checking: oops %s dcl %s (handled %s) ", - local_ec_type_str(oops.type), - local_ec_type_str(dcl.type), - local_ec_type_str(handled_type)); - } - // Declarative is for the raised exception and not handled by the statement. if( handled() ) return false; bool matches = enabled_ECs.match(dcl.type); @@ -10988,13 +10998,6 @@ class match_file_declarative { } } - if( matches && getenv("match_declarative") ) { - warnx(" matches exception %s (file %zu mode %s)", - local_ec_type_str(oops.type), - oops.file, - cbl_file_mode_str(oops.mode)); - } - return matches; } }; @@ -11194,25 +11197,12 @@ __gg__match_exception( cblc_field_t *index, p = std::find_if( dcls + 1, eodcls, [ec] (const cbl_declarative_t& dcl) { if( ! enabled_ECs.match(dcl.type) ) return false; if( ! ec_cmp(ec, dcl.type) ) return false; - - if( getenv("match_declarative") ) { - warnx("__gg__match_exception:%d: matched " - "%s against mask %s for section #%zu", - __LINE__, - local_ec_type_str(ec), local_ec_type_str(dcl.type), - dcl.section); - } return true; } ); if( p == eodcls ) { default_exception_handler(ec); } } else { // not enabled - if( getenv("match_declarative") ) { - warnx("__gg__match_exception:%d: raised exception " - "%s is disabled (%zu enabled)", __LINE__, - local_ec_type_str(ec), enabled_ECs.nec); - } } } @@ -11291,10 +11281,10 @@ __gg__pseudo_return_flush() } extern "C" -_Float128 +GCOB_FP128 __gg__float128_from_location(cblc_field_t *var, unsigned char *location) { - _Float128 retval = 0; + GCOB_FP128 retval = 0; switch( var->capacity ) { case 4: @@ -11323,9 +11313,9 @@ extern "C" __int128 __gg__integer_from_float128(cblc_field_t *field) { - _Float128 fvalue = __gg__float128_from_location(field, field->data); + GCOB_FP128 fvalue = __gg__float128_from_location(field, field->data); // we round() to take care of the possible 2.99999999999... problem. - fvalue = roundf128(fvalue); + fvalue = FP128_FUNC(round)(fvalue); return (__int128)fvalue; } @@ -11444,10 +11434,6 @@ extern "C" void __gg__set_exception_file(cblc_file_t *file) { - if( getenv("match_declarative") ) - { - warnx("%s: %s", __func__, file->name); - } recent_file = file; ec_type_t ec = local_ec_type_of( file->io_status ); if( ec ) @@ -11504,10 +11490,6 @@ extern "C" void __gg__set_exception_code(ec_type_t ec, int from_raise_statement) { - if( getenv("match_declarative") ) - { - warnx("%s: raised %02x", __func__, ec); - } sv_from_raise_statement = from_raise_statement; __gg__exception_code = ec; @@ -11551,13 +11533,13 @@ __gg__float32_from_int128(cblc_field_t *destination, int *size_error) { int rdigits; - _Float128 value = get_binary_value_local( &rdigits, + GCOB_FP128 value = get_binary_value_local( &rdigits, source, source->data + source_offset, source->capacity); value /= __gg__power_of_ten(rdigits); - if( fabsf128(value) > 3.4028235E38Q ) + if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) ) { if(size_error) { @@ -11592,7 +11574,7 @@ __gg__float64_from_int128(cblc_field_t *destination, *size_error = 0; } int rdigits; - _Float128 value = get_binary_value_local( &rdigits, + GCOB_FP128 value = get_binary_value_local( &rdigits, source, source->data + source_offset, source->capacity); @@ -11615,7 +11597,7 @@ __gg__float128_from_int128(cblc_field_t *destination, { if(size_error) *size_error = 0; int rdigits; - _Float128 value = get_binary_value_local( &rdigits, + GCOB_FP128 value = get_binary_value_local( &rdigits, source, source->data + source_offset, source->capacity); @@ -11642,7 +11624,7 @@ __gg__is_float_infinite(cblc_field_t *source, size_t offset) break; case 16: // retval = *(_Float128*)(source->data+offset) == INFINITY; - _Float128 t; + GCOB_FP128 t; memcpy(&t, source->data+offset, 16); retval = t == INFINITY; break; @@ -11659,9 +11641,9 @@ __gg__float32_from_128( cblc_field_t *dest, { int retval = 0; //_Float128 value = *(_Float128*)(source->data+source_offset); - _Float128 value; + GCOB_FP128 value; memcpy(&value, source->data+source_offset, 16); - if( fabsf128(value) > 3.4028235E38Q ) + if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) ) { retval = 1; } @@ -11681,7 +11663,7 @@ __gg__float32_from_64( cblc_field_t *dest, { int retval = 0; _Float64 value = *(_Float64*)(source->data+source_offset); - if( fabsf128(value) > 3.4028235E38Q ) + if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) ) { retval = 1; } @@ -11701,9 +11683,9 @@ __gg__float64_from_128( cblc_field_t *dest, { int retval = 0; // _Float128 value = *(_Float128*)(source->data+source_offset); - _Float128 value; + GCOB_FP128 value; memcpy(&value, source->data+source_offset, 16); - if( fabsf128(value) > 1.7976931348623157E308 ) + if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL(1.7976931348623157E308) ) { retval = 1; } @@ -11955,7 +11937,7 @@ __gg__function_handle_from_cobpath( char *unmangled_name, char *mangled_name) } if( !retval ) { - const char *COBPATH = getenv("COBPATH"); + const char *COBPATH = getenv("GCOBOL_LIBRARY_PATH"); retval = find_in_dirs(COBPATH, unmangled_name, mangled_name); } if( !retval ) diff --git a/libgcobol/libgcobol.h b/libgcobol/libgcobol.h index 1fc7abc..f35987d 100644 --- a/libgcobol/libgcobol.h +++ b/libgcobol/libgcobol.h @@ -54,14 +54,12 @@ extern "C" int __gg__compare_2( cblc_field_t *left_side, unsigned char *left_location, size_t left_length, int left_attr, - bool left_all, - bool left_address_of, + int left_flags, cblc_field_t *right_side, unsigned char *right_location, size_t right_length, int right_attr, - bool right_all, - bool right_address_of, + int right_flags, int second_time_through); extern "C" void __gg__int128_to_field(cblc_field_t *tgt, __int128 value, @@ -69,7 +67,7 @@ extern "C" void __gg__int128_to_field(cblc_field_t *tgt, enum cbl_round_t rounded, int *compute_error); extern "C" void __gg__float128_to_field(cblc_field_t *tgt, - _Float128 value, + GCOB_FP128 value, enum cbl_round_t rounded, int *compute_error); extern "C" void __gg__int128_to_qualified_field(cblc_field_t *tgt, @@ -81,10 +79,9 @@ extern "C" void __gg__int128_to_qualified_field(cblc_field_t *tgt, int *compute_error); extern "C" void __gg__float128_to_qualified_field(cblc_field_t *tgt, size_t tgt_offset, - _Float128 value, + GCOB_FP128 value, enum cbl_round_t rounded, int *compute_error); - extern "C" void __gg__double_to_target( cblc_field_t *tgt, double tgt_value, cbl_round_t rounded); @@ -93,7 +90,8 @@ extern "C" char __gg__get_decimal_point(); extern "C" char * __gg__get_default_currency_string(); extern "C" void __gg__clock_gettime(clockid_t clk_id, struct timespec *tp); -extern "C" _Float128 __gg__float128_from_location(cblc_field_t *var, + +extern "C" GCOB_FP128 __gg__float128_from_location(cblc_field_t *var, unsigned char *location); extern "C" void __gg__adjust_dest_size(cblc_field_t *dest, size_t ncount); @@ -106,7 +104,7 @@ extern "C" __int128 __gg__binary_value_from_qualified_field(int *rdigits, cblc_field_t *var, size_t offset, size_t size); -extern "C" _Float128 __gg__float128_from_qualified_field(cblc_field_t *field, +extern "C" GCOB_FP128 __gg__float128_from_qualified_field(cblc_field_t *field, size_t offset, size_t size); extern "C" __int128 __gg__integer_from_qualified_field(cblc_field_t *var, diff --git a/libgcobol/libgcobol.spec.in b/libgcobol/libgcobol.spec.in new file mode 100644 index 0000000..461587d --- /dev/null +++ b/libgcobol/libgcobol.spec.in @@ -0,0 +1,8 @@ +# +# This spec file is read by gcobol when linking. +# It is used to specify the libraries we need to link in, in the right +# order. +# + +%rename lib liborig +*lib: @LIBQUADSPEC@ @LIBM@ %(liborig) diff --git a/libgcobol/valconv.cc b/libgcobol/valconv.cc index 33d9a0d..7e58301 100644 --- a/libgcobol/valconv.cc +++ b/libgcobol/valconv.cc @@ -853,14 +853,14 @@ got_float: } else { - const char *decimal_location = index(dest, __gg__decimal_point); + const char *decimal_location = strchr(dest, __gg__decimal_point); if( !decimal_location ) { - decimal_location = index(dest, ascii_v); + decimal_location = strchr(dest, ascii_v); } if( !decimal_location ) { - decimal_location = index(dest, ascii_V); + decimal_location = strchr(dest, ascii_V); } if( !decimal_location ) { |