configure
上传用户:qaz666999
上传日期:2022-08-06
资源大小:2570k
文件大小:938k
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
- os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
- osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
- rdos*)
- dynamic_linker=no
- ;;
- solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
- sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
- sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
- sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
- tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
- *)
- dynamic_linker=no
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
- $as_echo "$dynamic_linker" >&6; }
- test "$dynamic_linker" = no && can_build_shared=no
- variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
- if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
- fi
- if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
- fi
- if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
- $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
- hardcode_action_F77=
- if test -n "$hardcode_libdir_flag_spec_F77" ||
- test -n "$runpath_var_F77" ||
- test "X$hardcode_automatic_F77" = "Xyes" ; then
- # We can hardcode non-existent directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
- else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5
- $as_echo "$hardcode_action_F77" >&6; }
- if test "$hardcode_action_F77" = relink ||
- test "$inherit_rpath_F77" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
- elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
- fi
- fi # test -n "$compiler"
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
- fi # test "$_lt_disable_F77" != 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:
- # Generate an error here if attempting to build both shared and static when
- # $libname.a is in $library_names_spec (as mentioned above), rather than
- # wait for ar or ld to fail.
- #
- if test "$enable_shared" = yes && test "$enable_static" = yes; then
- case $library_names_spec in
- *libname.a*)
- as_fn_error "cannot create both shared and static libraries on this system, --disable one of the two" "$LINENO" 5
- ;;
- esac
- fi
- if test "$enable_static" = yes; then
- ENABLE_STATIC_TRUE=
- ENABLE_STATIC_FALSE='#'
- else
- ENABLE_STATIC_TRUE='#'
- ENABLE_STATIC_FALSE=
- fi
- # Many of these library and header checks are for the benefit of
- # supplementary programs. libgmp doesn't use anything too weird.
- { $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 test "${ac_cv_header_stdc+set}" = set; 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
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
- $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
- if test "${ac_cv_header_time+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <sys/types.h>
- #include <sys/time.h>
- #include <time.h>
- int
- main ()
- {
- if ((struct tm *) 0)
- return 0;
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_time=yes
- else
- ac_cv_header_time=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
- $as_echo "$ac_cv_header_time" >&6; }
- if test $ac_cv_header_time = yes; then
- $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
- fi
- # Reasons for testing:
- # float.h - not in SunOS bundled cc
- # invent.h - IRIX specific
- # langinfo.h - X/Open standard only, not in djgpp for instance
- # locale.h - old systems won't have this
- # nl_types.h - X/Open standard only, not in djgpp for instance
- # (usually langinfo.h gives nl_item etc, but not on netbsd 1.4.1)
- # sys/attributes.h - IRIX specific
- # sys/iograph.h - IRIX specific
- # sys/mman.h - not in Cray Unicos
- # sys/param.h - not in mingw
- # sys/processor.h - solaris specific, though also present in macos
- # sys/pstat.h - HPUX specific
- # sys/resource.h - not in mingw
- # sys/sysctl.h - not in mingw
- # sys/sysinfo.h - OSF specific
- # sys/syssgi.h - IRIX specific
- # sys/systemcfg.h - AIX specific
- # sys/time.h - autoconf suggests testing, don't know anywhere without it
- # sys/times.h - not in mingw
- # machine/hal_sysinfo.h - OSF specific
- #
- # inttypes.h, stdint.h, unistd.h and sys/types.h are already in the autoconf
- # default tests
- #
- for ac_header in fcntl.h float.h invent.h langinfo.h locale.h nl_types.h sys/attributes.h sys/iograph.h sys/mman.h sys/param.h sys/processor.h sys/pstat.h sys/sysinfo.h sys/syssgi.h sys/systemcfg.h sys/time.h sys/times.h
- do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
- ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
- eval as_val=$$as_ac_Header
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
- _ACEOF
- fi
- done
- # On SunOS, sys/resource.h needs sys/time.h (for struct timeval)
- for ac_header in sys/resource.h
- do :
- ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "#if TIME_WITH_SYS_TIME
- # include <sys/time.h>
- # include <time.h>
- #else
- # if HAVE_SYS_TIME_H
- # include <sys/time.h>
- # else
- # include <time.h>
- # endif
- #endif
- "
- if test "x$ac_cv_header_sys_resource_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_SYS_RESOURCE_H 1
- _ACEOF
- fi
- done
- # On NetBSD and OpenBSD, sys/sysctl.h needs sys/param.h for various constants
- for ac_header in sys/sysctl.h
- do :
- ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#if HAVE_SYS_PARAM_H
- # include <sys/param.h>
- #endif
- "
- if test "x$ac_cv_header_sys_sysctl_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_SYS_SYSCTL_H 1
- _ACEOF
- fi
- done
- # On OSF 4.0, <machine/hal_sysinfo.h> must have <sys/sysinfo.h> for ulong_t
- for ac_header in machine/hal_sysinfo.h
- do :
- ac_fn_c_check_header_compile "$LINENO" "machine/hal_sysinfo.h" "ac_cv_header_machine_hal_sysinfo_h" "#if HAVE_SYS_SYSINFO_H
- # include <sys/sysinfo.h>
- #endif
- "
- if test "x$ac_cv_header_machine_hal_sysinfo_h" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_MACHINE_HAL_SYSINFO_H 1
- _ACEOF
- fi
- done
- # Reasons for testing:
- # optarg - not declared in mingw
- # fgetc, fscanf, ungetc, vfprintf - not declared in SunOS 4
- # sys_errlist, sys_nerr - not declared in SunOS 4
- #
- # optarg should be in unistd.h and the rest in stdio.h, both of which are
- # in the autoconf default includes.
- #
- # sys_errlist and sys_nerr are supposed to be in <errno.h> on SunOS according
- # to the man page (but aren't), in glibc they're in stdio.h.
- #
- ac_fn_c_check_decl "$LINENO" "fgetc" "ac_cv_have_decl_fgetc" "$ac_includes_default"
- if test "x$ac_cv_have_decl_fgetc" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_FGETC $ac_have_decl
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "fscanf" "ac_cv_have_decl_fscanf" "$ac_includes_default"
- if test "x$ac_cv_have_decl_fscanf" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_FSCANF $ac_have_decl
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "optarg" "ac_cv_have_decl_optarg" "$ac_includes_default"
- if test "x$ac_cv_have_decl_optarg" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_OPTARG $ac_have_decl
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "ungetc" "ac_cv_have_decl_ungetc" "$ac_includes_default"
- if test "x$ac_cv_have_decl_ungetc" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_UNGETC $ac_have_decl
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "vfprintf" "ac_cv_have_decl_vfprintf" "$ac_includes_default"
- if test "x$ac_cv_have_decl_vfprintf" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_VFPRINTF $ac_have_decl
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "sys_errlist" "ac_cv_have_decl_sys_errlist" "#include <stdio.h>
- #include <errno.h>
- "
- if test "x$ac_cv_have_decl_sys_errlist" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_SYS_ERRLIST $ac_have_decl
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "sys_nerr" "ac_cv_have_decl_sys_nerr" "#include <stdio.h>
- #include <errno.h>
- "
- if test "x$ac_cv_have_decl_sys_nerr" = x""yes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
- fi
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DECL_SYS_NERR $ac_have_decl
- _ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
- $as_echo_n "checking return type of signal handlers... " >&6; }
- if test "${ac_cv_type_signal+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <sys/types.h>
- #include <signal.h>
- int
- main ()
- {
- return *(signal (0, 0)) (0) == 1;
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_type_signal=int
- else
- ac_cv_type_signal=void
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
- $as_echo "$ac_cv_type_signal" >&6; }
- cat >>confdefs.h <<_ACEOF
- #define RETSIGTYPE $ac_cv_type_signal
- _ACEOF
- # Reasons for testing:
- # intmax_t - C99
- # long double - not in the HP bundled K&R cc
- # long long - only in reasonably recent compilers
- # ptrdiff_t - seems to be everywhere, maybe don't need to check this
- # quad_t - BSD specific
- # uint_least32_t - C99
- #
- # the default includes are sufficient for all these types
- #
- ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default"
- if test "x$ac_cv_type_intmax_t" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_INTMAX_T 1
- _ACEOF
- fi
- ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default"
- if test "x$ac_cv_type_long_double" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LONG_DOUBLE 1
- _ACEOF
- fi
- ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default"
- if test "x$ac_cv_type_long_long" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LONG_LONG 1
- _ACEOF
- fi
- ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
- if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_PTRDIFF_T 1
- _ACEOF
- fi
- ac_fn_c_check_type "$LINENO" "quad_t" "ac_cv_type_quad_t" "$ac_includes_default"
- if test "x$ac_cv_type_quad_t" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_QUAD_T 1
- _ACEOF
- fi
- ac_fn_c_check_type "$LINENO" "uint_least32_t" "ac_cv_type_uint_least32_t" "$ac_includes_default"
- if test "x$ac_cv_type_uint_least32_t" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_UINT_LEAST32_T 1
- _ACEOF
- fi
- ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
- if test "x$ac_cv_type_intptr_t" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_INTPTR_T 1
- _ACEOF
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for preprocessor stringizing operator" >&5
- $as_echo_n "checking for preprocessor stringizing operator... " >&6; }
- if test "${ac_cv_c_stringize+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #define x(y) #y
- char *s = x(teststring);
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "#teststring" >/dev/null 2>&1; then :
- ac_cv_c_stringize=no
- else
- ac_cv_c_stringize=yes
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stringize" >&5
- $as_echo "$ac_cv_c_stringize" >&6; }
- if test $ac_cv_c_stringize = yes; then
- $as_echo "#define HAVE_STRINGIZE 1" >>confdefs.h
- fi
- # FIXME: Really want #ifndef __cplusplus around the #define volatile
- # replacement autoconf gives, since volatile is always available in C++.
- # But we don't use it in C++ currently.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
- $as_echo_n "checking for working volatile... " >&6; }
- if test "${ac_cv_c_volatile+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- int
- main ()
- {
- volatile int x;
- int * volatile y = (int *) 0;
- return !x && !y;
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_volatile=yes
- else
- ac_cv_c_volatile=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
- $as_echo "$ac_cv_c_volatile" >&6; }
- if test $ac_cv_c_volatile = no; then
- $as_echo "#define volatile /**/" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
- $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
- if test "${ac_cv_c_restrict+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_c_restrict=no
- # The order here caters to the fact that C++ does not require restrict.
- for ac_kw in __restrict __restrict__ _Restrict restrict; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- typedef int * int_ptr;
- int foo (int_ptr $ac_kw ip) {
- return ip[0];
- }
- int
- main ()
- {
- int s[1];
- int * $ac_kw t = s;
- t[0] = 0;
- return foo(t)
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_restrict=$ac_kw
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_restrict" != no && break
- done
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
- $as_echo "$ac_cv_c_restrict" >&6; }
- case $ac_cv_c_restrict in
- restrict) ;;
- no) $as_echo "#define restrict /**/" >>confdefs.h
- ;;
- *) cat >>confdefs.h <<_ACEOF
- #define restrict $ac_cv_c_restrict
- _ACEOF
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <stdarg.h> exists and works" >&5
- $as_echo_n "checking whether <stdarg.h> exists and works... " >&6; }
- if test "${gmp_cv_c_stdarg+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <stdarg.h>
- int foo (int x, ...)
- {
- va_list ap;
- int y;
- va_start (ap, x);
- y = va_arg (ap, int);
- va_end (ap);
- return y;
- }
- int
- main ()
- {
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- gmp_cv_c_stdarg=yes
- else
- gmp_cv_c_stdarg=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_stdarg" >&5
- $as_echo "$gmp_cv_c_stdarg" >&6; }
- if test $gmp_cv_c_stdarg = yes; then
- $as_echo "#define HAVE_STDARG 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((const)) works" >&5
- $as_echo_n "checking whether gcc __attribute__ ((const)) works... " >&6; }
- if test "${gmp_cv_c_attribute_const+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- int foo (int x) __attribute__ ((const));
- int
- main ()
- {
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- gmp_cv_c_attribute_const=yes
- else
- gmp_cv_c_attribute_const=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_const" >&5
- $as_echo "$gmp_cv_c_attribute_const" >&6; }
- if test $gmp_cv_c_attribute_const = yes; then
- $as_echo "#define HAVE_ATTRIBUTE_CONST 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((malloc)) works" >&5
- $as_echo_n "checking whether gcc __attribute__ ((malloc)) works... " >&6; }
- if test "${gmp_cv_c_attribute_malloc+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.c <<EOF
- void *foo (int x) __attribute__ ((malloc));
- EOF
- gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_compile""; } >&5
- (eval $gmp_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- if grep "attribute directive ignored" conftest.out >/dev/null; then
- gmp_cv_c_attribute_malloc=no
- else
- gmp_cv_c_attribute_malloc=yes
- fi
- else
- gmp_cv_c_attribute_malloc=no
- fi
- cat conftest.out >&5
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_malloc" >&5
- $as_echo "$gmp_cv_c_attribute_malloc" >&6; }
- if test $gmp_cv_c_attribute_malloc = yes; then
- $as_echo "#define HAVE_ATTRIBUTE_MALLOC 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((mode (XX))) works" >&5
- $as_echo_n "checking whether gcc __attribute__ ((mode (XX))) works... " >&6; }
- if test "${gmp_cv_c_attribute_mode+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- typedef int SItype __attribute__ ((mode (SI)));
- int
- main ()
- {
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- gmp_cv_c_attribute_mode=yes
- else
- gmp_cv_c_attribute_mode=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_mode" >&5
- $as_echo "$gmp_cv_c_attribute_mode" >&6; }
- if test $gmp_cv_c_attribute_mode = yes; then
- $as_echo "#define HAVE_ATTRIBUTE_MODE 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc __attribute__ ((noreturn)) works" >&5
- $as_echo_n "checking whether gcc __attribute__ ((noreturn)) works... " >&6; }
- if test "${gmp_cv_c_attribute_noreturn+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- void foo (int x) __attribute__ ((noreturn));
- int
- main ()
- {
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- gmp_cv_c_attribute_noreturn=yes
- else
- gmp_cv_c_attribute_noreturn=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_attribute_noreturn" >&5
- $as_echo "$gmp_cv_c_attribute_noreturn" >&6; }
- if test $gmp_cv_c_attribute_noreturn = yes; then
- $as_echo "#define HAVE_ATTRIBUTE_NORETURN 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
- $as_echo_n "checking for inline... " >&6; }
- if test "${ac_cv_c_inline+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_c_inline=no
- for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #ifndef __cplusplus
- typedef int foo_t;
- static $ac_kw foo_t static_foo () {return 0; }
- $ac_kw foo_t foo () {return 0; }
- #endif
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
- done
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
- $as_echo "$ac_cv_c_inline" >&6; }
- case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
- #ifndef __cplusplus
- #define inline $ac_val
- #endif
- _ACEOF
- ;;
- esac
- case $ac_cv_c_inline in
- no) ;;
- *)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #define __GMP_WITHIN_CONFIGURE_INLINE 1
- #define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
- #define GMP_NAIL_BITS $GMP_NAIL_BITS
- #define GMP_LIMB_BITS 123
- $DEFN_LONG_LONG_LIMB
- #include "$srcdir/gmp-h.in"
- #ifndef __GMP_EXTERN_INLINE
- die die die
- #endif
- int
- main ()
- {
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- else
- case $ac_cv_c_inline in
- yes) tmp_inline=inline ;;
- *) tmp_inline=$ac_cv_c_inline ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gmp.h doesnt recognise compiler "$tmp_inline", inlines will be unavailable" >&5
- $as_echo "$as_me: WARNING: gmp.h doesnt recognise compiler "$tmp_inline", inlines will be unavailable" >&2;}
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ;;
- esac
- # from libtool
- LIBM=
- case $host in
- *-*-beos* | *-*-cygwin* | *-*-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 test "${ac_cv_lib_mw__mwvalidcheckl+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
- LIBS="-lmw $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 _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" = x""yes; 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 test "${ac_cv_lib_m_cos+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
- LIBS="-lm $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 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" = x""yes; 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 test "${ac_cv_lib_m_cos+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
- LIBS="-lm $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 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" = x""yes; then :
- LIBM="-lm"
- fi
- ;;
- esac
- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
- # for constant arguments. Useless!
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
- $as_echo_n "checking for working alloca.h... " >&6; }
- if test "${gmp_cv_header_alloca+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <alloca.h>
- int
- main ()
- {
- char *p = (char *) alloca (2 * sizeof (int));
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- gmp_cv_header_alloca=yes
- else
- gmp_cv_header_alloca=no
- fi
- rm -f core conftest.err conftest.$ac_objext
- conftest$ac_exeext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_header_alloca" >&5
- $as_echo "$gmp_cv_header_alloca" >&6; }
- if test $gmp_cv_header_alloca = yes; then
- $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca (via gmp-impl.h)" >&5
- $as_echo_n "checking for alloca (via gmp-impl.h)... " >&6; }
- if test "${gmp_cv_func_alloca+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
- #define GMP_NAIL_BITS $GMP_NAIL_BITS
- #define GMP_LIMB_BITS 123
- $DEFN_LONG_LONG_LIMB
- #include "$srcdir/gmp-h.in"
- #include "$srcdir/gmp-impl.h"
- int
- main ()
- {
- char *p = (char *) alloca (1);
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_link "$LINENO"; then :
- gmp_cv_func_alloca=yes
- else
- gmp_cv_func_alloca=no
- fi
- rm -f core conftest.err conftest.$ac_objext
- conftest$ac_exeext conftest.$ac_ext
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_func_alloca" >&5
- $as_echo "$gmp_cv_func_alloca" >&6; }
- if test $gmp_cv_func_alloca = yes; then
- $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to allocate temporary memory" >&5
- $as_echo_n "checking how to allocate temporary memory... " >&6; }
- if test "${gmp_cv_option_alloca+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $enable_alloca in
- yes)
- gmp_cv_option_alloca=alloca
- ;;
- no)
- gmp_cv_option_alloca=malloc-reentrant
- ;;
- reentrant | notreentrant)
- case $gmp_cv_func_alloca in
- yes) gmp_cv_option_alloca=alloca ;;
- *) gmp_cv_option_alloca=malloc-$enable_alloca ;;
- esac
- ;;
- *)
- gmp_cv_option_alloca=$enable_alloca
- ;;
- esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_option_alloca" >&5
- $as_echo "$gmp_cv_option_alloca" >&6; }
- case $gmp_cv_option_alloca in
- alloca)
- if test $gmp_cv_func_alloca = no; then
- as_fn_error "--enable-alloca=alloca specified, but alloca not available" "$LINENO" 5
- fi
- $as_echo "#define WANT_TMP_ALLOCA 1" >>confdefs.h
- TAL_OBJECT=tal-reent$U.lo
- ;;
- malloc-reentrant)
- $as_echo "#define WANT_TMP_REENTRANT 1" >>confdefs.h
- TAL_OBJECT=tal-reent$U.lo
- ;;
- malloc-notreentrant)
- $as_echo "#define WANT_TMP_NOTREENTRANT 1" >>confdefs.h
- TAL_OBJECT=tal-notreent$U.lo
- ;;
- debug)
- $as_echo "#define WANT_TMP_DEBUG 1" >>confdefs.h
- TAL_OBJECT=tal-debug$U.lo
- ;;
- *)
- # checks at the start of configure.in should protect us
- as_fn_error "unrecognised --enable-alloca=$gmp_cv_option_alloca" "$LINENO" 5
- ;;
- esac
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <stdio.h>
- #define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */
- #define GMP_NAIL_BITS $GMP_NAIL_BITS
- #define GMP_LIMB_BITS 123
- $DEFN_LONG_LONG_LIMB
- #include "$srcdir/gmp-h.in"
- #if ! _GMP_H_HAVE_FILE
- die die die
- #endif
- int
- main ()
- {
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gmp.h doesnt recognise <stdio.h>, FILE prototypes will be unavailable" >&5
- $as_echo "$as_me: WARNING: gmp.h doesnt recognise <stdio.h>, FILE prototypes will be unavailable" >&2;}
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
- $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
- if test "${ac_cv_c_bigendian+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <sys/types.h>
- #include <sys/param.h>
- int
- main ()
- {
- #if ! (defined BYTE_ORDER && defined BIG_ENDIAN
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <sys/types.h>
- #include <sys/param.h>
- int
- main ()
- {
- #if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
- else
- ac_cv_c_bigendian=no
- 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
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <limits.h>
- int
- main ()
- {
- #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <limits.h>
- int
- main ()
- {
- #ifndef _BIG_ENDIAN
- not big endian
- #endif
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
- else
- ac_cv_c_bigendian=no
- 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
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
- int
- main ()
- {
- return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- $ac_includes_default
- int
- main ()
- {
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
- ;
- return 0;
- }
- _ACEOF
- if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
- else
- ac_cv_c_bigendian=yes
- 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_c_bigendian" >&5
- $as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define HAVE_LIMB_BIG_ENDIAN 1" >>confdefs.h
- echo "define_not_for_expansion(`HAVE_LIMB_BIG_ENDIAN')" >> $gmp_tmpconfigm4p
- ;; #(
- no)
- $as_echo "#define HAVE_LIMB_LITTLE_ENDIAN 1" >>confdefs.h
- echo "define_not_for_expansion(`HAVE_LIMB_LITTLE_ENDIAN')" >> $gmp_tmpconfigm4p
- ;; #(
- universal)
- $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
- ;; #(
- *)
- : ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking format of `double' floating point" >&5
- $as_echo_n "checking format of `double' floating point... " >&6; }
- if test "${gmp_cv_c_double_format+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_c_double_format=unknown
- cat >conftest.c <<EOF
- struct {
- char before[8];
- double x;
- char after[8];
- } foo = {
- { ' 01', ' 43', '105', '147', '211', '253', '315', '357' },
- -123456789.0,
- { '376', '334', '272', '230', '166', '124', ' 62', ' 20' },
- };
- EOF
- gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >&5 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_compile""; } >&5
- (eval $gmp_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat >conftest.awk <<EOF
- BEGIN {
- found = 0
- }
- {
- for (f = 2; f <= NF; f++)
- {
- for (i = 0; i < 23; i++)
- got[i] = got[i+1];
- got[23] = $f;
- # match the special begin and end sequences
- if (got[0] != "001") continue
- if (got[1] != "043") continue
- if (got[2] != "105") continue
- if (got[3] != "147") continue
- if (got[4] != "211") continue
- if (got[5] != "253") continue
- if (got[6] != "315") continue
- if (got[7] != "357") continue
- if (got[16] != "376") continue
- if (got[17] != "334") continue
- if (got[18] != "272") continue
- if (got[19] != "230") continue
- if (got[20] != "166") continue
- if (got[21] != "124") continue
- if (got[22] != "062") continue
- if (got[23] != "020") continue
- saw = " (" got[8] " " got[9] " " got[10] " " got[11] " " got[12] " " got[13] " " got[14] " " got[15] ")"
- if (got[8] == "000" &&
- got[9] == "000" &&
- got[10] == "000" &&
- got[11] == "124" &&
- got[12] == "064" &&
- got[13] == "157" &&
- got[14] == "235" &&
- got[15] == "301")
- {
- print "IEEE little endian"
- found = 1
- exit
- }
- # Little endian with the two 4-byte halves swapped, as used by ARM
- # when the chip is in little endian mode.
- #
- if (got[8] == "064" &&
- got[9] == "157" &&
- got[10] == "235" &&
- got[11] == "301" &&
- got[12] == "000" &&
- got[13] == "000" &&
- got[14] == "000" &&
- got[15] == "124")
- {
- print "IEEE little endian, swapped halves"
- found = 1
- exit
- }
- # gcc 2.95.4 on one GNU/Linux ARM system was seen generating 000 in
- # the last byte, whereas 124 is correct. Not sure where the bug
- # actually lies, but a running program didn't seem to get a full
- # mantissa worth of working bits.
- #
- # We match this case explicitly so we can give a nice result message,
- # but we deliberately exclude it from the normal IEEE double setups
- # since it's too broken.
- #
- if (got[8] == "064" &&
- got[9] == "157" &&
- got[10] == "235" &&
- got[11] == "301" &&
- got[12] == "000" &&
- got[13] == "000" &&
- got[14] == "000" &&
- got[15] == "000")
- {
- print "bad ARM software floats"
- found = 1
- exit
- }
- if (got[8] == "301" &&
- got[9] == "235" &&
- got[10] == "157" &&
- got[11] == "064" &&
- got[12] == "124" &&
- got[13] == "000" &&
- got[14] == "000" &&
- got[15] == "000")
- {
- print "IEEE big endian"
- found = 1
- exit
- }
- if (got[8] == "353" &&
- got[9] == "315" &&
- got[10] == "242" &&
- got[11] == "171" &&
- got[12] == "000" &&
- got[13] == "240" &&
- got[14] == "000" &&
- got[15] == "000")
- {
- print "VAX D"
- found = 1
- exit
- }
- if (got[8] == "275" &&
- got[9] == "301" &&
- got[10] == "064" &&
- got[11] == "157" &&
- got[12] == "000" &&
- got[13] == "124" &&
- got[14] == "000" &&
- got[15] == "000")
- {
- print "VAX G"
- found = 1
- exit
- }
- if (got[8] == "300" &&
- got[9] == "033" &&
- got[10] == "353" &&
- got[11] == "171" &&
- got[12] == "242" &&
- got[13] == "240" &&
- got[14] == "000" &&
- got[15] == "000")
- {
- print "Cray CFP"
- found = 1
- exit
- }
- }
- }
- END {
- if (! found)
- print "unknown", saw
- }
- EOF
- gmp_cv_c_double_format=`od -b conftest.$OBJEXT | $AWK -f conftest.awk`
- case $gmp_cv_c_double_format in
- unknown*)
- echo "cannot match anything, conftest.$OBJEXT contains" >&5
- od -b conftest.$OBJEXT >&5
- ;;
- esac
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: oops, cannot compile test program" >&5
- $as_echo "$as_me: WARNING: oops, cannot compile test program" >&2;}
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_c_double_format" >&5
- $as_echo "$gmp_cv_c_double_format" >&6; }
- case $gmp_cv_c_double_format in
- "IEEE big endian")
- $as_echo "#define HAVE_DOUBLE_IEEE_BIG_ENDIAN 1" >>confdefs.h
- echo "define_not_for_expansion(`HAVE_DOUBLE_IEEE_BIG_ENDIAN')" >> $gmp_tmpconfigm4p
- ;;
- "IEEE little endian")
- $as_echo "#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1" >>confdefs.h
- echo "define_not_for_expansion(`HAVE_DOUBLE_IEEE_LITTLE_ENDIAN')" >> $gmp_tmpconfigm4p
- ;;
- "IEEE little endian, swapped halves")
- $as_echo "#define HAVE_DOUBLE_IEEE_LITTLE_SWAPPED 1" >>confdefs.h
- ;;
- "VAX D")
- $as_echo "#define HAVE_DOUBLE_VAX_D 1" >>confdefs.h
- ;;
- "VAX G")
- $as_echo "#define HAVE_DOUBLE_VAX_G 1" >>confdefs.h
- ;;
- "Cray CFP")
- $as_echo "#define HAVE_DOUBLE_CRAY_CFP 1" >>confdefs.h
- ;;
- "bad ARM software floats")
- ;;
- unknown*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not determine float format." >&5
- $as_echo "$as_me: WARNING: Could not determine float format." >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Conversions to and from "double" may be slow." >&5
- $as_echo "$as_me: WARNING: Conversions to and from "double" may be slow." >&2;}
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: oops, unrecognised float format: $gmp_cv_c_double_format" >&5
- $as_echo "$as_me: WARNING: oops, unrecognised float format: $gmp_cv_c_double_format" >&2;}
- ;;
- esac
- # Reasons for testing:
- # alarm - not in mingw
- # attr_get - IRIX specific
- # clock_gettime - not in glibc 2.2.4, only very recent systems
- # cputime - not in glibc
- # getsysinfo - OSF specific
- # getrusage - not in mingw
- # gettimeofday - not in mingw
- # mmap - not in mingw, djgpp
- # nl_langinfo - X/Open standard only, not in djgpp for instance
- # obstack_vprintf - glibc specific
- # processor_info - solaris specific
- # pstat_getprocessor - HPUX specific (10.x and up)
- # raise - an ANSI-ism, though probably almost universal by now
- # read_real_time - AIX specific
- # sigaction - not in mingw
- # sigaltstack - not in mingw, or old AIX (reputedly)
- # sigstack - not in mingw
- # strerror - not in SunOS
- # strnlen - glibc extension (some other systems too)
- # syssgi - IRIX specific
- # times - not in mingw
- #
- # clock_gettime is in librt on *-*-osf5.1. We could look for it
- # there, but that's not worth bothering with unless it has a decent
- # resolution (in a quick test clock_getres said only 1 millisecond).
- #
- # AC_FUNC_STRNLEN is not used because we don't want the AC_LIBOBJ
- # replacement setups it gives. It detects a faulty strnlen on AIX, but
- # missing out on that test is ok since our only use of strnlen is in
- # __gmp_replacement_vsnprintf which is not required on AIX since it has a
- # vsnprintf.
- #
- for ac_func in alarm attr_get clock clock_gettime cputime getpagesize getrusage gettimeofday getsysinfo localeconv memset mmap mprotect nl_langinfo obstack_vprintf popen processor_info pstat_getprocessor raise read_real_time sigaction sigaltstack sigstack syssgi strchr strerror strnlen strtol strtoul sysconf sysctl sysctlbyname times
- 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"
- eval as_val=$$as_ac_var
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
- _ACEOF
- fi
- done
- ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
- if test "x$ac_cv_func_vsnprintf" = x""yes; then :
- gmp_vsnprintf_exists=yes
- else
- gmp_vsnprintf_exists=no
- fi
- if test "$gmp_vsnprintf_exists" = no; then
- gmp_cv_func_vsnprintf=no
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf works" >&5
- $as_echo_n "checking whether vsnprintf works... " >&6; }
- if test "${gmp_cv_func_vsnprintf+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_func_vsnprintf=yes
- for i in 'check ("hello world");' 'int n; check ("%nhello world", &n);'; do
- if test "$cross_compiling" = yes; then :
- gmp_cv_func_vsnprintf=probably; break
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- #include <string.h> /* for strcmp */
- #include <stdio.h> /* for vsnprintf */
- #if HAVE_STDARG
- #include <stdarg.h>
- #else
- #include <varargs.h>
- #endif
- int
- #if HAVE_STDARG
- check (const char *fmt, ...)
- #else
- check (va_alist)
- va_dcl
- #endif
- {
- static char buf[128];
- va_list ap;
- int ret;
- #if HAVE_STDARG
- va_start (ap, fmt);
- #else
- char *fmt;
- va_start (ap);
- fmt = va_arg (ap, char *);
- #endif
- ret = vsnprintf (buf, 4, fmt, ap);
- if (strcmp (buf, "hel") != 0)
- exit (1);
- /* allowed return values */
- if (ret != -1 && ret != 3 && ret != 11)
- exit (2);
- return 0;
- }
- int
- main ()
- {
- $i
- exit (0);
- }
- _ACEOF
- if ac_fn_c_try_run "$LINENO"; then :
- :
- else
- gmp_cv_func_vsnprintf=no; break
- fi
- rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext
- conftest.$ac_objext conftest.beam conftest.$ac_ext
- fi
- done
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_func_vsnprintf" >&5
- $as_echo "$gmp_cv_func_vsnprintf" >&6; }
- if test "$gmp_cv_func_vsnprintf" = probably; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for properly working vsnprintf when cross compiling, will assume it's ok" >&5
- $as_echo "$as_me: WARNING: cannot check for properly working vsnprintf when cross compiling, will assume it's ok" >&2;}
- fi
- if test "$gmp_cv_func_vsnprintf" != no; then
- $as_echo "#define HAVE_VSNPRINTF 1" >>confdefs.h
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sscanf needs writable input" >&5
- $as_echo_n "checking whether sscanf needs writable input... " >&6; }
- if test "${gmp_cv_func_sscanf_writable_input+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $host in
- *-*-hpux9 | *-*-hpux9.*)
- gmp_cv_func_sscanf_writable_input=yes ;;
- *) gmp_cv_func_sscanf_writable_input=no ;;
- esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_func_sscanf_writable_input" >&5
- $as_echo "$gmp_cv_func_sscanf_writable_input" >&6; }
- case $gmp_cv_func_sscanf_writable_input in
- yes)
- $as_echo "#define SSCANF_WRITABLE_INPUT 1" >>confdefs.h
- ;;
- no) ;;
- *) as_fn_error "unrecognised $gmp_cv_func_sscanf_writable_input" "$LINENO" 5 ;;
- esac
- # Reasons for checking:
- # pst_processor psp_iticksperclktick - not in hpux 9
- #
- ac_fn_c_check_member "$LINENO" "struct pst_processor" "psp_iticksperclktick" "ac_cv_member_struct_pst_processor_psp_iticksperclktick" "#include <sys/pstat.h>
- "
- if test "x$ac_cv_member_struct_pst_processor_psp_iticksperclktick" = x""yes; then :
- $as_echo "#define HAVE_PSP_ITICKSPERCLKTICK 1" >>confdefs.h
- fi
- # C++ tests, when required
- #
- if test $enable_cxx = yes; then
- 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
- # Reasons for testing:
- # <sstream> - not in g++ 2.95.2
- # std::locale - not in g++ 2.95.4
- #
- for ac_header in sstream
- do :
- ac_fn_cxx_check_header_mongrel "$LINENO" "sstream" "ac_cv_header_sstream" "$ac_includes_default"
- if test "x$ac_cv_header_sstream" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_SSTREAM 1
- _ACEOF
- fi
- done
- ac_fn_cxx_check_type "$LINENO" "std::locale" "ac_cv_type_std__locale" "#include <locale>
- "
- if test "x$ac_cv_type_std__locale" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STD__LOCALE 1
- _ACEOF
- 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
- fi
- # Pick the correct source files in $path and link them to mpn/.
- # $gmp_mpn_functions lists all functions we need.
- #
- # The rule is to find a file with the function name and a .asm, .S,
- # .s, or .c extension. Certain multi-function files with special names
- # can provide some functions too. (mpn/Makefile.am passes
- # -DOPERATION_<func> to get them to generate the right code.)
- # Note: $gmp_mpn_functions must have mod_1 before pre_mod_1 so the former
- # can optionally provide the latter as an extra entrypoint. Likewise
- # divrem_1 and pre_divrem_1.
- gmp_mpn_functions_optional="umul udiv
- invert_limb sqr_diagonal
- mul_2 mul_3 mul_4
- addmul_2 addmul_3 addmul_4 addmul_5 addmul_6 addmul_7 addmul_8
- addlsh1_n sublsh1_n rsblsh1_n rsh1add_n rsh1sub_n
- addlsh2_n sublsh2_n rsblsh2_n
- addlsh_n sublsh_n rsblsh_n
- add_n_sub_n addaddmul_1msb0"
- gmp_mpn_functions="$extra_functions
- add add_1 add_n sub sub_1 sub_n neg com mul_1 addmul_1
- submul_1 lshift rshift dive_1 diveby3 divis divrem divrem_1 divrem_2
- fib2_ui mod_1 mod_34lsub1 mode1o pre_divrem_1 pre_mod_1 dump
- mod_1_1 mod_1_2 mod_1_3 mod_1_4 lshiftc
- mul mul_fft mul_n sqr mul_basecase sqr_basecase nussbaumer_mul
- random random2 pow_1
- rootrem sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp
- perfsqr perfpow
- gcd_1 gcd gcdext_1 gcdext gcd_lehmer gcd_subdiv_step
- gcdext_lehmer gcdext_subdiv_step
- div_q tdiv_qr jacbase get_d
- matrix22_mul hgcd2 hgcd mullo_n mullo_basecase
- toom22_mul toom32_mul toom42_mul toom52_mul toom62_mul
- toom33_mul toom43_mul toom53_mul toom63_mul
- toom44_mul
- toom6h_mul toom6_sqr toom8h_mul toom8_sqr
- toom_couple_handling
- toom2_sqr toom3_sqr toom4_sqr
- toom_eval_dgr3_pm1 toom_eval_dgr3_pm2
- toom_eval_pm1 toom_eval_pm2 toom_eval_pm2exp toom_eval_pm2rexp
- toom_interpolate_5pts toom_interpolate_6pts toom_interpolate_7pts
- toom_interpolate_8pts toom_interpolate_12pts toom_interpolate_16pts
- invertappr invert binvert mulmod_bnm1 sqrmod_bnm1
- sbpi1_div_q sbpi1_div_qr sbpi1_divappr_q
- dcpi1_div_q dcpi1_div_qr dcpi1_divappr_q
- mu_div_qr mu_divappr_q mu_div_q
- bdiv_q_1
- sbpi1_bdiv_q sbpi1_bdiv_qr
- dcpi1_bdiv_q dcpi1_bdiv_qr
- mu_bdiv_q mu_bdiv_qr
- bdiv_q bdiv_qr
- divexact bdiv_dbm1c redc_1 redc_2 redc_n powm powlo powm_sec subcnd_n
- redc_1_sec trialdiv remove
- and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n
- copyi copyd zero
- $gmp_mpn_functions_optional"
- # the list of all object files used by mpn/Makefile.in and the
- # top-level Makefile.in, respectively
- mpn_objects=
- mpn_objs_in_libgmp=
- # links from the sources, to be removed by "make distclean"
- gmp_srclinks=
- # mpn_relative_top_srcdir is $top_srcdir, but for use from within the mpn
- # build directory. If $srcdir is relative then we use a relative path too,
- # so the two trees can be moved together.
- case $srcdir in
- [\/]* | ?:[\/]*) # absolute, as per autoconf
- mpn_relative_top_srcdir=$srcdir ;;
- *) # relative
- mpn_relative_top_srcdir=../$srcdir ;;
- esac
- # Fat binary setups.
- #
- # We proceed through each $fat_path directory, and look for $fat_function
- # routines there. Those found are incorporated in the build by generating a
- # little mpn/<foo>.asm or mpn/<foo>.c file in the build directory, with
- # suitable function renaming, and adding that to $mpn_objects (the same as a
- # normal mpn file).
- #
- # fat.h is generated with macros to let internal calls to each $fat_function
- # go directly through __gmpn_cpuvec, plus macros and declarations helping to
- # setup that structure, on a per-directory basis ready for
- # mpn/<cpu>/fat/fat.c.
- #
- # fat.h includes thresholds listed in $fat_thresholds, extracted from
- # gmp-mparam.h in each directory. An overall maximum for each threshold is
- # established, for use in making fixed size arrays of temporary space.
- # (Eg. MUL_TOOM33_THRESHOLD_LIMIT used by mpn/generic/mul.c.)
- #
- # It'd be possible to do some of this manually, but when there's more than a
- # few functions and a few directories it becomes very tedious, and very
- # prone to having some routine accidentally omitted. On that basis it seems
- # best to automate as much as possible, even if the code to do so is a bit
- # ugly.
- #
- if test -n "$fat_path"; then
- # Usually the mpn build directory is created with mpn/Makefile
- # instantiation, but we want to write to it sooner.
- mkdir mpn 2>/dev/null
- echo "/* fat.h - setups for fat binaries." >fat.h
- echo " Generated by configure - DO NOT EDIT. */" >>fat.h
- $as_echo "#define WANT_FAT_BINARY 1" >>confdefs.h
- echo 'define(<WANT_FAT_BINARY>, <yes>)' >>$gmp_tmpconfigm4
- # Don't want normal copies of fat functions
- for tmp_fn in $fat_functions; do
- remove_from_list_tmp=
- for remove_from_list_i in $gmp_mpn_functions; do
- if test $remove_from_list_i = $tmp_fn; then :;
- else
- remove_from_list_tmp="$remove_from_list_tmp $remove_from_list_i"
- fi
- done
- gmp_mpn_functions=$remove_from_list_tmp
- remove_from_list_tmp=
- for remove_from_list_i in $gmp_mpn_functions_optional; do
- if test $remove_from_list_i = $tmp_fn; then :;
- else
- remove_from_list_tmp="$remove_from_list_tmp $remove_from_list_i"
- fi
- done
- gmp_mpn_functions_optional=$remove_from_list_tmp
- done
- for tmp_fn in $fat_functions; do
- case $tmp_fn in
- dive_1) tmp_fbase=divexact_1 ;;
- diveby3) tmp_fbase=divexact_by3c ;;
- pre_divrem_1) tmp_fbase=preinv_divrem_1 ;;
- mode1o) tmp_fbase=modexact_1c_odd ;;
- pre_mod_1) tmp_fbase=preinv_mod_1 ;;
- *) tmp_fbase=$tmp_fn ;;
- esac
- echo "
- #ifndef OPERATION_$tmp_fn
- #undef mpn_$tmp_fbase
- #define mpn_$tmp_fbase (*__gmpn_cpuvec.$tmp_fbase)
- #endif
- DECL_$tmp_fbase (__MPN(${tmp_fbase}_init));" >>fat.h
- # encourage various macros to use fat functions
- cat >>confdefs.h <<_ACEOF
- #define HAVE_NATIVE_$tmp_fbase 1
- _ACEOF
- done
- echo "" >>fat.h
- echo "/* variable thresholds */" >>fat.h
- for tmp_tn in $fat_thresholds; do
- echo "#undef $tmp_tn" >>fat.h
- echo "#define $tmp_tn CPUVEC_THRESHOLD (`echo $tmp_tn | tr A-Z a-z`)" >>fat.h
- done
- echo "
- /* Copy all fields into __gmpn_cpuvec.
- memcpy is not used because it might operate byte-wise (depending on its
- implementation), and we need the function pointer writes to be atomic.
- "volatile" discourages the compiler from trying to optimize this. */
- #define CPUVEC_INSTALL(vec) \
- do { \
- volatile struct cpuvec_t *p = &__gmpn_cpuvec; \" >>fat.h
- for tmp_fn in $fat_functions; do
- case $tmp_fn in
- dive_1) tmp_fbase=divexact_1 ;;
- diveby3) tmp_fbase=divexact_by3c ;;
- pre_divrem_1) tmp_fbase=preinv_divrem_1 ;;
- mode1o) tmp_fbase=modexact_1c_odd ;;
- pre_mod_1) tmp_fbase=preinv_mod_1 ;;
- *) tmp_fbase=$tmp_fn ;;
- esac
- echo " p->$tmp_fbase = vec.$tmp_fbase; \" >>fat.h
- done
- for tmp_tn in $fat_thresholds; do
- tmp_field_name=`echo $tmp_tn | tr A-Z a-z`
- echo " p->$tmp_field_name = vec.$tmp_field_name; \" >>fat.h
- done
- echo " } while (0)" >>fat.h
- echo "
- /* A helper to check all fields are filled. */
- #define ASSERT_CPUVEC(vec) \
- do { \" >>fat.h
- for tmp_fn in $fat_functions; do
- case $tmp_fn in
- dive_1) tmp_fbase=divexact_1 ;;
- diveby3) tmp_fbase=divexact_by3c ;;
- pre_divrem_1) tmp_fbase=preinv_divrem_1 ;;
- mode1o) tmp_fbase=modexact_1c_odd ;;
- pre_mod_1) tmp_fbase=preinv_mod_1 ;;
- *) tmp_fbase=$tmp_fn ;;
- esac
- echo " ASSERT (vec.$tmp_fbase != NULL); \" >>fat.h
- done
- for tmp_tn in $fat_thresholds; do
- tmp_field_name=`echo $tmp_tn | tr A-Z a-z`
- echo " ASSERT (vec.$tmp_field_name != 0); \" >>fat.h
- done
- echo " } while (0)" >>fat.h
- echo "
- /* Call ITERATE(field) for each fat threshold field. */
- #define ITERATE_FAT_THRESHOLDS() \
- do { \" >>fat.h
- for tmp_tn in $fat_thresholds; do
- tmp_field_name=`echo $tmp_tn | tr A-Z a-z`
- echo " ITERATE ($tmp_tn, $tmp_field_name); \" >>fat.h
- done
- echo " } while (0)" >>fat.h
- for tmp_dir in $fat_path; do
- CPUVEC_SETUP=
- THRESH_ASM_SETUP=
- echo "" >>fat.h
- tmp_suffix=`echo $tmp_dir | sed -e '///s:^[^/]*/::' -e 's:[\/]:_:g'`
- # In order to keep names unique on a DOS 8.3 filesystem, use a prefix
- # (rather than a suffix) for the generated file names, and abbreviate.
- case $tmp_suffix in
- pentium) tmp_prefix=p ;;
- pentium_mmx) tmp_prefix=pm ;;
- p6_mmx) tmp_prefix=p2 ;;
- p6_p3mmx) tmp_prefix=p3 ;;
- pentium4) tmp_prefix=p4 ;;
- pentium4_mmx) tmp_prefix=p4m ;;
- pentium4_sse2) tmp_prefix=p4s ;;
- k6_mmx) tmp_prefix=k6m ;;
- k6_k62mmx) tmp_prefix=k62 ;;
- k7_mmx) tmp_prefix=k7m ;;
- *) tmp_prefix=$tmp_suffix ;;
- esac
- # Extract desired thresholds from gmp-mparam.h file in this directory,
- # if present.
- tmp_mparam=$srcdir/mpn/$tmp_dir/gmp-mparam.h
- if test -f $tmp_mparam; then
- for tmp_tn in $fat_thresholds; do
- tmp_thresh=`sed -n "s/^#define $tmp_tn[ ]*\([0-9][0-9]*\).*$/\1/p" $tmp_mparam`
- if test -n "$tmp_thresh"; then
- THRESH_ASM_SETUP="${THRESH_ASM_SETUP}define($tmp_tn,$tmp_thresh)
- "
- CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.`echo $tmp_tn | tr A-Z a-z` = $tmp_thresh; \
- "
- eval tmp_limit=$${tmp_tn}_LIMIT
- if test -z "$tmp_limit"; then
- tmp_limit=0
- fi
- if test $tmp_thresh -gt $tmp_limit; then
- eval ${tmp_tn}_LIMIT=$tmp_thresh
- fi
- fi
- done
- fi
- for tmp_fn in $fat_functions; do
- # functions that can be provided by multi-function files
- tmp_mulfunc=
- case $tmp_fn in
- add_n|sub_n) tmp_mulfunc="aors_n" ;;
- addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
- popcount|hamdist) tmp_mulfunc="popham" ;;
- and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
- tmp_mulfunc="logops_n" ;;
- lshift|rshift) tmp_mulfunc="lorrshift";;
- addlsh1_n)
- tmp_mulfunc="aorslsh1_n aorrlsh1_n";;
- sublsh1_n)
- tmp_mulfunc="aorslsh1_n sorrlsh1_n";;
- rsblsh1_n)
- tmp_mulfunc="aorrlsh1_n sorrlsh1_n";;
- addlsh2_n)
- tmp_mulfunc="aorslsh2_n aorrlsh2_n";;
- sublsh2_n)
- tmp_mulfunc="aorslsh2_n sorrlsh2_n";;
- rsblsh2_n)
- tmp_mulfunc="aorrlsh2_n sorrlsh2_n";;
- addlsh_n)
- tmp_mulfunc="aorslsh_n aorrlsh_n";;
- sublsh_n)
- tmp_mulfunc="aorslsh_n sorrlsh_n";;
- rsblsh_n)
- tmp_mulfunc="aorrlsh_n sorrlsh_n";;
- rsh1add_n|rsh1sub_n)
- tmp_mulfunc="rsh1aors_n";;
- esac
- for tmp_base in $tmp_fn $tmp_mulfunc; do
- for tmp_ext in asm S s c; do
- tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
- if test -f $tmp_file; then
- mpn_objects="$mpn_objects ${tmp_prefix}_$tmp_fn.lo"
- mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/${tmp_prefix}_$tmp_fn.lo"
- case $tmp_fn in
- dive_1) tmp_fbase=divexact_1 ;;
- diveby3) tmp_fbase=divexact_by3c ;;
- pre_divrem_1) tmp_fbase=preinv_divrem_1 ;;
- mode1o) tmp_fbase=modexact_1c_odd ;;
- pre_mod_1) tmp_fbase=preinv_mod_1 ;;
- *) tmp_fbase=$tmp_fn ;;
- esac
- # carry-in variant, eg. divrem_1c or modexact_1c_odd
- case $tmp_fbase in
- *_1*) tmp_fbasec=`echo $tmp_fbase | sed 's/_1/_1c/'` ;;
- *) tmp_fbasec=${tmp_fbase}c ;;
- esac
- # Create a little file doing an include from srcdir. The
- # OPERATION and renamings aren't all needed all the time, but
- # they don't hurt if unused.
- #
- # FIXME: Should generate these via config.status commands.
- # Would need them all in one AC_CONFIG_COMMANDS though, since
- # that macro doesn't accept a set of separate commands generated
- # by shell code.
- #
- case $tmp_ext in
- asm)
- # hide the d-n-l from autoconf's error checking
- tmp_d_n_l=d""nl
- echo "$tmp_d_n_l mpn_$tmp_fbase - from $tmp_dir directory for fat binary.
- $tmp_d_n_l Generated by configure - DO NOT EDIT.
- define(OPERATION_$tmp_fn)
- define(__gmpn_$tmp_fbase, __gmpn_${tmp_fbase}_$tmp_suffix)
- define(__gmpn_$tmp_fbasec,__gmpn_${tmp_fbasec}_${tmp_suffix})
- define(__gmpn_preinv_${tmp_fbase},__gmpn_preinv_${tmp_fbase}_${tmp_suffix})
- $tmp_d_n_l For k6 and k7 gcd_1 calling their corresponding mpn_modexact_1_odd
- ifdef(`__gmpn_modexact_1_odd',,
- `define(__gmpn_modexact_1_odd,__gmpn_modexact_1_odd_${tmp_suffix})')
- $THRESH_ASM_SETUP
- include($mpn_relative_top_srcdir/mpn/$tmp_dir/$tmp_base.asm)
- " >mpn/${tmp_prefix}_$tmp_fn.asm
- ;;
- c)
- echo "/* mpn_$tmp_fbase - from $tmp_dir directory for fat binary.
- Generated by configure - DO NOT EDIT. */
- #define OPERATION_$tmp_fn 1
- #define __gmpn_$tmp_fbase __gmpn_${tmp_fbase}_$tmp_suffix
- #define __gmpn_$tmp_fbasec __gmpn_${tmp_fbasec}_${tmp_suffix}
- #define __gmpn_preinv_${tmp_fbase} __gmpn_preinv_${tmp_fbase}_${tmp_suffix}
- #include "$mpn_relative_top_srcdir/mpn/$tmp_dir/$tmp_base.c"
- " >mpn/${tmp_prefix}_$tmp_fn.c
- ;;
- esac
- # Prototype, and append to CPUVEC_SETUP for this directory.
- echo "DECL_$tmp_fbase (__gmpn_${tmp_fbase}_$tmp_suffix);" >>fat.h
- CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.$tmp_fbase = __gmpn_${tmp_fbase}_${tmp_suffix}; \
- "
- # Ditto for any preinv variant (preinv_divrem_1, preinv_mod_1).
- if grep "^PROLOGUE(mpn_preinv_$tmp_fn)" $tmp_file >/dev/null; then
- echo "DECL_preinv_$tmp_fbase (__gmpn_preinv_${tmp_fbase}_$tmp_suffix);" >>fat.h
- CPUVEC_SETUP="$CPUVEC_SETUP decided_cpuvec.preinv_$tmp_fbase = __gmpn_preinv_${tmp_fbase}_${tmp_suffix}; \
- "
- fi
- fi
- done
- done
- done
- # Emit CPUVEC_SETUP for this directory
- echo "" >>fat.h
- echo "#define CPUVEC_SETUP_$tmp_suffix \" >>fat.h
- echo " do { \" >>fat.h
- echo "$CPUVEC_SETUP } while (0)" >>fat.h
- done
- # Emit threshold limits
- echo "" >>fat.h
- for tmp_tn in $fat_thresholds; do
- eval tmp_limit=$${tmp_tn}_LIMIT
- echo "#define ${tmp_tn}_LIMIT $tmp_limit" >>fat.h
- done
- fi
- # Normal binary setups.
- #
- for tmp_ext in asm S s c; do
- eval found_$tmp_ext=no
- done
- for tmp_fn in $gmp_mpn_functions; do
- for tmp_ext in asm S s c; do
- test "$no_create" = yes || rm -f mpn/$tmp_fn.$tmp_ext
- done
- # mpn_preinv_divrem_1 might have been provided by divrem_1.asm, likewise
- # mpn_preinv_mod_1 by mod_1.asm.
- case $tmp_fn in
- pre_divrem_1)
- if test "$HAVE_NATIVE_mpn_preinv_divrem_1" = yes; then continue; fi ;;
- pre_mod_1)
- if test "$HAVE_NATIVE_mpn_preinv_mod_1" = yes; then continue; fi ;;
- esac
- # functions that can be provided by multi-function files
- tmp_mulfunc=
- case $tmp_fn in
- add_n|sub_n) tmp_mulfunc="aors_n" ;;
- addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
- popcount|hamdist) tmp_mulfunc="popham" ;;
- and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
- tmp_mulfunc="logops_n" ;;
- lshift|rshift) tmp_mulfunc="lorrshift";;
- addlsh1_n)
- tmp_mulfunc="aorslsh1_n aorrlsh1_n";;
- sublsh1_n)
- tmp_mulfunc="aorslsh1_n sorrlsh1_n";;
- rsblsh1_n)
- tmp_mulfunc="aorrlsh1_n sorrlsh1_n";;
- addlsh2_n)
- tmp_mulfunc="aorslsh2_n aorrlsh2_n";;
- sublsh2_n)
- tmp_mulfunc="aorslsh2_n sorrlsh2_n";;
- rsblsh2_n)
- tmp_mulfunc="aorrlsh2_n sorrlsh2_n";;
- addlsh_n)
- tmp_mulfunc="aorslsh_n aorrlsh_n";;
- sublsh_n)
- tmp_mulfunc="aorslsh_n sorrlsh_n";;
- rsblsh_n)
- tmp_mulfunc="aorrlsh_n sorrlsh_n";;
- rsh1add_n|rsh1sub_n)
- tmp_mulfunc="rsh1aors_n";;
- esac
- found=no
- for tmp_dir in $path; do
- for tmp_base in $tmp_fn $tmp_mulfunc; do
- for tmp_ext in asm S s c; do
- tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
- if test -f $tmp_file; then
- # For a nails build, check if the file supports our nail bits.
- # Generic code always supports all nails.
- #
- # FIXME: When a multi-function file is selected to provide one of
- # the nails-neutral routines, like logops_n for and_n, the
- # PROLOGUE grepping will create HAVE_NATIVE_mpn_<foo> defines for
- # all functions in that file, even if they haven't all been
- # nailified. Not sure what to do about this, it's only really a
- # problem for logops_n, and it's not too terrible to insist those
- # get nailified always.
- #
- if test $GMP_NAIL_BITS != 0 && test $tmp_dir != generic; then
- case $tmp_fn in
- and_n | ior_n | xor_n | andn_n |
- copyi | copyd |
- popcount | hamdist |
- udiv | udiv_w_sdiv | umul |
- cntlz | invert_limb)
- # these operations are either unaffected by nails or defined
- # to operate on full limbs
- ;;
- *)
- nails=`sed -n 's/^[ ]*NAILS_SUPPORT((.*))/1/p' $tmp_file `
- for n in $nails; do
- case $n in
- *-*)
- n_start=`echo "$n" | sed -n 's/(.*)-.*/1/p'`
- n_end=`echo "$n" | sed -n 's/.*-(.*)/1/p'`
- ;;
- *)
- n_start=$n
- n_end=$n
- ;;
- esac
- if test $GMP_NAIL_BITS -ge $n_start && test $GMP_NAIL_BITS -le $n_end; then
- found=yes
- break
- fi
- done
- if test $found != yes; then
- continue
- fi
- ;;
- esac
- fi
- found=yes
- eval found_$tmp_ext=yes
- if test $tmp_ext = c; then
- tmp_u='$U'
- else
- tmp_u=
- fi
- mpn_objects="$mpn_objects $tmp_fn$tmp_u.lo"
- mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/$tmp_fn$tmp_u.lo"
- ac_config_links="$ac_config_links mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext"
- gmp_srclinks="$gmp_srclinks mpn/$tmp_fn.$tmp_ext"
- # Duplicate AC_DEFINEs are harmless, so it doesn't matter
- # that multi-function files get grepped here repeatedly.
- # The PROLOGUE pattern excludes the optional second parameter.
- gmp_ep=`
- sed -n 's/^[ ]*MULFUNC_PROLOGUE((.*))/1/p' $tmp_file ;
- sed -n 's/^[ ]*PROLOGUE(([^,]*).*)/1/p' $tmp_file
- `
- for gmp_tmp in $gmp_ep; do
- cat >>confdefs.h <<_ACEOF
- #define HAVE_NATIVE_$gmp_tmp 1
- _ACEOF
- eval HAVE_NATIVE_$gmp_tmp=yes
- done
- case $tmp_fn in
- sqr_basecase) sqr_basecase_source=$tmp_file ;;
- esac
- break
- fi
- done
- if test $found = yes; then break ; fi
- done
- if test $found = yes; then break ; fi
- done
- if test $found = no; then
- for tmp_optional in $gmp_mpn_functions_optional; do
- if test $tmp_optional = $tmp_fn; then
- found=yes
- fi
- done
- if test $found = no; then
- as_fn_error "no version of $tmp_fn found in path: $path" "$LINENO" 5
- fi
- fi
- done
- # All cycle counters are .asm files currently
- if test -n "$SPEED_CYCLECOUNTER_OBJ"; then
- found_asm=yes
- fi
- # Don't demand an m4 unless it's actually needed.
- if test $found_asm = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suitable m4" >&5
- $as_echo_n "checking for suitable m4... " >&6; }
- if test "${gmp_cv_prog_m4+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$M4"; then
- gmp_cv_prog_m4="$M4"
- else
- cat >conftest.m4 <<EOF
- define(dollarhash,``$#'')ifelse(dollarhash(x),1,`define(t1,Y)',
- ``bad: $# not supported (SunOS /usr/bin/m4)
- '')ifelse(eval(89),89,`define(t2,Y)',
- `bad: eval() doesnt support 8 or 9 in a constant (OpenBSD 2.6 m4)
- ')ifelse(t1`'t2,YY,`good
- ')
- EOF
- echo "trying m4" >&5
- gmp_tmp_val=`(m4 conftest.m4) 2>&5`
- echo "$gmp_tmp_val" >&5
- if test "$gmp_tmp_val" = good; then
- gmp_cv_prog_m4="m4"
- else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH:/usr/5bin"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- echo "trying $ac_dir/m4" >&5
- gmp_tmp_val=`($ac_dir/m4 conftest.m4) 2>&5`
- echo "$gmp_tmp_val" >&5
- if test "$gmp_tmp_val" = good; then
- gmp_cv_prog_m4="$ac_dir/m4"
- break
- fi
- done
- IFS="$ac_save_ifs"
- if test -z "$gmp_cv_prog_m4"; then
- as_fn_error "No usable m4 in $PATH or /usr/5bin (see config.log for reasons)." "$LINENO" 5
- fi
- fi
- rm -f conftest.m4
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_prog_m4" >&5
- $as_echo "$gmp_cv_prog_m4" >&6; }
- M4="$gmp_cv_prog_m4"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if m4wrap produces spurious output" >&5
- $as_echo_n "checking if m4wrap produces spurious output... " >&6; }
- if test "${gmp_cv_m4_m4wrap_spurious+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- # hide the d-n-l from autoconf's error checking
- tmp_d_n_l=d""nl
- cat >conftest.m4 <<EOF
- changequote({,})define(x,)m4wrap({x})$tmp_d_n_l
- EOF
- echo test input is >&5
- cat conftest.m4 >&5
- tmp_chars=`$M4 conftest.m4 | wc -c`
- echo produces $tmp_chars chars output >&5
- rm -f conftest.m4
- if test $tmp_chars = 0; then
- gmp_cv_m4_m4wrap_spurious=no
- else
- gmp_cv_m4_m4wrap_spurious=yes
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_m4_m4wrap_spurious" >&5
- $as_echo "$gmp_cv_m4_m4wrap_spurious" >&6; }
- echo "define(<M4WRAP_SPURIOUS>,<$gmp_cv_m4_m4wrap_spurious>)" >> $gmp_tmpconfigm4
- else
- M4=m4-not-needed
- fi
- # Only do the GMP_ASM checks if there's a .S or .asm wanting them.
- if test $found_asm = no && test $found_S = no; then
- gmp_asm_syntax_testing=no
- fi
- if test "$gmp_asm_syntax_testing" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to switch to text section" >&5
- $as_echo_n "checking how to switch to text section... " >&6; }
- if test "${gmp_cv_asm_text+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- for i in ".text" ".code" ".csect .text[PR]"; do
- echo "trying $i" >&5
- cat >conftest.s <<EOF
- $i
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_text=$i
- rm -f conftest*
- break
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- done
- if test -z "$gmp_cv_asm_text"; then
- as_fn_error "Cannot determine text section directive" "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_text" >&5
- $as_echo "$gmp_cv_asm_text" >&6; }
- echo "define(<TEXT>, <$gmp_cv_asm_text>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to switch to data section" >&5
- $as_echo_n "checking how to switch to data section... " >&6; }
- if test "${gmp_cv_asm_data+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $host in
- *-*-aix*) gmp_cv_asm_data=".csect .data[RW]" ;;
- *) gmp_cv_asm_data=".data" ;;
- esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_data" >&5
- $as_echo "$gmp_cv_asm_data" >&6; }
- echo "define(<DATA>, <$gmp_cv_asm_data>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler label suffix" >&5
- $as_echo_n "checking for assembler label suffix... " >&6; }
- if test "${gmp_cv_asm_label_suffix+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_asm_label_suffix=unknown
- for i in "" ":"; do
- echo "trying $i" >&5
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- somelabel$i
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_label_suffix=$i
- rm -f conftest*
- break
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- cat conftest.out >&5
- fi
- rm -f conftest*
- done
- if test "$gmp_cv_asm_label_suffix" = "unknown"; then
- as_fn_error "Cannot determine label suffix" "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_label_suffix" >&5
- $as_echo "$gmp_cv_asm_label_suffix" >&6; }
- echo "define(<LABEL_SUFFIX>, <$gmp_cv_asm_label_suffix>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler global directive" >&5
- $as_echo_n "checking for assembler global directive... " >&6; }
- if test "${gmp_cv_asm_globl+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $host in
- hppa*-*-*) gmp_cv_asm_globl=.export ;;
- ia64*-*-* | itanium-*-* | itanium2-*-*) gmp_cv_asm_globl=.global ;;
- *) gmp_cv_asm_globl=.globl ;;
- esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_globl" >&5
- $as_echo "$gmp_cv_asm_globl" >&6; }
- echo "define(<GLOBL>, <$gmp_cv_asm_globl>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler global directive attribute" >&5
- $as_echo_n "checking for assembler global directive attribute... " >&6; }
- if test "${gmp_cv_asm_globl_attr+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $gmp_cv_asm_globl in
- .export) gmp_cv_asm_globl_attr=",entry" ;;
- *) gmp_cv_asm_globl_attr="" ;;
- esac
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_globl_attr" >&5
- $as_echo "$gmp_cv_asm_globl_attr" >&6; }
- echo "define(<GLOBL_ATTR>, <$gmp_cv_asm_globl_attr>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if globals are prefixed by underscore" >&5
- $as_echo_n "checking if globals are prefixed by underscore... " >&6; }
- if test "${gmp_cv_asm_underscore+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_asm_underscore="unknown"
- cat >conftest.c <<EOF
- int gurkmacka;
- EOF
- gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >&5"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_compile""; } >&5
- (eval $gmp_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- $NM conftest.$OBJEXT >conftest.out
- if grep _gurkmacka conftest.out >/dev/null; then
- gmp_cv_asm_underscore=yes
- elif grep gurkmacka conftest.out >/dev/null; then
- gmp_cv_asm_underscore=no
- else
- echo "configure: $NM doesn't have gurkmacka:" >&5
- cat conftest.out >&5
- fi
- else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_underscore" >&5
- $as_echo "$gmp_cv_asm_underscore" >&6; }
- case $gmp_cv_asm_underscore in
- yes)
- echo 'define(<GSYM_PREFIX>, <_>)' >>$gmp_tmpconfigm4
- ;;
- no)
- echo 'define(<GSYM_PREFIX>, <>)' >>$gmp_tmpconfigm4
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +----------------------------------------------------------" >&5
- $as_echo "$as_me: WARNING: +----------------------------------------------------------" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | Cannot determine global symbol prefix." >&5
- $as_echo "$as_me: WARNING: | Cannot determine global symbol prefix." >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | $NM output doesn't contain a global data symbol." >&5
- $as_echo "$as_me: WARNING: | $NM output doesn't contain a global data symbol." >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | Will proceed with no underscore." >&5
- $as_echo "$as_me: WARNING: | Will proceed with no underscore." >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | If this is wrong then you'll get link errors referring" >&5
- $as_echo "$as_me: WARNING: | If this is wrong then you'll get link errors referring" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | to ___gmpn_add_n (note three underscores)." >&5
- $as_echo "$as_me: WARNING: | to ___gmpn_add_n (note three underscores)." >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | In this case do a fresh build with an override," >&5
- $as_echo "$as_me: WARNING: | In this case do a fresh build with an override," >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: | ./configure gmp_cv_asm_underscore=yes" >&5
- $as_echo "$as_me: WARNING: | ./configure gmp_cv_asm_underscore=yes" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +----------------------------------------------------------" >&5
- $as_echo "$as_me: WARNING: +----------------------------------------------------------" >&2;}
- echo 'define(<GSYM_PREFIX>, <>)' >>$gmp_tmpconfigm4
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to switch to read-only data section" >&5
- $as_echo_n "checking how to switch to read-only data section... " >&6; }
- if test "${gmp_cv_asm_rodata+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $host in
- i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-* | x86_64-*-*)
- gmp_cv_asm_rodata="$gmp_cv_asm_data" ;;
- *)
- gmp_cv_asm_rodata="$gmp_cv_asm_text" ;;
- esac
- cat >conftest.c <<EOF
- const int foo = 123;
- EOF
- echo "Test program:" >&5
- cat conftest.c >&5
- gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&5"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_compile""; } >&5
- (eval $gmp_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- echo "Compiler output:" >&5
- cat conftest.s >&5
- if test $gmp_cv_asm_underscore = yes; then
- tmp_gsym_prefix=_
- else
- tmp_gsym_prefix=
- fi
- # must see our label
- if grep "^${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix" conftest.s >/dev/null 2>&5; then
- # take the last directive before our label (hence skipping segments
- # getting debugging info etc)
- tmp_match=`sed -n "/^${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix/q
- /^[. ]*data/p
- /^[. ]*rdata/p
- /^[. ]*text/p
- /^[. ]*section/p
- /^[. ]*csect/p
- /^[. ]*CSECT/p" conftest.s | sed -n '$p'`
- echo "Match: $tmp_match" >&5
- if test -n "$tmp_match"; then
- gmp_cv_asm_rodata=$tmp_match
- fi
- else
- echo "Couldn't find label: ^${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix" >&5
- fi
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_rodata" >&5
- $as_echo "$gmp_cv_asm_rodata" >&6; }
- echo "define(<RODATA>, <$gmp_cv_asm_rodata>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler .type directive" >&5
- $as_echo_n "checking for assembler .type directive... " >&6; }
- if test "${gmp_cv_asm_type+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_asm_type=
- for gmp_tmp_prefix in @ # %; do
- cat >conftest.s <<EOF
- .type sym,${gmp_tmp_prefix}function
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- if grep ".type pseudo-op used outside of .def/.endef ignored" conftest.out >/dev/null; then : ;
- else
- gmp_cv_asm_type=".type $1,${gmp_tmp_prefix}$2"
- break
- fi
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- done
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_type" >&5
- $as_echo "$gmp_cv_asm_type" >&6; }
- echo "define(<TYPE>, <$gmp_cv_asm_type>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler .size directive" >&5
- $as_echo_n "checking for assembler .size directive... " >&6; }
- if test "${gmp_cv_asm_size+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_asm_size=
- cat >conftest.s <<EOF
- .size sym,1
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- if grep ".size pseudo-op used outside of .def/.endef ignored" conftest.out >/dev/null; then : ;
- else
- gmp_cv_asm_size=".size $1,$2"
- fi
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_size" >&5
- $as_echo "$gmp_cv_asm_size" >&6; }
- echo "define(<SIZE>, <$gmp_cv_asm_size>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler local label prefix" >&5
- $as_echo_n "checking for assembler local label prefix... " >&6; }
- if test "${gmp_cv_asm_lsym_prefix+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_tmp_pre_appears=yes
- for gmp_tmp_pre in L .L $L $ L$; do
- echo "Trying $gmp_tmp_pre" >&5
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- dummy${gmp_cv_asm_label_suffix}
- ${gmp_tmp_pre}gurkmacka${gmp_cv_asm_label_suffix}
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- if $NM conftest.$OBJEXT >conftest.nm 2>&5; then : ; else
- cat conftest.nm >&5
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: "$NM" failure" >&5
- $as_echo "$as_me: WARNING: "$NM" failure" >&2;}
- break
- fi
- cat conftest.nm >&5
- if grep gurkmacka conftest.nm >/dev/null; then : ; else
- # no mention of the symbol, this is good
- echo "$gmp_tmp_pre label doesn't appear in object file at all (good)" >&5
- gmp_cv_asm_lsym_prefix="$gmp_tmp_pre"
- gmp_tmp_pre_appears=no
- break
- fi
- if grep ' [a-zN] .*gurkmacka' conftest.nm >/dev/null; then
- # symbol mentioned as a local, use this if nothing better
- echo "$gmp_tmp_pre label is local but still in object file" >&5
- if test -z "$gmp_cv_asm_lsym_prefix"; then
- gmp_cv_asm_lsym_prefix="$gmp_tmp_pre"
- fi
- else
- echo "$gmp_tmp_pre label is something unknown" >&5
- fi
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- done
- rm -f conftest*
- if test -z "$gmp_cv_asm_lsym_prefix"; then
- gmp_cv_asm_lsym_prefix=L
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine local label, using default $gmp_cv_asm_lsym_prefix" >&5
- $as_echo "$as_me: WARNING: cannot determine local label, using default $gmp_cv_asm_lsym_prefix" >&2;}
- fi
- # for development purposes, note whether we got a purely temporary local label
- echo "Local label appears in object files: $gmp_tmp_pre_appears" >&5
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_lsym_prefix" >&5
- $as_echo "$gmp_cv_asm_lsym_prefix" >&6; }
- echo "define(<LSYM_PREFIX>, <${gmp_cv_asm_lsym_prefix}>)" >> $gmp_tmpconfigm4
- cat >>confdefs.h <<_ACEOF
- #define LSYM_PREFIX "$gmp_cv_asm_lsym_prefix"
- _ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler byte directive" >&5
- $as_echo_n "checking for assembler byte directive... " >&6; }
- if test "${gmp_cv_asm_byte+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- for i in .byte data1; do
- echo "trying $i" >&5
- cat >conftest.s <<EOF
- $gmp_cv_asm_data
- $i 0
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_byte=$i
- rm -f conftest*
- break
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- cat conftest.out >&5
- fi
- rm -f conftest*
- done
- if test -z "$gmp_cv_asm_byte"; then
- as_fn_error "Cannot determine how to emit a data byte" "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_byte" >&5
- $as_echo "$gmp_cv_asm_byte" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to define a 32-bit word" >&5
- $as_echo_n "checking how to define a 32-bit word... " >&6; }
- if test "${gmp_cv_asm_w32+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $host in
- *-*-hpux*)
- # FIXME: HPUX puts first symbol at 0x40000000, breaking our assumption
- # that it's at 0x0. We'll have to declare another symbol before the
- # .long/.word and look at the distance between the two symbols. The
- # only problem is that the sed expression(s) barfs (on Solaris, for
- # example) for the symbol with value 0. For now, HPUX uses .word.
- gmp_cv_asm_w32=".word"
- ;;
- *-*-*)
- gmp_tmp_val=
- for gmp_tmp_op in .long .word data4; do
- cat >conftest.s <<EOF
- $gmp_cv_asm_data
- $gmp_cv_asm_globl foo
- $gmp_tmp_op 0
- foo$gmp_cv_asm_label_suffix
- $gmp_cv_asm_byte 0
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_tmp_val=`$NM conftest.$OBJEXT | grep foo |
- sed -e 's;[[][0-9][]](.*);1;' -e 's;[^1-9]*([0-9]*).*;1;'`
- if test "$gmp_tmp_val" = 4; then
- gmp_cv_asm_w32="$gmp_tmp_op"
- break
- fi
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- done
- rm -f conftest*
- ;;
- esac
- if test -z "$gmp_cv_asm_w32"; then
- as_fn_error "cannot determine how to define a 32-bit word" "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_w32" >&5
- $as_echo "$gmp_cv_asm_w32" >&6; }
- echo "define(<W32>, <$gmp_cv_asm_w32>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if .align assembly directive is logarithmic" >&5
- $as_echo_n "checking if .align assembly directive is logarithmic... " >&6; }
- if test "${gmp_cv_asm_align_log+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.s <<EOF
- $gmp_cv_asm_data
- .align 4
- $gmp_cv_asm_globl foo
- $gmp_cv_asm_byte 1
- .align 4
- foo$gmp_cv_asm_label_suffix
- $gmp_cv_asm_byte 2
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_tmp_val=`$NM conftest.$OBJEXT | grep foo |
- sed -e 's;[[][0-9][]](.*);1;' -e 's;[^1-9]*([0-9]*).*;1;'`
- if test "$gmp_tmp_val" = "10" || test "$gmp_tmp_val" = "16"; then
- gmp_cv_asm_align_log=yes
- else
- gmp_cv_asm_align_log=no
- fi
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- as_fn_error "cannot assemble alignment test" "$LINENO" 5
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_align_log" >&5
- $as_echo "$gmp_cv_asm_align_log" >&6; }
- echo "define(<ALIGN_LOGARITHMIC>,<$gmp_cv_asm_align_log>)" >> $gmp_tmpconfigm4
- case $host in
- hppa*-*-*)
- # for both pa32 and pa64
- echo "include_mpn(`pa32/pa-defs.m4')" >> $gmp_tmpconfigm4i
- ;;
- ia64*-*-* | itanium-*-* | itanium2-*-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler .align padding is good" >&5
- $as_echo_n "checking whether assembler .align padding is good... " >&6; }
- if test "${gmp_cv_asm_ia64_align_ok+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.awk <<EOF
- BEGIN {
- want[0] = "011"
- want[1] = "160"
- want[2] = "074"
- want[3] = "040"
- want[4] = "000"
- want[5] = "040"
- want[6] = "020"
- want[7] = "221"
- want[8] = "114"
- want[9] = "000"
- want[10] = "100"
- want[11] = "200"
- want[12] = "122"
- want[13] = "261"
- want[14] = "000"
- want[15] = "200"
- want[16] = "000"
- want[17] = "004"
- want[18] = "000"
- want[19] = "000"
- want[20] = "000"
- want[21] = "000"
- want[22] = "002"
- want[23] = "000"
- want[24] = "000"
- want[25] = "000"
- want[26] = "000"
- want[27] = "001"
- want[28] = "000"
- want[29] = "000"
- want[30] = "000"
- want[31] = "014"
- want[32] = "011"
- want[33] = "270"
- want[34] = "140"
- want[35] = "062"
- want[36] = "000"
- want[37] = "040"
- want[38] = "240"
- want[39] = "331"
- want[40] = "160"
- want[41] = "000"
- want[42] = "100"
- want[43] = "240"
- want[44] = "343"
- want[45] = "371"
- want[46] = "000"
- want[47] = "200"
- result = "yes"
- }
- {
- for (f = 2; f <= NF; f++)
- {
- for (i = 0; i < 47; i++)
- got[i] = got[i+1];
- got[47] = $f;
- found = 1
- for (i = 0; i < 48; i++)
- if (got[i] != want[i])
- {
- found = 0
- break
- }
- if (found)
- {
- result = "no"
- exit
- }
- }
- }
- END {
- print result
- }
- EOF
- cat >conftest.s <<EOF
- .text
- .align 32
- { .mmi; add r14 = r15, r16
- add r17 = r18, r19
- add r20 = r21, r22 ;; }
- .align 32
- { .mmi; add r23 = r24, r25
- add r26 = r27, r28
- add r29 = r30, r31 ;; }
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_ia64_align_ok=`od -b conftest.$OBJEXT | $AWK -f conftest.awk`
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: oops, cannot compile test program" >&5
- $as_echo "$as_me: WARNING: oops, cannot compile test program" >&2;}
- gmp_cv_asm_ia64_align_ok=yes
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_ia64_align_ok" >&5
- $as_echo "$gmp_cv_asm_ia64_align_ok" >&6; }
- echo "define(<IA64_ALIGN_OK>, <`$gmp_cv_asm_ia64_align_ok'>)" >> $gmp_tmpconfigm4
- ;;
- m68k-*-* | m68[0-9][0-9][0-9]-*-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler instruction and register style" >&5
- $as_echo_n "checking assembler instruction and register style... " >&6; }
- if test "${gmp_cv_asm_m68k_instruction+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- for i in "addl %d0,%d1" "add.l %d0,%d1" "addl d0,d1" "add.l d0,d1"; do
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- $i
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_m68k_instruction=$i
- rm -f conftest*
- break
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- done
- if test -z "$gmp_cv_asm_m68k_instruction"; then
- as_fn_error "cannot determine assembler instruction and register style" "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_m68k_instruction" >&5
- $as_echo "$gmp_cv_asm_m68k_instruction" >&6; }
- case $gmp_cv_asm_m68k_instruction in
- "addl d0,d1") want_dot_size=no; want_register_percent=no ;;
- "addl %d0,%d1") want_dot_size=no; want_register_percent=yes ;;
- "add.l d0,d1") want_dot_size=yes; want_register_percent=no ;;
- "add.l %d0,%d1") want_dot_size=yes; want_register_percent=yes ;;
- *) as_fn_error "oops, unrecognised instruction and register style" "$LINENO" 5 ;;
- esac
- echo "define(<WANT_REGISTER_PERCENT>, <`$want_register_percent'>)" >> $gmp_tmpconfigm4
- echo "define(<WANT_DOT_SIZE>, <`$want_dot_size'>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler addressing style" >&5
- $as_echo_n "checking assembler addressing style... " >&6; }
- if test "${gmp_cv_asm_m68k_addressing+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- case $gmp_cv_asm_m68k_instruction in
- addl*) movel=movel ;;
- add.l*) movel=move.l ;;
- *) as_fn_error "oops, unrecognised gmp_cv_asm_m68k_instruction" "$LINENO" 5 ;;
- esac
- case $gmp_cv_asm_m68k_instruction in
- *"%d0,%d1") dreg=%d0; areg=%a0 ;;
- *"d0,d1") dreg=d0; areg=a0 ;;
- *) as_fn_error "oops, unrecognised gmp_cv_asm_m68k_instruction" "$LINENO" 5 ;;
- esac
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- $movel $dreg, $areg@-
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_m68k_addressing=mit
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- $movel $dreg, -($areg)
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_m68k_addressing=motorola
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- as_fn_error "cannot determine assembler addressing style" "$LINENO" 5
- fi
- rm -f conftest*
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_m68k_addressing" >&5
- $as_echo "$gmp_cv_asm_m68k_addressing" >&6; }
- echo "define(<WANT_ADDRESSING>, <`$gmp_cv_asm_m68k_addressing'>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler shortest branches" >&5
- $as_echo_n "checking assembler shortest branches... " >&6; }
- if test "${gmp_cv_asm_m68k_branches+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- for i in jra jbra bra; do
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- foo$gmp_cv_asm_label_suffix
- $i foo
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_m68k_branches=$i
- rm -f conftest*
- break
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- :
- fi
- rm -f conftest*
- done
- if test -z "$gmp_cv_asm_m68k_branches"; then
- as_fn_error "cannot determine assembler branching style" "$LINENO" 5
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_m68k_branches" >&5
- $as_echo "$gmp_cv_asm_m68k_branches" >&6; }
- echo "define(<WANT_BRANCHES>, <`$gmp_cv_asm_m68k_branches'>)" >> $gmp_tmpconfigm4
- ;;
- powerpc*-*-* | power[3-9]-*-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler output is PIC by default" >&5
- $as_echo_n "checking whether compiler output is PIC by default... " >&6; }
- if test "${gmp_cv_asm_powerpc_pic+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_asm_powerpc_pic=yes
- cat >conftest.c <<EOF
- int foo;
- int *bar() { return &foo; }
- EOF
- echo "Test program:" >&5
- cat conftest.c >&5
- gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&5"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_compile""; } >&5
- (eval $gmp_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- echo "Compiler output:" >&5
- cat conftest.s >&5
- if grep 'foo@ha' conftest.s >/dev/null 2>&5; then
- gmp_cv_asm_powerpc_pic=no
- fi
- if grep 'ha16(_foo)' conftest.s >/dev/null 2>&5; then
- gmp_cv_asm_powerpc_pic=no
- fi
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_powerpc_pic" >&5
- $as_echo "$gmp_cv_asm_powerpc_pic" >&6; }
- echo "define(<PIC_ALWAYS>,<$gmp_cv_asm_powerpc_pic>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler needs r on registers" >&5
- $as_echo_n "checking if the assembler needs r on registers... " >&6; }
- if test "${gmp_cv_asm_powerpc_r_registers+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- mtctr 6
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_powerpc_r_registers=no
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- mtctr r6
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_powerpc_r_registers=yes
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- as_fn_error "neither "mtctr 6" nor "mtctr r6" works" "$LINENO" 5
- fi
- rm -f conftest*
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_powerpc_r_registers" >&5
- $as_echo "$gmp_cv_asm_powerpc_r_registers" >&6; }
- echo "define(<WANT_R_REGISTERS>,<$gmp_cv_asm_powerpc_r_registers>)" >> $gmp_tmpconfigm4
- echo "include_mpn(`powerpc32/powerpc-defs.m4')" >> $gmp_tmpconfigm4i
- case $host in
- *-*-aix*)
- case $ABI in
- 64 | aix64)
- echo "include_mpn(`powerpc64/aix.m4')" >> $gmp_tmpconfigm4i
- ;;
- *)
- echo "include_mpn(`powerpc32/aix.m4')" >> $gmp_tmpconfigm4i
- ;;
- esac
- ;;
- *-*-linux* | *-*-*bsd*)
- case $ABI in
- mode64)
- echo "include_mpn(`powerpc64/elf.m4')" >> $gmp_tmpconfigm4i
- ;;
- mode32 | 32)
- echo "include_mpn(`powerpc32/elf.m4')" >> $gmp_tmpconfigm4i
- ;;
- esac
- ;;
- *-*-darwin*)
- case $ABI in
- mode64)
- echo "include_mpn(`powerpc64/darwin.m4')" >> $gmp_tmpconfigm4i
- ;;
- mode32 | 32)
- echo "include_mpn(`powerpc32/darwin.m4')" >> $gmp_tmpconfigm4i
- ;;
- esac
- ;;
- *)
- # Assume unrecognized operating system is the powerpc eABI
- echo "include_mpn(`powerpc32/eabi.m4')" >> $gmp_tmpconfigm4i
- ;;
- esac
- ;;
- power*-*-aix*)
- echo "include_mpn(`powerpc32/aix.m4')" >> $gmp_tmpconfigm4i
- ;;
- sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
- case $ABI in
- 64)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler accepts ".register"" >&5
- $as_echo_n "checking if the assembler accepts ".register"... " >&6; }
- if test "${gmp_cv_asm_sparc_register+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- .register %g2,#scratch
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_sparc_register=yes
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- gmp_cv_asm_sparc_register=no
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_sparc_register" >&5
- $as_echo "$gmp_cv_asm_sparc_register" >&6; }
- echo "define(<HAVE_REGISTER>,<$gmp_cv_asm_sparc_register>)" >> $gmp_tmpconfigm4
- ;;
- esac
- ;;
- i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-* | athlon64-*-* | pentium4-*-* | atom-*-* | core2-*-* | corei-*-* | x86_64-*-* | nano-*-*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the .align directive accepts an 0x90 fill in .text" >&5
- $as_echo_n "checking if the .align directive accepts an 0x90 fill in .text... " >&6; }
- if test "${gmp_cv_asm_align_fill_0x90+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- .align 4, 0x90
- .byte 0
- .align 4, 0x90
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- if grep "Warning: Fill parameter ignored for executable section" conftest.out >/dev/null; then
- echo "Supressing this warning by omitting 0x90" 1>&5
- gmp_cv_asm_align_fill_0x90=no
- else
- gmp_cv_asm_align_fill_0x90=yes
- fi
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- gmp_cv_asm_align_fill_0x90=no
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_align_fill_0x90" >&5
- $as_echo "$gmp_cv_asm_align_fill_0x90" >&6; }
- echo "define(<ALIGN_FILL_0x90>,<$gmp_cv_asm_align_fill_0x90>)" >> $gmp_tmpconfigm4
- case $ABI in
- 32)
- echo "include_mpn(`x86/x86-defs.m4')" >> $gmp_tmpconfigm4i
- $as_echo "#define HAVE_HOST_CPU_FAMILY_x86 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler COFF type directives" >&5
- $as_echo_n "checking for assembler COFF type directives... " >&6; }
- if test "${gmp_cv_asm_x86_coff_type+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- $gmp_cv_asm_globl ${tmp_gsym_prefix}foo$gmp_cv_asm_globl_attr
- .def ${tmp_gsym_prefix}foo
- .scl 2
- .type 32
- .endef
- ${tmp_gsym_prefix}foo$gmp_cv_asm_label_suffix
- EOF
- gmp_assemble="$CCAS $CFLAGS $CPPFLAGS conftest.s >conftest.out 2>&1"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_assemble""; } >&5
- (eval $gmp_assemble) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: $? = $ac_status" >&5
- test $ac_status = 0; }; then
- cat conftest.out >&5
- gmp_cv_asm_x86_coff_type=yes
- else
- cat conftest.out >&5
- echo "configure: failed program was:" >&5
- cat conftest.s >&5
- gmp_cv_asm_x86_coff_type=no
- fi
- rm -f conftest*
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gmp_cv_asm_x86_coff_type" >&5
- $as_echo "$gmp_cv_asm_x86_coff_type" >&6; }
- echo "define(<HAVE_COFF_TYPE>, <$gmp_cv_asm_x86_coff_type>)" >> $gmp_tmpconfigm4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _GLOBAL_OFFSET_TABLE_ is prefixed by underscore" >&5
- $as_echo_n "checking if _GLOBAL_OFFSET_TABLE_ is prefixed by underscore... " >&6; }
- if test "${gmp_cv_asm_x86_got_underscore+set}" = set; then :
- $as_echo_n "(cached) " >&6
- else
- gmp_cv_asm_x86_got_underscore="not applicable"
- if test $gmp_cv_asm_underscore = yes; then
- tmp_gsym_prefix=_
- else
- tmp_gsym_prefix=
- fi
- for tmp_underscore in "" "_"; do
- cat >conftest.s <<EOF
- $gmp_cv_asm_text
- $gmp_cv_asm_globl ${tmp_gsym_prefix}main$gmp_cv_asm_globl_attr
- ${tmp_gsym_prefix}main$gmp_cv_asm_label_suffix
- addl $ ${tmp_underscore}_GLOBAL_OFFSET_TABLE_, %ebx
- EOF
- gmp_compile="$CCAS $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.s >&5 && $CC $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&5"
- if { { eval echo ""$as_me":${as_lineno-$LINENO}: "$gmp_compile""; } >&5
- (eval $gmp_compile) 2>&5