From 0c2f0333a4e539325da80cdf3fb182cd17134665 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 18 Jun 2014 11:12:01 +0000 Subject: Add libs/gmp and libs/mpfr in preparation for MetaPost 2.0 git-svn-id: svn://tug.org/texlive/trunk@34274 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/libs/gmp/m4/gmp-alloca.m4 | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Build/source/libs/gmp/m4/gmp-alloca.m4 (limited to 'Build/source/libs/gmp/m4/gmp-alloca.m4') diff --git a/Build/source/libs/gmp/m4/gmp-alloca.m4 b/Build/source/libs/gmp/m4/gmp-alloca.m4 new file mode 100644 index 00000000000..2fc59023a88 --- /dev/null +++ b/Build/source/libs/gmp/m4/gmp-alloca.m4 @@ -0,0 +1,56 @@ +# Autoconf macros for the GNU MP Library. +# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# +# Copyright (C) 2014 Peter Breitenlohner +# Extracted from gmp-6.0.0/acinclude.m4 and adapted for TeX Live. +# +# This file is free software; the copyright holders +# give unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# GMP_FUNC_ALLOCA +# --------------- +# Determine whether "alloca" is available. This is AC_FUNC_ALLOCA from +# autoconf, but changed so it doesn't use alloca.c if alloca() isn't +# available, and also to use gmp-impl.h for the conditionals detecting +# compiler builtin alloca's. + +AC_DEFUN([GMP_FUNC_ALLOCA], [dnl +AC_REQUIRE([KPSE_GMP_H]) +_GMP_HEADER_ALLOCA +AC_CACHE_CHECK([for alloca (via gmp-impl.h)], + [gmp_cv_func_alloca], +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "gmp-tmp.h" +#include "$srcdir/gmp-]gmp_version[/gmp-impl.h"]], + [[char *p = (char *) alloca (1);]])], + [gmp_cv_func_alloca=yes], + [gmp_cv_func_alloca=no])]) +if test "x$gmp_cv_func_alloca" = xyes; then + AC_DEFINE([HAVE_ALLOCA], 1, [Define to 1 if alloca() works (via gmp-impl.h).]) + AC_DEFINE([WANT_TMP_ALLOCA]) +else + AC_DEFINE([WANT_TMP_REENTRANT]) +fi +AH_VERBATIM([WANT_TMP], +[/* Define one of these to 1 for the temporary memory allocation method. */ +#undef WANT_TMP_ALLOCA +#undef WANT_TMP_REENTRANT]) +]) # GMP_FUNC_ALLOCA + +# _GMP_HEADER_ALLOCA +# ------------------ +# Internal subroutine +m4_define([_GMP_HEADER_ALLOCA], +[# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +AC_CACHE_CHECK([for working alloca.h], + [gmp_cv_header_alloca], +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[char *p = (char *) alloca (2 * sizeof (int));]])], + [gmp_cv_header_alloca=yes], + [gmp_cv_header_alloca=no])]) +if test "x$gmp_cv_header_alloca" = xyes; then + AC_DEFINE([HAVE_ALLOCA_H], 1, + [Define to 1 if you have and it should be used (not on Ultrix).]) +fi +]) # _GMP_HEADER_ALLOCA -- cgit v1.2.3